## 3 Mathematical Framework for Consistency
### Mathematical Representation of a Structural Model
#### 3.0.1 Port
Due to the identity being trivially injective on objects and morphisms, it is an injection. Therefore, \(Id_{X}\in Hom_{S2 ML+Cat}(X,X)\). * Composition:  
Let \(X,Y,Z\in S2 ML+Cat\), let \(F\in Hom_{S2 ML+Cat}(X,Y)\) and let \(G\in Hom_{S2 ML+Cat}(Y,Z)\). \(G\circ F\) is an injection, because each of its components (over objects and homsets) is a composition of injective applications and thus an injective application. Therefore \(H=G\circ F\in Hom_{S2 ML+Cat}(X,Z)\). * Associativity: Injections are functors between categories; therefore, they are associative. S2 ML+Cat presents identity morphisms. Its morphisms can be composed, and their composition is associative. Therefore, S2 ML + Cat is a category. We have defined a category that allows for the mathematical representation of S2 ML models. Under the hypothesis that any structural model can be represented with blocks, ports, and connections, this mathematical representation is readily applicable to any such model. This is the basis for our mathematical framework. The definition we have given here allows a unique categorical representation of any S2 ML that was defined as a quintuplet. **Theorem 1**. : \(Ob(S2 ML+Cat)\) _is isomorphic to the set of the quintuples from [5], up to the choice of symbols for blocks._  
Proof. : Let S2 ML be the set of all quintuplets from [5]. Let \(\left\{ \begin{array}{c}F:\ S2 ML\longrightarrow Ob(S2 ML+Cat)\\ X=<P,C,B,\alpha,r>\to X_{cat}\end{array} \right.\)  
where \(X_{cat}\) is such that:  
* For each \(p\in P\), the port \(P^{\prime}=\{p\}\);
- For each \(c=\{P_{1},\ldots,P_{n}\}\in C\), the connection \(c^{\prime}\) such as \(c^{\prime}=\{P^{\prime}_{1},\ldots,P^{\prime}_{n}\}\) with \(P^{\prime}_{k}=\{P_{k}\}\);
- For each block \(b\in B\), the block \(b^{\prime}\) that contains all blocks, ports, and connections that are under \(b\) for the \(\alpha\) relation;
* The morphisms in \(X\) are trivially obtained from Definition 12. The block \(b^{\prime}\) that we define is unique because it can be built by induction by building first the blocks that contain no blocks (the connection and ports being trivially unique, these blocks also are), then blocks of the next level of abstraction for the \(\alpha\) relation, until we have built all blocks that are contained in \(b^{\prime}\). F allows us to convert any model from S2 ML to a model in \(Ob(S2 ML+Cat)\). Let \(\left\{ \begin{array}{c}G:\ Ob(S2 ML+Cat)\longrightarrow\ S2 ML\\ X\to X_{quint}\end{array} \right.\)  
where \(X_{quint}\) is the set of models \(<P,C,B,\alpha,r>\) from S2 ML, such that:  
* P = \(\{\,p\in P_{Cat}\ |\ P_{cat}\in Ob(X)\) is a port \(\}\);
* B = \(\{\,b^{\prime}\ |\ b^{\prime}\) is a symbol associated to \(b\in Ob(X)\), which is a block \(\}\);
* C = \(\{\,c^{\prime}=\{p\in P_{cat}\ {\it for}\ P_{cat}\in c\ |\ c\in Ob(X)\) is a connection\(\}\);
* \(\alpha=\{\,(x,y)\in Ob(X)^{2}\ |\ Hom_{X}(x,y)\) contains a direct belonging morphism \(\}\);
* r is the root of X. The image of \(X_{quint}\) by F is X, by construction. Therefore, we have a way to map each element of S2 ML to an element of \(Ob(S2 ML+Cat)\). We also have a way to map each element of \(Ob(S2 ML+Cat)\) to a set of elements of S2 ML. Finally, both these mappings are each-other inverse up to the choice of symbols for the blocks. A pleasing property is that when two models can be injected into one another, they have the same structure; this can be expressed as follows. **Theorem 2**. : _Let \(A,B\in Ob(S2 ML+Cat)\), such that there exists injections \(F:A\longrightarrow B\) and \(G:B\longrightarrow A\)._  
_Then there exists an injection \(G^{\prime}:B\longrightarrow A\) such that \(G\circ F=Id_{A}\) and \(F\circ G=Id_{B}\)._  
**Remark 1**. : _Theorem 2 is a generalisation of the Cantor--Schroder--Bernstein theorem to S2 ML models._  
Proof. : Let \(M_{1},M_{2}\in Ob(S2 ML+Cat)\) and \(F:M_{1}\longrightarrow M_{2}\), \(G:M_{2}\longrightarrow M_{1}\) be two injections. F and G are injective on objects; therefore, we know that \(card(Ob(M_{1}))=card(Ob(M_{2}))\).