**1. Introduction**

Lie's theory of symmetry groups for differential equations was initiated and utilized for obtaining solutions or reductions of the differential equations [1]. Lie constructed a highly algorithmic technique for the solutions of differential equations. Lie established that several techniques to find the solutions of differential equations can be described and deduced by considering the Lie group analysis of differential equations [2]. Thus, Lie symmetry methodology has a great significance in the theory and applications of differential equations. It is broadly applied by several researchers to solve difficult nonlinear problems. Lie studied the groups of continuous transformations. These transformations (symmetries) can be described by the infinitesimal generators.

The symmetries, which are not continuous are called discrete symmetries. Discrete symmetries have several applications in differential equations, e.g., they are used to simplify the numerical scheme and to find the new exact solutions from the known solutions [3]. The nature of bifurcations in nonlinear dynamical systems are also obtained by using discrete symmetry groups [4]. The procedure to find the discrete symmetries of the differential equations is discussed in [5–8].

Nowadays, it is a challenging area of research to solve the dynamical equations, as various phenomena in nature are modeled in dynamical systems. Many researchers have considered dynamical systems, e.g., Martinez, Yu Zhang, and Timothy Gordon studied the uses of the control scheme in the classical dynamical systems theory to predict driver behavior and vehicle trajectories [9]. Martinez and Timothy also discussed the uses of machine learning for the systematic understanding of human control behaviors in driving [10]. Lie group theory has became a universal tool for the analysis of dynamical equations. Lie symmetry analysis provides an effective way to solve the partial differential equations.

But recently, interest is rising on the applications of Lie group analysis in the partial differential equations for their numerical solutions. Some work has been dedicated to building those numerical schemes that preserve the symmetries of the given differential equations. Invariantized finite difference schemes by using the idea of moving frame were constructed by Kim [11] and Olver [12]. The technique of discretization that preserves some continuous symmetries of the original differential equation was also studied in [13–17]. In [18], the exact solutions of Fisher's type equation with the help of Lie symmetries, which are continuous symmetries in nature, are studied. Since most of the partial differential equations have some geometrical properties and some discrete symmetry groups correspond to these geometrical features of partial differential equations [8], the new invaiantized finite difference methods constructed by using these discrete symmetry groups may show better performances than the other finite difference methods.

In this article, first, it is shown that the Crank Nicolson scheme of a diffusion (heat) equation is invariant under a group of the discrete symmetry transformation. Here, a modification is proposed for the invariantization of the Crank Nicolson method given by Kim et al. [19]. This modification is proposed with the help of the composition of discrete and continuous symmetry transformations of the heat equation. It is also shown that the proposed invariantized scheme gives better results, as compared to the other classical finite difference methods.
