Article MONOID_1, MML version 4.99.1005

:: MONOID_1:modenot 1
definition
  let a1, a2, a3 be non empty set;
  mode Function of a1,a2,a3 is Function-like quasi_total Relation of [:a1,a2:],a3;
end;

:: MONOID_1:funcnot 1 => MONOID_1:func 1
definition
  let a1 be Relation-like Function-like set;
  let a2, a3, a4 be set;
  func A1 ..(A2,A3,A4) -> set equals
    a1 ..([a2,a3],a4);
end;

:: MONOID_1:def 1
theorem
for b1 being Relation-like Function-like set
for b2, b3, b4 being set holds
b1 ..(b2,b3,b4) = b1 ..([b2,b3],b4);

:: MONOID_1:funcnot 2 => MONOID_1:func 2
definition
  let a1, a2, a3, a4 be non empty set;
  let a5 be Function-like quasi_total Relation of [:a2,a3:],Funcs(a1,a4);
  let a6 be Element of a2;
  let a7 be Element of a3;
  let a8 be Element of a1;
  redefine func a5 ..(a6,a7,a8) -> Element of a4;
end;

:: MONOID_1:funcnot 3 => MONOID_1:func 3
definition
  let a1 be set;
  let a2, a3, a4 be non empty set;
  let a5 be Function-like quasi_total Relation of [:a2,a3:],a4;
  let a6 be Function-like quasi_total Relation of a1,a2;
  let a7 be Function-like quasi_total Relation of a1,a3;
  redefine func a5 .:(a6,a7) -> Element of Funcs(a1,a4);
end;

:: MONOID_1:funcnot 4 => FINSEQ_2:func 2
notation
  let a1 be non empty set;
  let a2 be Element of NAT;
  let a3 be Element of a1;
  synonym a2 .--> a3 for a1 |-> a2;
end;

:: MONOID_1:funcnot 5 => MONOID_1:func 4
definition
  let a1 be non empty set;
  let a2 be Element of NAT;
  let a3 be Element of a1;
  redefine func a2 .--> a3 -> FinSequence of a1;
end;

:: MONOID_1:funcnot 6 => MONOID_1:func 5
definition
  let a1 be non empty set;
  let a2 be set;
  let a3 be Element of a1;
  redefine func a2 --> a3 -> Element of Funcs(a2,a1);
end;

:: MONOID_1:funcnot 7 => MONOID_1:func 6
definition
  let a1 be set;
  let a2, a3, a4 be non empty set;
  let a5 be Function-like quasi_total Relation of [:a2,a3:],a4;
  let a6 be Element of a2;
  let a7 be Function-like quasi_total Relation of a1,a3;
  redefine func a5 [;](a6,a7) -> Element of Funcs(a1,a4);
end;

:: MONOID_1:funcnot 8 => MONOID_1:func 7
definition
  let a1 be set;
  let a2, a3, a4 be non empty set;
  let a5 be Function-like quasi_total Relation of [:a2,a3:],a4;
  let a6 be Function-like quasi_total Relation of a1,a2;
  let a7 be Element of a3;
  redefine func a5 [:](a6,a7) -> Element of Funcs(a1,a4);
end;

:: MONOID_1:th 2
theorem
for b1, b2 being Relation-like Function-like set
for b3 being set holds
   b2 * (b1 | b3) = (b3 | b2) * b1;

:: MONOID_1:sch 1
scheme MONOID_1:sch 1
{F1 -> set,
  F2 -> non empty set}:
ex b1 being Function-like quasi_total Relation of F1(),F2() st
   for b2 being set
         st b2 in F1()
      holds P1[b2, b1 . b2]
provided
   for b1 being set
         st b1 in F1()
      holds ex b2 being Element of F2() st
         P1[b1, b2];


