Mathematical modelling by help of category theory: models and relations between them

The growing complexity of modern practical problems puts high demands on the mathematical modelling. Given that various models can be used for modelling one physical phenomenon, the role of model comparison and model choice becomes particularly important. Methods for model comparison and model choice typically used in practical applications nowadays are computation-based, and thus, time consuming and computationally costly. Therefore, it is necessary to develop other approaches for working abstractly, i.e. without computations, with mathematical models. The abstract description of mathematical models can be achieved by help of abstract mathematics, implying formalisation of models and relations between them. In this paper, a category theory-based approach to mathematical modelling is proposed. On this way, mathematical models are formalised in the language of categories, relations between the models are formally defined, as well as several practically relevant properties are introduced on the level of categories. Finally, an illustrative example is presented underlying how the category-theory based approach can be used in practice. Further, all constructions presented in this paper are also discussed from the modelling point of view by making explicit the link to concrete modelling scenarios.


Introduction
The rapid development of modern technologies naturally leads to higher demands 18 for the mathematical modelling process, because practical problems nowadays require 19 advanced coupled models.Moreover, typically several models can be used for modelling a 20 given physical phenomenon, and thus, a model selection process must be made.Evidently, future work.For making the paper self-contained, some basic definitions from category 85 theory are presented in the Appendix.(iv) all objects are related to mathematical models acting in the same physical dimension.

116
Let us now provide some motivation from the modelling perspective and comments 117 for the assumptions used in this definition:

118
• Assumption (i).This assumption comes naturally from the modelling process: a math- as morphism in the categories.We will make these relations more specific in Section 3. first ideas on using type theory to describe the formalisation process towards detecting 147 conceptual modelling errors have been presented in [8,15].

148
We also would like to remark, that originally, mapping S has been called invertible 149 in [7].The invertibility in this case means, that set of assumptions can be uniquely Moreover, let X be the set of all modelling assumptions used in this category.Then category Model 1 contains totally ordered objects, and therefore is associated with totally ordered models, iff Thus, the constructed category is partially ordered, and since objects Set A 1 and Set A 2 are not related, this category does not contain neither the most complex nor the simplest objects, since no object satisfies assumptions of Corollary 1.
For proving case (iv), let us consider the object 1 , A 1 , A , and let us construct several other objects according to the following commutative diagram (1) (1) (1) Although the diagram is commutative, but the objects on the left side are not related to the objects of the right side in the sense of Definition 2. Thus, we have a partially ordered category, where both the most complex object A Proof.The proof of the theorem follows immediately from Corollary 1, Proposition 1, and Definition 3. Looking at the proof of the case (iv) in Proposition 1, we see immediately that two totally ordered subcategories exist.The case of only one totally ordered subcategory is excluded by the assumption of simultaneous existence of the most complex and the simplest objects.Further, if the most complex and the simplest objects exist simultaneously and all objects in the category Model 1 are related by help of complexity, then it follows immediately that Model 1 is a totally ordered category.
Evidently, the last statement can be straightforwardly generalised as follows: Theorem 2. Every partially ordered category of mathematical models contains at least one totally ordered category of mathematical models as a subcategory.

Convertible mathematical models 304
In this section, we will discuss the mappings S between sets of assumptions and the 305 corresponding models appearing in Definition 1, and as we will see from the upcoming 306 discussion, the role of mappings S provides clear reasoning why objects of categories 307 of mathematical models are sets of assumptions and not the models themselves.The 308 mappings S are generally not invertible, because they represent a formalisation process 309 of basic modelling assumptions in terms of mathematical expressions.Moreover, these 310 mappings are also not unique, since the same set of assumptions can be formalised differ-311 ently.However, if objects in a category have been ordered (partially or totally) according 312 their complexity, then the mappings will preserve this structure.Thus, these mappings are 313 structure preserving mappings, i.e. they are functors.

314
Because the mappings between sets of assumptions and the corresponding mathemati-315 cal models are functorial, then, in fact, the mathematical models constitute also a category.

