By translating and rescaling if necessary, we assume that \(x_0=0\)  and \(R=1.\)  Notice that since \(\mathcal {H}^1(Q_1\cap \partial A)<+\infty ,\)  by Lemma REF  there exists \(\xi \in (0,1)^2\)  such that the set
\(\lbrace x\in Q_1\cap \partial ^* A:\,\text{${\rm tr}_A(u)$ exists and is equal to $\xi $}\rbrace \) 
is \(\mathcal {H}^1\) -negligible. By [1]} up to a \(\mathcal {H}^1\) -negligible set we can cover \(Q_1\cap \partial ^* A\)  with \(C^1\) -maps so that by [2]} \({\rm tr}_A(u)\)  exist \(\mathcal {H}^1\) -a.e. on \(Q_1\cap \partial ^* A.\)
Let
\(\widetilde{u}:=u\chi _{ Q_1\cap A} + \xi \chi _{ Q_1\setminus A}.\) 
Note that \(\widetilde{u}\in GSBD^2(Q_1;\mathbb {R}^2)\)  and by the choice of \(\xi \)  and [2]} \(Q\cap \partial ^*A= J_{\widetilde{u}}.\) 
In addition, possibly perturbing \(\widetilde{u}\)  by a \(W^{1,\infty }\) -function with small norm supported near \(\color {black}Q_1\cap \partial A\)  we suppose that \( Q_1\cap J_{\widetilde{u}}\supset Q_1\cap \partial A\)  up to a \(\mathcal {H}^1\) -negligible setA similar argument was used in [4]}.
\(\delta :=\mathcal {H}^1( Q_1\cap [\partial A]^r)^{1/2} = \mathcal {H}^1( Q_1\cap J_{\widetilde{u}})^{1/2}.\) 
Set \(N:=[1/\delta ]\)  so that \((-N\delta ,N\delta )^2\subset Q_1.\)  For \(i:=0,1,\ldots ,N-1\)  let \(Q^i:=(-(N-i)\delta ,(N-i)\delta )^2\)  and \(C^i:=Q^i\setminus Q^{i+1}\)  (assuming \(C^{N-1}:=Q^{N-1}\) ). Up to a slight translation of \(Q^i\)  we assume that \(\mathcal {H}^1(\partial A\cap \partial Q^i)=0\)  for all \(i.\)  By [5]} we find \(i_0\ge 1\)  such that
\({\left\lbrace \begin{array}{ll}\int _{C^{i_0}\cup C^{i_0+1}} |e(\widetilde{u})|^2dx \le 8\sqrt{\delta } \int _{ Q_1\setminus Q_{1-\sqrt{\delta }}} |e(\widetilde{u})|^2dx,\\[2mm]\mathcal {H}^1(\partial A \cap (C^{i_0}\cup C^{i_0+1})) \le 8\sqrt{\delta }\, \mathcal {H}^1( \partial A \cap ( Q_1\setminus Q_{1-\delta })).\end{array}\right.}\) 
We partition \(Q^{i_0+1}\)  into pairwise disjoint squares with sidelength \(\delta \)  and divide the slice \(C^{i_0}\)  into dyadic slices
\(G_j:=(-(N-i_0-2^{-j})\delta ,(N-i_0-2^{-j})\delta )^2\setminus (-(N-i_0-2^{-j+1})\delta ,(N-i_0-2^{-j+1})\delta )^2,\) 
then we partition each slice \(G_j\)  into pairwise disjoint squares \( Q_{j,l}\)  of sidelength \(2^{-j}\delta \)  whose sides parallel to the coordinate axis. Let \(\mathcal {V}_0\)  be the collection of all squares of sidelength \(\delta \)  which cover the central square \(Q^{i_0+1}\)  and let \(\mathcal {V}\)  be the union of \(\mathcal {V}_0\)  and the collection of all \( Q_{j,l}.\)  Following [5]} we differentiate between “good and bad” squares in \(\mathcal {V}.\)  A square \(Q\in \mathcal {V}\)  is “good” if
\(\mathcal {H}^1(Q^{\prime \prime \prime }\cap \partial A ) \le \eta \delta _Q^{},\) 
where \(Q^{\prime \prime \prime }\)  is the square with the same center as \(Q\)  and dilated by \(7/6,\)  and \(\delta _Q^{}:=\delta \)  if \(Q\in \mathcal {V}_0\)  and \(\delta _Q^{}:=2^{-j}\delta \)  if \(Q\subset G_j.\)  A square \(Q\)  is “bad” if it does not satisfy (REF ). By (REF ) \(\delta ^2=\mathcal {H}^1( Q_1\cap \partial A) <\eta \delta ,\)  hence, by definition, all squares in \(\mathcal {V}_0\)  are good and by [5]} the sum of the perimeters of all bad squares satisfies
\(\sum \limits _{Q\,\text{bad}} \mathcal {H}^1(\partial ^*Q) \le \widetilde{c}_0\sqrt{\delta }\, \mathcal {H}^1(( Q_1\setminus Q_{1-\sqrt{\delta }})\cap \partial A )\) 
for some \(\widetilde{c}_0>0\) .
Since \(\delta <\eta ,\)  by [5]} there exist \(\widetilde{v}\in GSBD^2( Q_1;\mathbb {R}^2),\)  \(r\in (1-\sqrt{\delta },1)\)  and a Lebesgue measurable set \(\widetilde{\omega }\subset \subset Q_r\)  such that
(a1)
\(\widetilde{v} \in C^\infty ( Q_{1-\sqrt{\delta }}),\)  \(\widetilde{u}=\widetilde{v}\)  in \( Q_1\setminus Q_r\)  and \(\mathcal {H}^1(J_{\widetilde{u}}\cap \partial Q_r)=\mathcal {H}^1(J_{\widetilde{v}}\cap \partial Q_r)=0;\)
(a2)
\(\mathcal {H}^1(J_{\widetilde{v}}\setminus J_{\widetilde{u}}) \le \widetilde{c}_0\,\sqrt{\delta }\,\mathcal {H}^1(( Q_1\setminus Q_{1-\sqrt{\delta }})\cap J_{\widetilde{u}});\)
(a3)
\(|\widetilde{\omega }|\le \widetilde{c}_0\delta \mathcal {H}^1( Q_r\cap \partial A )\)  and
\(\int _{ Q_1\setminus \widetilde{\omega }}|\widetilde{v} - \widetilde{u}|^2dx \le \widetilde{c}_0\delta ^2 \int _{ Q_1} |e(\widetilde{u})|^2dx;\) 
(a4)
for any \(\psi \in \mathrm {Lip}( Q_1;[0,1])\)  and elasticity tensor \(L^\infty ( Q_1)\)  satisfying (REF ) there exists \(d_3:=d_3(\widetilde{c}_0,d_1,d_2)>0\)  such that
\(\int _{ Q_1} \psi x)e(\widetilde{v}):e(\widetilde{v})dx \le \int _{ Q_1} \psi x)e(\widetilde{u}):e(\widetilde{u})dx + d_3\delta ^s\,(1+\mathrm {Lip}(\psi )) \int _{ Q_1}|e(\widetilde{u})|^2dx;\) 

