Vector logic

From HandWiki
Revision as of 21:27, 6 March 2023 by LinXED (talk | contribs) (correction)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Vector logic[1][2] is an algebraic model of elementary logic based on matrix algebra. Vector logic assumes that the truth values map on vectors, and that the monadic and dyadic operations are executed by matrix operators. "Vector logic" has also been used to refer to the representation of classical propositional logic as a vector space,[3][4] in which the unit vectors are propositional variables. Predicate logic can be represented as a vector space of the same type in which the axes represent the predicate letters [math]\displaystyle{ S }[/math] and [math]\displaystyle{ P }[/math].[5] In the vector space for propositional logic the origin represents the false, F, and the infinite periphery represents the true, T, whereas in the space for predicate logic the origin represents "nothing" and the periphery represents the flight from nothing, or "something".

Overview

Classic binary logic is represented by a small set of mathematical functions depending on one (monadic) or two (dyadic) variables. In the binary set, the value 1 corresponds to true and the value 0 to false. A two-valued vector logic requires a correspondence between the truth-values true (t) and false (f), and two q-dimensional normalized real-valued column vectors s and n, hence:

[math]\displaystyle{ t\mapsto s }[/math]    and    [math]\displaystyle{ f\mapsto n }[/math]

(where [math]\displaystyle{ q \geq 2 }[/math] is an arbitrary natural number, and "normalized" means that the length of the vector is 1; usually s and n are orthogonal vectors). This correspondence generates a space of vector truth-values: V2 = {s,n}. The basic logical operations defined using this set of vectors lead to matrix operators.

The operations of vector logic are based on the scalar product between q-dimensional column vectors: [math]\displaystyle{ u^Tv=\langle u,v\rangle }[/math]: the orthonormality between vectors s and n implies that [math]\displaystyle{ \langle u,v\rangle=1 }[/math] if [math]\displaystyle{ u = v }[/math], and [math]\displaystyle{ \langle u,v\rangle=0 }[/math] if [math]\displaystyle{ u \ne v }[/math], where [math]\displaystyle{ u, v \in \{s, n\} }[/math].

Monadic operators

The monadic operators result from the application [math]\displaystyle{ Mon: V_2 \to V_2 }[/math], and the associated matrices have q rows and q columns. The two basic monadic operators for this two-valued vector logic are the identity and the negation:

  • Identity: A logical identity ID(p) is represented by matrix [math]\displaystyle{ I=ss^T + nn^T }[/math]. This matrix operates as follows: Ip = p, p ∈ V2; due to the orthogonality of s with respect to n, we have [math]\displaystyle{ Is=ss^Ts+nn^Ts=s\langle s,s\rangle+n\langle n,s\rangle=s }[/math], and similarly [math]\displaystyle{ In=n }[/math]. It is important to note that this vector logic identity matrix is not generally an identity matrix in the sense of matrix algebra.
  • Negation: A logical negation ¬p is represented by matrix [math]\displaystyle{ N=ns^T + sn^T }[/math] Consequently, Ns = n and Nn = s. The involutory behavior of the logical negation, namely that ¬(¬p) equals p, corresponds with the fact that N2 = I.

Dyadic operators

The 16 two-valued dyadic operators correspond to functions of the type [math]\displaystyle{ Dyad: V_2 \otimes V_2\to V_2 }[/math]; the dyadic matrices have q2 rows and q columns. The matrices that execute these dyadic operations are based on the properties of the Kronecker product. Two properties of this product are essential for the formalism of vector logic:

  1. The mixed-product property

    If A, B, C and D are matrices of such size that one can form the matrix products AC and BD, then

    [math]\displaystyle{ (A \otimes B)(C \otimes D) = AC \otimes BD }[/math]
  2. Distributive transpose The operation of transposition is distributive over the Kronecker product:
    [math]\displaystyle{ (A\otimes B)^T = A^T \otimes B^T. }[/math]

Using these properties, expressions for dyadic logic functions can be obtained:

  • Conjunction. The conjunction (pq) is executed by a matrix that acts on two vector truth-values: [math]\displaystyle{ C(u\otimes v) }[/math] .This matrix reproduces the features of the classical conjunction truth-table in its formulation:
[math]\displaystyle{ C=s(s\otimes s)^T + n(s\otimes n)^T + n(n\otimes s)^T + n(n\otimes n)^T }[/math]
and verifies
[math]\displaystyle{ C(s\otimes s)=s, }[/math] and
[math]\displaystyle{ C(s\otimes n)=C(n\otimes s)=C(n\otimes n)=n. }[/math]
  • Disjunction. The disjunction (pq) is executed by the matrix
