Analogical proportions

Analogy-making is at the core of human and artificial intelligence and creativity with applications to such diverse tasks as proving mathematical theorems and building mathematical theories, common sense reasoning, learning, language acquisition, and story telling. This paper introduces from first principles an abstract algebraic framework of analogical proportions of the form ‘a is to b what c is to d’ in the general setting of universal algebra. This enables us to compare mathematical objects possibly across different domains in a uniform way which is crucial for AI-systems. It turns out that our notion of analogical proportions has appealing mathematical properties. As we construct our model from first principles using only elementary concepts of universal algebra, and since our model questions some basic properties of analogical proportions presupposed in the literature, to convince the reader of the plausibility of our model we show that it can be naturally embedded into first-order logic via model-theoretic types and prove from that perspective that analogical proportions are compatible with structure-preserving mappings. This provides conceptual evidence for its applicability. In a broader sense, this paper is a first step towards a theory of analogical reasoning and learning systems with potential applications to fundamental AI-problems like common sense reasoning and computational learning and creativity.


Introduction
Analogy-making is at the core of human and artificial intelligence and creativity with applications to such diverse tasks as proving mathematical theorems and building mathematical theories, common sense reasoning, learning, language acquisition, and story telling (e.g.Boden, 1998;Gust, Krumnack, Kühnberger, & Schwering, 2008;Hofstadter, 2001;Hofstadter & Sander, 2013;Krieger, 2003;Pólya, 1954;Sowa & Majumdar, 2003;Winston, 1980;Wos, 1993).This paper introduces from first principles an abstract algebraic framework of analogical proportions of the form 'a is to b what c is to d' in the general setting of universal algebra.This enables us to compare mathematical objects possibly across different domains in a uniform way which is crucial for AI-systems.The main idea is simple and is illustrated in the following example.
Example 1. Imagine two domains, one consisting of positive integers 1, 2, . . .and the other made up of words ab, ba . . .et cetera.The analogical equation 2 : 4 :: ab : x (1) is asking for some word x (here x is a variable) which is to ab what 4 is to 2. What can be said about the relationship between 2 and 4? One simple observation is that 4 is the square of 2. Now, by analogy, what is the 'square' of ab?If we interpret 'multiplication' of words as concatenation-a natural choice-then (ab) 2 is the word abab, which is a plausible solution to (1).We can state this more formally as follows.Let s(z) := z and t(z) := z 2 be two terms.We have 2 = s(2), 4 = t(2), and ab = s(ab).
(2) By continuing the pattern in ( 2), what could x in (1) be equal to?In (2), we see that transforming 2 into 4 means transforming s(2) into t (2).Now what does it mean to transform ab 'in the same way' or 'analogously'?The obvious answer is to transform s(ab) into t(ab) = abab computed before.As simple as this line of reasoning may seem, it cannot be formalized by some current models of analogical proportions which restrict themselves to proportions between objects of a single domain (cf.Stroppa & Yvon, 2006;Miclet, Bayoudh, & Delhay, 2008) and we will return to this specific analogical proportion in a more formal manner in 26.
It is important to emphasize that we do not want our model to capture only obvious analogical proportions as in the example above.To the contrary, in the more interesting and 'creative' cases, analogical proportions provide a tool for deriving unexpected and often hypothetical conclusions, which if necessary can afterwards be checked for plausibility in a specific context.This process is similar to non-monotonic reasoning, where this kind of 'guess and check' paradigm is common (cf.Eiter, Ianni, & Krennwallner, 2009).The next example illustrates the idea of formalizing aspects of creativity via unexpected analogical proportions.
We believe that finding such hidden transformations between seemingly unrelated objects is crucial for formalizing creativity (cf.Boden, 1998).We will come back to this proportion in 55.
The rest of the paper is devoted to formalizing and studying reasoning patterns as in the examples above within the abstract algebraic setting of universal algebra.The aim of this paper is to introduce our model of analogical proportions-which to the best of our knowledge is novel-in its full generality.The core idea is formulated in 8 and despite its conceptual simplicity (it consists of three parts, where the second and third parts are symmetrical variants of the first) it has interesting consequences with mathematically appealing proofs, which we plan to explore further in the future.Since 'plausible analogical proportion' is an informal concept, we cannot hope to formally prove the soundness and completeness of our framework-the best we can do is to prove that some desirable proportions are derivable within our framework (e.g.Theorems 24,28,37,40) and that some implausible proportions cannot be derived (e.g.Theorem 28 and Examples 39 and 45).We compare our framework with two recently introduced frameworks of analogical proportions from the literature (Miclet et al., 2008;Stroppa & Yvon, 2006)-introduced for applications to artificial intelligence and machine learning, specifically for natural language processing and handwritten character recognition-within the concrete domains of sets and numbers, and in each case we either disagree with the notion from the literature justified by some counter-example (45) or we can show that our model yields strictly more justifiable solutions (49), which provides evidence for its applicability.Finally, in the 2-element boolean setting, we argue in Section 7 that our model coincides with Klein's (Klein, 1982) model and that it reasonably disagrees with Miclet and Prade's (Miclet & Prade, 2009) framework, which is remarkable as our framework is not geared towards the boolean domain.Lepage (2003)  To be more precise, Lepage (2003) introduces his axioms in the linguistic setting of words and although his axioms appear reasonable in the word domain (but see Problem 30), the following counter-examples show that they cannot be straightforwardly applied to the general case.Strong reflexivity fails, for instance, in cases where the relation of a to b and to d is identical, for some distinct elements b and d.Strong inner reflexivity fails, for instance, if the relation of a to itself is similar to the relation of c to d.In our framework, by making the underlying structures of an analogical proportion explicit, it turns out that except for symmetry none of Lepage's axioms holds in the general case, justified by counter-examples (Theorem 28).This has critical consequences as his axioms are assumed by many authors (e.g.Barbot, Miclet, & Prade, 2019;Miclet et al., 2008) to hold beyond the word domain.We adapt Lepage's list of axioms by including symmetry, and by adding inner We prove that the inner symmetry, inner reflexivity, reflexivity, and determinism axioms are satisfied within our framework, whereas commutativity, transitivity, inner transitivity, and central transitivity fail in general (Theorem 28).This shows that the property of being in analogical proportion is a local property (31).This is in contrast to category theory (cf.Awodey, 2010)-the algebraic field for formalizing mathematical analogies-where the transitivity of arrows leads to a form of 'connectedness' which in general is not present in analogical proportions (see the discussion in Section 7.3).
Interestingly, analogical proportions turn out to be non-monotonic in the sense that expanding the underlying structure of an analogical proportion may prevent its derivation (Theorem 28).This may have interesting connections to non-monotonic reasoning, which itself is crucial for common sense reasoning and which has been prominently formalized within the field of answer set programming (Gelfond & Lifschitz, 1991) (cf. Brewka, Eiter, & Truszczynski, 2011)).
The functional-based view in (Barbot et al., 2019) is related to our Functional Proportion Theorem 24 on functional solutions and the preservation of functional dependencies across different domains, which means that in case t(z) is a transformation, satisfying a mild injectivity condition and applicable in the source and target domains, we have a : t(a) :: c : t(c).The critical difference is that the authors of (Barbot et al., 2019) assume Lepage's central permutation axiom, which implies in their framework that the functional transformation t need to be bijective.
Analogical proportions turn out to be compatible with structure-preserving mappings as shown in our First and Second Isomorphism Theorems 37 and 40, respectively-a result which is in the vein of Gentner's (Gentner, 1983) Structure-Mapping Theory (SMT) of analogy-making (see the brief discussion in Section 7).
As we construct our model from first principles using only elementary concepts of universal algebra, and since our model questions some fundamental properties of analogical proportions presupposed in the literature, to convince the reader of the plausibility of our model we need to validate it either empirically or-what we prefer here-theoretically by showing that it fits naturally into the overall mathematical landscape.For this, we will show in Section 6 that our purely algebraic model can be naturally embedded into first-order logic via model-theoretic types (cf.Hinman, 2005, §7.1).More precisely, we show that sets of algebraic justifications of analogical proportions are in one-toone correspondence with so-called 'rewrite formulas' and 'rewrite types', which is appealing as types play a fundamental role in model theory in general and showing that our model-which is primarily motivated by simple examples-has a natural logical interpretation, provides strong evidence for its applicability.In Section 6.2, we then prove from this logical perspective that analogical proportions are compatible with isomorphisms, a further desired property.
In a broader sense, this paper is a first step towards a theory of analogical reasoning and learning systems with potential applications to fundamental AI-problems like common sense reasoning and computational learning and creativity.
2.1.1.Syntax.A language L of algebras consists of a set F s L of function symbols, a set C s L of constant symbols, a rank function rk L : F s L → N − {0}, and a denumerable set V = {x, z 1 , z 2 , . ..} of variables.The sets F s L , C s L , and V are pairwise disjoint.Moreover, we always assume that L contains the equality relation symbol = interpreted as the equality relation in every algebra.A language L is a sublanguage of a language L ′ -in symbols, and rk L is the restriction of rk L ′ to the function symbols in L. In the special case that F s L = F s L ′ , we say that L ′ is an extension by constants.An L-expression is any finite string of symbols from L. An L-atomic term is either a variable or a constant symbol.The set T L (V) of L-terms is the smallest set of L-expressions such that (i) every L-atomic term is an L-term; and (ii) for any L-function symbol f and any L-terms t 1 , . . ., t rk L ( f ) , f (t 1 , . . ., t rk L ( f ) ) is an L-term.We denote the set of variables occurring in a term t by V(t).We say that t has rank n if V(t) ⊆ {z 1 , . . ., z n }.A term is ground if it contains no variables.