:: MONOID_1:funcnot 9 => MONOID_1:func 8
definition
  let a1, a2, a3 be non empty set;
  let a4 be Function-like quasi_total Relation of [:a1,a2:],a3;
  let a5 be set;
  func (A4,A3).: A5 -> Function-like quasi_total Relation of [:Funcs(a5,a1),Funcs(a5,a2):],Funcs(a5,a3) means
    for b1 being Element of Funcs(a5,a1)
    for b2 being Element of Funcs(a5,a2) holds
       it .(b1,b2) = a4 .:(b1,b2);
end;

:: MONOID_1:def 2
theorem
for b1, b2, b3 being non empty set
for b4 being Function-like quasi_total Relation of [:b1,b2:],b3
for b5 being set
for b6 being Function-like quasi_total Relation of [:Funcs(b5,b1),Funcs(b5,b2):],Funcs(b5,b3) holds
      b6 = (b4,b3).: b5
   iff
      for b7 being Element of Funcs(b5,b1)
      for b8 being Element of Funcs(b5,b2) holds
         b6 .(b7,b8) = b4 .:(b7,b8);

:: MONOID_1:th 3
theorem
for b1, b2, b3 being non empty set
for b4 being Function-like quasi_total Relation of [:b1,b2:],b3
for b5 being set
for b6 being Function-like quasi_total Relation of b5,b1
for b7 being Function-like quasi_total Relation of b5,b2
for b8 being set
      st b8 in b5
   holds ((b4,b3).: b5) ..(b6,b7,b8) = b4 .(b6 . b8,b7 . b8);

:: MONOID_1:th 4
theorem
for b1 being set
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,b2:],b2
for b4, b5 being Function-like quasi_total Relation of b1,b2
      st b3 is commutative(b2)
   holds b3 .:(b4,b5) = b3 .:(b5,b4);

:: MONOID_1:th 5
theorem
for b1 being set
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,b2:],b2
for b4, b5, b6 being Function-like quasi_total Relation of b1,b2
      st b3 is associative(b2)
   holds b3 .:(b3 .:(b4,b5),b6) = b3 .:(b4,b3 .:(b5,b6));

:: MONOID_1:th 6
theorem
for b1 being set
for b2 being non empty set
for b3 being Element of b2
for b4 being Function-like quasi_total Relation of [:b2,b2:],b2
for b5 being Function-like quasi_total Relation of b1,b2
      st b3 is_a_unity_wrt b4
   holds b4 [;](b3,b5) = b5 & b4 [:](b5,b3) = b5;

:: MONOID_1:th 7
theorem
for b1 being set
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,b2:],b2
for b4 being Function-like quasi_total Relation of b1,b2
      st b3 is idempotent(b2)
   holds b3 .:(b4,b4) = b4;

:: MONOID_1:th 8
theorem
for b1 being set
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,b2:],b2
      st b3 is commutative(b2)
   holds (b3,b2).: b1 is commutative(Funcs(b1,b2));

:: MONOID_1:th 9
theorem
for b1 being set
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,b2:],b2
      st b3 is associative(b2)
   holds (b3,b2).: b1 is associative(Funcs(b1,b2));

:: MONOID_1:th 10
theorem
for b1 being set
for b2 being non empty set
for b3 being Element of b2
for b4 being Function-like quasi_total Relation of [:b2,b2:],b2
      st b3 is_a_unity_wrt b4
   holds b1 --> b3 is_a_unity_wrt (b4,b2).: b1;

:: MONOID_1:th 11
theorem
for b1 being set
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,b2:],b2
      st b3 is having_a_unity(b2)
   holds the_unity_wrt ((b3,b2).: b1) = b1 --> the_unity_wrt b3 &
    (b3,b2).: b1 is having_a_unity(Funcs(b1,b2));

:: MONOID_1:th 12
theorem
for b1 being set
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,b2:],b2
      st b3 is idempotent(b2)
   holds (b3,b2).: b1 is idempotent(Funcs(b1,b2));

