MENTAL
 Main Menu
 Language
 Primitives
 Addition and Subtraction


Addition and Subtraction
 ADDITION AND
SUBSTRACTIONN

"Numbers govern the universe" (Pythagoras).

"The One begets the Two. The Two begets the Three. The Three begets the ten thousand beings" (Lao-Tse).

"Arithmetic is the grammar of numbers" (Witgenstein).

"Number is to be found in another space, not in this space" (George Spencer−Brown).



Addition

Semantics and Syntax

The sum of two expressions, specified by means of is as follows: In general, the result of the expression (r1*x + r2*y), where r1 and r2 are real numbers, is as follows: When in the general expression (r1*x + r2*y), x and y are equal to 1, then we have the traditional arithmetic sum: r1+r2.


Justification

The Sum primitive is the classical arithmetic operation, but generalized for any expressions.


Examples
  1. abc+abc // ev. 2*abc

  2. (2*x + y) // ev. 2*x+y

  3. (2*x + 3*x) // ev. 5*x

  4. (x/a + x/a) // ev. 2*(x/a)

  5. (apple + 3*apple) // ev. 4*apple

  6. (a b)+(a b) // ev. 2*(a b)

  7. ({a b c} + 4*{a b c}) // ev. 5*{a b c}

  8. ⟨(x y)⟩+⟨(x y)⟩ // ev. 2*⟨(x y)⟩

  9. (x + y + x) // ev. (2*x + y)

  10. (13 + 27) // ev. 40

Remarks
Axioms
  1. ⟨( x+yy+x )⟩ // commutativity

  2. ⟨( x+(y+z) ≡ (x+y)+z )⟩ // associativity

    By default, the associativity is to the left, as expressions are evaluated from left to right: ⟨ ( x+y+z ≡ (x+y)+z )⟩

  3. ⟨( r*xx*r )⟩ The forms x*r and r*x, by definition, are equivalent: (2*x + x*3) // ev. 5*x

  4. ⟨( x*r = r*x )⟩

    Any expression of the form x*r, where x is not a number, is replaced by r*x, with the numerical factor in front.

  5. ⟨( (r1+r2)*x =: (r1*x + r2*x) )⟩ // by the definition of sum

    ⟨( (r1*x + r2*x) = (r1+r2)*x )⟩ // by the definition of sum

  6. ⟨( r*(x+y) =: (r*x + r*y) )⟩ // distribution

    ⟨( (r*x + r*y) = r*(x+y) )⟩ // distribution

  7. ⟨( x+θ = x )⟩ // null expression

  8. ⟨(x ≡ 1*x)⟩ and ⟨(1*x = x)⟩
    By default, the multiplier attribute of an expression is 1.

  9. ⟨( 0*x = 0 )⟩ // an expression with zero multiplier attribute, is zero

    Therefore, also: (0*0 = 0) (0*α = 0) (0*θ = 0) (0*Ω = 0)

  10. ⟨( r1*(r2*x) ≡ (r1*r2)*x )⟩ // associativity in the multiplicative factor

    By default, the associativity is to the left, as expressions are evaluated from left to right: ⟨( r1*r2*x ≡ (r1*r2)*x )⟩

Theorems
  1. ⟨((x+y)^2 = (x*x + 2*x*y + y*y))⟩

    By the axioms of distribution and commutativity (Newton's binomial).
    This theorem generalizes to any positive integer exponent.

Substraction

Syntax

(x +' y) or (x - y) // x minus y


Definition

⟨(((xy = z) ↔ (x = z+y))⟩


Remarks
Examples
  1. (5*x − x*3) // ev. 2*x

  2. x−y // self-evaluates

  3. (2*x − y) // self-evaluates

  4. (2*x − 5*x) // ev. (−3)*x ev. −3*x

Axioms
  1. ⟨( (x+y)−x = y )⟩

  2. ⟨( (x+y)−y = x )⟩

  3. ⟨( x−0 = x )⟩

  4. ⟨( x−θ = x )⟩

  5. ⟨( (r1*x - r2*x) = (< b>r1−r2)*x )⟩ // by the definition of subtraction

    ⟨( (r1r2)*x =: (r1*x - r2*x) )⟩ // by the definition of subtraction

  6. ⟨( r*(xy) =: (r*xr*y) )⟩

    ⟨( (r*xr*y) = r*(xy) )⟩

Theorems
  1. ⟨( xx = 0 )⟩

    Demonstration: xx  eq.  (1*x − 1*x)  eq.   (1−1)*x  ev.  0*x  ev.  0

Sign of an Expression

By definition, the sign of an expression is the sign (+ or ) of the numerical value of its multiplying attribute, according to the following


Axioms
  1. ⟨( (+r)*x ≡ +(r*x) ≡ r*x )⟩

  2. ⟨( (−r)*x ≡ −(r*x) ≡ −r*x )⟩

  3. ⟨( 0−x = −x )⟩

  4. ⟨( θ−x = −x )⟩

  5. ⟨( −(−r)*x) = r*x )⟩

  6. ⟨( −(x+y) = −x−y )⟩

  7. ⟨( x+(+y) = x+y )⟩

  8. ⟨( x+(−y) = x−y )⟩

  9. ⟨( x−(+y) = xy )⟩

  10. ⟨( x−(−y) = x+y )⟩

Examples
  1. (−3)*x // ev. −3*x

  2. (+3)*x // ev. 3*x

  3. +x // ev. x