2.1.2.
Semantics.An L-algebra A consists of (i) a non-empty set A, the universe of A; (ii) for each f ∈ F s L , a function f A : A rk L ( f ) → A, the functions of A; and (iii) for each c ∈ C s L , an element c A ∈ A, the distinguished elements of A.
Notation 3.With a slight abuse of notation, we will not distinguish between an L-algebra A and its universe A in case the operations are understood from the context.This means we will write a ∈ A instead of a ∈ A et cetera.Moreover, given a subset A ′ of the universe of A, the language L(A ′ ) is the language L augmented by a constant symbol a for each element a ∈ A ′ .

Given an L-algebra A and an L
For any L-algebra A, an A-assignment is a function ν : V → A. For any assignment ν, let ν z →a denote the assignment ν ′ such that ν ′ (z) := a, and for all other variables z ′ , ν ′ (z ′ ) := ν(z ′ ).We extend the domain of the A-assignment ν from variables in V to terms in T L (V) inductively as follows: where ν (a 1 ,...,a |V(t)| ) (z i ) := a i , for all 1 ≤ i ≤ |V(t)|.We call a term t constant in A iff t A is a constant function, and we call t injective in A iff t A is an injective function.For instance, the term t(z) = 0z is constant in (N, •, 0) despite containing the variable z.Terms can be interpreted as 'generalized elements' containing variables as placeholders for concrete elements, and they will play a central role in our algebraic formulation of analogical proportions given below.
A homomorphism from A to B is a mapping H : A → B such that for any function symbol f ∈ F s L and any elements a 1 , . . ., a rk L ( f ) , An isomorphism is a bijective homomorphism, and we call two algebras A and B isomorphic-in symbols, A ≃ B-iff there exists an isomorphism from A to B.

2.2.
First-Order Logic.We recall the syntax and semantics of first-order logic, restricted to functional structures containing no relation symbols, by mainly following the lines of (Hinman, 2005).

Syntax.
A first-order language L is a language of algebras extended by relation symbols, the connectives ¬ and ∨, and the existential quantifier ∃.We call L a functional language if it contains no relation symbols other than equality.Notice that there is no real difference between a language of algebras and a functional first-order language; however, we make the formal distinction here to highlight the fact that full first-order logic and model theory containing relation symbols is strictly more expressive than plain universal algebra, summed up by Chang and Keisler (1973) as universal algebra + logic = model theory.
Notation 4. In this paper, we always assume that L is functional.
An L-atomic formula has the form s = t, where s and t are L-terms and we denote the set of all such formulas by aFm L .The set of L-formulas is the smallest set of L-expressions such that (i) every L-atomic formula is an L-formula; (ii) if ϕ and ψ are L-formulas, then so are ¬ϕ and ϕ ∨ ψ; (iii) if ϕ is an L-formula and z ∈ V is a variable, then ∃z ϕ is an L-formula.We introduce the following abbreviations: ϕ ∧ ψ :≡ ¬(¬ϕ ∨ ¬ψ) and ∀z ϕ :≡ ¬∃z¬ϕ.A 2-formula is a formula containing exactly two free variables.

2.2.2.
Semantics.An L-structure A is the same as an L-algebra in case L is functional.We define the logical entailment relation inductively as follows: for any functional L-structure A and any Aassignment ν, (i) for any L-terms s and t, for some a ∈ A. With the abbreviations introduced above, we further have, for any formulas ϕ and ψ, (i) , for all a ∈ A. For any function H : A → B and any A-assignment ν, we define the H-induced B-assignment by H(ν)(z) := H(ν(z)).We say that H respects (i) a term t iff for each A-assignment ν, H(ν(t)) = H(ν)(t); or, in other words, iff for each e ∈ A rk L (t) , H(t A (e)) = t B (H(e)), where H(e) means component-wise application; (ii) a formula ϕ iff for each A-assignment ν, The following result will be useful in Section 6.2 for reproving our First Isomorphism Theorem 37 in Section 4.4; its proof can be found in (Hinman, 2005, Lemma 2.3.6).
Lemma 5.For any A and B and any H : A → B, H respects all L-terms and formulas.

Analogical Proportions
In the rest of the paper, we may assume some 'known' source domain A and some 'unknown' target domain B, both L-algebras of same language L. We may think of the source domain A as our background knowledge-a repertoire of elements we are familiar with-whereas B stands for an unfamiliar domain which we want to explore via analogical transfer from A. For this we will first consider arrow equations of the form 'a transforms into b as c transforms into x'-in symbols, a → b : • c → x-where a and b are source elements of A, c is a target element of B, and x is a variable.Solutions to arrow equations will be elements of B which are obtained from c in B as b is obtained from a in A in a mathematically precise way (8).Specifically, we want to functionally relate elements of an algebra via term rewrite rules as follows.Recall from 1 that transforming 2 into 4 in the algebra (N, •) means transforming s(2) into t(2), 1 where s(z) := z and t(z) := z 2 are terms.We can state this transformation more pictorially as the term rewrite rule s → t or z → z 2 .Now transforming the word ab 'in the same way' means to transform s(ab) into t(ab), which again is an instance of s → t.Let us make this notation official.Notation 6.We will always write s(z) → t(z) or s → t instead of (s, t), for any pair of L-terms s and t containing variables among z such that every variable in t occurs in s.We call such expressions L-rewrite rules or L-justifications where we often omit the reference to L. We denote the set of all L-justifications with variables among z by J(L, z).We make the convention that → binds weaker than every other algebraic operation.Definition 8. We define the analogical proportion relation in three steps: 1 To be more precise, we transform s (N,•) (2) into t (N,•) (2).
(1) An arrow equation in (A, B) is an expression of the form 'a transforms into b in A as c transforms into x in B'-in symbols, where a and b are source elements from A, c is a target element from B, and x is a variable.Given a target element d ∈ B, define the set of justifications of an arrow proportion a → b : A justification s → t is trivial in (A, B) iff it justifies every arrow proportion in (A, B), and we say that J is a trivial set of justifications in (A, B) iff every justification in J is trivial.
In this case, we say that a, b, c, d are in arrow proportion in (A, B) written We denote the set of all solutions to (3) in (A, B) by We say that a → b : where a and b are again source elements from A, c is a target element from B, and x is a variable.We call d a solution to (4) in (A, B) iff In this case, we say that a, b, c, d are in directed analogical proportion in (A, B) written We denote the set of all solutions to (4) in (A, B) by We say that a : b :  We say that a : b :: Notation 9. We will always write A instead of (A, A).

