
theorem Th41:
  for X being non empty set, x being Element of X
  for c being 2-ary associative unital
  non empty quasi_total homogeneous PartFunc of X*, X st x is_a_unity_wrt c
  for i being 3-ary non empty quasi_total homogeneous PartFunc of X*, X
  for w being 2-ary non empty quasi_total homogeneous PartFunc of X*, X
  ex S being non-empty strict UAStr st the carrier of S = X &
  the charact of S = <*(0-tuples_on X)-->x,c*>^<*i,w*> &
  S is with_empty-instruction with_catenation unital associative
  with_if-instruction with_while-instruction quasi_total partial
proof
  let X be non empty set;
  let x be Element of X;
  let c be 2-ary associative unital non empty quasi_total homogeneous
  PartFunc of X*, X;
  assume
A1: x is_a_unity_wrt c;
  let i be 3-ary non empty quasi_total homogeneous PartFunc of X*, X;
  let w be 2-ary non empty quasi_total homogeneous PartFunc of X*, X;
  set Y = 0-tuples_on X;
  set e = Y --> x;
  reconsider e as 0-ary
  non empty quasi_total homogeneous PartFunc of X*, X;
  set char = <*e,c*>^<*i,w*>;
  char is PFuncFinSequence of X
  proof
    let a be object;
    assume a in rng char;
    then a in rng <*e,c*> \/ rng <*i,w*> by FINSEQ_1:31;
    then a in rng <*e,c*> or a in rng <*i,w*> by XBOOLE_0:def 3;
    then a in {e,c} or a in {i,w} by FINSEQ_2:127;
    then a = e or a = c or a = i or a = w by TARSKI:def 2;
    hence thesis by PARTFUN1:45;
  end;
  then reconsider char as non empty non-empty PFuncFinSequence of X;
  reconsider S = UAStr(#X, char#) as non-empty strict UAStr by UNIALG_1:def 3;
  take S;
  thus the carrier of S = X;
  thus the charact of S = <*(0-tuples_on X)-->x,c*>^<*i,w*>;
A2: len <*e,c*> = 2 by FINSEQ_1:44;
  len <*i,w*> = 2 by FINSEQ_1:44;
  then len char = 2+2 by A2,FINSEQ_1:22;
  then
A3: dom char = Seg 4 by FINSEQ_1:def 3;
  reconsider e as 0-ary non empty homogeneous
  PartFunc of (the carrier of S)*, the carrier of S;
  reconsider c as 2-ary associative non empty homogeneous
  quasi_total PartFunc of (the carrier of S)*, the carrier of S;
A4: <*e,c*>.1 = e;
A5: <*e,c*>.2 = c;
A6: <*i,w*>.1 = i;
A7: <*i,w*>.2 = w;
  thus 1 in dom the charact of S by A3;
A8: dom <*e,c*> = Seg 2 by FINSEQ_1:89;
  then
A9: 1 in dom <*e,c*>;
A10: 2 in dom <*e,c*> by A8;
A11: e = (the charact of S).1 by A4,A9,FINSEQ_1:def 7;
A12: c = (the charact of S).2 by A5,A10,FINSEQ_1:def 7;
  thus (the charact of S).1 is 0-ary non empty homogeneous
  quasi_total PartFunc of (the carrier of S)*, the carrier of S
  by A4,A9,FINSEQ_1:def 7;
  thus 2 in dom the charact of S by A3;
  thus (the charact of S).2 is 2-ary non empty homogeneous
  quasi_total PartFunc of (the carrier of S)*, the carrier of S
  by A5,A10,FINSEQ_1:def 7;
  thus S is unital
  proof
    take c;
    thus c = (the charact of S).2 by A5,A10,FINSEQ_1:def 7;
A13: 1 in dom the charact of S by A3;
A14: Y = {{}} by COMPUT_1:5;
A15: In(1, dom the charact of S) = 1 by A13,SUBSET_1:def 8;
A16: {} in Y by A14,TARSKI:def 1;
    e = Den(In(1, dom the charact of S),S) by A4,A9,A15,FINSEQ_1:def 7;
    hence thesis by A1,A16,FUNCOP_1:7;
  end;
  thus (the charact of S).2 is 2-ary associative non empty homogeneous
  quasi_total PartFunc of (the carrier of S)*, the carrier of S
  by A5,A10,FINSEQ_1:def 7;
  thus 3 in dom the charact of S by A3;
A17: dom <*i,w*> = Seg 2 by FINSEQ_1:89;
  then
A18: 1 in dom <*i,w*>;
A19: 2 in dom <*i,w*> by A17;
A20: char.(2+1) = i by A2,A6,A18,FINSEQ_1:def 7;
A21: char.(2+2) = w by A2,A7,A19,FINSEQ_1:def 7;
  thus (the charact of S).3 is 3-ary non empty homogeneous
  quasi_total PartFunc of (the carrier of S)*, the carrier of S by A20;
  thus 4 in dom the charact of S by A3;
  thus (the charact of S).4 is 2-ary non empty homogeneous
  quasi_total PartFunc of (the carrier of S)*, the carrier of S by A2,A7,A19,
FINSEQ_1:def 7;
  thus S is quasi_total
  proof
    let i be Nat, h be PartFunc of (the carrier of S)*, the carrier of S;
    assume i in dom the charact of S;
    hence thesis by A3,A11,A12,A20,A21,ENUMSET1:def 2,FINSEQ_3:2;
  end;
  let i be Nat, h be PartFunc of (the carrier of S)*, the carrier of S;
  assume that
A22: i in dom the charact of S and
A23: h = (the charact of S).i;
  let p1,p2 be FinSequence;
  i = 1 or i = 2 or i = 3 or i = 4 by A3,A22,ENUMSET1:def 2,FINSEQ_3:2;
  hence thesis by A11,A12,A20,A21,A23,MARGREL1:def 1;
end;