316
However, since final form of a model depends on the formalisation process, it is more 317 difficult to work directly with categories of models, rather than to describe categories of sets 318 of assumptions, as we have done already.Nonetheless, we will point out now some results 319 related to the models directly.First, we summarise the above discussion in the following  The discussion about convertible mathematical models underlines once more why sets 333 of assumptions are considered as objects in categories of mathematical models, and not 334 model formulations directly.Assume for a moment, that the latter would be the case and 335 consider the following diagram with three objects for simplicity: Obviously, it is necessary to be able to distinguish between the two kinds of morphisms, which would imply much more complicated constructions for the structure of the category, as well as for relations between its objects.As a simple immediate example indicating the necessity for considering convertible mathematical models, let us consider the classical model of linear elasticity describing deformations of an elastic body in a static case.The classical formulation of this model is given by the following system of equations where σ is a symmetric stress tensor, ε is a symmetric strain tensor, u is a displacement vector, ρ is a material density, ν is the Poisson's ration, and K is the volume force.System of equations ( 1) is the classical tensor version of elasticity equations, see for example [17].However, the Lamé equation is often used in practice as well.Furthermore, model of linear elasticity can be also written as follows where the multiplication operator M is defined by Equation ( 3) is a quaternionic form of elasticity model with D denoting the Dirac operator, see [9] for all details on quaternionic analysis and its applications.
For the sake of clarity of further considerations, let us denote the models ( 1)-( 3) as follows: A possible representation of these models is provided by the diagram Here, functor S is a formalisation process of basic set of assumptions of linear elasticity  Rayleigh, and Timoshenko beam theories, respectively.We start our discussion on the 369 construction of category Beam by explicitly listing the sets of assumptions, which are given 370 in Table 1.however in some cases it is more convenient to formulate sets of assumptions directly in terms of mathematical expressions, or as a mixture of both.Although from the set-theoretic point of view such a freedom in writing sets of assumptions is not completely justified, it is acceptable in our setting because each set of assumption written in natural language can be rigorously formalised in terms of mathematical expressions.Thus, writing mathematical expressions in sets of assumptions can be considered as a kind of syntactic sugar, similar to programming languages terminology.Of course, this analogy not perfect but reflects a general point of view on writing sets of assumptions.
Since derivation of beam models is well known, it will be omitted.Set of assumption Set B−E of the Bernoulli-Euler theory leads to the following beam equation: where E is the Young's modulus of the material, I y is the moment of inertia, rho is the density of material, and F is the area of cross section.Next, set of assumption Set R of the Rayleigh theory leads to the equation: Finally, if the effect of bending of cross sections is taken into account, then set of assumption Set T of the Timoshenko theory is obtained, which leads to the system of differential equations: where ϕ is the angle of rotation of the normal to the mid-surface of the beam, ℵ is the Timoshenko shear coefficient, which depends on the geometry of the beam, and µ is the shear modulus.After some calculations this system can be reformulated in terms of only one partial differential equation for u as follows: Looking at the above beam models from the categorical perspective, we can summarise these models and their sets of assumptions as follows: where S are formalisation mappings, as discussed before.It is worth making the remark:

397
Note that, first three facts, as well as the commutative diagram presented above, do not require, in fact, models themself, because these facts are solely obtained simply from the sets of assumptions, i.e. by looking at the objects in category Beam.Thus, the categorical point of view introduced in the previous section reflects the following idea: The principle difference between models lies not in their final form, but in the basic modelling assumptions these models constructed from.
Finally, let us look at the level of models, where the following diagram is obtained where ϑ denotes a natural transformation appearing in the definition of convertible models,  Next, we briefly revisit the example of aerodynamic models used in bridge engineering 401 presented in [13].Since the idea is only briefly discuss categorical constructions introduced 402 in previous sections, we will not present aerodynamic models in details, but we refer to 403 works [11,12].We consider the category AeroModel containing as objects the following Let us now list some facts we know about the category AeroModel: Additionally, we can say that no models associated to the objects of AeroModel are con-417 vertible, but for that it is necessary to take a look at the derivation of models, see again [13] 418 and references therein.