Convention 10.
In what follows, we will usually omit trivial justifications from notation.So, for example, we will write only trivial justifications in (A, B), et cetera.The empty set is always a trivial set of justifications.Every justification is meant to be non-trivial unless stated otherwise.Moreover, we will always write sets of justifications modulo renaming of variables, that is, we will write {z → z} instead of {z → z | z ∈ V} et cetera.
Roughly, an element d in the target domain is a solution to an analogical equation of the form a : b :: c : x iff there is no other target element d ′ whose relation to c is more similar to the relation between a and b in the source domain (see 12), expressed in terms of maximal sets of algebraic justifications satisfying appropriate symmetries.Analogical proportions formalize the idea that analogy-making is the task of transforming different objects from the source to the target domain in 'the same way';3 or as Pólya (Pólya, 1954) puts it: Two systems are analogous if they agree in clearly definable relations of their respective parts.
In our formulation, the 'parts' are the elements a, b, c, d and the 'definable relations' are represented by term rewrite rules relating a, b and c, d in 'the same way' via maximal sets of justifications.
Example 11.First consider the algebra A 1 := ({a, b, c, d}), consisting of four distinct elements with no functions and no constants (see the forthcoming Theorem 33): A ′ , we have, for example: On the other hand, since (cf.10) This is an instance of the forthcoming determinism axiom ( 20 In the algebra A 3 given by we have The intuitive reason is that a : b :: a : b is a more plausible proportion than a : b :: a : c, which is reflected in the computation Remark 12.It is important to emphasize that we interpret the expression 'in the same way' as 'maximally similar' instead of 'identical' as the latter interpretation is too strict to be useful.To see why, consider, for instance, the algebra (N, +, N) of natural numbers with addition where each number is a distinguished element, and consider the arrow equation in (N, +, N) given by 2 → 4 : We compute where we have Neither ), which means that under a strict interpretation, neither 5 nor 6 would be a solution to the above equation.In our interpretation, on the other hand, both 5 and 6 are justifiable solutions according to 8 as expected (cf.18).
Remark 13.Section 6 provides an alternative logical interpretation of analogical proportions in terms of model-theoretic types.
Definition 14.We call an L-term s(z) an A-generalization of an element a in A iff a = s A (e), for some e ∈ A |z| , and we denote the set of all A-generalizations of a in A by gen A (a).Moreover, we define for any elements a ∈ A and c ∈ B: Convention 15.Notice that any justification s(z ) and b = t A (e 1 ) and c = s B (e 2 ) and for some e 1 ∈ A |z| and e 2 ∈ B |z| .In particular, this means We sometimes write s e 1 →e 2 − −−−− → t to make the witnesses e 1 , e 2 and their transition explicit.This situation can be depicted as follows: The following characterization of solutions to analogical equations in terms of solutions to directed analogical equations is an immediate consequence of 8.

Fact 16. For any a, b ∈ A and c, d ∈ B, d is a solution to a
We can visualize the derivation steps for proving a : b :: c : d as follows: This means that in order to prove a : b :: c : d, we need to check the four relations in the first line.
To guide the AI-practitioner, we shall now rewrite the above framework in a more algorithmic style.
Pseudocode 17.First of all, one has to specify the L-algebras A and B. Computing the solutions S to an analogical equation a : b :: c : x in (A, B) consists of the following steps: (1) Compute (2) For each d ∈ S 0 , check the following relations with the above procedure (cf.16): (a Add those d ∈ S 0 to S which pass all three tests.The set S now contains all solutions to a : b :: c : x in (A, B).
We now want to demonstrate analogical proportions with two illustrative examples over the natural numbers.
Example 18.Consider the analogical equation 2 : 4 :: 3 : x. (7) According to 8, solving (7) requires three steps: (1) First, we need to solve the arrow equation We can transform 2 into 4 in at least three different ways justified by z → 2 + z, z → 2z, and z → z 2 .Here it is important to clarify the algebras involved.The first two justifications require addition, whereas the last justification requires multiplication.Moreover, the first justification additionally presupposes that 2 is a distinguished element-this is not the case for the last two justifications as 2z and z 2 are abbreviations for z + z and z • z, respectively, not involving 2. Analogously, transforming 3 'in the same way' as 2 can therefore mean at least three things: and 3 → 3 ) is a subset maximal set of justifications with respect to the last argument.This formally proves The other two cases being analogous, we can further derive (2) We now check whether these solutions are solutions to 2 : 4 : • 3 : x as follows.Let us start with (8).We need to check that 3 is a solution to 4 → 2 : has the solutions x 1 = 6 and x 2 = 9 in the multiplicative algebra M := (N 2 , •, N 2 ) as we show in 66 (Appendix).The first solution, x 1 = 6, has an intuitive explanation as we obtain 4 from 20 by dividing by 5-analogously, dividing 30 by 5 yields 6.In the expanded algebra of rationals, this can be written as 20 : 20 5 :: 30 : 30 5 .
The second solution, x 2 = 9, is more subtle and can be roughly justified by the following reasoning (for the complete proof see 66): (10 • 2) : 2 2 :: This last solution is less obvious than the first one and it therefore appears more interesting and more 'creative'.Finally, we shall emphasize that a similar reasoning fails: The reason is that the arrow proportion 4 → 20 : • 4 → 30 has no justifications in M (see 1 in 66 for details), which indicates that computing (all) solutions to an analogical equation is more complicated than 8 might suggest.