[math]\displaystyle{ D=s(s\otimes s)^T+s(s\otimes n)^T+s(n\otimes s)^T+n(n\otimes n)^T, }[/math] resulting in
[math]\displaystyle{ D(s\otimes s)=D(s\otimes n)=D(n\otimes s)=s }[/math] and
[math]\displaystyle{ D(n\otimes n)=n. }[/math]
  • Implication. The implication corresponds in classical logic to the expression p → q ≡ ¬p ∨ q. The vector logic version of this equivalence leads to a matrix that represents this implication in vector logic: [math]\displaystyle{ L=D(N\otimes I) }[/math]. The explicit expression for this implication is:
[math]\displaystyle{ L=s(s\otimes s)^T+n(s\otimes n)^T+s(n\otimes s)^T+s(n\otimes n)^T, }[/math]
and the properties of classical implication are satisfied:
[math]\displaystyle{ L(s\otimes s)=L(n\otimes s)=L(n\otimes n)=s }[/math] and
[math]\displaystyle{ L(s\otimes n)=n. }[/math]
[math]\displaystyle{ E=s(s\otimes s)^T+n(s\otimes n)^T+n(n\otimes s)^T+s(n\otimes n)^T }[/math] with
[math]\displaystyle{ E(s\otimes s)=E(n\otimes n)=s }[/math] and
[math]\displaystyle{ E(s\otimes n)=E(n\otimes s)=n. }[/math]
The Exclusive or is the negation of the equivalence, ¬(pq); it corresponds with the matrix [math]\displaystyle{ X=NE }[/math] given by
[math]\displaystyle{ X=n(s\otimes s)^T+s(s\otimes n)^T+s(n\otimes s)^T+n(n\otimes n)^T, }[/math]
with [math]\displaystyle{ X(s\otimes s)=X(n\otimes n)=n }[/math] and
[math]\displaystyle{ X(s\otimes n)=X(n\otimes s)=s. }[/math]

The matrices S and P correspond to the Sheffer (NAND) and the Peirce (NOR) operations, respectively:

[math]\displaystyle{ S=NC }[/math]
[math]\displaystyle{ P=ND }[/math]

Numerical examples

Here are numerical examples of some basic logical gates implemented as matrices for two different sets of 2-dimensional orthonormal vectors for s and n.

Set 1: [math]\displaystyle{ s=\begin{bmatrix}1 \\ 0 \end{bmatrix} \quad n=\begin{bmatrix}0 \\ 1 \end{bmatrix} }[/math]

In this case the identity and negation operators are the identity and anti-diagonal identity matrices:,

[math]\displaystyle{ I=\begin{bmatrix}1 & 0\\0 & 1\end{bmatrix}, \quad N=\begin{bmatrix}0 & 1\\1 & 0\end{bmatrix} }[/math]

and the matrices for conjunction, disjunction and implication are

[math]\displaystyle{ C=\begin{bmatrix}1 & 0 & 0 & 0\\0 & 1 & 1 & 1\end{bmatrix}, \quad D=\begin{bmatrix}1 & 1 & 1 & 0\\0 & 0 & 0 &1\end{bmatrix}, \quad L=\begin{bmatrix}1 & 0 & 1 & 1\\0 & 1 & 0 & 0\end{bmatrix} }[/math] respectively.


Set 2: [math]\displaystyle{ s=\frac{1}{\sqrt{2}}\begin{bmatrix}1 \\ 1 \end{bmatrix} \quad n=\frac{1}{\sqrt{2}}\begin{bmatrix}1 \\ -1 \end{bmatrix} }[/math]


Here the identity operator is the identity matrix, but the negation operator is no longer the anti-diagonal identity matrix :

[math]\displaystyle{ I=\begin{bmatrix}1 & 0\\0 & 1\end{bmatrix}, \quad N=\begin{bmatrix}1 & 0\\0 & -1\end{bmatrix} }[/math]

The resulting matrices for conjunction, disjunction and implication are:

[math]\displaystyle{ C=\frac{1}{\sqrt{2}}\begin{bmatrix}2 & 0 & 0 & 0\\-1 & 1 & 1 & 1\end{bmatrix}, \quad D=\frac{1}{\sqrt{2}}\begin{bmatrix}2 & 0 & 0 & 0\\1 & 1 & 1 &-1\end{bmatrix}, \quad L=\begin{bmatrix}2 & 0 & 0 & 0\\1 & 1 & -1 & 1\end{bmatrix} }[/math] respectively.