86 2 . 108 Definition 1 (
Categories of mathematical models 87Before starting with categorical constructions, it is important to underline, that models 88 used in practice can be generally classified in two types: 89 • physics-based models -models which are based on mathematical formalisations of 90 physical laws and assumptions; 91 • data-driven models -models which are based on representations of data, e.g.results of 92 experiments or measurements obtained from a monitoring system.93 This paper deals with physics-based models, which are referred to simply as mathematical 94 models, because this type of models is typically implied by the term mathematical modelling.95 Moreover, because mathematical models are based on physical assumptions formalised by 96 help of mathematical expressions, they provide a richer basis for abstract considerations, 97 compared to data-driven models, which are very often black-box models not relying on 98 any physical assumptions.99 We start our construction with the introduction of concrete categories Model i , i = 100 1, 2, . .., which are associated with mathematical models used to describe a certain physical 101 phenomenon, such as, for example, models of elasticity theory or heat conduction.The 102 term "associated" has been used, because, strictly speaking, the objects of categories 103 Model i , i = 1, 2, . . .are not mathematical models themself, but rather sets of basic physical 104 assumptions on which the corresponding mathematical models are created.However, 105 to keep notations short and transparent, we will refer to these categories simply as to 106 categories of mathematical models.The following definition introduces basic structure of these 107 categories: Category of mathematical models).Let Model 1 be a category of mathematical 109 models describing a given physical phenomenon.Then for all objects of Model 1 the following 110 assumptions hold: 111 (i) each object is a finite non-empty set -set of assumptions of a mathematical model, denoted by 112 Set A , where A is the corresponding mathematical model; 113 (ii) morphisms (arrows) are relations between these sets; 114 (iii) for each set of assumptions and its corresponding model exists a mapping

Theorem 1 .
simultaneously.Hence, the proposition is proved.Next, we have the following theorem: Consider a category Model 1 with n objects.If the most complex object Set A 1 and the simplest object Set A n exist simultaneously in the category Model 1 , then Model 1 is either a totally ordered category, or contains at least two totally ordered subcategories.

Definition 4 .FCorollary 2 .
Let Set A 1 be an object in the category Model 1 , and let B 1 and B 2 be two possible 322 model formulations associated with the object Set A 1 via two functors F and G. Then the model 323 formulations B 1 and B 2 are connected via a natural transformation of functors ϑ, and the model 324 formulations B 1 and B 2 are called convertible.This construction corresponds to the commutative Set A 1 → G Set A 1 Moreover, models which are instantiated by convertible model formulations will be called convertible 327 models.328 Obviously, because different model formulations are related to the same set of as-329 sumptions, the model complexity of these formulations remains the same.Thus, we have 330 immediately the following corollary: 331 Convertible models have the same complexity. 332 additionally that the model formulations A 1 and A 2 are convertible in the sense of Definition 4, while the model formulation A 3 is not associated with the same set of assumptions.Thus, we would end up with two kinds of morphisms in the category: morphism f plays the same role as the natural transformation ϑ in Definition 4, while morphisms g and h represent complexity-relation on the level of model formulations.

363 5 . 1 .
Categorical modelling of beam theories 364 Transverse vibrations of one-dimensional beams are typically modelled by one of three 365 common beam theories: Bernoulli-Euler theory, Rayleigh theory, and Timoshenko theory.366Thus, let us consider a category of mathematical models, denoted by Beam, containing 367 as objects sets of assumptions Set B−E , Set R , Set T corresponding to the Bernoulli-Euler, 368