Properties of Analogical Proportions
This section studies some basic mathematical properties of analogical equations and proportions.
4.1.Characteristic Sets of Justifications.Computing all justifications of an arrow proportion is difficult in general (see 19), which fortunately can be omitted in many cases.
Definition 20.We call a set J of justifications a characteristic set of justifications of a → b : Notation 21.In case J is a characteristic set of justifications, we will occasionally write to make the set of characteristic justifications J explicit.
Example 22.In 66 (Appendix) we argue that {z The following lemma provides a sufficient condition of characteristic justifications in terms of mild injectivity.
Lemma 23 (Uniqueness Lemma).Let s(z) → t(z) be a non-trivial justification of a → b : Proof.We prove each item separately: (1) Since s(z by assumption, there are sequences of elements e 1 ∈ A |z| and e 2 ∈ B |z| satisfying (6), and e 2 is uniquely determined by assumption.Consequently, given any element 4.2.Functional Proportion Theorem.The following reasoning pattern-which roughly says that functional dependencies are preserved across (different) domains-will often be used in the rest of the paper.
(1) Given a ∈ A and c ∈ B, the rewrite rule z → t(z) characteristically justifies (3) Consequently, if e 1 = a ∈ A and e 2 = c ∈ B are unique elements satisfying t A (e 1 ) = t A (a) and t B (e 2 ) = t B (c), then In this case, we call t Functional solutions are plausible since transforming a into t(a) and c into t(c) is a direct implementation of 'transforming a and c in the same way', and it is therefore surprising that functional solutions can be nonetheless unexpected and therefore 'creative' as will be demonstrated, for instance, in 55.
Remark 25.An interesting consequence of Theorem 24 is that in case t is a ground term, we have the directed analogical proportion for all a ∈ A and c ∈ B, (10) characteristically justified by Theorem 24 via z → t.This can be intuitively interpreted as follows: every ground term is a 'name' in our language for a specific element of the algebra, which means that it is in a sense a 'known' element.As the framework is designed to compute 'novel' or 'unknown' elements in the target domain via analogy-making, (10) means that 'known' target elements can always be computed.
The following example shows how we can solve analogical equations across different domains within our framework.
Example 26.We want to formally solve the analogical equation of 1 given by 2 : 4 :: ab : x. (11) For this, we first need to specify the algebras involved.Let L be the language consisting of a single binary function symbol •, and let (N, •) and (Σ + , •), where Σ := {a, b}, be L-algebras.This means we interpret • as multiplication of numbers in N and as concatenation of words in Σ + .As a direct consequence of Theorem 24 with t(z) := z • z, injective in (N, •) and (Σ + , •), we can formally derive the solution abab to (11): Miclet et al., 2008, pp. 796-797) introduces the following axioms in the linguistic context as a guideline for formal models of analogical proportions (over a single universe), adapted here to our framework formulated above:4  ).This has critical consequences, as his axioms are assumed by many authors (e.g.Barbot et al., 2019;Miclet et al., 2008) to hold beyond the word domain.
We replace Lepage's above list by the following list of axioms: Finally, we consider the following schema, where A ′ and B ′ are L ′ -algebras, for some language L ⊆ L ′ : Remark 27.Notice that strong inner reflexivity is a conditional statement, whereas inner reflexivity is an assertion not implied by strong inner reflexivity.The same applies to strong reflexivity and reflexivity.Importantly, central permutation and strong reflexivity imply strong inner reflexivity, and central permutation together with strong inner reflexivity imply strong reflexivity.
We have the following analysis of the above axioms within our framework.
Theorem 28.The analogical proportion relation, as defined in 8, satisfies • symmetry ( 16), • inner symmetry ( 17), • inner reflexivity ( 18), • reflexivity ( 19), • determinism ( 20   The proof is analogous to the above disproof of transitivity.• Finally, we disprove monotonicity.For this, consider the algebra A := ({a, b, c, d}), consisting only of its universe.We have (see the forthcoming Theorem 33 which depends only on inner reflexivity already proved above) Remark 29.Notice that Lepage's axioms (except for symmetry) fail in a single algebra A by Theorem 28, which according to 9 is the special case (A, A) of (A, B)-this means that, in general, Lepage's axioms fail in (A, B) as well.Lepage (2003) proposed his axioms in the linguistic setting of words.This raises the following important question which is beyond the scope of the paper and which therefore remains an open problem.

This shows
Problem 30.Do Lepage's axioms hold within our framework in the word domain?
Remark 31.We shall emphasize that the negative results in Theorem 28 regarding transitivity show that the property of being in analogical proportion is a local property.By this we mean that, for example, the relation between a and b, and between b and e does not fully determine the relation between a and e as inner transitivity fails in general.The same applies to (central) transitivity.
Problem 32.In which algebras is the analogical proportion relation transitive and therefore an equivalence relation?The same question can be asked for inner and central transitivity.Corollary 34.In addition to the positive axioms of Theorem 28, every algebra A := (A), consisting only of its universe, satisfies commutativity, inner transitivity, transitivity, central transitivity, and strong inner reflexivity.
Proof.A direct consequence of Theorem 33.4.4.Isomorphism Theorems.It is reasonable to expect isomorphisms-which are structure-preserving bijective mappings between algebras-to be compatible with analogical proportions.Consider the following simple example.
Example 35.Let Σ := {a} be the alphabet consisting of the single letter a, and let Σ * denote the set of all words over Σ including the empty word ε.We can identify every sequence a n = a . . .a (n consecutive a's) with the non-negative integer n, for every n ≥ 0. Therefore, define the isomorphism We expect the following analogical proportion to hold: That this is indeed the case is the content of the First Isomorphism Theorem 37 below.(⊇) Since H is an isomorphism, its inverse H −1 is an isomorphism as well, and we can apply the already shown case above to prove

Lemma 36 (Isomorphism Lemma). For any isomorphism H : A → B and any elements a, b ∈ A, we have
Theorem 37 (First Isomorphism Theorem).For any isomorphism H : A → B and any elements a, b ∈ A, we have Remark 38.In Section 6.2 we will see a different proof of the First Isomorphism Theorem 37 from the logical perspective of model-theoretic types.
The following counter-example shows that the First Isomorphism Theorem 37 cannot be generalized to homomorphisms.
Example 39.Let A := ({a, b, a ′ , b ′ }, f A ) and B := ({c, d}, f B ), where f A and f B are unary functions defined by One can verify that H as defined by the dashed arrows in the figure above is a homomorphism from A to B.
We claim We have The following theorem shows that the analogical proportion relation is invariant under isomorphic transformations.Proof.An immediate consequence of the Isomorphism Lemma 36 which yields

Sets and Numbers
In this section, we demonstrate our abstract algebraic framework of analogical proportions introduced above by investigating some elementary properties of proportions between sets and numbers, and by comparing our model with the models in (Miclet et al., 2008;Stroppa & Yvon, 2006).5.1.Set Proportions.This section studies analogical proportions between sets called set proportions.
Notation 41.In the rest of this section, let L := {∩, .c } be the language of sets, interpreted in the usual way, let U and W be universes, and let A(U, W) := (P(U), ∩, .c , P(U) ∩ P(W)), B(W, U) := (P(W), ∩, .c , P(U) ∩ P(W)), be L(P(U) ∩ P(W))-algebras containing the distinguished sets in P(U) ∩ P(W) as constants (cf.3).We will write A(U) instead of A(U, U).We introduce the following abbreviations: Notice that in case A = B, every set in A is a distinguished set; the empty set is always a distinguished set.
The following proposition summarizes some elementary properties of set proportions.

Proposition 42. The following proportions hold in (A, B), for all A ∈ A, C ∈ B, and B, E ∈ A ∩ B:
A : A c ::

Moreover, in case B ⊆ A and B ⊆ C, we further have the arrow proportion
Proof.All proportions are immediate consequences of Theorem 24 with t(Z) defined as follows: • The proportions in (24) follow from the fact that t(Z) := Z c is injective in A and B. Example 43.The rewrite rule

• The directed proportions
, which shows that it is a trivial justification in (A, B).This example shows that trivial justifications may contain useful information about the underlying structures-in this case, it encodes the trivial observation that any two sets A and B are symmetrically
Although 44 works in some cases, in general we disagree with the notion of set proportions in (Stroppa & Yvon, 2006) justified by the following counter-example.This is implausible as it has no non-trivial justification.In fact, determinism (20) implies that {a} is the only solution to {a} : {a} :: {a} : X in A({a}) according to our 8 (cf.Theorem 28).

Miclet, Bayoudh, and Delhay.
There is at least one more definition of set proportions in the literature due to Miclet et al. (2008, Definition 2.3). 6  Definition 46.Given a finite universe U and sets A, B, C, D ∈ A, for some finite sets E and F.
Remark 47.Notice that Miclet et al. (2008) define set proportions only for finite sets which is a serious restriction to its practical applicability.
For example, shows that (32) holds with respect to 46 as well.
We have the following implication.
The following example shows that the converse of Theorem 48 fails in general.
Example 49.Consider the analogical equation in A({a, b}) given by {a} : {b} :: As {b} is the complement of {a} in A({a, b}), {a, b} = ∅ c is a solution of (33) in our framework as a consequence of (24).In contrast, since there are no finite sets E and F in A({a, b}) satisfying {b} = ({a} ∪ E) − F and {a, b} = (∅ ∪ E) − F, {a, b} is not a solution of (33) according to 46. 6 To be more precise, the definition in (Miclet et al., 2008) is stated informally as Four sets A, B, C and D are in analogical proportion A : B :: C : D iff A can be transformed into B, and C into D, by adding and subtracting the same elements to A and C.This definition is ambiguous.One interpretation is the one we choose in 46-another interpretation would be equivalent to 44.Moreover, as in the case of 44, we adapt the definition of Miclet et al. (2008) to our schema by making the underlying structure A explicit. 7Here it is important to emphasize that we assume every set in A to be a distinguished set by 41 (recall from 9 that A is an abbreviation for (A, A)).
Moreover, for any integers a, c, k, ℓ, m, n ∈ Z, k, m 0, we have Proof.The first three lines are immediate consequences of Theorem 24 with t(z) defined as follows: the first line is justified via t(z) := −z, the second via t(z) := 1 z , and the third line is justified via t(z) := kz + ℓ and t(z) := z k • ℓ, as in each case t is injective in the respective algebra since k, ℓ 0 holds by assumption.Since the terms s(z) := kz + ℓ and t(z) := mz + n, k, m 0, are injective in (Z, +, Z) containing the same variable z, the Uniqueness Lemma 23 implies via the justification s(z) → t(z) the arithmetical proportion ka + ℓ : ma + n :: kc + ℓ : mc + n in (Z, +, Z).
The following result formally proves two well-known arithmetical proportions known as 'difference' and 'geometric' proportion within our framework.
Proof.The two proportions are direct consequences of Theorem 24 with t(z) := z+b−a and t(z) := z b a , respectively, since both terms are injective in the respective algebras. 8  The following counter-examples show that the converse of Theorem 51 fails in general.On the other hand, we have a 2 a = c 2 c iff a = c.The following result summarizes some unexpected and therefore 'creative' arithmetical proportions containing the numbers 0 and 1.
Proposition 53.For any integers a, c, k, ℓ ∈ Z, k, ℓ 0, we have Proof.An immediate consequence of Theorem 24 with t(z) defined as follows: the first two arrow proportions are justified via t(z) := z − z and t(z) := z z ; and the next two proportions are justified via t(z) := kz ℓ and t(z) := z ℓ , both injective for k, ℓ 0 in the respective algebras.The following counter-example shows that the first two arrow proportions in 53 cannot be inverted. 8Notice that in the algebra (Z, +, −, Z), every integer is a distinguished element, which shows that the constants a and b in z + b − a are syntactically correct.
In such cases, where the characteristic justifications of a proportion are not obvious from the context, it is preferable to write (cf.21): Here is another arithmetical proportion of this kind formalizing 2 (notice that z + 5 and 1000z + 3000 are injective in (Z, +, Z) and see Lemma 23): 2 : 0 :: 3 : 1000.
We believe that analogical proportions of this form, which are unexpected but still reasonably justifiable, are crucial for formalizing creativity.
We have the following implication.  In this example it is essential that every coefficient occurring in a justification is a distinguished element.
Proof.An immediate consequence of Theorem 24 with t(z) := z − a 2 + d 2 , injective in (Z, +, Z).The following counter-example shows that the converse of Theorem 58 fails in general.
The justification z → z + z, injective in (Z, +, Z), implies the solution x = 2 as a consequence of Theorem 24.This solution cannot be obtained from 57 by the following argument.Suppose, towards a contradiction, that 0, 1, 2 can be decomposed according to 57 into From the first two identities we deduce a 2 = d 2 , which further implies 1 Theorem 58 together with 59 shows that our notion of arithmetical proportion yields strictly more justifiable solutions than the notion of Stroppa and Yvon (Stroppa & Yvon, 2006).

Logical Interpretation
As we have constructed our model from first principles using only elementary concepts of universal algebra, and since our model questions some basic properties of analogical proportions presupposed in the literature (Section 4.3), to convince the reader of the 'soundness' of our model, we show in this section that our purely algebraic model from above can be naturally embedded into the logical setting of first-order logic via model-theoretic types, which play a key role in classical model theory (cf.Hinman, 2005, §7.1).We then reprove our First Isomorphism Theorem 37, which says that analogical proportions are compatible with isomorphisms, from this logical perspective.This hopefully convinces the reader that the introduced notions for formalizing analogical proportions from above-which are motivated by simple examples-are theoretically well-founded.
6.1.Rewrite Types.We reformulate our model of analogical proportions from above into first-order logic via a restricted form of model-theoretic types.
Notation 60.In this section, A and B denote functional L-structures, which are L-structures containing no relation symbols.
Recall from Section 3 that justifications of analogical proportions are rewrite rules of the form s → t expressing a functional relationship between elements.We now want to translate such justifications into logical formulas, which motivates the following definition.
Definition 61.We associate with each rewrite rule s(z) → t(z), where t contains only variables occurring in s, the L-rewrite formula We denote the set of all L-rewrite formulas by rwFm L .Now that we have defined rewrite formulas, we continue by translating sets of justifications into sets of rewrite formulas via a restricted notion of the well-known model-theoretic types (e.g.Hinman, 2005, §7.1).
Definition 62. Define the L-rewrite type of two elements a, b ∈ A by We have the following correspondence between sets of justifications and rewrite formulas and types (cf.15): Proof.An immediate consequence of (39).6.2.Isomorphisms.We reprove the First Isomorphism Theorem 37 from the logical perspective of types.We proceed by showing that rwT ype

Proof of Theorem 37. If rwT ype
) is subset maximal with respect to H(b).From A → B we deduce with Lemma 5 that for any rewrite 2-L-formula ϕ,

This further implies
and, consequently, This shows that rwT ype An analogous argument shows the remaining directed proportions (see 16).Now apply 64.

Related Work
Arguably, the most prominent (symbolic) model of analogical reasoning to date is Gentner's (Gentner, 1983) Structure-Mapping Theory (or SMT), first implemented by Falkenhainer, Forbus, and Gentner (Falkenhainer, Forbus, & Gentner, 1989).Our approach shares with Gentner's SMT its symbolic nature.However, while in SMT mappings are constructed with respect to meta-logical considerations-for instance, Gentner's systematicity principle prefers connected knowledge over independent facts-in our framework 'mappings' are realized via analogical proportions satisfying mathematically well-defined properties.In Theorems 37 and 40 we have shown that analogical proportions are compatible with structure-preserving mappings-a result which is in the vein of SMT.We leave a more detailed comparison between our algebraic approach and Gentner's SMT as future work.
Formal models of analogy have been studied by artificial intelligence researchers for decades (cf.Hall, 1989;Prade & Richard, 2014).In this paper, we compared our algebraic framework of analogical proportions with two recently introduced models of analogical proportions from the literature (Miclet et al., 2008;Stroppa & Yvon, 2006)-introduced for applications to artificial intelligence and machine learning, specifically for natural language processing and handwritten character recognition-in the concrete domains of sets and numbers, and we showed that in each case we either disagree with the notion from the literature justified by some counter-example or we can show that our model yields strictly more justifiable solutions.This provides some evidence for its applicability.We expect similar results in other domains where the models of (Stroppa & Yvon, 2006) and (Miclet et al., 2008) are applicable.
The functional-based view in (Barbot et al., 2019) is related to our Theorem 24 on the preservation of functional dependencies across different domains (Section 4.2).The critical difference is that Barbot, Miclet, and Prade (Barbot et al., 2019) assume Lepage's central permutation axiom (13), which implies in their framework that functional transformations need to be bijective, a serious restriction.In our framework, on the other hand, we proved in Theorem 28 that central permutation does not hold in general-justified by some reasonable counter-example-and so functional transformations can be functions induced by terms satisfying a mild injectivity condition (Theorem 24).
To summarize, our framework differs substantially from the aforementioned models of analogical proportions: (1) Our model is abstract and algebraic in nature, formulated in the general language of universal algebra.Specific structures, like sets and numbers, are instances of the generic framework.
To the best of our knowledge, this is not the case for the aforementioned frameworks, which are formulated only for concrete structures.
(2) In our model, we make the underlying mathematical structures A (source) and B (target) explicit.This allows us to distinguish, for example, between the similar structures (Z, +) and (Z, •), which yield different arithmetical proportions.More importantly, it allows us to derive analogical proportions between two different domains, e.g.numbers and words (26).This distinction is not made in any of the aforementioned articles.
(3) As a consequence, we could prove in Theorem 28 that all of Lepage's axioms (except for symmetry)-which are taken for granted in the aforementioned articles-are not axioms, but properties which may or may not hold in a specific structure.This has critical consequences, as structures satisfying some or all of Lepage's axioms behave differently than structures in which the properties fail.
For further references on analogical reasoning we refer the interested reader to (Hall, 1989) and (Prade & Richard, 2014).
7.1.Boolean Proportions.Miclet and Prade (Miclet & Prade, 2009) (cf. Prade & Richard, 2010, 2017) and Klein (Klein, 1982) study analogical proportions between boolean elements which correspond in our general framework to boolean proportions within the specific 2-element boolean algebra BOOL (defined in Section 2), and which are related to set proportions as studied in Section 5.1.In a recent paper (Antić, 2023a), we compare our model to the frameworks of (Miclet & Prade, 2009) and (Klein, 1982) in detail and derive the following conclusions: (1) In (Antić, 2023a), we derive, for every set of boolean constants B ⊆ BOOL: Surprisingly, this turns out to be equivalent to Klein's (Klein, 1982) characterization of boolean proportions.
(2) Miclet and Prade's (Miclet & Prade, 2009) definition, on the other hand, does not consider the proportions 0 : 1 :: 1 : 0 and 1 : 0 :: 0 : 1 to be in boolean proportion, 'justified' on page 642 as follows: The two other cases, namely 0 : 1 :: 1 : 0 and 1 : 0 :: 0 : 1, do not fit the idea that a is to b as c is to d, since the changes from a to b and from c to d are not in the same sense.They in fact correspond to cases of maximal analogical dissimilarity, where 'd is not at all to c what b is to a', but rather 'c is to d what b is to a'.Arguably, this is counter-intuitive as in case negation is available (which it implicitly is in (Miclet & Prade, 2009)), common sense tells us that 'a is to its negation ¬a what c is to its negation ¬c' makes sense, and z → ¬z (or, equivalently, ¬z → z) is therefore a plausible characteristic justification of 0 : 1 :: 1 : 0 and 1 : 0 :: 0 : 1 in our framework.
These correspondences are promising as our model was not explicitly geared towards the boolean setting and provide further evidence for the applicability of our framework.7.2.Word Proportions.A conceptually related approach to solving analogical word equations is given by Dastani, Indurkhya, and Scha (2003).At this point, it is not entirely clear how our framework relates to the rather complicated model of (Dastani et al., 2003) built on top of concepts such as 'gestalts' of sequential patterns, structural information theory (SIT), algebraic coding systems for SIT, information load, representation systems, local homomorphism, constraints, et cetera.We challenge the reader to find instances where the model of (Dastani et al., 2003) is more expressive-in the word domain-than our model, which would (partially) justify their heavy machinery.To give a glimpse of what we mean, consider the following simple example (cf.Navarrete & Dartnell, 2017, p.4).  Dastani et al. (2003) obtain the same solution in a different way by using the algebras generated by the letters in Σ and operators (named in their terminology 'gestalts') such as 'iteration', 'successor', 'symmetry', 'alternation', 'representation systems', et cetera, and, finally, by computing the solution dcba via 'local homomorphisms'.We have but there is no non-trivial justification in Jus(a, c).It is interesting, however, to study analogical proportions in algebras where the justifications do form a category, which is related to Problem 32.This is left as future work.

Future Work
This theoretical paper introduces and studies central properties of analogical proportions within the general setting of universal algebra and (the functional fragment of) first-order logic, and within the specific domains of sets and numbers.8.1.Multiple Variables.One way to generalize our notion of an analogical equation is to allow multiple variables and higher-order terms to occur in different parts of an analogical equation as, for example, in 2 + x 1 : 3 + x 1 :: 5 + x 1 + x 2 : x 3 .Here solutions are constrained by multiple equations and the identity shows that we can reduce solving systems of equations to solving single equations.We can further generalize the framework by considering infinite systems of analogical equations and proportions, for example expressed via universal quantification.For instance, consider the infinite list of proportions, where e ∈ A is a fixed element and A = (A, •) is an infinite algebra with • being a binary operation: ∀a ∈ A : a : a :: a : a • e. (42) By determinism (20)-shown in Theorem 28 to hold in any algebra A-we know that (42) implies a • e = a, which means that we can interpret (42) as a definition of e being a neutral element in A in terms of analogical proportions.8.3.Algorithms.From a practical point of view, the main task for future research is to develop algorithms for the computation of some or all solutions to analogical equations as defined in this paper.This problem is highly non-trivial in the general case and fairly complicated even in concrete cases (see 66).A reasonable starting point is therefore to first study small concrete mathematical domains such as, for example, the booleans or small number fields (e.g. the integers modulo m, Z m , for some small m) from the computational perspective.After that a reasonable next step is to study analogical proportions in finitely representable infinite structures (cf.Ebbinghaus & Flum, 1999;Libkin, 2012), which are more relevant to computer science and artificial intelligence research than the infinite models studied in classical universal algebra.Here interesting connections between, e.g., word proportions and logics on words studied in algebraic formal language and automata theory will hopefully become available, which may then lead to concrete algorithms for solving analogical equations over words, trees, and related data structures.8.4.Axioms.In Section 4.3, we argued that Lepage's (2003) central permutation axiom-a critical axiom assumed by many authors (e.g.Barbot et al., 2019)-strong inner reflexivity, and strong reflexivity axioms are in general not satisfied as there are algebras in which these axioms fail, justified by counter-examples (Theorem 28).It is interesting to investigate in which structures some of his axioms hold and to provide general characterizations (see Problem 30).8.5.Applications to AI.Another key line of research is to apply our model to various AI-related problems such as, e.g., common sense reasoning, formalizing metaphors, learning by analogy, and computational creativity.In Theorem 28 we have seen that analogical proportions are non-monotonic in nature, and it is important to investigate potential connections to non-monotonic reasoning in detail-itself a central research area of logic-based artificial intelligence prominently formalized by (Gelfond & Lifschitz, 1991) in answer set programming (cf.Brewka et al., 2011).Here interesting and surprising phenomena may occur.Moreover, it will be useful (and challenging) to fully apply our model to logic programming (cf.Apt, 1990) by first introducing appropriate algebraic operations on the space of all programs (Antić, 2023c(Antić, , 2023d)), and then by considering analogical proportions between logic programs of the form P : Q :: R : S (Antić, 2023b)-in combination with unexpected or 'creative' proportions, this line of research may lead to interesting formalizations of computational creativity (Boden, 1998).We wish to expand this study to other domains relevant for computer science and artificial intelligence as, for instance, trees, graphs, automata, neural networks, et cetera.More broadly speaking, from the point of view of computational creativity, it is interesting to analyze unexpected (directed) analogical proportions as in Examples 2, 55, and 19, and to try to find a qualitative notion of the degree of creativity of a solution to an analogical proportion in terms of its set of justifications.For instance, why does the solution x = 9 of the arrow equation 20 → 4 : • 30 → x in 19 appear to be more 'creative' than x = 6?Is there a relationship between the degree of unexpectedness or creativity of an analogical proportion and the algebraic structure of its set of justification?Related to this question, it will often be useful to have an evaluation criterion for the plausibility of an analogical proportion.In the setting of logic programming described before, for instance, the user may provide sets of positive and negative examples to impose additional constraints on solutions to analogical equations.In general, algorithmically ranking analogical proportions and formulating general principles for evaluating the plausibility of solutions to analogical equations is crucial and non-trivial.8.6.Universal Algebra.From a mathematical point of view, relating analogical proportions to other concepts of universal algebra and related subjects is an interesting line of research.Specifically, studying analogical proportions in abstract mathematical structures like, for example, various kinds of lattices, semigroups and groups, rings, et cetera, is particularly interesting in the case of proportions between objects from different domains.Here it will be essential to study the relationship between properties of elements like being 'neutral' or 'absorbing' and their proportional properties (e.g.53 and 55; and see the discussion in the last paragraph of Section 8.2).At this point-due to the author's lack of expertise-it is not clear how exactly analogical proportions fit into the overall landscape of universal algebra and relating analogical proportions to other concepts of algebra and logic is therefore an important line of future research.
In this paper, we have studied analogical proportions between elements of possibly different algebras having the same underlying language L. It is challenging to generalize the framework to algebras over different languages, which requires an alignment of operations, possibly of different arity.For this, it might be useful to study meta-proportions between algebras of the form A : B :: C : D. 8.7.Logical Extensions.In this paper, we have studied the functional case expressed via algebras and functional structures containing no relations and via rewrite formulas of the special logical form (38), not containing relation symbols other than equality.An important next step is to enlarge the notion of a rewrite formula to include relation symbols and other logical constructs.This is challenging as allowing arbitrary formulas yields an overfitting where, in some domains, all elements are in analogical proportion.For example, consider the structure (N, succ, 0), where succ : N → N is the successor function.In this structure, we can identify every natural number a with the numeral a := succ a (0).Hence, given some natural numbers a, b, c, d ∈ N, the formula where R is an arbitrary binary relation symbol (other than equality).8.8.Term Rewriting.Lastly, it is interesting to examine the role of term rewriting (cf.Baader & Nipkow, 1998) in analogical reasoning.More precisely, in this paper justifications of analogical proportions have the form s → t, for some terms s and t, which are rewriting rules as studied in term rewriting.This raises the question whether methods of term rewriting can be applied to reasoning about analogical proportions.

Conclusion
This paper introduced from first principles an abstract algebraic framework of analogical proportions in the general setting of universal algebra.This enabled us to compare mathematical objects possibly across different domains in a uniform way which is crucial for AI-systems.It turned out that our notion of analogical proportions has appealing mathematical properties.We showed that analogical proportions are compatible with injective functional transformations (Theorem 24) and structure-preserving mappings (Theorem 37) as desired.We further discussed Lepage's (2003) axioms and argued why in general we disagree with all of his axioms except for symmetry, while we agree with four axioms added in this paper, namely inner symmetry, inner reflexivity, reflexivity, and determinism (Theorem 28).Moreover, it turned out that analogical proportions are non-monotonic in nature, which may have interesting connections to non-monotonic reasoning.We then compared our framework with two recently introduced frameworks of analogical proportions from the literature (Miclet et al., 2008;Stroppa & Yvon, 2006) within the concrete domains of sets and numbers, and in each case we either disagreed with the notion from the literature justified by some counter-example or we showed that our model yields strictly more justifiable solutions.Finally, we showed that our model has a natural logical interpretation in terms of model-theoretic types.This provides evidence for its applicability.In a broader sense, this paper is a first step towards a theory of analogical reasoning and learning systems with potential applications to fundamental AI-problems like common sense reasoning and computational learning and creativity.(2) s(z 1 , z 2 ) = 5z 1 z 2 : The only e 1 ∈ M 2 satisfying 20 = s(e 1 ) is given by (2, 2).There are two e (1) 2 , e (2) 2 ∈ M 2 satisfying 30 = s(e (1) 2 ) = s(e (2)  2 ) given by e (1) 2 = (2, 3) and e (2) 2 = (3, 2).Moreover, we have five t 1 (z 1 , z 2 ), t 2 (z 1 , z 2 ), t 3 (z 1 , z 2 ), t 4 (z 1 , z 2 ), t 5 (z 1 , z 2 ) ∈ gen M (4) satisfying 4 = t i (2, 2), 1 ≤ i ≤ 5, given by t 1 (z 1 , z 2 ) = 2z 1 , t 2 (z 1 , z 2 ) = 2z 2 , t 3 (z 1 , z 2 ) = z 2 1 , t 4 (z 1 , z 2 ) = z 2 2 , t 5 (z 1 , z 2 ) = z 1 z 2 .
We therefore have the following justifications: Notice the symmetries between the first and second, and between the third and fourth diagrams above; in what follows, we will only mention one of multiple symmetric cases.We see here that 20 → 4 : • 30 → 10 has the justification 2z 1 z 2 → 2z 1 in M, which is also a justification of 20 → 4 : • 30 → 6; on the other hand, we have seen above that 5z 1 z 2 → 2z 1 and 5z 1 z 2 → 2z 2 are justifications of 20 → 4 : • 30 → 6, but not of 20 → 4 : • 30 → 10, which shows that, up to this point, Jus M (20 → 4 : • 30 → 10) is strictly contained in Jus M (20 → 4 : • 30 → 6) and therefore not subset maximal with respect to 10.The case t(z 1 , z 2 ) = 2z 2 is analogous.We further have the arrow proportion The case t(z 1 , z 2 ) = z 2 2 is analogous.The next case is:
proposes four axioms-namely symmetry a : b :: c : d ⇔ c : d :: a : b, central permutation a : b :: c : d ⇔ a : c :: b : d, strong inner reflexivity a : a :: c : d ⇒ d = c, and strong reflexivity a : b :: a : d ⇒ d = b-as a guideline for formal models of analogical proportions.
symmetry a : b :: c : d ⇔ b : a :: d : c, inner reflexivity a : a :: c : c, and reflexivity a : b :: a : b, and determinism a : a :: a : d ⇔ a = d to the list.Notice that inner reflexivity and reflexivity are weak forms of Lepage's strong inner reflexivity and strong reflexivity axioms, respectively, whereas inner symmetry is a variant of Lepage's symmetry axiom which requires symmetry to hold within the respective structures.Moreover, we consider the properties of commutativity a : b :: b : a, transitivity a : b :: c : d & c : d :: e : f ⇒ a : b :: e : f , inner transitivity a : b :: c : d & b : e :: d : f ⇒ a : e :: c : f , and central transitivity a : b :: b : c & b : c :: c : d ⇒ a : b :: c : d.

Definition 7 .
Define the set of justifications of two elements a, b ∈ A in A by Jus A (a, b) := s → t ∈ J(L, z) a = s A (e) and b = t A (e), for some e ∈ A |z| .For instance, in the example above, Jus (N,•) (2, 4) and Jus ({a,b} * ,•) (ab, abab) both contain the justification z → z 2 , witnessed by e 1 = 2 ∈ N and e 2 = ab ∈ {a, b} * .Once we have a definition of a → b : • c → d, we can define a : b : • c : d and, finally, a : b :: c : d via appropriate symmetries as follows.
2 Now we call d a solution to (3) in (A, B) iff either Jus A (a, b) ∪ Jus B (c, d) consists only of trivial justifications, in which case there is neither a non-trivial transformation of a into b in A nor of c into d in B; or Jus (A,B) (a → b : • c → d) is maximal with respect to subset inclusion among the sets Jus • c : d is a trivial directed proportion in (A, B) iff (A, B) | = a : b : • c : d, and Jus (A,B) (a → b : • c → d) and Jus (A,B) (b → a : • d → c) consist only of trivial justifications.

( 3 )
An analogical equation in (A, B) is an expression of the form 'a is to b in A what c is to x in B'-in symbols, a : b :: c : x, (5) where a and b are again source elements from A, c is a target element from B, and x is a variable.We call d a solution to (5) in (A, B) iff (A, B) | = a : b : • c : d and (B, A) | = c : d : • a : b.In this case, we say that a, b, c, d are in analogical proportion in (A, B) written (A, B) | = a : b :: c : d.We denote the set of all solutions to (5) in (A, B) by S ol (A,B) (a : b :: c : x).
) proved to hold within our framework in Theorem 28.Now consider the slightly different algebra A 2 := ({a, b, c, d}, f ), where f is the unary function defined byWe expect a : b :: c : d to fail in A 2 as it has no non-trivial justification.In fact, d) consists only of trivial justifications, then add d to S 0 .(b) For each L-term s(z) ∈ gen (A,B) (a, c) and all witnesses e 1 ∈ A |z| , e 2 ∈ B |z| satisfying (cf.15) a = s A (e 1 ) and c = s B (e 2 ), and for each L-term t(z) ∈ gen A (b) containing only variables occurring in s(z) and satisfying b = t A (e 1 ), add s → t to Jus (A,B) (a → b : • c → t B (e 2 )).(c) Identify those non-empty sets Jus (A,B) (a → b : • c → d) which are subset maximal with respect to d and add those d's to S 0 .
B) and there are unique e 1 , e 2 ∈ B |z| such that c = s B (e 1 ) and d = t B (e 2 ) by assumption, s → t and t → s (recall that s and t contain the same variables by assumption) are characteristic justifications of a → b : • c → d and b → a : • d → c in (A, B), respectively, by the argument in 1.(3) Analogous to 2. (4) Direct consequence of 3.
B (c) a functional solution of a : b :: c : x in (A, B) characteristically justified by z → t(z).Hence, if t is injective in A and B, then (A, B) | = a : t A (a) :: c : t B (c).Proof.The rewrite rule z → t(z) is a characteristic justification of a → t A (a) : • c → t B (c) in (A, B) by the Uniqueness Lemma 23 as z is injective in B. The other cases follow by analogous arguments from the Uniqueness Lemma 23.
(A, B) | = a : b :: c : d ⇔ (B, A) | = c : d :: a : b (symmetry), (12) A | = a : b :: c : d ⇔ A | = a : c :: b : d (central permutation), (13) A | = a : a :: c : d ⇒ d = c (strong inner reflexivity), (14) A | = a : b :: a : d ⇒ d = b (strong reflexivity).(15) Although Lepage's axioms appear reasonable in the word domain (but see Problem 30), they cannot be straightforwardly applied to the general case.Strong inner reflexivity fails, for instance, if the relation of a to itself is similar to the relation between c and d.Strong reflexivity fails, for example, in algebras where the relation of a to b and d is identical, for distinct elements b and d.In our framework, by making the underlying structures of an analogical proportion explicit, it turns out that except for symmetry none of Lepage's axioms holds in the general case, justified by counter-examples (Theorem 28
), and, in general, it does not satisfy • central permutation (13), • strong inner reflexivity (14), • strong reflexivity (15), • commutativity (21), • transitivity, • inner transitivity, • central transitivity, • monotonicity.Proof.We have the following proofs:• Symmetry (16) and inner symmetry (17) are immediate consequences of 8 as the framework is designed to satisfy these axioms.• Inner reflexivity (18) is an immediate consequence of Theorem 24 with t(z):= z, injective in A and B. • Next, we prove reflexivity (19).If Jus A (a, b) ∪ Jus A (a, b) = Jus A (a,b) consists only of trivial justifications, we are done.Otherwise, there is at least one non-trivial justification in Jus A (a, b) = Jus A (a → b : • a → b).We proceed by showing that Jus A (a → b : • a → b) is subset maximal with respect to the last b.For any d ∈ A, we have Jus A (a → b : • a → d) = Jus A (a, b) ∩ Jus A (a, d) ⊆ Jus A (a, b) = Jus A (a → b : • a → b), which shows that Jus A (a → b : • a → b) is indeed maximal.Hence, A | = a → b : • a → b.The same line of reasoning proves A | = b → a : • b → a.Hence, A | = a : b : • a : b, which finally proves A | = a : b :: a : b. • Next, we prove determinism (20).(⇐) Inner reflexivity (18) implies A | = a : a :: a : a. (⇒) We assume A | = a : a :: a : d.Since z → z ∈ Jus A (a, a), the set Jus A (a, a) ∪ Jus A (a, d) cannot consist only of trivial justifications.Every justification s e 1 →e 2 − −−−− → t of a → a : • a → d can be transformed into a justification s e 1 →e 1 − −−−− → t (replace e 2 by e 1 ) of a → a : • a → a.On the other hand, we have which impliesA | = a : a :: a : d, for all d a.• Next, we disprove central permutation(13).For this consider the algebra A := ({a, b, c, d}, f ), given by (we omit the loops f (o) := o, for o ∈ {b, c, d}, in the figure) We have A | = a : b :: c : d, whereas A | = a : c :: b : d as there is an arrow from a to c but not from b to d in A. A second proof follows from the forthcoming Theorem 33 (depending only on inner reflexivity already shown above), which yields ({a, b, c}) | = a : b :: a : c whereas ({a, b, c}) | = a : a :: b : c. • Next, we disprove strong inner reflexivity (14).For this consider the algebra A := ({a, c, d}, f ) As f is injective in A, applying the Functional Proportion Theorem 24 yields A | = a : f (a) :: c : f (c) which is equivalent to A | = a : a :: c : d. • Next, we disprove strong reflexivity (15).By the forthcoming Theorem 33 (which depends only on inner reflexivity already proved above), we have ({a, b, d}) | = a : b :: a : d. • Commutativity fails in the algebra A := ({a, b}, f ) given by Jus A (a, b) ∪ Jus A (b, a) = {z → f (z), . ..} ∅ whereas Jus A (a → b : • b → a) = ∅.• Transitivity fails in the algebra A := ({a, b, c, d, e, f }, g, h) given by (we omit the loops g(o) := o for o ∈ {b, d, e, f }, and h(o) := o for o ∈ {a, b, d, f }, in the figure) The arrow proportions a → g(a) : • c → g(c) = a → b : • c → d and c → d : • a → b are immediate consequences of the Functional Proportion Theorem 24, and the arrow proportions b → a : • d → c and d → c : • b → a follow from the fact that are non-empty and maximal.This shows A | = a : b :: c : d.An analogous argument shows A | = c : d :: e : f .On the other hand, Jus A (a, b) ∪ Jus A (e, f ) ∅ whereas Jus A (a → b : • e → f ) = ∅ shows A | = a : b :: e : f .• Inner transitivity fails in the algebra A := ({a, b, c, d, e, f }, g) given by (we omit the loops g(o) := o, for o ∈ {b, e, c, d, f }, in the figure) We have A | = a : b :: c : d and A | = b : e :: d : f by an argument analogous to the proof of Theorem 33.On the other hand, Jus A (a, e) ∪ Jus A (c, f ) ∅ whereas Jus A (a → e : • c → f ) = ∅ shows A | = a : e :: c : f .• Central transitivity fails in the algebra A := ({a, b, c, d}, g, h) given by (we omit the loops g(o) := o for o ∈ {c, d}, and h(o) := o for o ∈ {a, d}, in the figure) | = a : b :: c : d.Now consider the expansion A ′ := ({a, b, c, d}, f ) of A given by (we omit the loops f (o) := o, for o ∈ {b, c, d}, in the figure) = a : b :: c : d.

