 for a negative triangle.

\begin{figure}[!ht]
\begin{center}
\begin{tabular}{l}
\includegraphics[scale=0.5]{basic-112.pdf}$\longrightarrow$\includegraphics[scale=0.5]{f+-112.pdf}
$\longrightarrow$\includegraphics[scale=0.5]{f+squared-1.pdf}$=$\includegraphics[scale=0.5]{rules-112.pdf}
\\[0.2cm]
\includegraphics[scale=0.5]{basic-444.pdf}$\longrightarrow$\includegraphics[scale=0.5]{f+-444.pdf}
$\longrightarrow$\includegraphics[scale=0.5]{f+squared-2.pdf}$=$\includegraphics[scale=0.5]{rules-444.pdf}
\end{tabular}
\caption{Substitution rules $F_P$ as $F_+^2$.}
\label{pict:f+squared}
\end{center}
\end{figure}

We also introduce additional auxiliary substitution rules $F_-$ (see Figure \ref{pict:f-}) that differ from $F_+$ only by the coloring of central triangles.

\begin{figure}[!ht]
\begin{center} 
\begin{tabular}{llll}
\includegraphics[scale=0.5]{basic-111.pdf}$\longrightarrow$\includegraphics[scale=0.5]{f--111.pdf}&
\includegraphics[scale=0.5]{basic-112.pdf}$\longrightarrow$\includegraphics[scale=0.5]{f--112.pdf}&
\includegraphics[scale=0.5]{basic-122.pdf}$\longrightarrow$\includegraphics[scale=0.5]{f--122.pdf}&
\includegraphics[scale=0.5]{basic-222.pdf}$\longrightarrow$\includegraphics[scale=0.5]{f--222.pdf}
\\[0.2cm]
\includegraphics[scale=0.5]{basic-444.pdf}$\longrightarrow$\includegraphics[scale=0.5]{f--444.pdf}&
\includegraphics[scale=0.5]{basic-344.pdf}$\longrightarrow$\includegraphics[scale=0.5]{f--344.pdf}&
\includegraphics[scale=0.5]{basic-334.pdf}$\longrightarrow$\includegraphics[scale=0.5]{f--334.pdf}&
\includegraphics[scale=0.5]{basic-333.pdf}$\longrightarrow$\includegraphics[scale=0.5]{f--333.pdf}
\end{tabular}
\caption{Auxiliary substitution rules $F_-$.}
\label{pict:f-}
\end{center}
\end{figure}



\begin{lem}\label{lem:pattern=+-}
Let $\mathcal F=\{a_i\}_{i=1}^k$ be a finite sequence of elementary foldings. 

If $k$ is even, then the finite folding pattern $P_\mathcal F$ can be obtained as $$P_\mathcal F=F_{a_1}\circ F_{a_2}\circ \ldots \circ F_{a_k}(\text{\includegraphics[scale=0.4]{basic-111.pdf}})$$
for a certain choice of the boundary coloring.

Similarly, if $k$ is odd, then the finite folding pattern $P_\mathcal F$ can be obtained as $$P_\mathcal F=F_{a_1}\circ F_{a_2}\circ \ldots \circ F_{a_k}(\text{\includegraphics[scale=0.4]{basic-333.pdf}})$$
for a certain choice of the boundary coloring.
\end{lem}
\begin{proof}
First of all we notice that the composition described in the lemma leads to a triangle of side length $2^k$ which is positive if $k$ is even and negative if $k$ is odd, so the size and orientation of the resulting pattern coincides with the size and orientation of $P_\mathcal F$. In the rest of the proof we show that the colorings of the layers $\mathcal L_j$, $1\leq j\leq k-1$ in the composition and in $P_\mathcal F$ coincide too. Note, that we do not need equal coloring of the layer $\mathcal L_k$ as this layer is exactly on the boundary of $P_\mathcal F$.

Suppose $k$ is even. After we construct the pattern $\mathcal P_1:=F_{a_2}\circ \ldots \circ F_{a_k}(\text{\includegraphics[scale=0.4]{basic-111.pdf}})$, we get a pattern inside a positive triangle with side length $2^{k-1}$. According to the rules $F_+$ and $F_-$, in order to construct $P_\mathcal F=F_{a_1}(\mathcal P_1)$ we need to inflate the pattern $\mathcal P_1$ twice, swap the colors in the inflated pattern, and then add either red or blue triangles inside every resulting triangle of side length $2$. We add negative blue triangles and positive red triangles if $a_1=+$ and negative red triangles and positive blue triangles if $a_1=-$. 

Let us consider the pattern $-\mathcal P_1$. It represents a coloring of the layers $\mathcal L_j$, $1\leq j\leq k-1$ inside a negative triangle of side length $2^{k-1}$. In order to get the pattern $2\mathcal P_1$ we apply $(-2)$-homothety, so we get some coloring of the layers $\mathcal L_j$, $2\leq j\leq k$ (that needs to be swapped) and the additional red and blue triangles are exactly triangles from the missing layer $\mathcal L_1$. Note, that the coloring we get coincides with the one described in Lemma \ref{lem:layer}.

In a similar way, let $\mathcal P_2=F_{a_3}\circ \ldots \circ F_{a_k}(\text{\includegraphics[scale=0.4]{basic-111.pdf}})$. This is a pattern inside positive triangle of side length $2^{k-2}$. If we inflate this pattern with a factor of $4$ we get a coloring of all layers inside a positive triangle of side length $2^k$ except $\mathcal L_1$ and $\mathcal L_2$; note that this inflation does not necessarily give a proper coloring of these layers immediately. The layer $\mathcal L_1$ is colored during the last substitution $F_{a_1}$, so the coloring of $\mathcal L_2$ is defined by the substitution $F_{a_2}$ applied to $\mathcal P_2$ and then adjusted during the last substitution $F_{a_1}$.

In order to get the pattern $F_{a_2}(\mathcal P_2)$ we stretch $\mathcal P_2$ with the factor of $2$ and fill the resulting triangles of side length $2$ with unit red or blue triangles. After that, when we apply $F_{a_1}$, these unit triangles are inflated to triangles with side length $2$ of $\mathcal L_2$ and we swap the color of their sides according to substitution $F_+$ or $F_-$. So, if $a_2=+$, then initial positive triangles are colored with red and initial negative triangles are colored with blue. After we inflate and swap colors, the positive triangles of $\mathcal L_2$ are colored with blue and the negative triangles of $\mathcal L_2$ are colored with red. Similarly, if $a_2=-$, then the positive triangles of $\mathcal L_2$ are colored with red and the negative triangles of $\mathcal L_2$ are colored with blue. This coloring coincides with the coloring of $\mathcal L_2$ defined by $a_2$ according to Lemma \ref{lem:layer}.


In the same way, let  $\mathcal P_j:=F_{a_{j+1}}\circ \ldots \circ F_{a_k}(\text{\includegraphics[scale=0.4]{basic-111.pdf}})$. The coloring of the layer $\mathcal L_j$ in $P_\mathcal F$ is defined only by the substitution $F_{a_j}$ applied to $\mathcal P_j$ as central triangles introduced during this step form the layer $\mathcal L_1$ of the pattern $\mathcal P_{j-1}$; these triangles are inflated to triangles of the layer $\mathcal L_2$ of the pattern $\mathcal P_{j-2}$ by $F_{a_{j-1}}$, and so on. After the process of $j-1$ inflations applied to $\mathcal P_{j-1}=F_{a_j}(\mathcal P_j)$ we get triangles of $\mathcal L_{j}$ with side length $2^{j-1}$ and swap colors of their sides $j-1$ times which