419 6 .Definition 5 .•
Further characterisations of mathematical models and conclusions 420In this section, we present some further ideas on characterisations of mathematical 421 models.One of the most important aspect of applications of category theory is a definition 422 of a universal mapping property (UMP), or simply, a universal arrow, which provides, in fact, a 423 categorical characterisation of objects, see[1,18] for details.Hence, it is important to discuss 424 the universal arrow definition also in the context of category theory-based modelling 425 methodology.426 Let us consider a formalisation functor S : Model → M, where M denotes formally a 427 category of instantiations of mathematical models corresponding to the objects in Model.428 Let m be an object of M, then a universal arrow from m to S is a pair r, u consisting of 429 an object r of Model and an arrow r : m → Sr of M, such that to every pair d, f with d 430 an object of Model and f : c → Sd an arrow of M, there is a unique arrow f : r → d of 431 Model with S f • u = f .Practical meaning of a universal arrow in the context of category 432 theory-based modelling methodology is that to the same set of assumption can correspond 433 only convertible model formulations.434 Finally, we would like to provide another possible definition of a mathematical model 435 in general, which would summarise our discussion in this paper: 436 A mathematical model M is a triple M = Set, M, S , where 437 Set is the set of assumptions of the model; 438 • M is an instantiation of the model in terms of mathematical expressions and equations; 439 • S is a formalisation mapping, which formalises the set of assumptions Set into the model 440 instantiation M. 441 Relations between the models can be introduced again by help of Definition 2. Defi-442 nition 5 proposes an abstract description of a mathematical model similar to the abstract 443 algebraic approach presented in [16].Thus, a connection between the category theory-444 based modelling methodology and abstract algebraic approach is established.Hence, both 445 approaches to the modelling process in engineering might complement each other, and 446 therefore, the connection between both approaches will be studied in future research.447 In this paper, we have revisited the category theory-based modelling methodology 448 proposed in recent years.The main idea of this modelling methodology is representation 449 of mathematical models by help of categorical constructions.We have presented revised 450 results from previous works, as well as new results and ideas supporting a deeper un-• For each object A, there is given an arrow 1 A : A −→ A called the identity arrow of A.These data are required to satisfy the following laws:• Associativity: h • (g • f ) = (h • g) • f for all f : A −→ B, g : B −→ C, h : C −→ D. • Unit: f • 1 A = f = 1 B • f for all f : A −→ B. Definition A2.A functor F : C −→ Dbetween categories C and D is a mapping of objects to objects and arrows to arrows, in such a way that (a) F( f: A −→ B) = F( f ) : F(A) −→ F(B), (b) F(1 A ) = 1 F(A) , (c) F(g • f ) = F(g) • F( f ).That is, F respects domains and codomains, identity arrows, and composition.Definition A3.For categories C, D and functors F, G :C −→ D a natural transformation ϑ : F −→ G is a family of arrows in D (ϑ C : FC −→ GC) C∈C , such that, for any f : C −→ C in C, one has ϑ C • F( f ) = G( f ) • ϑ C ,that is, the following diagram commutesIn any category C, and object • 0 is initial if for any object C there is a unique morphism 0 −→ C, • 1 is terminal if for any object C there is a unique morphism C −→ 1. Definition A5.A subcategory S of a category C is a collection of some of the objects and some of the arrows of C, which includes with each arrow f both the object dom f and the object cod f , with each object s its identity arrow 1 S and with each pair of composable arrows s −→ s −→ s their composite.
This assumption, in fact, introduces the structure of categories of 123tions is understood in a broader sense: not only basic physical assumptions are listed, 124 but all further modifications and simplifications of the model, such as for example a 125 linearisation of original equations, are also elements of the set of assumptions.The 126 requirements for the set of assumptions to be finite comes from the fact that no model 127 possess an infinite set of physical assumptions.Therefore, consideration of more general sets is not necessary.129Itisalsoimportantto remark that having finite sets as objects in the category is one 130 possible way to approach mathematical models.Alternatively, one could think of 131 working directly with mathematical expressions (equations) representing the models.132However, in this case it will be more difficult to distinguish models, since the same set 133 of assumptions can be formalised differently in terms of final equations, as we will see 134 in Section 4.135•Assumption (ii).

Assumption (iv). This assumption ensures that we do not treat equally models from 157 different dimensions.
150 reconstructed from the final form of a model.Although that such a reconstruction 151 is theoretically indeed possible, it is generally not unique.Even if we consider the 152 following canonical parabolic equation 153 u t = a 2 u xx , then without extra context it cannot be decided if this is a heat equation or a diffusion 154 equation.Therefore, the invertibility of a mapping S has been dropped from Definition 155 1. 156 •