Finally
, we have the following characterization of analogical proportions in algebras with no functions and no constants.Theorem 33.Let A := (A) be an algebra consisting only of its universe.For any a, b, c, d ∈ A, we have (A) | = a : b :: c : d ⇔ (a = b and c = d) or (a b and c d). Proof.(⇐) (i) If a = b and c = d, then (A) | = a : b :: c : d holds by inner reflexivity (18).(ii) If a b and c d, then (cf.10) which entails (A) | = a : b :: c : d. (⇒) By assumption, we have (A) | = a → b : • c → d.We distinguish two cases: (i) if Jus (A) (a, b) ∪ Jus (A) (c, d) consists only of trivial justifications, then we must have a b and c d (since otherwise the the non-trivial justification z → z would be included); (ii) otherwise, Jus (A) (a → b : • c → d) contains the only available non-trivial justification z → z, which implies a = b and c = d.

(
A, B) | = a : b :: H(a) : H(b).(23) Proof.If Jus A (a, b) ∪ Jus B (H(a), H(b)) consists only of trivial justifications, we are done.Otherwise, there is at least one non-trivial justification s → t in Jus A (a, b) or in Jus B (H(a), H(b)), in which case the Isomorphism Lemma 36 implies that s → t is in both Jus A (a, b) and Jus B (H(a), H(b)), which means that Jus (A,B) (a → b : • H(a) → H(b)) contains at least one non-trivial justification as well.We proceed by showing that Jus (A,B) (a → b : • H(a) → H(b)) is subset maximal with respect to H(b):Jus (A,B) (a → b : • H(a) → H(b)) = Jus A (a, b) ∩ Jus B (H(a), H(b)) = Jus A (a, b) ⊇ Jus A (a, b) ∩ Jus B (H(a), d) = Jus (A,B) (a → b : • H(a), d), for every d ∈ B,where the second identity follows from Lemma 36.This shows that Jus (A,B) (a → b : • H(a) → H(b)) is indeed a subset maximal set of justifications of a → b : • H(a) → H(b) in (A, B) with respect to H(b).An analogous argument shows the remaining directed proportions (see 16).
proportion in (27) follows with both t(Z) := Z ∪ A ∪ C and, since A ∪ C is a distinguished set by assumption, t(Z) := A ∪ C. • The directed proportion in (28) follows with both t(Z) := Z ∪ (A ∩ C) and, since A ∩ C is a distinguished set by assumption, t(Z) := A ∩ C. • The directed proportion in (29) follows with t(Z) := Z ∪ Z c .• The directed proportion in (30) follows with t(Z) := Z ∩ Z c or t(Z) := ∅. • From B ⊆ A and B ⊆ C we deduce that B is a distinguished set, which means that t(Z) := B is a valid definition implying (31).