(a5)
\(J_{\widetilde{v}} \subset \partial ^* D\cup (J_{\widetilde{u}} \setminus Q^{i_0+1})\)  and \(J_{\widetilde{v}}\setminus J_{\widetilde{u}} \subset \partial ^*D,\)  where \(D\)  is the union of all bad squares.

Note that for proving (a4) in [5]} a mollifying argument is used (together with the fact that \( is assumed to be constant in \cite {CCI:2019.jmpa}). As in our setting \)  is in general not constant, we revised such argument (see [5]}), by using the fact that the energy
\(w\in GSBD^2(O)\mapsto \int _O {w}:e(w)dx\) 
is quadratic with respect to the \(e(w)\)  and hence, we have convexity and we can employ Cauchy-Schwartz inequality for positive semidefinite bilinear forms to obtain
\(\begin{aligned}& \int _{G\cap \widetilde{Q}} x)e(\widetilde{v}):e(\widetilde{v})dx \le \int _{G\cap \widetilde{Q}} x)e(\widetilde{u}):e(\widetilde{u})dx + 2\int _{G\cap \widetilde{Q}} x)e(\widetilde{v}):[e(\widetilde{v}) - e(\widetilde{u})]dx\\\le & \int _{G\cap \widetilde{Q}} x)e(\widetilde{u}):e(\widetilde{u})dx+ 2\Big [\int _{G\cap \widetilde{Q}} x)e(\widetilde{v}):e(\widetilde{v})dx\Big ]^{1/2}\times \\& \hspace*{170.71652pt} \times \Big [\int _{G\cap \widetilde{Q}} x) [e(\widetilde{v}) - e(\widetilde{u})]:[e(\widetilde{v}) - e(\widetilde{u})]dx\Big ]^{1/2}.\end{aligned}\) 
Since the inequality \(a^2 \le b^2 + 2ac,\)  where \(a,b,c\ge 0,\)  implies \(a\le b+ 2c,\)  we get
\(\begin{aligned}\Big [\int _{G\cap \widetilde{Q}} x)e(\widetilde{v}):e(\widetilde{v})dx\Big ]^{1/2}\le &\Big [\int _{G\cap \widetilde{Q}} x)e(\widetilde{u}):e(\widetilde{u})dx\Big ]^{1/2}\\& + 2\Big [\int _{G\cap \widetilde{Q}} x) [e(\widetilde{v}) - e(\widetilde{u})]:[e(\widetilde{v}) - e(\widetilde{u})]dx\Big ]^{1/2}\\\le & (1 + c\delta ^s)\Big [\int _{G\cap \widetilde{Q}} x)e(\widetilde{u}):e(\widetilde{u})dx\Big ]^{1/2}\end{aligned}\) 
so that Eq.23 of [5]} holds also in our setting.
Let \(\mathcal {V}_i\)  be the family of all bad squares \(Q\)  intersecting \(\mathrm {Int}(A)\)  and \(D_i:=\bigcup _{Q\in \mathcal {V}_i} Q.\)  For every \(Q\in \mathcal {V}_i\)  we define \(I_Q\)  as the segment of smallest length connecting \((Q^{\prime \prime \prime }\cap \partial A) \setminus \overline{Q}\)  to \(\partial Q\)  with the convention that \(I_Q=\emptyset \)  if \((Q^{\prime \prime \prime }\cap \partial A )\setminus \overline{Q}=\emptyset \)  or \( Q\cap \mathrm {Int}(\Omega \setminus A)\ne \emptyset .\) 
By the definition of \(Q^{\prime \prime \prime }\)  and \(Q,\)  \(\mathcal {H}^1(I_Q) \le \frac{\sqrt{2}}{24}\,\mathcal {H}^1(\partial Q).\)
Let
\(B:=\Big [\big (A\setminus \overline{D_i}\big ) \cup \partial D_i\Big ]\setminus \bigcup \limits _{Q\in \mathcal {V}_i} I_Q\) 
and
\(v:=\widetilde{v}\chi _{ Q_1}^{} + \widetilde{u}\chi _{(\Omega \cup S)\setminus Q_1}.\) 
We claim that \(B,\)  \(v\)  and \(\widetilde{\omega }\)  satisfy the assertions of the lemma.
Indeed, from (a4) applied with \(\psi \equiv 1\)  and \(I\)  it follows that \(v\in GSBD^2(\mathrm {Int}(B);\mathbb {R}^2).\)  Moreover, by (a5) \(v\in H^1_\mathrm {loc}(\mathrm {Int}(B);\mathbb {R}^2),\)  thus, \((B,v)\in \mathcal {C}.\) 
Let us show that if \(A\in \mathcal {A}_m\)  for some \(m\in \mathbb {N},\)  then \(B\in \mathcal {A}_m.\)  Indeed, by the construction of \(B,\)  we replace \(\partial A\)  inside a bad cube \(Q\)  either with \(\partial Q\)  or add \(\partial Q\cup I_Q\)  to \(\partial A\) . Since, as a difference from [5]}, we do not remove \(\partial A\)  from good squares, by the definition of \(B,\)  during both operations we do not increase the number of connected components \(\partial A.\)  Therefore, if \((A,u)\in \mathcal {C}_m\)  for some \(m\in \mathbb {N},\)  then \((B,v\big |_B)\in \mathcal {C}_m.\)
By (a1) it follows that \(v\in C^\infty ( Q_{1-\sqrt{\delta }}).\)  Moreover, by the definition of \(B,\)  \(A\Delta B\subset \subset Q_{r_h}\setminus Q_{1-\sqrt{\delta }}\)  for some \(r_h\in (1-\sqrt{\delta },1)\)  such that \(D_i\subset Q_{r_h}.\) 
Also, by (a1) \(\mathrm {supp}\,(\widetilde{u}-\widetilde{v})\subset \subset Q_1\)  so that \(\mathrm {supp}\,(\widetilde{u}-v)\subset \subset Q_1,\)  and (1) follows.
Moreover, by the definition of \(B,\)  \(I_Q\)  and (REF )
\(\begin{aligned}\mathcal {H}^1(\partial B\setminus \partial A)\le & \sum \limits _{Q\in \mathcal {V}_i}P(Q) + \sum \limits _{Q\in \mathcal {V}_i} \mathcal {H}^1(I_Q)\\\le &\Big (1 + \frac{\sqrt{2}}{24}\Big )\sum \limits _{Q\in \mathcal {V}_i} P(Q) \le c_0\sqrt{\delta } \mathcal {H}^1(( Q_1\setminus Q_{1-\sqrt{\delta }})\cap \partial A),\end{aligned}\) 
where \(c_0:=\widetilde{c}_0(1 + \sqrt{2}/24),\)  and (2) follows.
Next, by (a3) \(|\omega |\le c_0\delta \mathcal {H}^1( Q_1\cap \partial A ),\)  and
\(\int _{ Q_1\setminus \omega } |v(x) - \widetilde{u}(x)|^2dx = & \int _{ Q_1\setminus \widetilde{\omega }} |\widetilde{v}(y) - \widetilde{u}(y)|^2dy \le \widetilde{c}_0\delta ^2\int _{ Q_1}|e(\widetilde{u})|^2dy\\\color {black}\le & \color {black}c_0\delta ^2\int _{ Q_1}|e(\widetilde{u})|^2(y)dy.\) 

Finally, by (a4) and the definition of \(v\)  (i.e., \(v=\widetilde{v}\)  in \(Q_1\) ) for any \(\psi \in \mathrm {Lip}( Q_1)\)  and \(L^\infty ( Q_1)\)  satisfying (REF ) we have
\(&\int _{ Q_1} \psi (x) x)e(v):e(v)dx = \int _{ Q_1} \psi (x) x)e(\widetilde{v}):e(\widetilde{v})dx \\\le & \int _{ Q_1} \psi (x) x)e(\widetilde{u}):e(\widetilde{u})dx + d_3\,(1+\mathrm {Lip}(\psi )) \int _{ Q_1}|e(\widetilde{u})|^2dx\\= & \int _{ Q_1\cap A} \psi (x) x)e(u):e(u)dx + d_3\delta ^s\,(1+\mathrm {Lip}(\psi )) \int _{ Q_1\cap A}|e(u)|^2dx,\) 

since \(\widetilde{u}\)  is constant in \( Q_1\setminus A.\)  Hence, (4) follows.
