## 3 Mathematical Framework for Consistency
### Consistency Relation  
Now that we have explained the category in which we are working, we can define a consistency relation between two S2 ML models. **Definition 20**: _Binary consistency relation_  
_Let \(\sim\) be a binary relation over \(Ob(S2 ML+Cat)\). For \(A,B\in Ob(S2 ML+Cat)\), we note \(A\sim B\) if \((A,B)\in\sim\), i.e., if \(A\) is in relation with \(B\). \(\sim\) is a Binary consistency relation if and only if for \(A,B\in Ob(S2 ML+Cat)\), there exist \(A^{\prime}\), \(B^{\prime}\) such that these injections exist:_  
* \(f_{A}:A^{\prime}\longrightarrow A\)_;_
* \(f_{B}:B^{\prime}\longrightarrow B\)_;_
* \(F:A^{\prime}\longrightarrow B^{\prime}\)_;_
* \(G:B^{\prime}\longrightarrow A^{\prime}\)_._
* \(F\) _and_ \(G\) _respect the following properties:_
* \(F\circ G=Id_{B^{\prime}}\)_;_
* \(G\circ F=Id_{A^{\prime}}\)_._  
This definition means that the two models are in a consistency relation if the structure shown in Figure 10 exists with \(\textit{fa}\), \(\textit{fb}\), \(F\), and \(G\) being injections. All the morphisms are injections and the compositions of \(F\) and \(G\) are the identities of \(A^{\prime}\) and \(B^{\prime}\). Note that Theorem 2 implies that if this structure exists without the compositions of \(F\) and \(G\) being the identities, then we can find \(G^{\prime}\) such that \(F\) and \(G^{\prime}\) compose into the identities. Figure 10: The structure of a binary consistency relation. Such a relation is too general to describe a relevant interpretation of consistency between two models. To illustrate this idea, we can create a binary consistency relation such that any couple of models would be in the relation:  
Let \(\sim_{all}\) be the binary relation over \(Ob(S2 ML+Cat)\) with no other restriction than being a binary consistency relation. Let \(A,B\in Ob(S2 ML+Cat)\). Then \(A\sim_{all}B\). Let \(A,B\in S2 ML+Cat\). We have \(A\sim_{all}B\) if there exists A', B' in \(Ob(S2 ML+Cat)\) such that there exist injections \(f_{A}:A^{\prime}\longrightarrow A\), \(f_{B}:B^{\prime}\longrightarrow B\), \(F:A^{\prime}\longrightarrow B^{\prime}\), and \(G:B^{\prime}\longrightarrow A^{\prime}\) such that \(F\circ G=Id_{B^{\prime}}\) and \(G\circ F=Id_{A^{\prime}}\). Because \(A\) and \(B\) are S2 ML models, there exists unique blocks \(r_{A}\in Ob(A)\) and \(r_{B}\in B\) such as there are no morphisms in \(A\) (resp \(B\)) with domain \(r_{A}\) (resp \(r_{B}\)). Let \(A^{\prime}\) be the S2 ML model with only one object \(r_{A}\) and no morphisms and \(B^{\prime}\) be the S2 ML model with only one object \(r_{B}\) and no morphisms. \[\left\{ \begin{array}{rl}f_{A}:&A^{\prime}\longrightarrow A\\ r_{A}\to r_{A}\end{array} \right.\] is trivially an injection (we only present the injections through their mappings over \(Ob(X)\) here since the models have no morphisms). We define \(f_{B}\) using the same construction. \[\text{Let}\left\{ \begin{array}{rl}F:&A^{\prime}\longrightarrow B^{\prime}\\ r_{A}\to r_{B}\end{array} \right.\text{ and }\left\{ \begin{array}{rl}G:&B^{\prime} \longrightarrow A^{\prime}\\ r_{B}\to r_{A}\end{array} \right..\]  
F and G are injections, and \(F\circ G=\left\{ \begin{array}{rl}B^{\prime}\longrightarrow B^{\prime}\\ r_{B}\to r_{B}\end{array} \right.=Id_{B^{\prime}}\) and similarly \(G\circ F=Id_{A^{\prime}}\). Therefore \(A\sim_{all}B\). Our definition of a binary consistency relation describes the existence of a similarity between \(A\) and \(B\). This similarity is the shared structure of \(A^{\prime}\) and \(B^{\prime}\). Because the definition is general, the fact that \(A\) and \(B\) are models induces a similarity: the existence of the main element of the model, namely \(r_{A}\) and \(r_{B}\), unique elements of the models with no parents. This results in any couple of models being in relation. This means that not all binary consistency relations are interesting for model comparison. The main idea behind this definition is that we can complete it with restrictions to assert consistency over specific properties of the models.