Theorem 48 .
For any finite sets A, B, C, D ∈ A, we have A | = MBD A : B :: C : D ⇒ A | = A : B :: C : D. Proof.Let B and D be written as in 46.The arrow proportions A → B : • C → D and C → D : • A → B are immediate consequences of Theorem 24 with t(Z) := (Z − E) ∪ F, and B → A : • D → C and D

Example 56 .
The rewrite rule x + y − y → x + y − x justifies any arrow proportion a → b : • c → d in (Z, +, −), which shows that it is a trivial justification encoding the trivial observation that any two integers a and b are symmetrically related via b = a+b−a and a = b + a − b.Stroppa and Yvon.The following notion of arithmetical proportion is an instance of the more general definition due to Stroppa and Yvon (2006, Proposition 2) given for abelian semigroups.Definition 57.For any integers a, b, c, d ∈ Z, define (Z, +, Z) | = S Y a : b ::

)
This is interesting as it shows that functional justifications of the form s → t, which were motivated by simple examples, have an intuitive logical meaning.The expression 'a transforms into b in A as c transforms into d in B' can now be reinterpreted from a logical point of view as follows: the functional relationships between a and b in A and between c and d in B are formally captured by all rewrite formulas ϕ(x, y) such that ϕ(a, b) and ϕ(b, a) holds in A and ϕ(c, d) and ϕ(d, c) holds in B, respectively, and the elements a, b, c, d are in directed analogical proportion in (A, B) iff the set of shared functional properties is maximal with respect to d.This leads us to the following logical variant of 8. Definition 63.We call an element d ∈ B an rw-solution of an analogical equation a : b :: c : x in (A, B)-in symbols, (A, B) | = rw a : b :: c : d-iff it satisfies the conditions in 8 with Jus replaced by rwT ype.The notion of triviality is adapted in the obvious way.We have the following logical characterization of analogical proportions in terms of model-theoretic rewrite types.Fact 64.For any functional L-structures A and B, and any elements a, b ∈ A and c, d ∈ B, we have (A, B) | = a : b :: c : d ⇔ (A, B) | = rw a : b :: c : d.
A (a, b) ∪ rwT ype B (H(a), H(b)) consists only of trivial rewrite formulas, we are done.Otherwise, we need to show that rwT ype (A,B) (a → b : • H(a) → H(b)) contains at least one non-trivial rewrite formula-this can be shown by an analogous argument as in the algebraic proof of Theorem 37 in Section 4.4.