De Morgan's law

In the two-valued logic, the conjunction and the disjunction operations satisfy the De Morgan's law: pq≡¬(¬p∨¬q), and its dual: pq≡¬(¬p∧¬q)). For the two-valued vector logic this law is also verified:

[math]\displaystyle{ C(u\otimes v)=ND(Nu\otimes Nv) }[/math], where u and v are two logic vectors.

The Kronecker product implies the following factorization:

[math]\displaystyle{ C(u\otimes v)=ND(N\otimes N)(u\otimes v). }[/math]

Then it can be proved that in the two-dimensional vector logic the De Morgan's law is a law involving operators, and not only a law concerning operations:[6]

[math]\displaystyle{ C=ND(N\otimes N) }[/math]

Law of contraposition

In the classical propositional calculus, the law of contraposition p → q ≡ ¬q → ¬p is proved because the equivalence holds for all the possible combinations of truth-values of p and q.[7] Instead, in vector logic, the law of contraposition emerges from a chain of equalities within the rules of matrix algebra and Kronecker products, as shown in what follows:

[math]\displaystyle{ L(u\otimes v)=D(N\otimes I)(u\otimes v)=D(Nu\otimes v)=D(Nu\otimes NNv)= }[/math]
[math]\displaystyle{ D(NNv\otimes Nu)=D(N\otimes I)(Nv\otimes Nu)=L(Nv\otimes Nu) }[/math]

This result is based in the fact that D, the disjunction matrix, represents a commutative operation.

Many-valued two-dimensional logic

Many-valued logic was developed by many researchers, particularly by Jan Łukasiewicz and allows extending logical operations to truth-values that include uncertainties.[8] In the case of two-valued vector logic, uncertainties in the truth values can be introduced using vectors with s and n weighted by probabilities.

Let [math]\displaystyle{ f=\epsilon s + \delta n }[/math], with [math]\displaystyle{ \epsilon, \delta \in [0,1], \epsilon + \delta = 1 }[/math] be this kind of "probabilistic" vectors. Here, the many-valued character of the logic is introduced a posteriori via the uncertainties introduced in the inputs.[1]

Scalar projections of vector outputs

The outputs of this many-valued logic can be projected on scalar functions and generate a particular class of probabilistic logic with similarities with the many-valued logic of Reichenbach.[9][10][11] Given two vectors [math]\displaystyle{ u=\alpha s + \beta n }[/math] and [math]\displaystyle{ v=\alpha's + \beta'n }[/math] and a dyadic logical matrix [math]\displaystyle{ G }[/math], a scalar probabilistic logic is provided by the projection over vector s:

[math]\displaystyle{ Val(\mathrm{scalars}) = s^TG(\mathrm{vectors}) }[/math]

Here are the main results of these projections:

[math]\displaystyle{ NOT(\alpha)=s^TNu=1-\alpha }[/math]
[math]\displaystyle{ OR(\alpha,\alpha')=s^TD(u\otimes v)=\alpha + \alpha' - \alpha\alpha' }[/math]
[math]\displaystyle{ AND(\alpha,\alpha')=s^TC(u\otimes v)=\alpha\alpha' }[/math]
[math]\displaystyle{ IMPL(\alpha,\alpha')=s^TL(u\otimes v)=1-\alpha(1-\alpha') }[/math]
[math]\displaystyle{ XOR(\alpha,\alpha')=s^TX(u\otimes v)=\alpha+\alpha'-2\alpha\alpha' }[/math]

The associated negations are:

[math]\displaystyle{ NOR(\alpha,\alpha')=1-OR(\alpha,\alpha') }[/math]
[math]\displaystyle{ NAND(\alpha,\alpha')=1-AND(\alpha,\alpha') }[/math]
[math]\displaystyle{ EQUI(\alpha,\alpha')=1-XOR(\alpha,\alpha') }[/math]

If the scalar values belong to the set {0, ½, 1}, this many-valued scalar logic is for many of the operators almost identical to the 3-valued logic of Łukasiewicz. Also, it has been proved that when the monadic or dyadic operators act over probabilistic vectors belonging to this set, the output is also an element of this set.[6]

Square root of NOT

This operator was originally defined for qubits in the framework of quantum computing.[12][13] In vector logic, this operator can be extended for arbitrary orthonormal truth values.[2][14] There are, in fact, two square roots of NOT:

[math]\displaystyle{ A=(\sqrt{N})_1=\frac{1}{2}(1+i)I+\frac{1}{2}(1-i)N }[/math], and
[math]\displaystyle{ B=(\sqrt{N})_2=\frac{1}{2}(1-i)I+\frac{1}{2}(1+i)N }[/math],

with [math]\displaystyle{ i=\sqrt{-1} }[/math]. [math]\displaystyle{ A }[/math] and [math]\displaystyle{ B }[/math] are complex conjugates: [math]\displaystyle{ B=A^* }[/math], and note that [math]\displaystyle{ A^2=B^2=N }[/math], and [math]\displaystyle{ AB=BA=I }[/math]. Another interesting point is the analogy with the two square roots of -1. The positive root [math]\displaystyle{ +(\sqrt{-1}) }[/math] corresponds to [math]\displaystyle{ (\sqrt{N})_1=IA }[/math], and the negative root [math]\displaystyle{ -(\sqrt{-1}) }[/math] corresponds to [math]\displaystyle{ (\sqrt{N})_2=NA }[/math]; as a consequence, [math]\displaystyle{ NA=B }[/math].

History

Early attempts to use linear algebra to represent logic operations can be referred to Peirce and Copilowish,[15] particularly in the use of logical matrices to interpret the calculus of relations.

The approach has been inspired in neural network models based on the use of high-dimensional matrices and vectors.[16][17] Vector logic is a direct translation into a matrix–vector formalism of the classical Boolean polynomials.[18] This kind of formalism has been applied to develop a fuzzy logic in terms of complex numbers.[19] Other matrix and vector approaches to logical calculus have been developed in the framework of quantum physics, computer science and optics.[20][21]

The Indian biophysicist G.N. Ramachandran developed a formalism using algebraic matrices and vectors to represent many operations of classical Jain logic known as Syad and Saptbhangi; see Indian logic.[22] It requires independent affirmative evidence for each assertion in a proposition, and does not make the assumption for binary complementation.

Boolean polynomials

George Boole established the development of logical operations as polynomials.[18] For the case of monadic operators (such as identity or negation), the Boolean polynomials look as follows:

[math]\displaystyle{ f(x) = f(1)x + f(0)(1-x) }[/math]

The four different monadic operations result from the different binary values for the coefficients. Identity operation requires f(1) = 1 and f(0) = 0, and negation occurs if f(1) = 0 and f(0) = 1. For the 16 dyadic operators, the Boolean polynomials are of the form:

[math]\displaystyle{ f(x,y) = f(1,1)xy + f(1,0)x(1-y) +f(0,1)(1-x)y + f(0,0)(1-x)(1-y) }[/math]

The dyadic operations can be translated to this polynomial format when the coefficients f take the values indicated in the respective truth tables. For instance: the NAND operation requires that:

[math]\displaystyle{ f(1,1)=0 }[/math] and [math]\displaystyle{ f(1,0)=f(0,1)=f(0,0)=1 }[/math].

These Boolean polynomials can be immediately extended to any number of variables, producing a large potential variety of logical operators. In vector logic, the matrix-vector structure of logical operators is an exact translation to the format of linear algebra of these Boolean polynomials, where the x and 1−x correspond to vectors s and n respectively (the same for y and 1−y). In the example of NAND, f(1,1)=n and f(1,0)=f(0,1)=f(0,0)=s and the matrix version becomes:

[math]\displaystyle{ S=n(s\otimes s)^T + s[(s\otimes n)^T+(n\otimes s)^T+(n\otimes n)^T] }[/math]

Extensions

  • Vector logic can be extended to include many truth values since large-dimensional vector spaces allow the creation of many orthogonal truth values and the corresponding logical matrices.[2]
  • Logical modalities can be fully represented in this context, with recursive process inspired in neural models.[2][23]
  • Some cognitive problems about logical computations can be analyzed using this formalism, in particular recursive decisions. Any logical expression of classical propositional calculus can be naturally represented by a tree structure.[7] This fact is retained by vector logic, and has been partially used in neural models focused in the investigation of the branched structure of natural languages.[24][25][26][27][28][29]
  • The computation via reversible operations as the Fredkin gate can be implemented in vector logic. Such an implementation provides explicit expressions for matrix operators that produce the input format and the output filtering necessary for obtaining computations.[2][6]
  • Elementary cellular automata can be analyzed using the operator structure of vector logic; this analysis leads to a spectral decomposition of the laws governing its dynamics.[30][31]
  • In addition, based on this formalism, a discrete differential and integral calculus has been developed.[32]

See also

References

  1. 1.0 1.1 Mizraji, E. (1992). Vector logics: the matrix-vector representation of logical calculus. Fuzzy Sets and Systems, 50, 179–185
  2. 2.0 2.1 2.2 2.3 2.4 Mizraji, E. (2008) Vector logic: a natural algebraic representation of the fundamental logical gates. Journal of Logic and Computation, 18, 97–121
  3. Westphal, J. and Hardy, J. (2005) Logic as a Vector System. Journal of Logic and Computation, 751-765
  4. Westphal, J. Caulfield, H.J. Hardy, J. and Qian, L.(2005) Optical Vector Logic Theorem-Proving. Proceedings of the Joint Conference on Information Systems, Photonics, Networking and Computing Division.
  5. Westphal, J (2010). The Application of Vector Theory to Syllogistic Logic. New Perspectives on the Square of Opposition, Bern, Peter Lang.
  6. 6.0 6.1 6.2 Mizraji, E. (1996) The operators of vector logic. Mathematical Logic Quarterly, 42, 27–39
  7. 7.0 7.1 Suppes, P. (1957) Introduction to Logic, Van Nostrand Reinhold, New York.
  8. Łukasiewicz, J. (1980) Selected Works. L. Borkowski, ed., pp. 153–178. North-Holland, Amsterdam, 1980
  9. Rescher, N. (1969) Many-Valued Logic. McGraw–Hill, New York
  10. Blanché, R. (1968) Introduction à la Logique Contemporaine, Armand Colin, Paris
  11. Klir, G.J., Yuan, G. (1995) Fuzzy Sets and Fuzzy Logic. Prentice–Hall, New Jersey
  12. Hayes, B. (1995) The square root of NOT. American Scientist, 83, 304–308
  13. Deutsch, D., Ekert, A. and Lupacchini, R. (2000) Machines, logic and quantum physics. The Bulletin of Symbolic Logic, 6, 265-283.
  14. Mizraji, E. (2020). Vector logic allows counterfactual virtualization by the square root of NOT, Logic Journal of the IGPL. Online version (doi:10.1093/jigpal/jzaa026)
  15. Copilowish, I.M. (1948) Matrix development of the calculus of relations. Journal of Symbolic Logic, 13, 193–203
  16. Kohonen, T. (1977) Associative Memory: A System-Theoretical Approach. Springer-Verlag, New York
  17. Mizraji, E. (1989) Context-dependent associations in linear distributed memories. Bulletin of Mathematical Biology, 50, 195–205
  18. 18.0 18.1 Boole, G. (1854) An Investigation of the Laws of Thought, on which are Founded the Theories of Logic and Probabilities. Macmillan, London, 1854; Dover, New York Reedition, 1958
  19. Dick, S. (2005) Towards complex fuzzy logic. IEEE Transactions on Fuzzy Systems, 15,405–414, 2005
  20. Mittelstaedt, P. (1968) Philosophische Probleme der Modernen Physik, Bibliographisches Institut, Mannheim
  21. Stern, A. (1988) Matrix Logic: Theory and Applications. North-Holland, Amsterdam
  22. Jain, M.K. (2011) Logic of evidence-based inference propositions, Current Science, 1663–1672, 100
  23. Mizraji, E. (1994) Modalities in vector logic . Notre Dame Journal of Formal Logic, 35, 272–283
  24. Mizraji, E., Lin, J. (2002) The dynamics of logical decisions. Physica D, 168–169, 386–396
  25. beim Graben, P., Potthast, R. (2009). Inverse problems in dynamic cognitive modeling. Chaos, 19, 015103
  26. beim Graben, P., Pinotsis, D., Saddy, D., Potthast, R. (2008). Language processing with dynamic fields. Cogn. Neurodyn., 2, 79–88
  27. beim Graben, P., Gerth, S., Vasishth, S.(2008) Towards dynamical system models of language-related brain potentials. Cogn. Neurodyn., 2, 229–255
  28. beim Graben, P., Gerth, S. (2012) Geometric representations for minimalist grammars. Journal of Logic, Language and Information, 21, 393-432 .
  29. Binazzi, A.(2012) Cognizione logica e modelli mentali. Studi sulla formazione, 1–2012, pag. 69–84
  30. Mizraji, E. (2006) The parts and the whole: inquiring how the interaction of simple subsystems generates complexity. International Journal of General Systems, 35, pp. 395–415.
  31. Arruti, C., Mizraji, E. (2006) Hidden potentialities. International Journal of General Systems, 35, 461–469.
  32. Mizraji, E. (2015) Differential and integral calculus for logical operations. A matrix–vector approach Journal of Logic and Computation 25, 613-638, 2015