3. Relations between mathematical models 174
Model 1 .We say that model A has higher complexity than model B if and only 183 if Set A ⊂ Set B , but Set B ⊂ Set A .Consequently, two models are called equal, in the sense of 184 complexity, iff Set B = Set A .
[13]odel cannot be assessed with respect to its ability represent the corresponding physical 192 process, otherwise that would imply that the exact representation of the physical process is 193 known a priori.194It is important to underline, that the notion of model complexity proposed in Definition 195 2 is neither related to the notion of complexity of an algorithm, nor to the notion of 196 complexity used for statistical models, where the number of parameters is typically served 197 as complexity measure.The advantage of the notion of model complexity introduced in 198 Definition 2 is the fact that it does not depend on specific boundary or initial conditions, 199 since typically basic model assumptions are not influenced by them.Nonetheless, if 200 boundary conditions are essential for basic model assumptions, e.g.singular boundary 201 conditions, then they will be automatically listed in the corresponding set of assumptions, 202 since such boundary conditions are critical for describing the physical process.Thus, the 203 model complexity introduced in Definition 2 is a universal model property.204Additionally,Definition 2 might sound a bit counterintuitive, since it states that a 205 model satisfying less modelling assumption is more complex, and not of higher simplicity, 206 as it could be expected as well.In fact, both points of view on the complexity are possible, 207 and differ only in the general understanding of modelling assumptions.Definition 2 is 208 based on the idea that modelling assumptions act as restrictions for a model, and thus, 209 implying that a model with less modelling assumptions is more general.Nonetheless, 210 another perspective on the notion of model complexity still can be considered, which would 211 reflect the opposite point of view that model assumptions are not restrictions, but rather 212 generalisations of models.This discussion is also directly related to the following important 213 remark: 214 Remark 1. Sets of assumptions introduced in Definition 2 are assumed to be written by help 215of a natural language.Although intuitively it is clear how to formulate these sets, as well as 216 how to compare them in the sense of model complexity, from the formal perspective it is not so 217 straightforward.In fact, a formal comparison of sets of assumptions written in a natural language 218 can be done only by help of a detailed semantic analysis of these sentences, and only after that, 219 sentences, and hence sets of assumptions, can be rigorously compared.As a possible way around this problem, stricter rules on formulating sets of assumptions might be imposed.In that case, a 221 kind of basic "alphabet" containing allowed expressions and symbols could be introduced.Moreover, 222 perhaps a combination of a natural language and mathematical expressions complemented by strict 223 rules could be a suitable option.Different possibilities to address the problem of a rigorous comparison 224 of sets of assumptions will be studied in future work.233objects,weintroduce the following definition[13]: 234 Definition 3. Let Model 1 be a category of mathematical models in which n objects Set A j , j = 1, . . ., n can be ordered according to Definition 2 as follows and Set A n = X, otherwise, the category Model 1 contains partially ordered objects corresponding to partially ordered In a totally ordered category Model 1 with n objects always exist two unique objects: For a partially ordered category Model 1 with n objects one of the following the most complex object Set A 1 and the simplest object Set A n do not exist; 258 (ii) the most complex object Set A 1 exists, while the simplest object Set A n does not exist; 259 (iii) the most complex object Set A 1 does not exist, while the simplest object Set A n exists; 260 (iv) the most complex object Set A 1 and the simplest object Set A n exist simultaneously.
236As a direct consequence of this definition we have the following corollary:237 Corollary 1. 238 • object Set A 1 satisfying Set A 1 ⊂ Set A i ∀i = 2, . ..,n, which is called the most complex object, 239 and the associated model A 1 is called the most complex model; 240 • object Set A n satisfying Set A n = Set A 1 ∪ Set A 2 ∪ . . .∪ Set A n , which is called the the simplest 241 object element, and the associated model A n is called the simplest model.242 It is worth to mention, that in the framework of introduced modelling formalism, 243 the most complex object and the simplest object are, in fact, initial object and terminal 244 object in categories of mathematical models, respectively.Note that, although categories 245 of mathematical models have finite sets as objects, the initial and terminal objects are 246 different to the ones in the classical category Sets, where these are given by the empty set 251 The proof of Corollary 1 is straightforward, and we only would like to mention, that 252 uniqueness of objects Set A 1 and Set A n follows immediately from Definition 2 and from 253 the fact that a totally ordered category is considered.The situation is trickier in the case of 254 partially ordered categories: Proposition 1. 257 (i)

Table 1 .
Sets of assumptions of beam theoriesAssumptionsSet B−E Set R Set T 1. Cross sections of a beam that are planes remain planes after the deformation process The assumptions, as listed in Table1, are formulated by help of natural language, Note that, in general, mappings S can be different for each set of assumptions, or, can 381 be the same if all equations are derived based on the same principle, e.g. the Hamilton's principle.If the fact that different formalisation processes have been used to obtain models from the sets of 383 assumptions in one category is essential for the application, then it is necessary to indicate this fact 384 by using sub-scripts, i.e. S 1 , S 2 , ..., otherwise the general notation for the formalisation mappingsThe morphisms f , g, and h indicate the simple fact, that one beam theory can be obtained 387 from another by weakening basic assumptions.Moreover, the above diagram clearly indi-388 cate that the object Set T (Timoshenko theory) is the most complex, the object Set R (Rayleigh 380Remark 3.382