## 4 Lateral Constraint Inversion Theory
### Roughness Constraints and Weighting  
To achieve lateral resistivity continuity, a lateral roughness constraint is implemented to enforce the continuity of inversion outcomes.  
\[\mathbf{R}_{\rm{ls}}\mathbf{m}=\mathbf{e}_{\rm{ls}} \tag{11}\]Here, the subscript \"Is\" denotes the lateral direction, \(\mathbf{e}_{\text{ls}}\) signifies the model parameter error in the lateral direction, and \(\mathbf{R}_{\text{ls}}\) stands for the lateral constraint matrix of the model. Subtracting \(\mathbf{R}_{\text{ls}}\mathbf{m}_{0}\) from both sides of Equation (11), we obtain  
\[\mathbf{R}_{\text{ls}}(\mathbf{m}-\mathbf{m}_{0})+\mathbf{R}_{\text{ls}}\mathbf{m}_{0}=\mathbf{e}_{\text {ls}} \tag{12}\]  
where \(\mathbf{m}_{0}\) denotes the initial model. Set \(\mathbf{R}_{\text{ls}}\) to 1 between two laterally adjacent model parameters and 0 at other positions:  
\[\mathbf{R}_{\text{ls}}=\begin{bmatrix}1&0&\ldots&0&-1&0&\ldots&0&0&0\\ 0&1&0&\ldots&0&-1&0&\ldots&0&0\\ \vdots&&&&\vdots&&&&\vdots\\ 0&0&0&\ldots&0&1&0&\ldots&0&-1\end{bmatrix}_{S_{1}\times T_{1}} \tag{13}\]  
In the formula above, \(S_{1}=N_{\text{s}}-1\), \(T_{1}=N_{\text{s}}N\), \(N_{\text{s}}\) represents the number of measurement points, and \(N\) denotes the number of model layers.  
Adaptive regularization inversion represents an enhancement of OCCAM inversion, aiming to bolster the vertical continuity of inversion outcomes. While single-point inversion already exhibits satisfactory vertical continuity, the introduction of a vertical roughness constraint is proposed to further enhance this aspect. Analogous to the lateral constraint Equation (12), a vertical constraint matrix is formulated as follows:  
\[\mathbf{R}_{\text{vs}}(\mathbf{m}-\mathbf{m}_{0})+\mathbf{R}_{\text{vs}}\mathbf{m}_{0}=\mathbf{e}_{ \text{vs}} \tag{14}\]  
The subscript \"vs\" denotes the vertical direction, and the interpretation of each variable in this equation aligns with that in Equation (13) as follows:  
\[\mathbf{R}_{\text{vs}}=\begin{bmatrix}1&-1&&&&0\\ &\ddots&\ddots&&&&&\\ &&1&-1&&\\ &&&\ddots&\ddots&\\ 0&&&&1&-1\end{bmatrix}_{S_{2}\times T_{2}} \tag{15}\]  
In the formula above, \(S_{2}=N_{\text{s}}N\), \(T_{2}=N_{\text{s}}(N-1)\), \(N_{\text{s}}\) represents the number of measurement points, and \(N\) denotes the number of model layers.  
During the inversion process, the horizontal and vertical constraint matrices of both data and model items are weighted. The consistency of the inversion outcomes in both horizontal and vertical directions is achieved by modifying the magnitudes of the weighting factors. Here, \(\mathbf{W}\) in Equation (6) represents the weighted roughness matrix:  
\[\mathbf{W}=\begin{bmatrix}\mathbf{W}_{\text{obs}}&&\mathbf{0}\\ &\mathbf{W}_{\text{ls}}&\\ \mathbf{0}&&\mathbf{W}_{\text{vs}}\end{bmatrix} \tag{16}\]  
Here, the diagonal matrices \(\mathbf{W}_{\text{obs}}\), \(\mathbf{W}_{\text{ls}}\), and \(\mathbf{W}_{\text{vs}}\) represent weighting factors for the data item, lateral constraints, and vertical constraints, respectively. In Equation (16), \(\mathbf{W}_{\text{ls}}=\mathbf{W}_{\text{ls}}R_{\text{ls}}\). The lateral and vertical weighting factors are denoted by \(\mathbf{W}_{\text{ls}}\) and \(\mathbf{W}_{\text{ls}}\), respectively.