Example 65 .
Let Σ := {a, b, c, d} be an alphabet.Define A := (Σ + , • A , succ A ) and B := (Σ + , • B , succ B ) via succ A (a) := b, succ A (b) := c, succ A (c) := d, succ A (d) := da (40) and succ B (d) := c, succ B (c) := b, succ B (b) := a, succ B (a) := ad, extended to words lexicographically. 10Consider the analogical equation in (A, B) given by abc : abcd :: dcb : x.This equation is asking for a word which is to dcb in B what abcd is to abc in A. Observe that we obtain abcd from abc by concatenating the 'successor' of c at the end of abc.Since there is a unique e 2 := (d, c, b) satisfying (z 1 z 2 z 3 ) B (d, c, b) = dcb and (z 1 z 2 z 3 • succ(z 3 )) B (d, c, b) = dcba (notice that the empty word does not occur in B), the solution z = dcba is characteristically justified by the Uniqueness Lemma 23 via the justification abc → abcd : • dcb → dcba.

7. 3 .
Category Theory.In mathematics, category theory (cf.Awodey, 2010) is a branch of algebra devoted to formalizing structural analogies.Roughly, the key axiom for a 'collection of arrows' to form a category requires that to any pair of arrows f :a → b ∈ Arr(a, b) and g : b → c ∈ Arr(b, c) there is an arrow g• f : a → c ∈ Arr(a, c), called the composite of f and g.There is a striking similarity between an arrow f : a → b ∈ Arr(a, b) in a category and a justification s → t ∈ Jus(a, b), which leads to the question whether the collection of all justifications ('arrows') of all pairs of elements forms a category; particularly, whether to each pair of justifications s → t ∈ Jus(a, b) and r → u ∈ Jus(b, c) there is a 'composite' justification s → t • r → u ∈ Jus(a, c).The following counter-example shows that this is, in general, not the case: consider the algebra A := ({a, b, c}, f ), where f is given by (we omit the loop f (b) := b in the figure) asking for a triple d = (d 1 , d 2 , d 3 )-the solution to (41)-satisfying the arithmetical proportion 2 + d 1 : 3 + d 1 :: 5 + d 1 + d 2 : d 3 .For instance, in (Z, +, −, Z) a solution is given by (2, 0, 8) yielding the difference proportion (cf.Theorem 51) (Z, +, −, Z) | = 4 : 5 :: 7 : 8. 8.2.Systems of Analogical Equations and Proportions.In this paper, we have considered only single analogical equations and proportions.We have argued in 31 that the property of being in analogical proportion is a local property.An interesting way to express and analyze global properties of an algebra is to study systems of analogical equations and proportions, where we can express multiple relationships between elements, of the form a 1 : b 1 :: c 1 : x . . .a n : b n :: c n : x.