:: MONOID_1:th 13
theorem
for b1 being set
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,b2:],b2
      st b3 is invertible(b2)
   holds (b3,b2).: b1 is invertible(Funcs(b1,b2));

:: MONOID_1:th 14
theorem
for b1 being set
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,b2:],b2
      st b3 is cancelable(b2)
   holds (b3,b2).: b1 is cancelable(Funcs(b1,b2));

:: MONOID_1:th 15
theorem
for b1 being set
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,b2:],b2
      st b3 is uniquely-decomposable(b2)
   holds (b3,b2).: b1 is uniquely-decomposable(Funcs(b1,b2));

:: MONOID_1:th 16
theorem
for b1 being set
for b2 being non empty set
for b3, b4 being Function-like quasi_total Relation of [:b2,b2:],b2
      st b3 absorbs b4
   holds (b3,b2).: b1 absorbs (b4,b2).: b1;

:: MONOID_1:th 17
theorem
for b1 being set
for b2, b3, b4, b5, b6, b7 being non empty set
for b8 being Function-like quasi_total Relation of [:b2,b3:],b4
for b9 being Function-like quasi_total Relation of [:b5,b6:],b7
      st b8 c= b9
   holds (b8,b4).: b1 c= (b9,b7).: b1;

:: MONOID_1:funcnot 10 => MONOID_1:func 9
definition
  let a1 be non empty multMagma;
  let a2 be set;
  func .:(A1,A2) -> multMagma equals
    multLoopStr(#Funcs(a2,the carrier of a1),(the multF of a1,the carrier of a1).: a2,a2 --> the_unity_wrt the multF of a1#)
    if a1 is unital
    otherwise multMagma(#Funcs(a2,the carrier of a1),(the multF of a1,the carrier of a1).: a2#);
end;

:: MONOID_1:def 3
theorem
for b1 being non empty multMagma
for b2 being set holds
   (b1 is unital implies .:(b1,b2) = multLoopStr(#Funcs(b2,the carrier of b1),(the multF of b1,the carrier of b1).: b2,b2 --> the_unity_wrt the multF of b1#)) &
    (b1 is unital or .:(b1,b2) = multMagma(#Funcs(b2,the carrier of b1),(the multF of b1,the carrier of b1).: b2#));

:: MONOID_1:funcreg 1
registration
  let a1 be non empty multMagma;
  let a2 be set;
  cluster .:(a1,a2) -> non empty;
end;

:: MONOID_1:th 18
theorem
for b1 being set
for b2 being non empty multMagma holds
   the carrier of .:(b2,b1) = Funcs(b1,the carrier of b2) &
    the multF of .:(b2,b1) = (the multF of b2,the carrier of b2).: b1;

:: MONOID_1:th 19
theorem
for b1, b2 being set
for b3 being non empty multMagma holds
      b1 is Element of the carrier of .:(b3,b2)
   iff
      b1 is Function-like quasi_total Relation of b2,the carrier of b3;

:: MONOID_1:funcreg 2
registration
  let a1 be non empty multMagma;
  let a2 be set;
  cluster .:(a1,a2) -> constituted-Functions;
end;

:: MONOID_1:th 20
theorem
for b1 being set
for b2 being non empty multMagma
for b3 being Element of the carrier of .:(b2,b1) holds
   proj1 b3 = b1 & proj2 b3 c= the carrier of b2;

:: MONOID_1:th 21
theorem
for b1 being set
for b2 being non empty multMagma
for b3, b4 being Element of the carrier of .:(b2,b1)
      st for b5 being set
              st b5 in b1
           holds b3 . b5 = b4 . b5
   holds b3 = b4;

:: MONOID_1:funcnot 11 => MONOID_1:func 10
definition
  let a1 be non empty multMagma;
  let a2 be non empty set;
  let a3 be Element of the carrier of .:(a1,a2);
  let a4 be Element of a2;
  redefine func a3 . a4 -> Element of the carrier of a1;
end;

:: MONOID_1:funcreg 3
registration
  let a1 be non empty multMagma;
  let a2 be non empty set;
  let a3 be Element of the carrier of .:(a1,a2);
  cluster proj2 a3 -> non empty;
end;

:: MONOID_1:th 22
theorem
for b1 being non empty set
for b2 being non empty multMagma
for b3, b4 being Element of the carrier of .:(b2,b1)
for b5 being Element of b1 holds
   (b3 * b4) . b5 = (b3 . b5) * (b4 . b5);

:: MONOID_1:funcnot 12 => MONOID_1:func 11
definition
  let a1 be non empty unital multMagma;
  let a2 be set;
  redefine func .:(a1,a2) -> non empty strict well-unital constituted-Functions multLoopStr;
end;

:: MONOID_1:th 23
theorem
for b1 being set
for b2 being non empty unital multMagma holds
   1. .:(b2,b1) = b1 --> the_unity_wrt the multF of b2;

:: MONOID_1:th 24
theorem
for b1 being non empty multMagma
for b2 being set holds
   (b1 is commutative implies .:(b1,b2) is commutative) & (b1 is associative implies .:(b1,b2) is associative) & (b1 is idempotent implies .:(b1,b2) is idempotent) & (b1 is invertible implies .:(b1,b2) is invertible) & (b1 is cancelable implies .:(b1,b2) is cancelable) & (b1 is uniquely-decomposable implies .:(b1,b2) is uniquely-decomposable);

:: MONOID_1:th 25
theorem
for b1 being set
for b2 being non empty multMagma
for b3 being non empty SubStr of b2 holds
   .:(b3,b1) is SubStr of .:(b2,b1);

:: MONOID_1:th 26
theorem
for b1 being set
for b2 being non empty unital multMagma
for b3 being non empty SubStr of b2
      st the_unity_wrt the multF of b2 in the carrier of b3
   holds .:(b3,b1) is MonoidalSubStr of .:(b2,b1);

:: MONOID_1:funcnot 13 => MONOID_1:func 12
definition
  let a1 be non empty unital associative commutative cancelable uniquely-decomposable multMagma;
  let a2 be set;
  redefine func .:(a1,a2) -> non empty strict associative commutative well-unital constituted-Functions cancelable uniquely-decomposable multLoopStr;
end;

:: MONOID_1:funcnot 14 => MONOID_1:func 13
definition
  let a1 be set;
  func MultiSet_over A1 -> non empty strict associative commutative well-unital constituted-Functions cancelable uniquely-decomposable multLoopStr equals
    .:(<NAT,+,0>,a1);
end;

:: MONOID_1:def 4
theorem
for b1 being set holds
   MultiSet_over b1 = .:(<NAT,+,0>,b1);

:: MONOID_1:th 27
theorem
for b1 being set holds
   the carrier of MultiSet_over b1 = Funcs(b1,NAT) &
    the multF of MultiSet_over b1 = (addnat,NAT).: b1 &
    1. MultiSet_over b1 = b1 --> 0;

:: MONOID_1:modenot 2
definition
  let a1 be set;
  mode Multiset of a1 is Element of the carrier of MultiSet_over a1;
end;

:: MONOID_1:th 28
theorem
for b1, b2 being set holds
   b1 is Element of the carrier of MultiSet_over b2
iff
   b1 is Function-like quasi_total Relation of b2,NAT;

:: MONOID_1:th 29
theorem
for b1 being set
for b2 being Element of the carrier of MultiSet_over b1 holds
   proj1 b2 = b1 & proj2 b2 c= NAT;

:: MONOID_1:funcnot 15 => MONOID_1:func 14
definition
  let a1 be non empty set;
  let a2 be Element of the carrier of MultiSet_over a1;
  redefine func rng a2 -> Element of bool NAT;
end;

:: MONOID_1:funcnot 16 => MONOID_1:func 15
definition
  let a1 be non empty set;
  let a2 be Element of the carrier of MultiSet_over a1;
  let a3 be Element of a1;
  redefine func a2 . a3 -> Element of NAT;
end;

:: MONOID_1:th 30
theorem
for b1 being non empty set
for b2, b3 being Element of the carrier of MultiSet_over b1
for b4 being Element of b1 holds
   (b2 * b3) . b4 = (b2 . b4) + (b3 . b4);

:: MONOID_1:th 31
theorem
for b1, b2 being set holds
chi(b1,b2) is Element of the carrier of MultiSet_over b2;

:: MONOID_1:funcnot 17 => MONOID_1:func 16
definition
  let a1, a2 be set;
  redefine func chi(a1,a2) -> Element of the carrier of MultiSet_over a2;
end;

:: MONOID_1:funcnot 18 => MONOID_1:func 17
definition
  let a1 be set;
  let a2 be Element of NAT;
  redefine func a1 --> a2 -> Element of the carrier of MultiSet_over a1;
end;

:: MONOID_1:funcnot 19 => MONOID_1:func 18
definition
  let a1 be non empty set;
  let a2 be Element of a1;
  func chi A2 -> Element of the carrier of MultiSet_over a1 equals
    chi({a2},a1);
end;

:: MONOID_1:def 5
theorem
for b1 being non empty set
for b2 being Element of b1 holds
   chi b2 = chi({b2},b1);

:: MONOID_1:th 32
theorem
for b1 being non empty set
for b2, b3 being Element of b1 holds
(chi b2) . b2 = 1 & (b3 = b2 or (chi b2) . b3 = 0);

:: MONOID_1:th 33
theorem
for b1 being non empty set
for b2, b3 being Element of the carrier of MultiSet_over b1
      st for b4 being Element of b1 holds
           b2 . b4 = b3 . b4
   holds b2 = b3;

:: MONOID_1:funcnot 20 => MONOID_1:func 19
definition
  let a1 be set;
  func finite-MultiSet_over A1 -> non empty strict MonoidalSubStr of MultiSet_over a1 means
    for b1 being Element of the carrier of MultiSet_over a1 holds
          b1 in the carrier of it
       iff
          b1 " (NAT \ {0}) is finite;
end;

:: MONOID_1:def 6
theorem
for b1 being set
for b2 being non empty strict MonoidalSubStr of MultiSet_over b1 holds
      b2 = finite-MultiSet_over b1
   iff
      for b3 being Element of the carrier of MultiSet_over b1 holds
            b3 in the carrier of b2
         iff
            b3 " (NAT \ {0}) is finite;

:: MONOID_1:th 34
theorem
for b1 being non empty set
for b2 being Element of b1 holds
   chi b2 is Element of the carrier of finite-MultiSet_over b1;

:: MONOID_1:th 35
theorem
for b1 being set
for b2 being non empty set
for b3 being FinSequence of b2 holds
   proj1 ({b1} | (b3 ^ <*b1*>)) = (dom ({b1} | b3)) \/ {(len b3) + 1};

:: MONOID_1:th 36
theorem
for b1, b2 being set
for b3 being non empty set
for b4 being FinSequence of b3
      st b1 <> b2
   holds proj1 ({b1} | (b4 ^ <*b2*>)) = dom ({b1} | b4);

:: MONOID_1:funcreg 4
registration
  let a1 be set;
  let a2 be Relation-like finite set;
  cluster a1 | a2 -> Relation-like finite;
end;

:: MONOID_1:funcnot 21 => MONOID_1:func 20
definition
  let a1 be non empty set;
  let a2 be FinSequence of a1;
  func |.A2.| -> Element of the carrier of MultiSet_over a1 means
    for b1 being Element of a1 holds
       it . b1 = card dom ({b1} | a2);
end;

:: MONOID_1:def 7
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Element of the carrier of MultiSet_over b1 holds
      b3 = |.b2.|
   iff
      for b4 being Element of b1 holds
         b3 . b4 = card dom ({b4} | b2);

:: MONOID_1:th 37
theorem
for b1 being non empty set
for b2 being Element of b1 holds
   |.<*> b1.| . b2 = 0;

:: MONOID_1:th 38
theorem
for b1 being non empty set holds
   |.<*> b1.| = b1 --> 0;

:: MONOID_1:th 39
theorem
for b1 being non empty set
for b2 being Element of b1 holds
   |.<*b2*>.| = chi b2;

:: MONOID_1:th 40
theorem
for b1 being non empty set
for b2 being Element of b1
for b3 being FinSequence of b1 holds
   |.b3 ^ <*b2*>.| = |.b3.| * chi b2;

:: MONOID_1:th 41
theorem
for b1 being non empty set
for b2, b3 being FinSequence of b1 holds
|.b2 ^ b3.| = |.b2.| * |.b3.|;

:: MONOID_1:th 42
theorem
for b1 being Element of NAT
for b2 being non empty set
for b3 being Element of b2 holds
   |.b1 .--> b3.| . b3 = b1 &
    (for b4 being Element of b2
          st b4 <> b3
       holds |.b1 .--> b3.| . b4 = 0);

:: MONOID_1:th 43
theorem
for b1 being non empty set
for b2 being FinSequence of b1 holds
   |.b2.| is Element of the carrier of finite-MultiSet_over b1;

:: MONOID_1:th 44
theorem
for b1 being set
for b2 being non empty set
      st b1 is Element of the carrier of finite-MultiSet_over b2
   holds ex b3 being FinSequence of b2 st
      b1 = |.b3.|;

:: MONOID_1:funcnot 22 => MONOID_1:func 21
definition
  let a1, a2, a3 be non empty set;
  let a4 be Function-like quasi_total Relation of [:a1,a2:],a3;
  func A4 .:^2 -> Function-like quasi_total Relation of [:bool a1,bool a2:],bool a3 means
    for b1 being Element of [:bool a1,bool a2:] holds
       it . b1 = a4 .: [:b1 `1,b1 `2:];
end;

:: MONOID_1:def 8
theorem
for b1, b2, b3 being non empty set
for b4 being Function-like quasi_total Relation of [:b1,b2:],b3
for b5 being Function-like quasi_total Relation of [:bool b1,bool b2:],bool b3 holds
      b5 = b4 .:^2
   iff
      for b6 being Element of [:bool b1,bool b2:] holds
         b5 . b6 = b4 .: [:b6 `1,b6 `2:];

:: MONOID_1:th 45
theorem
for b1, b2, b3 being non empty set
for b4 being Function-like quasi_total Relation of [:b1,b2:],b3
for b5 being Element of bool b1
for b6 being Element of bool b2 holds
   b4 .:^2 .(b5,b6) = b4 .: [:b5,b6:];

:: MONOID_1:th 46
theorem
for b1, b2, b3 being non empty set
for b4 being Function-like quasi_total Relation of [:b1,b2:],b3
for b5 being Element of bool b1
for b6 being Element of bool b2
for b7, b8 being set
      st b7 in b5 & b8 in b6
   holds b4 .(b7,b8) in b4 .:^2 .(b5,b6);

:: MONOID_1:th 47
theorem
for b1, b2, b3 being non empty set
for b4 being Function-like quasi_total Relation of [:b1,b2:],b3
for b5 being Element of bool b1
for b6 being Element of bool b2 holds
   b4 .:^2 .(b5,b6) = {b4 .(b7,b8) where b7 is Element of b1, b8 is Element of b2: b7 in b5 & b8 in b6};

:: MONOID_1:th 48
theorem
for b1, b2 being set
for b3 being non empty set
for b4 being Function-like quasi_total Relation of [:b3,b3:],b3
      st b4 is commutative(b3)
   holds b4 .: [:b1,b2:] = b4 .: [:b2,b1:];

:: MONOID_1:th 49
theorem
for b1, b2, b3 being set
for b4 being non empty set
for b5 being Function-like quasi_total Relation of [:b4,b4:],b4
      st b5 is associative(b4)
   holds b5 .: [:b5 .: [:b1,b2:],b3:] = b5 .: [:b1,b5 .: [:b2,b3:]:];

:: MONOID_1:th 50
theorem
for b1 being non empty set
for b2 being Function-like quasi_total Relation of [:b1,b1:],b1
      st b2 is commutative(b1)
   holds b2 .:^2 is commutative(bool b1);

:: MONOID_1:th 51
theorem
for b1 being non empty set
for b2 being Function-like quasi_total Relation of [:b1,b1:],b1
      st b2 is associative(b1)
   holds b2 .:^2 is associative(bool b1);

:: MONOID_1:th 52
theorem
for b1 being set
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,b2:],b2
for b4 being Element of b2
      st b4 is_a_unity_wrt b3
   holds b3 .: [:{b4},b1:] = b2 /\ b1 &
    b3 .: [:b1,{b4}:] = b2 /\ b1;

:: MONOID_1:th 53
theorem
for b1 being non empty set
for b2 being Function-like quasi_total Relation of [:b1,b1:],b1
for b3 being Element of b1
      st b3 is_a_unity_wrt b2
   holds {b3} is_a_unity_wrt b2 .:^2 & b2 .:^2 is having_a_unity(bool b1) & the_unity_wrt (b2 .:^2) = {b3};

:: MONOID_1:th 54
theorem
for b1 being non empty set
for b2 being Function-like quasi_total Relation of [:b1,b1:],b1
      st b2 is having_a_unity(b1)
   holds b2 .:^2 is having_a_unity(bool b1) &
    {the_unity_wrt b2} is_a_unity_wrt b2 .:^2 &
    the_unity_wrt (b2 .:^2) = {the_unity_wrt b2};

:: MONOID_1:th 55
theorem
for b1 being non empty set
for b2 being Function-like quasi_total Relation of [:b1,b1:],b1
      st b2 is uniquely-decomposable(b1)
   holds b2 .:^2 is uniquely-decomposable(bool b1);

:: MONOID_1:funcnot 23 => MONOID_1:func 22
definition
  let a1 be non empty multMagma;
  func bool A1 -> multMagma equals
    multLoopStr(#bool the carrier of a1,(the multF of a1) .:^2,{the_unity_wrt the multF of a1}#)
    if a1 is unital
    otherwise multMagma(#bool the carrier of a1,(the multF of a1) .:^2#);
end;

:: MONOID_1:def 9
theorem
for b1 being non empty multMagma holds
   (b1 is unital implies bool b1 = multLoopStr(#bool the carrier of b1,(the multF of b1) .:^2,{the_unity_wrt the multF of b1}#)) &
    (b1 is unital or bool b1 = multMagma(#bool the carrier of b1,(the multF of b1) .:^2#));

:: MONOID_1:funcreg 5
registration
  let a1 be non empty multMagma;
  cluster bool a1 -> non empty;
end;

:: MONOID_1:funcnot 24 => MONOID_1:func 23
definition
  let a1 be non empty unital multMagma;
  redefine func bool a1 -> non empty strict well-unital multLoopStr;
end;

:: MONOID_1:th 56
theorem
for b1 being non empty multMagma holds
   the carrier of bool b1 = bool the carrier of b1 & the multF of bool b1 = (the multF of b1) .:^2;

:: MONOID_1:th 57
theorem
for b1 being non empty unital multMagma holds
   1. bool b1 = {the_unity_wrt the multF of b1};

:: MONOID_1:th 58
theorem
for b1 being non empty multMagma holds
   (b1 is commutative implies bool b1 is commutative) & (b1 is associative implies bool b1 is associative) & (b1 is uniquely-decomposable implies bool b1 is uniquely-decomposable);