HILB10_7

index · ← NDIFF11 · FIELD_11 →
:: Prime Representing Polynomial with 10 Unknowns -- Introduction
::  by Karol P\kak
::
:: Received September 30, 2022
:: Copyright (c) 2022-2026 Association of Mizar Users
::           (Stowarzyszenie Uzytkownikow Mizara, Bialystok, Poland).
:: This code can be distributed under the GNU General Public Licence
:: version 3.0 or later, or the Creative Commons Attribution-ShareAlike
:: License version 3.0 or later, subject to the binding interpretation
:: detailed in file COPYING.interpretation.
:: See COPYING.GPL and COPYING.CC-BY-SA for the full text of these
:: licenses, or see http://www.gnu.org/licenses/gpl.html and
:: http://creativecommons.org/licenses/by-sa/3.0/.

environ

 vocabularies NUMBERS, SUBSET_1, RELAT_1, ORDINAL4, FINSEQ_1, XBOOLE_0,
      BINOP_1, FUNCT_1, FINSOP_1, SETWISEO, XXREAL_0, TARSKI, NAT_1, ARYTM_3,
      FINSUB_1, SETFAM_1, FINSET_1, ZFMISC_1, CARD_1, PARTFUN1, ARYTM_1,
      FUNCOP_1, FUNCT_4, FINSEQ_2, FUNCT_2, CLASSES1, PRE_POLY, FUNCT_6,
      WAYBEL_4, FUNCT_5, ABIAN, AOFA_I00, NET_1, FUNCT_7, FINSEQOP, MONOID_0,
      MATRIX_1, UPROOTS, HILB10_7;
 notations TARSKI, XBOOLE_0, ZFMISC_1, SUBSET_1, CARD_1, NUMBERS, ABIAN,
      RELAT_1, XXREAL_0, XCMPLX_0, FUNCT_1, RELSET_1, FINSET_1, FINSUB_1,
      SETWISEO, PARTFUN1, FUNCT_2, FINSOP_1, FINSEQ_1, FUNCT_3, BINOP_1,
      FINSEQ_2, FUNCT_4, FUNCT_5, FUNCOP_1, NAT_1, CLASSES1, SETFAM_1,
      DOMAIN_1, FINSEQOP, PRE_POLY, POLNOT_1, MONOID_0, MATRIX_1, RLAFFIN3,
      FINSEQ_3, ORDINAL1, MATRIX_3;
 constructors WELLORD2, SETWISEO, ABIAN, FINSOP_1, FINSEQ_4, RFUNCT_3,
      CLASSES1, PRE_POLY, POLNOT_1, MONOID_0, MATRIX_3, RLAFFIN3;
 registrations XBOOLE_0, SUBSET_1, RELAT_1, FUNCT_1, ORDINAL1, FUNCOP_1,
      FINSET_1, XXREAL_0, XREAL_0, NAT_1, CARD_1, FINSEQ_1, FINSEQ_2, VALUED_0,
      RELSET_1, FUNCT_2, FINSUB_1, INT_1, PRE_POLY, NEWTON04, FLEXARY1,
      MSAFREE5, PRE_CIRC, FOMODEL0, AOFA_A00, FUNCT_4, ABIAN, POLNOT_1,
      MEMBERED, MATRIX_1, FINSEQ_3, NEWTON03;
 requirements NUMERALS, REAL, BOOLE, SUBSET, ARITHM;
 definitions TARSKI, XBOOLE_0, FINSEQ_1, FUNCT_1;
 equalities FINSEQ_1, FINSEQ_2, XCMPLX_0;
 expansions TARSKI, XBOOLE_0, FUNCT_1, FINSEQ_1;
 theorems XBOOLE_0, MATRIX_3, TARSKI, NAT_1, FINSEQ_1, FINSEQ_5, FINSEQ_3,
      FUNCT_1, FINSEQ_2, XXREAL_0, SUBSET_1, RELAT_1, FINSUB_1, PRE_POLY,
      FUNCT_2, XBOOLE_1, CARD_1, ZFMISC_1, CARD_2, SETWISEO, FINSOP_1,
      FOMODEL0, BINOP_1, FUNCT_5, FUNCOP_1, SETWOP_2, PARTFUN1, FINSEQOP,
      WELLORD2, RLAFFIN3, SETFAM_1, XREAL_1, ENUMSET1, RFINSEQ, CLASSES1,
      FUNCT_4, POLNOT_1, STIRL2_1, FUNCT_3, FINSEQ_4, MATRIX11, MATRIX_1,
      ABIAN, SRINGS_5, XTUPLE_0;
 schemes XBOOLE_0, NAT_1, FRAENKEL, CLASSES1, FINSEQ_1, FUNCT_2, FUNCT_1,
      BINOP_1, SETWISEO;

begin :: Preliminaries

reserve i,j,n,k,m for Nat,
     a,b,x,y,z for object,
     F,G for FinSequence-yielding FinSequence,
     f,g,p,q for FinSequence,
     X,Y for set,
     D for non empty set;

definition
  let X be finite set;
  func [#]X -> Element of Fin X equals
    X;
  coherence by FINSUB_1:def 5;
end;

theorem Th1:
  for X1,X2,Y be non empty set
  for F be BinOp of Y
   for B1 be Element of Fin X1, B2 be Element of Fin X2 st B1=B2 &
      (B1 <> {} or F is having_a_unity) & F is associative commutative
   for f1 be Function of X1,Y, f2 be Function of X2,Y st f1|B1=f2|B2 holds
     F$$(B1,f1) = F$$(B2,f2)
proof
  let X1,X2,Y be non empty set;
  let F be BinOp of Y;
  let B1 be Element of Fin X1, B2 be Element of Fin X2 such that
A1: B1=B2 and
A2: (B1 <> {} or F is having_a_unity) & F is associative commutative;
  let f1 be Function of X1,Y, f2 be Function of X2,Y such that
A3: f1|B1=f2|B2;
  consider G1 be Function of Fin X1, Y such that
A4: F$$(B1,f1) = G1.B1 and
A5: (for e being Element of Y st e is_a_unity_wrt F holds G1.{} = e) and
A6: (for x being Element of X1 holds G1.{x} = f1.x) and
A7: for B9 being Element of Fin X1 st
    B9 c= B1 & B9 <> {} for x being Element of X1 st x in B1 \ B9
    holds G1.(B9 \/ {x}) = F.(G1.B9,f1.x) by A2,SETWISEO:def 3;
  consider G2 be Function of Fin X2, Y such that
A8: F$$(B2,f2) = G2.B2 and
A9: (for e being Element of Y st e is_a_unity_wrt F holds G2.{} = e) and
A10: (for x being Element of X2 holds G2.{x} = f2.x) and
A11: for B9 being Element of Fin X2 st
  B9 c= B2 & B9 <> {} for x being Element of X2 st x in B2 \ B9 holds
  G2.(B9 \/ {x}) = F.(G2.B9,f2.x) by A1,A2,SETWISEO:def 3;
  defpred P[set] means $1 c= B1 implies G1.$1= G2.$1 or $1={};
A12:P[{}.X1];
A13: for B9 being (Element of Fin X1), b being Element of X1 holds
   P[B9] & not b in B9 implies P[B9 \/ {b}]
  proof
    let B9 be Element of Fin X1;
    let b be Element of X1 such that
A14:  P[B9] & not b in B9;
    assume
A15:  B9 \/ {b} c= B1;
    b in {b} by TARSKI:def 1;then
A16:  b in B9 \/ {b} by XBOOLE_0:def 3;
    then
A17:  b in B1 by A15;
A18:  f1.b = (f1|B1).b & f2.b = (f2|B2).b by A1,A16,A15,FUNCT_1:49;
A19:  B2 c= X2 by FINSUB_1:def 5;
    per cases;
    suppose
A20:    B9={};
      G1.{b} = f1.b = G2.{b} by A6,A10,A3,A18,A19,A17,A1;
      hence thesis by A20;
    end;
    suppose
A21:    B9<>{};
A22:    B9 c= B9 \/ {b} by XBOOLE_1:7;
      then
A23:    B9 c= B1 by A15;
      B9 c= X2 by A19,A1,A22,A15;
      then reconsider B92=B9 as Element of Fin X2 by FINSUB_1:def 5;
      b in B1\B9 by A14,A16,A15,XBOOLE_0:def 5;
      then G2.(B92 \/ {b}) = F.(G2.B92,f2.b) & G1.(B9 \/ {b}) = F.(G1.B9,f1.b)
        by A11,A7,A1,A21,A23,A19,A17;
      hence thesis by A18,A3,A23,A21,A14;
    end;
  end;
A24: for B being Element of Fin X1   holds P[B] from SETWISEO:sch 2(A12,A13);
  per cases;
  suppose
A25:  B1={};
    then G1.{} = the_unity_wrt F & G2.{} = the_unity_wrt F
      by A5,A9,A2,SETWISEO:14;
    hence thesis by A4,A8,A25,A1;
  end;
  suppose B1<>{};
    hence thesis by A24,A1,A4,A8;
  end;
end;

theorem Th2:
for D be non empty set, d1,d2 be Element of D, B be BinOp of D st
  B is having_a_unity associative commutative having_an_inverseOp holds
    B.((the_inverseOp_wrt B).d1,d2) =
       (the_inverseOp_wrt B).(B.(d1,(the_inverseOp_wrt B).d2))
  &
    B.(d1,(the_inverseOp_wrt B).d2) =
       (the_inverseOp_wrt B).(B.((the_inverseOp_wrt B).d1,d2))
proof
  let D be non empty set, d1,d2 be Element of D, B be BinOp of D;
  set I=the_inverseOp_wrt B;
  assume
A1: B is having_a_unity associative commutative having_an_inverseOp; then
  B.(B.(d1,I.d2), B.(I.d1,d2))
     = B.(B.(I.d2,d1), B.(I.d1,d2)) by BINOP_1:def 2
    .= B.(B.(B.(I.d2,d1),I.d1),d2) by A1,BINOP_1:def 3
    .= B.(B.(I.d2,B.(d1,I.d1)),d2) by A1,BINOP_1:def 3
    .= B.(B.(I.d2,the_unity_wrt B),d2) by A1,FINSEQOP:59
    .= B.(I.d2,d2) by A1,SETWISEO:15
    .= the_unity_wrt B by A1,FINSEQOP:59;
  hence thesis by A1,FINSEQOP:60;
end;

theorem Th3:
  for D be non empty set, A,M be BinOp of D  st
    A is commutative associative having_a_unity &
    M is commutative & M is_distributive_wrt A &
    (for d be Element of D holds M.(the_unity_wrt A,d) = the_unity_wrt A)
  for X,Y be non empty finite set
    for f be Function of X,D, g be Function of Y,D
      for a be Element of Fin X,b be Element of Fin Y
        holds
   A $$ ([:a,b:],M*(f,g))=M. ( A$$(a,f),A$$(b,g))
proof
  let D be non empty set, A,M be BinOp of D such that
A1: A is commutative associative having_a_unity &
    M is commutative & M is_distributive_wrt A and
A2:(for d be Element of D holds M.(the_unity_wrt A,d) = the_unity_wrt A);
  let X,Y be non empty finite set;
  let f be Function of X,D, g be Function of Y,D;
set m=M*(f,g);
  defpred P[set] means
    for a be Element of Fin X,b be Element of Fin Y st a=$1 holds
    A $$ ([:a,b:],m)=M. ( A$$(a,f),A$$(b,g));
A3:P[{}.X]
  proof
    let a be Element of Fin X, b be Element of Fin Y such that
A4:  a={}.X;
    [:{}.X,b:] = {}.[:X,Y:] by ZFMISC_1:90;
    then
A5:   A $$ ([:{}.X,b:],m)= the_unity_wrt A by A1,SETWISEO:31;
    A$$({}.X,f) = the_unity_wrt A by A1,SETWISEO:31;
    hence thesis by A4,A2,A5;
  end;
A6:for E be (Element of Fin X), e be Element of X holds P[E] & not e in E
    implies P[E \/ {e}]
  proof
    let E be (Element of Fin X), e be Element of X such that
A7: P[E] & not e in E;
    defpred Q[set] means for B be Element of Fin Y st B=$1 holds
    A $$ ([:{.e.},B:],m)=M. ( A$$({.e.},f),A$$(B,g));
A8: Q[{}.Y]
    proof
      let B be Element of Fin Y such that
A9:     B={}.Y;
A10:    [:{.e.},{}.Y:] = {}.[:X,Y:];
      M. ( A$$({.e.},f),A$$(B,g)) = M. (A$$(B,g),A$$({.e.},f))
        by A1,BINOP_1:def 2
      .= M. ( the_unity_wrt A,A$$({.e.},f)) by A9,A1,SETWISEO:31
      .= the_unity_wrt A by A2;
      hence A $$ ([:{.e.},B:],M*(f,g))=M. ( A$$({.e.},f),A$$(B,g))
        by A10,A9,A1,SETWISEO:31;
    end;
A11: for B be (Element of Fin Y), b be Element of Y holds Q[B]
      & not b in B implies Q[B \/ {b}]
    proof
      let B be (Element of Fin Y), b be Element of Y such that
A12:    Q[B] & not b in B;
      let Bb be Element of Fin Y such that
A13:    Bb=B \/ {b};
A14:  B misses {.b.} by A12,ZFMISC_1:50;
      then
A15:    [:{.e.},B:] misses [:{.e.},{.b.}:] by ZFMISC_1:104;
A16:    {[e,b]} = [:{.e.},{.b.}:] by ZFMISC_1:29;
      reconsider eb=[e,b] as Element of [:X,Y:];
A17:  A $$([:{.e.},{.b.}:],m) = m.eb by A16,A1,SETWISEO:17
      .= m.(e,b) by BINOP_1:def 1
      .= M.(f.e,g.b) by FINSEQOP:81
      .= M.(A$$({.e.},f),g.b) by A1,SETWISEO:17
      .= M.(A$$({.e.},f),A$$({.b.},g)) by A1,SETWISEO:17;
      [:{.e.},B:] \/ [:{.e.},{.b.}:] = [:{.e.},Bb:] by A13,ZFMISC_1:97;
      hence A$$([:{.e.},Bb:],m)
        = A.(A $$([:{.e.},B:],m),A $$([:{.e.},{.b.}:],m)) by A15,A1,SETWOP_2:4
      .= A. ( M. ( A$$({.e.},f),A$$(B,g)), M.(A$$({.e.},f),A$$({.b.},g)))
        by A12,A17
      .= M. ( A$$({.e.},f),A.(A$$(B,g),A$$({.b.},g))) by A1,BINOP_1:11
      .= M. ( A$$({.e.},f),A$$(Bb,g)) by A13,A1,A14,SETWOP_2:4;
    end;
A18: for B be (Element of Fin Y) holds Q[B] from SETWISEO:sch 2(A8,A11);
    let Q be Element of Fin X,B be Element of Fin Y such that A19:Q=E \/ {e};
A20: E misses {.e.} by A7,ZFMISC_1:50;
    then
A21: [:E,B:] misses [:{.e.},B:] by ZFMISC_1:104;
    [:E,B:] \/ [:{.e.},B:] = [:Q,B:] by A19,ZFMISC_1:97;
    hence A$$([:Q,B:], m) = A. (A $$ ([:E,B:], m),A $$ ([:{.e.},B:], m))
      by A21,A1,SETWOP_2:4
    .= A. (M.(A $$ (E, f),A $$ (B, g)), A $$ ([:{.e.},B:],M*(f,g))) by A7
    .= A. (M.(A $$ (E, f),A $$ (B, g)), M.(A$$({.e.},f),A$$(B,g))) by A18
    .= M.(A. ( A $$ (E, f),A$$({.e.},f)), A$$(B,g)) by A1,BINOP_1:11
    .= M.(A $$ (Q,f), A$$(B,g)) by A19,A1,A20,SETWOP_2:4;
  end;
  for E be (Element of Fin X) holds P[E] from SETWISEO:sch 2(A3,A6);
  hence thesis;
end;

theorem Th4:
  for D be non empty set, M,A be BinOp of D, d be Element of D  st
    M is having_a_unity &
    A is associative having_a_unity having_an_inverseOp &
    M is_distributive_wrt A
  holds
   (n is even implies M "**" (n|-> (the_inverseOp_wrt A).d) =
      M "**" (n|-> d) ) &
   (n is odd implies M "**" (n|-> (the_inverseOp_wrt A).d) =
      (the_inverseOp_wrt A).(M "**" (n|-> d)) )
proof
  let D be non empty set, M,A be BinOp of D, d be Element of D;
  set I = the_inverseOp_wrt A;
  assume that
A1: M is having_a_unity and
A2: A is associative having_a_unity having_an_inverseOp and
A3: M is_distributive_wrt A;
  defpred P[Nat] means
  ($1 is even implies M "**" ($1|-> I.d) = M "**" ($1|-> d) ) &
  (not $1 is even implies M "**" ($1|-> I.d) = I.(M "**" ($1|-> d)) );
A4: P[0];
A5: P[i] implies P[i+1]
  proof
    assume
A6:   P[i];
A7:   (i+1)|-> I.d = (i|->I.d)^<*I.d*> by FINSEQ_2:60;
A8:   (i+1)|-> d = (i|->d)^<*d*> by FINSEQ_2:60;
    per cases;
    suppose
A9:   i is even;
      M "**" ((i+1) |-> I.d) = M. (M"**" (i|->d), I.d)
        by A6,A7,A1,A9,FINSOP_1:4
      .= I. (M. (M"**" (i|->d), d)) by A2,A3,FINSEQOP:67
      .= I.(M "**" ((i+1)|-> d)) by A8,A1,FINSOP_1:4;
      hence thesis by A9;
    end;
    suppose
A10:    not i is even;
      M "**" ((i+1) |-> I.d) = M. (I.(M"**" (i|->d)), I.d)
        by A6,A7,A1,A10,FINSOP_1:4
      .= I. (M. (M"**" (i|->d), I.d)) by A2,A3,FINSEQOP:67
      .= I. (I.(M. (M"**" (i|->d), d))) by A2,A3,FINSEQOP:67
      .= I.(I.(M "**" ((i+1)|-> d))) by A8,A1,FINSOP_1:4
      .= M "**" ((i+1)|-> d) by A2,FINSEQOP:62;
      hence thesis by A10;
    end;
  end;
  P[i] from NAT_1:sch 2(A4,A5);
  hence thesis;
end;

theorem Th5:
  for s be FinSequence st s"{y}<>{}
    ex p be Permutation of Seg (len s) st (s*p) . (len s) = y & p = p"
proof
  let s be FinSequence; assume s"{y}<>{};
  then consider x be object such that
A1: x in s"{y} by XBOOLE_0:def 1;
A2: x in dom s & s.x in {y} by A1,FUNCT_1:def 7;
  then
A3: s.x = y by TARSKI:def 1;
A4: dom s = Seg len s by FINSEQ_1:def 3;
  reconsider x as Nat by A2;
  per cases;
  suppose
A5:   x = len s;
    reconsider I=id Seg len s as Permutation of Seg (len s);
    take I;
    x in dom s /\ Seg len s by A1,A4,FUNCT_1:def 7;
    hence thesis by A5,A3,FUNCT_1:20,45;
  end;
  suppose
A6:   x <> len s;
    1 <= x <= len s by A2,FINSEQ_3:25;
    then
A7:   1 <= len s & x < len s by A6,XXREAL_0:1,2;
    then len s in dom s by FINSEQ_3:25;
    then consider tr be Element of Permutations (len s) such that
A8:   tr is being_transposition & tr.x = len s by A2,A4,A7,MATRIX11:16;
A9:   tr.(len s) =x & len s in dom tr by A7,A8,MATRIX11:8;
    reconsider tr as Permutation of Seg (len s) by MATRIX_1:def 16;
    take tr;
    thus thesis by A3,A9,A8,FUNCT_1:13,MATRIX11:20;
  end;
end;

registration
  let D be non empty set;
  cluster non empty non-empty for FinSequence of D*;
  existence
  proof
    set d=the Element of D;
    take <*<*d*>*>;
    thus <*<*d*>*> is non empty;
    thus <*<*d*>*> is non-empty;
  end;
end;

registration
  let X,Y be non empty set;
  cluster UNION(X,Y) -> non empty;
  coherence
  proof
    (the Element of X)\/the Element of Y in UNION(X,Y) by SETFAM_1:def 4;
    hence thesis;
  end;
end;

registration
  let X,Y be finite set;
  cluster UNION(X,Y) -> finite;
  coherence
  proof
    per cases;
    suppose
A1:     X={} or Y={};
      UNION(X,Y) ={}
      proof
        assume UNION(X,Y)<>{};
        then consider xy be object such that
A2:       xy in UNION(X,Y) by XBOOLE_0:def 1;
        ex x,y be set st x in X & y in Y & xy = x\/y by A2,SETFAM_1:def 4;
        hence thesis by A1;
      end;
      hence thesis;
    end;
    suppose X<>{} & Y<>{};
      then reconsider X,Y as non empty finite set;
      deffunc F(set,set)=$1\/$2;
      set XY={F(u,v) where u is Element of X, v is Element of Y:
        u in X & v in Y };
A3:     UNION(X,Y) c= XY
      proof
        let xy be object;
        assume xy in UNION(X,Y);
        then ex x,y be set st x in X & y in Y & xy = x\/y by SETFAM_1:def 4;
        hence thesis;
      end;
A4:     X is finite;
A5:     Y is finite;
      XY is finite from FRAENKEL:sch 22(A4,A5);
      hence thesis by A3;
    end;
  end;
end;

theorem Th6:
  for X,Y be set holds UNION(bool X,bool Y)=bool(X\/Y)
proof
  let X,Y be set;
  thus UNION(bool X,bool Y) c= bool(X\/Y)
  proof
    let xy be object;
    assume xy in UNION(bool X,bool Y);
    then consider x,y be set such that
A1:   x in bool X & y in bool Y & xy = x\/y by SETFAM_1:def 4;
    x\/y c= X\/Y by A1,XBOOLE_1:13;
    hence thesis by A1;
  end;
  let x;
  reconsider A=x as set by TARSKI:1;
  assume x in bool(X\/Y);
  then
A2: A\X c= Y by XBOOLE_1:43;
  A/\X c= X by XBOOLE_1:17;
  then (A/\X)\/(A\X) in UNION(bool X,bool Y) by A2,SETFAM_1:def 4;
  hence thesis;
end;

theorem Th7:
  for X,Y1,Y2 be set holds UNION(X,Y1\/Y2) = UNION(X,Y1)\/UNION(X,Y2)
proof
  let X,Y1,Y2 be set;
  thus UNION(X,Y1\/Y2) c= UNION(X,Y1)\/UNION(X,Y2)
  proof
    let xy be object such that
A1:   xy in UNION(X,Y1\/Y2);
    consider x,y be set such that
A2:   x in X & y in Y1\/Y2 & xy=x\/y by A1,SETFAM_1:def 4;
    y in Y1 or y in Y2 by A2,XBOOLE_0:def 3;
    then xy in UNION(X,Y1) or xy in UNION(X,Y2) by A2,SETFAM_1:def 4;
    hence thesis by XBOOLE_0:def 3;
  end;
  let xy be object such that
A3: xy in UNION(X,Y1)\/UNION(X,Y2);
  per cases by A3,XBOOLE_0:def 3;
  suppose xy in UNION(X,Y1);
    then consider x,y be set such that
A4:   x in X & y in Y1 & xy=x\/y by SETFAM_1:def 4;
    y in Y1 \/Y2 by A4,XBOOLE_0:def 3;
    hence thesis by A4,SETFAM_1:def 4;
  end;
  suppose xy in UNION(X,Y2);
    then consider x,y be set such that
A5:   x in X & y in Y2 & xy=x\/y by SETFAM_1:def 4;
    y in Y1 \/Y2 by A5,XBOOLE_0:def 3;
    hence thesis by A5,SETFAM_1:def 4;
  end;
end;

theorem Th8:
  X misses union Y implies card UNION(Y,{X}) = card Y
proof
  assume
A1: X misses union Y;
  deffunc F(set)=$1\/X;
  consider f be Function such that
A2: dom f=Y & for A be set st A in Y holds f.A = F(A) from FUNCT_1:sch 5;
A3: rng f c= UNION(Y,{X})
  proof
    let y be object;
    assume y in rng f;
    then consider x such that
A4:   x in dom f & f.x =y by FUNCT_1:def 3;
    reconsider x as set by TARSKI:1;
    X in {X} by TARSKI:def 1;
    then F(x) in UNION(Y,{X}) by A2,A4,SETFAM_1:def 4;
    hence thesis by A4,A2;
  end;
  UNION(Y,{X}) c= rng f
  proof
    let xy be object;
    assume xy in UNION(Y,{X});
    then consider y,x be set such that
A5:   y in Y & x in {X} & xy=y\/x by SETFAM_1:def 4;
    x=X by A5,TARSKI:def 1;
    then f.y=xy by A5,A2;
    hence thesis by A2,A5,FUNCT_1:def 3;
  end;
  then
A6: UNION(Y,{X}) = rng f by A3;
  f is one-to-one
  proof
    let x,y such that
A7:   x in dom f & y in dom f & f.x=f.y;
    reconsider x,y as set by TARSKI:1;
A8:   x misses X & y misses X by A1,A2,A7,XBOOLE_1:63,ZFMISC_1:74;
    f.x=F(x) & f.y = F(y) by A7,A2;
    hence thesis by A7,A8,XBOOLE_1:71;
  end;
  hence thesis by A2,A6,CARD_1:5,WELLORD2:def 4;
end;

theorem Th9:
   m<>0 implies 2 * card bool (Seg m\{1}) = card bool (Seg (1+m)\{1})
proof
  assume A1:m<>0;
  set S = Seg (m)\{1},F= bool S;
  {} misses union F;
  then
A2: card UNION(F,{{}}) = card F by Th8;
  {m+1} misses union F
  proof
    assume {m+1} meets union F;
    then consider x such that
A3:   x in {m+1} & x in union F by XBOOLE_0:3;
    x=m+1 & x in S by A3,TARSKI:def 1;
    then m+1 in Seg m by XBOOLE_0:def 5;
    then m+1 <=m by FINSEQ_1:1;
    hence thesis by NAT_1:13;
  end;
  then
A4: card UNION(F,{{m+1}}) = card F by Th8;
  {{}}\/{{m+1}} = {{},{m+1}}=bool{m+1} by ENUMSET1:1,ZFMISC_1:24;
  then
A5: UNION(F,bool{m+1})
     = UNION(F,{{}}) \/ UNION(F,{{m+1}}) by Th7;
  UNION(F,{{}}) misses UNION(F,{{m+1}})
  proof
    assume UNION(F,{{}}) meets UNION(F,{{m+1}});
    then consider x such that
A6:  x in UNION(F,{{}}) & x in UNION(F,{{m+1}}) by XBOOLE_0:3;
    consider a,b be set such that
A7:  a in F & b in {{}} & x=a\/b by A6,SETFAM_1:def 4;
    consider c,d be set such that
A8:  c in F & d in {{m+1}} & x=c\/d by A6,SETFAM_1:def 4;
    b={} & m+1 in {m+1} =d by A7,A8,TARSKI:def 1;
    then m+1 in c\/d =a by A7,A8,XBOOLE_0:def 3;
    then m+1 in Seg m by A7,XBOOLE_0:def 5;
    then m+1 <=m by FINSEQ_1:1;
    hence thesis by NAT_1:13;
  end;
  then
A9: card UNION(F,bool{m+1}) = card UNION(F,{{}}) + card UNION(F,{{m+1}})
  by A5,CARD_2:40;
  1<>1+m by A1;
  then
A10: {1+m}\{1} = {1+m} by ZFMISC_1:14;
  Seg (1+m) = Seg (m) \/ {1+m} by FINSEQ_1:9;
  then Seg (1+m)\{1} = S \/ {1+m} by A10,XBOOLE_1:42;
  hence thesis by A2,A4,A9,Th6;
end;

begin :: Selected Operations on Set Families

definition
  let X be set,a,b be object;
  func Ext(X,a,b) -> set equals
    {A\/{b} where A is Element of X: a in A} \/
    {A      where A is Element of X: not a in A & A in X};
  coherence;
end;

definition
  let X be set,a,b be object;
  func swap(X,a,b) -> set equals
    {(A\{a})\/{b} where A is Element of X: a in A} \/
     {A\/{a}      where A is Element of X: not a in A & A in X};
  coherence;
end;

theorem Th10:
  not y in union Y implies
        card Y = card Ext(Y,x,y)
proof
  assume
A1: not y in union Y;
  set P ={X where X is Element of Y: x in X};
  set Py = {X\/{y} where X is Element of Y: x in X};
  set N ={X where X is Element of Y: not x in X & X in Y};
  deffunc F(set)=$1\/{y};
  consider f be Function such that
A2: dom f=P & for A be set st A in P holds f.A = F(A) from FUNCT_1:sch 5;
A3: rng f c= Py
  proof
    let a be object;
    assume a in rng f;
    then consider b such that
A4:   b in dom f & f.b=a by FUNCT_1:def 3;
    reconsider b as set by TARSKI:1;
    a = b\/{y} &ex X be Element of Y st b=X & x in X by A4,A2;
    hence thesis;
  end;
  Py c= rng f
  proof
    let a be object;
    assume a in Py;
    then consider X be Element of Y such that
A5:   a=X\/{y} & x in X;
A6:   X in P by A5;
    then f.X = a by A5,A2;
    hence thesis by A2,A6,FUNCT_1:def 3;
  end;
  then
A7: rng f = Py by A3;
  f is one-to-one
  proof
    let a,b be object such that
A8:   a in dom f & b in dom f & f.a=f.b;
    reconsider a,b as set by TARSKI:1;
A9:   f.a = a\/{y} & f.b = b\/{y} by A2,A8;
A10: (ex X be Element of Y st a=X & x in X)&
      ex X be Element of Y st b=X & x in X by A8,A2;
    then Y<>{} by SUBSET_1:def 1;
    then a c= union Y & b c= union Y by A10,ZFMISC_1:74;
    then {y} misses a & {y} misses b by A1,ZFMISC_1:50;
    hence thesis by A8,A9,XBOOLE_1:71;
  end;
  then
A11: P,Py are_equipotent by A2,A7,WELLORD2:def 4;
A12: P c= Y
  proof
    let a be object;
    assume a in P;
    then
A13:  ex X be Element of Y st a=X & x in X;
    then Y<>{} by SUBSET_1:def 1;
    hence thesis by A13;
  end;
A14: N c= Y
  proof
    let a be object;
    assume a in N;
    then ex X be Element of Y st a=X & not x in X & X in Y;
    hence thesis;
  end;
  Y c= N \/ P
  proof
    let a be object;
    assume
A15:  a in Y;
    then reconsider a as Element of Y;
    x in a or not x in a;
    then a in P or a in N by A15;
    hence thesis by XBOOLE_0:def 3;
  end;
  then
A16: Y = N \/P by A12,A14,XBOOLE_1:8;
A17: N misses Py
  proof
    assume N meets Py;
    then consider a be object such that
A18:  a in N/\Py by XBOOLE_0:4;
    a in N by A18,XBOOLE_0:def 4;
    then consider A be Element of Y such that
A19:  a=A & not x in A & A in Y;
    a in Py by A18,XBOOLE_0:def 4;
    then ex B be Element of Y st a=B\/{y} & x in B;
    hence thesis by A19,XBOOLE_0:def 3;
  end;
  N misses P
  proof
    assume N meets P;
    then consider a be object such that
A20:  a in N/\P by XBOOLE_0:4;
    a in N by A20,XBOOLE_0:def 4;
    then consider A be Element of Y such that
A21:  a=A & not x in A & A in Y;
    a in P by A20,XBOOLE_0:def 4;
    then ex B be Element of Y st a=B & x in B;
    hence thesis by A21;
  end;
  hence thesis by A17,A11,A16,CARD_1:5,31;
end;

theorem Th11:
  not y in union Y implies
       card Y = card swap(Y,x,y)
proof
  assume
A1: not y in union Y;
  set P ={X where X is Element of Y: x in X};
  set Py = {(X\{x})\/{y} where X is Element of Y: x in X};
  set N ={X where X is Element of Y: not x in X & X in Y};
  set Nx ={X\/{x} where X is Element of Y: not x in X & X in Y};
  deffunc F(set)=($1\{x})\/{y};
  consider f be Function such that
A2: dom f=P & for A be set st A in P holds f.A = F(A)
    from FUNCT_1:sch 5;
A3: rng f c= Py
  proof
    let a be object;
    assume a in rng f;
    then consider b such that
A4:   b in dom f & f.b=a by FUNCT_1:def 3;
    reconsider b as set by TARSKI:1;
    a = (b\{x})\/{y} &ex X be Element of Y st b=X & x in X by A4,A2;
    hence thesis;
  end;
  Py c= rng f
  proof
    let a be object;
    assume a in Py;
    then consider X be Element of Y such that
A5:   a=(X\{x})\/{y} & x in X;
A6:   X in P by A5;
    then f.X = a by A5,A2;
    hence thesis by A2,A6,FUNCT_1:def 3;
  end;
  then
A7: rng f = Py by A3;
  f is one-to-one
  proof
    let a,b be object such that
A8:   a in dom f & b in dom f & f.a=f.b;
    reconsider a,b as set by TARSKI:1;
A9:   f.a = (a\{x})\/{y} & f.b = (b\{x})\/{y} by A2,A8;
A10: (ex X be Element of Y st a=X & x in X)&
      ex X be Element of Y st b=X & x in X by A8,A2;
    then Y<>{} by SUBSET_1:def 1;
    then a c= union Y & b c= union Y & x in a & x in b by A10,ZFMISC_1:74;
    then {y} misses a & {y} misses b by A1,ZFMISC_1:50;
    then {y} misses a\{x} & {y} misses b\{x} by XBOOLE_1:80;
    then a\{x} = b\{x} by A8,A9,XBOOLE_1:71;
    then a = a\{x}\/{x} = b by A10,ZFMISC_1:116;
    hence thesis;
  end;
  then
A11: P,Py are_equipotent by A2,A7,WELLORD2:def 4;
  deffunc G(set)=$1\/{x};
  consider g be Function such that
A12: dom g=N & for A be set st A in N holds g.A = G(A) from FUNCT_1:sch 5;
A13: rng g c= Nx
  proof
    let a be object;
    assume a in rng g;
    then consider b such that
A14:  b in dom g & g.b=a by FUNCT_1:def 3;
    reconsider b as set by TARSKI:1;
    a = b\/{x} &ex X be Element of Y st b=X & not x in X & X in Y by A14,A12;
    hence thesis;
  end;
  Nx c= rng g
  proof
    let a be object;
    assume a in Nx;
    then consider X be Element of Y such that
A15:  a=X\/{x} & not x in X & X in Y;
A16:  X in N by A15;
    then g.X = a by A15,A12;
    hence thesis by A12,A16,FUNCT_1:def 3;
  end;
  then
A17: rng g = Nx by A13;
  g is one-to-one
  proof
    let a,b be object such that
A18:  a in dom g & b in dom g & g.a=g.b;
    reconsider a,b as set by TARSKI:1;
A19:  g.a = a\/{x} & g.b = b\/{x} by A12,A18;
    (ex X be Element of Y st a=X & not x in X & X in Y)&
      ex X be Element of Y st b=X & not x in X & X in Y by A18,A12;
    then {x} misses a & {x} misses b by ZFMISC_1:50;
    hence thesis by A18,A19,XBOOLE_1:71;
  end;
  then
A20: N,Nx are_equipotent by A12,A17,WELLORD2:def 4;
A21: P c= Y
  proof
    let a be object;
    assume a in P;
    then
A22:  ex X be Element of Y st a=X & x in X;
    then Y<>{} by SUBSET_1:def 1;
    hence thesis by A22;
  end;
A23: N c= Y
  proof
    let a be object;
    assume a in N;
    then ex X be Element of Y st a=X & not x in X & X in Y;
    hence thesis;
  end;
  Y c= N \/ P
  proof
    let a be object;
    assume
A24:  a in Y;
    then reconsider a as Element of Y;
    x in a or not x in a;
    then a in P or a in N by A24;
    hence thesis by XBOOLE_0:def 3;
  end;
  then
A25: Y = N \/P by A21,A23,XBOOLE_1:8;
A26: Nx misses Py
  proof
    assume Nx meets Py;
    then consider a be object such that
A27:  a in Nx/\Py by XBOOLE_0:4;
    a in Nx by A27,XBOOLE_0:def 4;
    then consider A be Element of Y such that
A28:  a=A\/{x} & not x in A & A in Y;
    a in Py by A27,XBOOLE_0:def 4;
    then consider B be Element of Y such that
A29:  a=(B\{x})\/{y} & x in B;
A30:  x in union Y by A28,A29,TARSKI:def 4;
    x in {x} by TARSKI:def 1;
    then x in (B\{x})\/{y} by A28,A29,XBOOLE_0:def 3;
    then x in (B\{x}) or x in {y} by XBOOLE_0:def 3;
    hence thesis by A30,A1,TARSKI:def 1,ZFMISC_1:56;
  end;
  N misses P
  proof
    assume N meets P;
    then consider a be object such that
A31:  a in N/\P by XBOOLE_0:4;
    a in N by A31,XBOOLE_0:def 4;
    then consider A be Element of Y such that
A32:  a=A & not x in A & A in Y;
    a in P by A31,XBOOLE_0:def 4;
    then ex B be Element of Y st a=B & x in B;
    hence thesis by A32;
  end;
  hence thesis by A26,A11,A20,A25,CARD_1:5,31;
end;

theorem Th12:
  swap({},x,y)={}
proof
  assume swap({},x,y)<>{};
  then consider a be object such that
A1: a in swap({},x,y) by XBOOLE_0:def 1;
  per cases by A1,XBOOLE_0:def 3;
  suppose a in {(A\{x})\/{y} where A is Element of {}: x in A};
    then ex A be Element of {} st a =(A\{x})\/{y} & x in A;
    hence thesis by SUBSET_1:def 1;
  end;
  suppose a in {A\/{x} where A is Element of {}: not x in A & A in {}};
    then ex A be Element of {} st a =A\/{x} & not x in A & A in {};
    hence thesis;
  end;
end;

theorem Th13:
  swap(X\/Y,x,y)=swap(X,x,y)\/swap(Y,x,y)
proof
  thus swap(X\/Y,x,y) c= swap(X,x,y)\/swap(Y,x,y)
  proof
    let a be object;
    assume a in swap(X\/Y,x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {(A\{x})\/{y} where A is Element of X\/Y: x in A};
      then consider A be Element of X\/Y such that
A1:     a =(A\{x})\/{y} & x in A;
      X\/Y <>{} by A1,SUBSET_1:def 1;
      then A in X or A in Y by XBOOLE_0:def 3;
      then a in {(A\{x})\/{y} where A is Element of X: x in A} or
      a in {(A\{x})\/{y} where A is Element of Y: x in A} by A1;
      then a in swap(X,x,y) or a in swap(Y,x,y) by XBOOLE_0:def 3;
      hence thesis by XBOOLE_0:def 3;
    end;
    suppose a in {A\/{x} where A is Element of X\/Y :
      not x in A & A in X\/Y};
      then consider A be Element of X\/Y such that
A2:     a =A\/{x} & not x in A & A in X\/Y;
      A in X or A in Y by A2,XBOOLE_0:def 3;
      then a in {A\/{x} where A is Element of X: not x in A & A in X} or
      a in {A\/{x} where A is Element of Y: not x in A & A in Y} by A2;
      then a in swap(X,x,y) or a in swap(Y,x,y) by XBOOLE_0:def 3;
      hence thesis by XBOOLE_0:def 3;
    end;
  end;
A3: swap(X,x,y) c= swap(X\/Y,x,y)
  proof
    let a be object;
    assume a in swap(X,x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {(A\{x})\/{y} where A is Element of X: x in A};
      then consider A be Element of X such that
A4:     a =(A\{x})\/{y} & x in A;
      X<>{} by A4,SUBSET_1:def 1;
      then A in X\/Y by XBOOLE_0:def 3;
      then a in {(A\{x})\/{y} where A is Element of X\/Y: x in A} by A4;
      hence thesis by XBOOLE_0:def 3;
    end;
    suppose a in {A\/{x} where A is Element of X : not x in A & A in X};
      then consider A be Element of X such that
A5:     a =A\/{x} & not x in A & A in X;
      A in X\/Y by A5,XBOOLE_0:def 3;
      then a in {A\/{x} where A is Element of X\/Y: not x in A & A in X\/Y}
        by A5;
      hence thesis by XBOOLE_0:def 3;
    end;
  end;
  swap(Y,x,y) c= swap(X\/Y,x,y)
  proof
    let a be object;
    assume a in swap(Y,x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {(A\{x})\/{y} where A is Element of Y: x in A};
      then consider A be Element of Y such that
A6:     a =(A\{x})\/{y} & x in A;
      Y<>{} by A6,SUBSET_1:def 1;
      then A in X\/Y by XBOOLE_0:def 3;
      then a in {(A\{x})\/{y} where A is Element of X\/Y: x in A} by A6;
      hence thesis by XBOOLE_0:def 3;
    end;
    suppose a in {A\/{x} where A is Element of Y : not x in A & A in Y};
      then consider A be Element of Y such that
A7:     a =A\/{x} & not x in A & A in Y;
      A in X\/Y by A7,XBOOLE_0:def 3;
      then a in {A\/{x} where A is Element of X\/Y: not x in A & A in X\/Y}
        by A7;
      hence thesis by XBOOLE_0:def 3;
    end;
  end;
  hence thesis by A3,XBOOLE_1:8;
end;

theorem Th14:
  Y in swap(X,x,y) & x<>y & not y in union X implies (x in Y iff not y in Y)
proof
  assume
A1: Y in swap(X,x,y) & x<>y & not y in union X;
  then per cases by XBOOLE_0:def 3;
  suppose Y in {(A\{x})\/{y} where A is Element of X: x in A};
    then consider A be Element of X such that
A2:   Y =(A\{x})\/{y} & x in A;
    hereby assume x in Y;
      then x in A\{x} by A2,A1,ZFMISC_1:136;
      hence not y in Y by ZFMISC_1:56;
    end;
    thus thesis by A2,ZFMISC_1:136;
  end;
  suppose Y in {A\/{x} where A is Element of X : not x in A & A in X};
    then consider A be Element of X such that
A3:   Y =A\/{x} & not x in A & A in X;
    not y in A by A1,A3,TARSKI:def 4;
    hence thesis by A3,A1,ZFMISC_1:136;
  end;
end;

theorem
  Ext({},x,y)={}
proof
  assume Ext({},x,y)<>{};
  then consider a be object such that
A1: a in Ext({},x,y) by XBOOLE_0:def 1;
  per cases by A1,XBOOLE_0:def 3;
  suppose a in {A\/{y} where A is Element of {}: x in A};
    then ex A be Element of {} st a =A\/{y} & x in A;
    hence thesis by SUBSET_1:def 1;
  end;
  suppose a in {A where A is Element of {}: not x in A & A in {}};
    then ex A be Element of {} st a =A & not x in A & A in {};
    hence thesis;
  end;
end;

theorem Th16:
  Ext(X\/Y,x,y)=Ext(X,x,y)\/Ext(Y,x,y)
proof
  thus Ext(X\/Y,x,y) c= Ext(X,x,y)\/Ext(Y,x,y)
  proof
    let a be object;
    assume a in Ext(X\/Y,x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {A\/{y} where A is Element of X\/Y: x in A};
      then consider A be Element of X\/Y such that
A1:     a =A\/{y} & x in A;
      X\/Y <>{} by A1,SUBSET_1:def 1;
      then A in X or A in Y by XBOOLE_0:def 3;
      then a in {A\/{y} where A is Element of X: x in A} or
      a in {A\/{y} where A is Element of Y: x in A} by A1;
      then a in Ext(X,x,y) or a in Ext(Y,x,y) by XBOOLE_0:def 3;
      hence thesis by XBOOLE_0:def 3;
    end;
    suppose a in {A where A is Element of X\/Y : not x in A & A in X\/Y};
      then consider A be Element of X\/Y such that
A2:     a =A & not x in A & A in X\/Y;
      A in X or A in Y by A2,XBOOLE_0:def 3;
      then a in {A where A is Element of X: not x in A & A in X} or
      a in {A where A is Element of Y: not x in A & A in Y} by A2;
      then a in Ext(X,x,y) or a in Ext(Y,x,y) by XBOOLE_0:def 3;
      hence thesis by XBOOLE_0:def 3;
    end;
  end;
A3:  Ext(X,x,y) c= Ext(X\/Y,x,y)
  proof
    let a be object;
    assume a in Ext(X,x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {A\/{y} where A is Element of X: x in A};
      then consider A be Element of X such that
A4:     a =A\/{y} & x in A;
      X<>{} by A4,SUBSET_1:def 1;
      then A in X\/Y by XBOOLE_0:def 3;
      then a in {A\/{y} where A is Element of X\/Y: x in A} by A4;
      hence thesis by XBOOLE_0:def 3;
    end;
    suppose a in {A where A is Element of X : not x in A & A in X};
      then consider A be Element of X such that
A5:     a =A & not x in A & A in X;
      A in X\/Y by A5,XBOOLE_0:def 3;
      then a in {A where A is Element of X\/Y: not x in A & A in X\/Y} by A5;
      hence thesis by XBOOLE_0:def 3;
    end;
  end;
  Ext(Y,x,y) c= Ext(X\/Y,x,y)
  proof
    let a be object;
    assume a in Ext(Y,x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {A\/{y} where A is Element of Y: x in A};
      then consider A be Element of Y such that
A6:     a =A\/{y} & x in A;
      Y<>{} by A6,SUBSET_1:def 1;
      then A in X\/Y by XBOOLE_0:def 3;
      then a in {A\/{y} where A is Element of X\/Y: x in A} by A6;
      hence thesis by XBOOLE_0:def 3;
    end;
    suppose a in {A where A is Element of Y : not x in A & A in Y};
      then consider A be Element of Y such that
A7:     a =A & not x in A & A in Y;
      A in X\/Y by A7,XBOOLE_0:def 3;
      then a in {A where A is Element of X\/Y: not x in A & A in X\/Y} by A7;
      hence thesis by XBOOLE_0:def 3;
    end;
  end;
  hence thesis by A3,XBOOLE_1:8;
end;

theorem Th17:
  Y in Ext(X,x,y) & not y in union X implies (x in Y iff y in Y)
proof
  assume that
A1: Y in Ext(X,x,y) and
A2:  not y in union X;
  per cases by A1,XBOOLE_0:def 3;
  suppose Y in {A\/{y} where A is Element of X: x in A};
    then ex A be Element of X st Y =A\/{y} & x in A;
    hence thesis by ZFMISC_1:136;
  end;
  suppose Y in {A where A is Element of X : not x in A & A in X};
    then ex A be Element of X st
    Y=A & not x in A & A in X;
    hence thesis by A2,TARSKI:def 4;
  end;
end;

registration
  let X be finite set,a,b be object;
  cluster swap(X,a,b)->finite;
  coherence
  proof
A1:   X is finite;
    deffunc F(set)=($1 \{a})\/{b};
    deffunc G(set)=$1 \/{a};
    set FF={ F(w) where w is Element of X: w in X },
        GG={ G(w) where w is Element of X: w in X };
A2:   swap(X,a,b) c= FF\/GG
    proof
      let y be object;
      assume y in swap(X,a,b);
      then per cases by XBOOLE_0:def 3;
      suppose y in {(A\{a})\/{b} where A is Element of X: a in A};
        then
A3:       ex A be Element of X st y = (A\{a})\/{b} & a in A;
        then X<>{} by SUBSET_1:def 1;
        then y in FF by A3;
        hence thesis by XBOOLE_0:def 3;
      end;
      suppose y in {A\/{a} where A is Element of X: not a in A & A in X};
        then
A4:       ex A be Element of X st y=A\/{a} & not a in A & A in X;
        y in GG by A4;
        hence thesis by XBOOLE_0:def 3;
      end;
    end;
A5:   FF is finite from FRAENKEL:sch 21(A1);
    GG is finite from FRAENKEL:sch 21(A1);
    hence thesis by A5,A2;
  end;
  cluster Ext(X,a,b)->finite;
  coherence
  proof
A6:   X is finite;
    deffunc F(set)=$1\/{b};
    deffunc G(set)=$1;
    set FF={ F(w) where w is Element of X: w in X },
        GG={ G(w) where w is Element of X: w in X };
A7: Ext(X,a,b) c= FF\/GG
    proof
      let y be object;
      assume y in Ext(X,a,b);
      then per cases by XBOOLE_0:def 3;
      suppose y in {A\/{b} where A is Element of X: a in A};
        then
A8:       ex A be Element of X st y = A\/{b} & a in A;
        then X<>{} by SUBSET_1:def 1;
        then y in FF by A8;
        hence thesis by XBOOLE_0:def 3;
      end;
      suppose y in {A where A is Element of X: not a in A & A in X};
        then
A9:       ex A be Element of X st y=A & not a in A & A in X;
        y in GG by A9;
        hence thesis by XBOOLE_0:def 3;
      end;
    end;
A10:  FF is finite from FRAENKEL:sch 21(A6);
    GG is finite from FRAENKEL:sch 21(A6);
    hence thesis by A10,A7;
  end;
end;

definition
  let f be Function,a,b be object;
  func Swap(f,a,b) -> Function means :Def4:
    dom it = dom f &
    for x st x in dom f holds
     (    a in f.x implies it.x = ((f.x)\{a} )\/{b}) &
     (not a in f.x implies it.x = (f.x)\/{a} );
  existence
  proof
    defpred P[object,object] means
      (a in f.$1 implies $2 = ((f.$1)\{a} )\/{b}) &
      (not a in f.$1 implies $2 = (f.$1)\/{a});
A1:   for e being object st e in dom f ex u being object st P[e,u]
    proof
      let e be object;
      a in f.e or (not a in f.e);
      hence thesis;
    end;
    consider s be Function such that
A2:   dom s = dom f & for e being object st e in dom f holds P[e,s.e]
      from CLASSES1:sch 1(A1);
    take s;
    thus thesis by A2;
  end;
  uniqueness
  proof
    let S1,S2 be Function such that
A3: dom S1 = dom f &
    for x st x in dom f holds
    (    a in f.x implies S1.x = ((f.x)\{a} )\/{b}) &
    (not a in f.x implies S1.x = (f.x)\/{a} ) and
A4: dom S2 = dom f &
    for x st x in dom f holds
    (    a in f.x implies S2.x = ((f.x)\{a} )\/{b}) &
    (not a in f.x implies S2.x = (f.x)\/{a} );
    for x st x in dom S1 holds S1.x = S2.x
    proof
      let x such that
A5:     x in dom S1;
      per cases;
      suppose a in f.x;
        then S1.x = ((f.x)\{a} )\/{b}=S2.x by A3,A4,A5;
        hence thesis;
      end;
      suppose not a in f.x;
        then S1.x = (f.x)\/{a}=S2.x by A3,A4,A5;
        hence thesis;
      end;
    end;
    hence thesis by A3,A4;
  end;
end;

definition
  let f be Function,a,b be object;
  func Ext(f,a,b) -> Function means :Def5:
    dom it = dom f &
    for x st x in dom f holds
     (    a in f.x implies it.x = (f.x)\/{b} ) &
     (not a in f.x implies it.x = (f.x) );
  existence
  proof
    defpred P[object,object] means
    (a in f.$1 implies $2 = (f.$1)\/{b} ) &
    (not a in f.$1 implies $2 = f.$1);
A1: for e being object st e in dom f ex u being object st P[e,u]
    proof
      let e be object;
      a in f.e or (not a in f.e);
      hence thesis;
    end;
    consider s be Function such that
A2:   dom s = dom f &
    for e being object st e in dom f holds P[e,s.e] from CLASSES1:sch 1(A1);
    take s;
    thus thesis by A2;
  end;
  uniqueness
  proof
    let S1,S2 be Function such that
A3: dom S1 = dom f &
    for x st x in dom f holds
    (    a in f.x implies S1.x = (f.x)\/{b} ) &
    (not a in f.x implies S1.x = (f.x) )
    and
A4: dom S2 = dom f &
    for x st x in dom f holds
    (    a in f.x implies S2.x = (f.x)\/{b} ) &
    (not a in f.x implies S2.x = (f.x) );
    for x st x in dom S1 holds S1.x = S2.x
    proof
      let x such that
A5:     x in dom S1;
      per cases;
      suppose a in f.x;
        then S1.x = (f.x)\/{b}=S2.x by A3,A4,A5;
        hence thesis;
      end;
      suppose not a in f.x;
        then S1.x = f.x =S2.x by A3,A4,A5;
        hence thesis;
      end;
    end;
    hence thesis by A3,A4;
  end;
end;


registration
  let f be FinSequence,a,b be object;
  cluster Swap(f,a,b) -> (len f)-element FinSequence-like;
  coherence
  proof
A1:   dom Swap(f,a,b) = dom f = Seg len f by Def4,FINSEQ_1:def 3;
    then reconsider S = Swap(f,a,b) as FinSequence by FINSEQ_1:def 2;
    len S = len f by A1,FINSEQ_3:29;
    hence thesis by CARD_1:def 7;
  end;
  cluster Ext(f,a,b) -> (len f)-element FinSequence-like;
  coherence
  proof
A2:   dom Ext(f,a,b) = dom f = Seg len f by Def5,FINSEQ_1:def 3;
    then reconsider E = Ext(f,a,b) as FinSequence by FINSEQ_1:def 2;
    len E = len f by A2,FINSEQ_3:29;
    hence thesis by CARD_1:def 7;
  end;
end;

theorem Th18:
  for f,g be FinSequence holds
    Swap(f^g,a,b) = Swap(f,a,b)^Swap(g,a,b)
proof
  let f,g be FinSequence;
  set Sf=Swap(f,a,b),Sg=Swap(g,a,b),Sfg=Swap(f^g,a,b);
A1: len Sf = len f & len Sg=len g & len Sfg = len (f^g) by CARD_1:def 7;
A2: len (Sf^Sg) = len Sf + len Sg & len (f^g)=len f+len g by FINSEQ_1:22;
  for k st 1 <= k & k <= len Sfg holds Sfg.k = (Sf^Sg).k
  proof
    let k such that
A3:   1 <= k & k <= len Sfg;
A4:   k in dom (f^g) by A3,A1,FINSEQ_3:25; then
    per cases by FINSEQ_1:25;
    suppose
A5:     k in dom f;
      then
A6:     f.k = (f^g).k by FINSEQ_1:def 7;
A7:     dom f c= dom (f^g) by FINSEQ_1:26;
      k in dom Sf by A5,Def4;
      then
A8:     (Sf^Sg).k = Sf.k by FINSEQ_1:def 7;
      per cases;
      suppose
A9:       a in f.k;
        hence (Sf^Sg).k = ((f.k)\{a}) \/ {b} by A8,A5,Def4
        .= Sfg.k by A6,A9,A7,A5,Def4;
      end;
      suppose
A10:    not a in f.k;
        hence (Sf^Sg).k = (f.k) \/ {a} by A8,A5,Def4
        .= Sfg.k by A6,A10,A7,A5,Def4;
      end;
    end;
    suppose ex n st n in dom g & k = len f+n;
      then consider n such that
A11:    n in dom g & k = len f+n;
A12:    g.n = (f^g).k by A11,FINSEQ_1:def 7;
      n in dom Sg by A11,Def4;
      then
A13:    (Sf^Sg).k = Sg.n by A11,A1,FINSEQ_1:def 7;
      per cases;
      suppose
A14:      a in g.n;
        hence (Sf^Sg).k = ((g.n)\{a}) \/ {b} by A13,A11,Def4
        .= Sfg.k by A12,A14,A4,Def4;
      end;
      suppose
A15:    not a in g.n;
        hence (Sf^Sg).k = (g.n) \/ {a} by A13,A11,Def4
        .= Sfg.k by A12,A15,A4,Def4;
      end;
    end;
  end;
  hence thesis by A2,A1;
end;

theorem Th19:
  for f,g be FinSequence holds
    Ext(f^g,a,b) = Ext(f,a,b)^Ext(g,a,b)
proof
  let f,g be FinSequence;
  set Ef=Ext(f,a,b),Eg=Ext(g,a,b),Efg=Ext(f^g,a,b);
A1: len Ef = len f & len Eg=len g & len Efg = len (f^g) by CARD_1:def 7;
A2: len (Ef^Eg) = len Ef + len Eg & len (f^g)=len f+len g by FINSEQ_1:22;
  for k st 1 <= k & k <= len Efg holds Efg.k = (Ef^Eg).k
  proof
    let k such that
A3:  1 <= k & k <= len Efg;
A4:  k in dom (f^g) by A3,A1,FINSEQ_3:25;
    per cases by A4,FINSEQ_1:25;
    suppose
A5:     k in dom f;
      then
A6:     f.k = (f^g).k by FINSEQ_1:def 7;
A7:     dom f c= dom (f^g) by FINSEQ_1:26;
      k in dom Ef by A5,Def5;
      then
A8:     (Ef^Eg).k = Ef.k by FINSEQ_1:def 7;
      per cases;
      suppose
A9:       a in f.k;
        hence (Ef^Eg).k = (f.k)\/ {b} by A8,A5,Def5
        .= Efg.k by A6,A9,A7,A5,Def5;
      end;
      suppose
A10:      not a in f.k;
        hence (Ef^Eg).k = f.k by A8,A5,Def5
        .= Efg.k by A6,A10,A7,A5,Def5;
      end;
    end;
    suppose ex n st n in dom g & k = len f+n;
      then consider n such that
A11:    n in dom g & k = len f+n;
A12:    g.n = (f^g).k by A11,FINSEQ_1:def 7;
      n in dom Eg by A11,Def5;
      then
A13:    (Ef^Eg).k = Eg.n by A11,A1,FINSEQ_1:def 7;
      per cases;
      suppose
A14:      a in g.n;
        hence (Ef^Eg).k = (g.n) \/ {b} by A13,A11,Def5
        .= Efg.k by A12,A14,A4,Def5;
      end;
      suppose
A15:      not a in g.n;
        hence (Ef^Eg).k = (g.n) by A13,A11,Def5
        .= Efg.k by A12,A15,A4,Def5;
      end;
    end;
  end;
  hence thesis by A2,A1;
end;

theorem Th20:
  for f be Function st b<>x & b <> y holds
    b in Ext(f,x,y).a iff b in f.a
proof
  let f be Function such that
A1: b<>x & b <> y;
  thus b in Ext(f,x,y).a implies b in f.a
  proof
    assume
A2:   b in Ext(f,x,y).a;
    then a in dom Ext(f,x,y) by FUNCT_1:def 2;
    then
A3:   a in dom f by Def5;
    per cases;
    suppose x in f.a;
      then Ext(f,x,y).a = (f.a)\/{y} by Def5,A3;
      hence thesis by A2,A1,ZFMISC_1:136;
    end;
    suppose not x in f.a;
      hence thesis by A2,A3,Def5;
    end;
  end;
  assume
A4: b in f.a;
  then
A5: a in dom f by FUNCT_1:def 2;
  per cases;
  suppose x in f.a;
    then Ext(f,x,y).a = (f.a)\/{y} by Def5,A5;
    hence thesis by A4,XBOOLE_0:def 3;
  end;
  suppose not x in f.a;
    hence thesis by A4,A5,Def5;
  end;
end;

theorem Th21:
  for f be Function st b<>x & b <> y holds
    b in Swap(f,x,y).a iff b in f.a
proof
  let f be Function such that
A1: b<>x & b <> y;
  thus b in Swap(f,x,y).a implies b in f.a
  proof
    assume
A2:   b in Swap(f,x,y).a;
    then a in dom Swap(f,x,y) by FUNCT_1:def 2;
    then
A3:   a in dom f by Def4;
    per cases;
    suppose x in f.a;
      then Swap(f,x,y).a = ((f.a)\{x} )\/{y} by Def4,A3;
      then b in ((f.a)\{x} ) by A2,A1,ZFMISC_1:136;
      hence thesis;
    end;
    suppose not x in f.a;
      then Swap(f,x,y).a = (f.a)\/{x} by A3,Def4;
      hence thesis by A2,A1,ZFMISC_1:136;
    end;
  end;
  assume
A4: b in f.a;
  then
A5: a in dom f by FUNCT_1:def 2;
  b in (f.a)\{x} by A4,A1,ZFMISC_1:56;
  then
A6: b in ((f.a)\{x} )\/{y} by XBOOLE_0:def 3;
  per cases;
  suppose  x in f.a;
    hence thesis by A6,Def4,A5;
  end;
  suppose not x in f.a;
    then Swap(f,x,y).a = (f.a)\/{x} by A5,Def4;
    hence thesis by A4,ZFMISC_1:136;
  end;
end;

theorem Th22:
  x<>y & not y in union X & not y in union Y  implies
    Ext(X,x,y) misses swap(Y,x,y)
proof
  assume
A1: x<>y & not y in union X & not y in union Y;
  assume Ext(X,x,y) meets swap(Y,x,y);
  then consider a be object such that
A2: a in Ext(X,x,y) & a in swap(Y,x,y) by XBOOLE_0:3;
  reconsider a as set by TARSKI:1;
  x in a iff not y in a by A2,A1,Th14;
  hence thesis by A2,A1,Th17;
end;

theorem Th23:
  for f,g be Function holds Swap(f,x,y)*g = Swap(f*g,x,y)
proof
  let f,g be Function;set S=Swap(f,x,y),Sg=Swap(f*g,x,y);
A1: dom S = dom f & dom Sg = dom (f*g) by Def4;
A2: dom (S*g) c= dom (f*g)
  proof
    let a be object;
    assume a in dom (S*g);
    then a in dom g & g.a in dom S by FUNCT_1:11;
    hence thesis by A1,FUNCT_1:11;
  end;
  dom (f*g) c= dom (S*g)
  proof
    let a be object;assume a in dom (f*g);
    then a in dom g & g.a in dom f by FUNCT_1:11;
    hence thesis by A1,FUNCT_1:11;
  end;
  then
A3: dom Sg = dom (S*g) by A2,Def4;
  for a st a in dom Sg holds Sg.a = (S*g).a
  proof
    let a such that
A4:   a in dom Sg;
A5:   a in dom (f*g) by A4,Def4;
    then
A6:   (f*g).a = f.(g.a) by FUNCT_1:12;
A7:   (S*g).a = S.(g.a) & g.a in dom S by A4,A3,FUNCT_1:11,12;
    per cases;
    suppose
A8:     x in (f*g).a;
      then Sg.a = (((f*g).a)\{x})\/{y} by A5,Def4;
      hence thesis by A6,A7,A8,A1,Def4;
    end;
    suppose
A9:     not x in (f*g).a;
      then Sg.a = ((f*g).a)\/{x} by A5,Def4;
      hence thesis by A9,A6,A7,A1,Def4;
    end;
  end;
  hence thesis by A3;
end;

theorem Th24:
  for f be Function holds Swap(f,x,y)|X = Swap(f|X,x,y)
proof
  let f be Function;
  thus Swap(f,x,y)|X = Swap(f,x,y)*(id X) by RELAT_1:65
  .=Swap(f*(id X),x,y) by Th23
  .=Swap(f|X,x,y) by RELAT_1:65;
end;

theorem Th25:
  for f,g be Function holds Ext(f,x,y)*g = Ext(f*g,x,y)
proof
  let f,g be Function;set E=Ext(f,x,y),Eg=Ext(f*g,x,y);
A1: dom E = dom f & dom Eg = dom (f*g) by Def5;
A2: dom (E*g) c= dom (f*g)
  proof
    let a be object;
    assume a in dom (E*g);
    then a in dom g & g.a in dom E by FUNCT_1:11;
    hence thesis by A1,FUNCT_1:11;
  end;
  dom (f*g) c= dom (E*g)
  proof
    let a be object;
    assume a in dom (f*g);
    then a in dom g & g.a in dom f by FUNCT_1:11;
    hence thesis by A1,FUNCT_1:11;
  end;
  then
A3: dom Eg = dom (E*g) by A2,Def5;
  for a st a in dom Eg holds Eg.a = (E*g).a
  proof
    let a such that
A4:   a in dom Eg;
A5:   a in dom (f*g) by A4,Def5;
    then
A6:   (f*g).a = f.(g.a) by FUNCT_1:12;
A7:   (E*g).a = E.(g.a) & g.a in dom E by A4,A3,FUNCT_1:11,12;
    per cases;
    suppose
A8:     x in (f*g).a;
      then Eg.a = ((f*g).a)\/{y} by A5,Def5;
      hence thesis by A8,A6,A7,A1,Def5;
    end;
    suppose
A9:     not x in (f*g).a;
      then Eg.a = (f*g).a by A5,Def5;
      hence thesis by A9,A6,A7,A1,Def5;
    end;end;
    hence thesis by A3;
  end;

theorem Th26:
  for f be Function holds Ext(f,x,y)|X = Ext(f|X,x,y)
proof
  let f be Function;
  thus  Ext(f,x,y)|X = Ext(f,x,y)*(id X) by RELAT_1:65
  .=Ext(f*(id X),x,y) by Th25
  .=Ext(f|X,x,y) by RELAT_1:65;
end;

registration
  let X be finite set;
  cluster -> card X -element X-valued for Enumeration of X;
  coherence
  proof
    let E be Enumeration of X;
A1:   rng E=X by RLAFFIN3:def 1;
    Seg len E = dom E by FINSEQ_1:def 3;
    then len E = card dom E;
    hence thesis by A1,CARD_1:70,def 7,RELAT_1:def 19;
  end;
end;

theorem Th27:
  for F be finite set
  for E be Enumeration of F st  not y in union F  holds
    Swap(E,x,y) is  Enumeration of swap(F,x,y)
proof
let F be finite set;

  let E be Enumeration of F such that A1: not y in union F;
set S=Swap(E,x,y);
A2: dom S = dom E = Seg len E by Def4,FINSEQ_1:def 3;
A3: rng E=F by RLAFFIN3:def 1;
A4: rng S c= swap(F,x,y)
  proof
    let a be object;
    assume a in rng S;
    then consider c be object such that
A5:   c in dom S & S.c = a by FUNCT_1:def 3;
A6:   E.c in rng E by A5,A2,FUNCT_1:def 3;
    per cases;
    suppose
A7:     x in E.c;
      then S.c = ((E.c)\{x})\/{y} by A5,A2,Def4;
      then S.c in {(A\{x})\/{y} where A is Element of F: x in A} by A7,A6;
      hence thesis by A5,XBOOLE_0:def 3;
    end;
    suppose
A8:     not x in E.c;
      then S.c = ((E.c)\/{x}) by A5,A2,Def4;
      then S.c in {A\/{x} where A is Element of F: not x in A & A in F}
        by A8,A6;
      hence thesis by A5,XBOOLE_0:def 3;
    end;
  end;
  swap(F,x,y) c= rng S
  proof
    let a be object;
    assume a in swap(F,x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {(A\{x})\/{y} where A is Element of F: x in A};
      then consider A be Element of F such that
A9:     a = (A\{x})\/{y} & x in A;
      F<>{} by A9,SUBSET_1:def 1;then
      consider b be object such that
A10:    b in dom E & E.b = A by A3,FUNCT_1:def 3;
      S.b = ((E.b)\{x})\/{y} by Def4,A9,A10;
      hence thesis by A9,A10,A2,FUNCT_1:def 3;
    end;
    suppose a in {A\/{x} where A is Element of F: not x in A & A in F};
      then consider A be Element of F such that
A11:    a = A\/{x} & not x in A & A in F;
      consider b be object such that
A12:    b in dom E & E.b = A by A11,A3,FUNCT_1:def 3;
      S.b = (E.b)\/{x} by Def4,A11,A12;
      hence thesis by A11,A12,A2,FUNCT_1:def 3;
    end;
  end;
  then
A13: swap(F,x,y) = rng S by A4;
A14: card swap(F,x,y) = card F by A1,Th11;
  card F = len E =len S by CARD_1:def 7;
  then S is one-to-one by A13,A14,FINSEQ_4:62;
  hence thesis by A13,RLAFFIN3:def 1;
end;

theorem Th28:
  for F be finite set
  for E be Enumeration of F st  not y in union F  holds
    Ext(E,x,y) is  Enumeration of Ext(F,x,y)
proof
  let F be finite set;
  let E be Enumeration of F such that
A1: not y in union F;
  set S=Ext(E,x,y);
A2: dom S = dom E = Seg len E by Def5,FINSEQ_1:def 3;
A3: rng E=F by RLAFFIN3:def 1;
A4: rng S c= Ext(F,x,y)
  proof
    let a be object;
    assume a in rng S;
    then consider c be object such that
A5:   c in dom S & S.c = a by FUNCT_1:def 3;
A6:   E.c in rng E by A5,A2,FUNCT_1:def 3;
    per cases;
    suppose
A7:     x in E.c;
      then S.c = (E.c)\/{y} by A5,A2,Def5;
      then S.c in {A\/{y} where A is Element of F: x in A} by A7,A6;
      hence thesis by A5,XBOOLE_0:def 3;
    end;
    suppose
A8:     not x in E.c;
      then S.c = E.c by A5,A2,Def5;
      then S.c in {A where A is Element of F: not x in A & A in F} by A8,A6;
      hence thesis by A5,XBOOLE_0:def 3;
    end;
  end;
  Ext(F,x,y) c= rng S
  proof
    let a be object;
    assume a in Ext(F,x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {A\/{y} where A is Element of F: x in A};
      then consider A be Element of F such that
A9:     a = A\/{y} & x in A;
      F<>{} by A9,SUBSET_1:def 1;
      then consider b be object such that
A10:    b in dom E & E.b = A by A3,FUNCT_1:def 3;
      S.b = (E.b)\/{y} by Def5,A9,A10;
      hence thesis by A9,A10,A2,FUNCT_1:def 3;
    end;
    suppose a in {A where A is Element of F: not x in A & A in F};
      then consider A be Element of F such that
A11:    a = A & not x in A & A in F;
      consider b be object such that
A12:    b in dom E & E.b = A by A11,A3,FUNCT_1:def 3;
      S.b = (E.b) by Def5,A11,A12;
      hence thesis by A11,A12,A2,FUNCT_1:def 3;
    end;
  end;
  then
A13: Ext(F,x,y) = rng S by A4;
A14: card Ext(F,x,y) = card F by A1,Th10;
  card F = len E =len S by CARD_1:def 7;
  then S is one-to-one by A13,A14,FINSEQ_4:62;
  hence thesis by A13,RLAFFIN3:def 1;
end;

theorem Th29:
  x in X implies Ext({X},x,y) = { X\/{y} }
proof
  assume
A1: x in X;
  thus Ext({X},x,y) c= { X\/{y} }
  proof
    let a be object;
    assume a in Ext({X},x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {A\/{y} where A is Element of {X}: x in A};
      then consider A be Element of {X} such that
A2:     a=A\/{y} & x in A;
      A=X by TARSKI:def 1;
      hence thesis by A2,TARSKI:def 1;
    end;
    suppose a in {A where A is Element of {X}: not x in A & A in {X}};
      then ex A be Element of {X} st a=A & not x in A & A in {X};
      hence thesis by A1,TARSKI:def 1;
    end;
  end;
  let a be object;
  assume a in { X\/{y} };
  then a=X\/{y} & X in {X} by TARSKI:def 1;
  then a in {A\/{y} where A is Element of {X}: x in A} by A1;
  hence thesis by XBOOLE_0:def 3;
end;

theorem Th30:
  not x in X implies Ext({X},x,y) = { X }
proof
  assume A1: not x in X;
  thus Ext({X},x,y) c= { X }
  proof
    let a be object;
    assume a in Ext({X},x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {A\/{y} where A is Element of {X}: x in A};
      then ex A be Element of {X} st a=A\/{y} & x in A;
      hence thesis by A1,TARSKI:def 1;
    end;
    suppose a in {A where A is Element of {X}: not x in A & A in {X}};
      then ex A be Element of {X} st a=A & not x in A & A in {X};
      hence thesis;
    end;
  end;
  let a be object;
  assume a in { X };
  then a=X & X in {X} by TARSKI:def 1;
  then a in {A where A is Element of {X}: not x in A & A in {X}} by A1;
  hence thesis by XBOOLE_0:def 3;
end;

theorem Th31:
  x in X implies swap({X},x,y) = { (X\{x}) \/{y} }
proof
  assume
A1: x in X;
  thus swap({X},x,y) c= { X\{x} \/{y} }
  proof
    let a be object;
    assume a in swap({X},x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {(A\{x}) \/{y} where A is Element of {X}: x in A};
      then consider A be Element of {X} such that
A2:     a= A\{x} \/{y} & x in A;
      A=X by TARSKI:def 1;
      hence thesis by A2,TARSKI:def 1;
    end;
    suppose a in {A\/{x}
      where A is Element of {X}: not x in A & A in {X}};
      then ex A be Element of {X} st
      a=A\/{x} & not x in A & A in {X};
      hence thesis by A1,TARSKI:def 1;
    end;
  end;
  let a be object;
  assume a in { (X\{x}) \/{y}  };
  then a=(X\{x}) \/{y} & X in {X} by TARSKI:def 1;
  then a in {(A\{x}) \/{y} where A is Element of {X}: x in A} by A1;
  hence thesis by XBOOLE_0:def 3;
end;

theorem Th32:
  not x in X implies swap({X},x,y) = { X\/{x} }
proof
  assume
A1: not x in X;
  thus swap({X},x,y) c= { X\/{x} }
  proof
    let a be object;
    assume a in swap({X},x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {(A\{x}) \/{y} where A is Element of {X}: x in A};
      then ex A be Element of {X} st a=(A\{x}) \/{y} & x in A;
      hence thesis by A1,TARSKI:def 1;
    end;
    suppose a in {A\/{x} where A is Element of {X}:
      not x in A & A in {X}};
      then consider A be Element of {X} such that
A2:     a=A\/{x} & not x in A & A in {X};
      A=X by TARSKI:def 1;
      hence thesis by A2,TARSKI:def 1;
    end;
  end;
  let a be object;
  assume a in { X\/{x} };
  then a=X\/{x} & X in {X} by TARSKI:def 1;
  then a in {A\/{x} where A is Element of {X}: not x in A & A in {X}} by A1;
  hence thesis by XBOOLE_0:def 3;
end;

registration
  let X be non empty set;
  let a,b be object;
  cluster Ext(X,a,b) -> non empty;
  coherence
  proof
    set T=the Element of X;
    per cases;
    suppose a in T;
      then T\/{b} in {A\/{b} where A is Element of X: a in A};
      hence thesis;
    end;
    suppose not a in T;
      then T in {A where A is Element of X: not a in A & A in X};
      hence thesis;
    end;
  end;
  cluster swap(X,a,b) -> non empty;
  coherence
  proof
    set T=the Element of X;
    per cases;
    suppose a in T;
      then T\{a}\/{b} in {A\{a}\/{b} where A is Element of X: a in A};
      hence thesis;
    end;
    suppose not a in T;
      then T\/{a} in {A\/{a} where A is Element of X: not a in A & A in X};
      hence thesis;
    end;
  end;
end;

theorem Th33:
  not y in union X & not y in union Y implies
    (X misses Y iff Ext(X,x,y) misses Ext(Y,x,y))
proof
  assume
A1: not y in union X & not y in union Y;
  thus X misses Y implies Ext(X,x,y) misses Ext(Y,x,y)
  proof
    assume that
A2:   X misses Y and
A3:   Ext(X,x,y) meets Ext(Y,x,y);
    consider a be object such that
A4:   a in Ext(X,x,y) & a in Ext(Y,x,y) by A3,XBOOLE_0:3;
    per cases by A4,XBOOLE_0:def 3;
    suppose a in {A\/{y} where A is Element of X: x in A};
      then consider A be Element of X such that
A5:     a= A\/{y} & x in A;
      per cases by A4,XBOOLE_0:def 3;
      suppose a in {A\/{y} where A is Element of Y: x in A};
        then consider B be Element of Y such that
A6:       a= B\/{y} & x in B;
A7:       X <>{} & Y <>{} by A5,A6,SUBSET_1:def 1;
        then not y in A & not y in B by A1,TARSKI:def 4;
        then {y} misses A & {y} misses B by ZFMISC_1:50;
        then A=B by A6,A5,XBOOLE_1:71;
        hence thesis by A2,A7,XBOOLE_0:3;
      end;
      suppose a in {A where A is Element of Y: not x in A & A in Y};
        then ex B be Element of Y st a= B & not x in B & B in Y;
        hence thesis by A5,ZFMISC_1:136;
      end;
    end;
    suppose a in {A where A is Element of X: not x in A & A in X};
      then consider A be Element of X such that
A8:     a= A & not x in A & A in X;
      per cases by A4,XBOOLE_0:def 3;
      suppose a in {A\/{y} where A is Element of Y: x in A};
        then ex B be Element of Y st a= B\/{y} & x in B;
        hence thesis by A8,ZFMISC_1:136;
      end;
      suppose a in {A where A is Element of Y: not x in A & A in Y};
        then ex B be Element of Y st a= B & not x in B & B in Y;
        hence thesis by A2,A8,XBOOLE_0:3;
      end;
    end;
  end;
  assume that
A9:  Ext(X,x,y) misses Ext(Y,x,y) and
A10: X meets Y;
  consider a be object such that
A11: a in X & a in Y by A10,XBOOLE_0:3;
  reconsider a as set by TARSKI:1;
  per cases;
  suppose x in a;
    then a\/{y} in {A\/{y} where A is Element of X: x in A} &
    a\/{y} in {A\/{y} where A is Element of Y: x in A} by A11;
    then a\/{y} in Ext(X,x,y) & a\/{y} in Ext(Y,x,y) by XBOOLE_0:def 3;
    hence thesis by A9,XBOOLE_0:3;
  end;
  suppose not x in a;
    then a in {A where A is Element of X:  not x in A & A in X} &
    a in {A where A is Element of Y:  not x in A & A in Y} by A11;
    then a in Ext(X,x,y) & a in Ext(Y,x,y) by XBOOLE_0:def 3;
    hence thesis by A9,XBOOLE_0:3;
  end;
end;

theorem Th34:
  x<>y & not y in union X & not y in union Y implies
    (X misses Y iff swap(X,x,y) misses swap(Y,x,y))
proof
  assume
A1: x<>y & not y in union X & not y in union Y;
  thus X misses Y implies swap(X,x,y) misses swap(Y,x,y)
  proof
    assume that
A2:   X misses Y and
A3:   swap(X,x,y) meets swap(Y,x,y);
    consider a be object such that
A4:   a in swap(X,x,y) & a in swap(Y,x,y) by A3,XBOOLE_0:3;
    per cases by A4,XBOOLE_0:def 3;
    suppose a in {A\{x}\/{y} where A is Element of X: x in A};
      then consider A be Element of X such that
A5:     a= A\{x}\/{y} & x in A;
      per cases by A4,XBOOLE_0:def 3;
      suppose a in {A\{x}\/{y} where A is Element of Y: x in A};
        then consider B be Element of Y such that
A6:       a= B\{x} \/{y} & x in B;
A7:       X <>{} & Y <>{} by A5,A6,SUBSET_1:def 1;
        then not y in A & not y in B by A1,TARSKI:def 4;
        then {y} misses A\{x} & {y} misses B\{x} by XBOOLE_1:80,ZFMISC_1:50;
        then A= A\{x}\/{x} = B\{x}\/{x}=B by A6,A5,XBOOLE_1:71,ZFMISC_1:116;
        hence thesis by A2,A7,XBOOLE_0:3;
      end;
      suppose a in {A\/{x} where A is Element of Y: not x in A & A in Y};
        then consider B be Element of Y such that
A8:       a= B\/{x} & not x in B & B in Y;
        not x in A\{x} by ZFMISC_1:56;
        then not x in A\{x} \/{y} by A1,ZFMISC_1:136;
        hence thesis by A5,A8,ZFMISC_1:136;
      end;
    end;
    suppose a in {A\/{x} where A is Element of X: not x in A & A in X};
      then consider A be Element of X such that
A9:     a= A\/{x} & not x in A & A in X;
      per cases by A4,XBOOLE_0:def 3;
      suppose a in {A\{x}\/{y} where A is Element of Y: x in A};
        then consider B be Element of Y such that
A10:      a= B\{x} \/{y} & x in B;
        not x in B\{x} by ZFMISC_1:56;
        then not x in B\{x} \/{y} by A1,ZFMISC_1:136;
        hence thesis by A9,A10,ZFMISC_1:136;
      end;
      suppose a in {A\/{x} where A is Element of Y: not x in A & A in Y};
        then consider B be Element of Y such that
A11:      a= B\/{x} & not x in B & B in Y;
        {x} misses A & {x} misses B by A9,A11,ZFMISC_1:50;
        then A=B by A11,A9,XBOOLE_1:71;
        hence thesis by A2,A9,A11,XBOOLE_0:3;
      end;
    end;
  end;
  assume that
A12: swap(X,x,y) misses swap(Y,x,y) and
A13: X meets Y;
  consider a be object such that
A14: a in X & a in Y by A13,XBOOLE_0:3;
  reconsider a as set by TARSKI:1;
  per cases;
  suppose x in a;
    then a\{x}\/{y} in {A\{x}\/{y} where A is Element of X: x in A} &
    a\{x}\/{y} in {A\{x}\/{y} where A is Element of Y: x in A} by A14;
    then a\{x}\/{y} in swap(X,x,y)&a\{x}\/{y} in swap(Y,x,y) by XBOOLE_0:def 3;
    hence thesis by A12,XBOOLE_0:3;
  end;
  suppose not x in a;
    then a\/{x} in {A\/{x} where A is Element of X:  not x in A & A in X} &
    a\/{x} in {A\/{x} where A is Element of Y:  not x in A & A in Y} by A14;
    then a\/{x} in swap(X,x,y) & a\/{x} in swap(Y,x,y) by XBOOLE_0:def 3;
    hence thesis by A12,XBOOLE_0:3;
  end;
end;

theorem Th35:
  for f be Function st z in dom f holds Ext(<*f.z*>,x,y) = <*Ext(f,x,y).z*>
proof
  let f be Function;
  assume
A1: z in dom f;
A2:  1 in Seg 1;
A3:  dom Ext(<*f.z*>,x,y) = dom <*f.z*> = Seg 1 by Def5,FINSEQ_1:38;
  then
A4: len Ext(<*f.z*>,x,y) = len <*f.z*> =1 by FINSEQ_1:40,FINSEQ_3:29;
A5:<*f.z*>.1 = f.z;
  per cases;
  suppose x in f.z;
    then Ext(<*f.z*>,x,y).1 = (f.z)\/{y} = Ext(f,x,y).z by A2,Def5,A3,A5,A1;
    hence thesis by A4,FINSEQ_1:40;
  end;
  suppose not x in f.z;
    then Ext(<*f.z*>,x,y).1 = (f.z) = Ext(f,x,y).z by A2,Def5,A3,A5,A1;
    hence thesis by A4,FINSEQ_1:40;
  end;
end;

theorem Th36:
  for f be Function st z in dom f holds Swap(<*f.z*>,x,y) = <*Swap(f,x,y).z*>
proof
  let f be Function;
  assume
A1:  z in dom f;
A2:  1 in Seg 1;
A3:  dom Swap(<*f.z*>,x,y) = dom <*f.z*> = Seg 1 by Def4,FINSEQ_1:38;
  then
A4: len Swap(<*f.z*>,x,y) = len <*f.z*> =1 by FINSEQ_1:40,FINSEQ_3:29;
A5: <*f.z*>.1 = f.z;
  per cases;
  suppose x in f.z;
    then Swap(<*f.z*>,x,y).1 = ((f.z)\{x})\/{y} = Swap(f,x,y).z
      by A2,Def4,A3,A5,A1;
    hence thesis by A4,FINSEQ_1:40;
  end;
  suppose not x in f.z;
    then Swap(<*f.z*>,x,y).1 = (f.z)\/{x} = Swap(f,x,y).z by A2,Def4,A3,A5,A1;
    hence thesis by A4,FINSEQ_1:40;
  end;
end;

theorem Th37:
  for f be Function st z in dom f holds Ext({f.z},x,y) = {Ext(f,x,y).z}
proof
  let f be Function;
  assume A1: z in dom f;
  per cases;
  suppose x in f.z;
    then Ext({f.z},x,y) = {(f.z)\/{y}} & Ext(f,x,y).z = (f.z)\/{y}
      by A1,Def5,Th29;
    hence thesis;
  end;
  suppose not x in f.z;
    then Ext({f.z},x,y) = {(f.z)} & Ext(f,x,y).z = (f.z) by A1,Def5,Th30;
    hence thesis;
  end;
end;

theorem
  for f be Function st z in dom f holds swap({f.z},x,y) = {Swap(f,x,y).z}
proof
  let f be Function;
  assume A1: z in dom f;
  per cases;
  suppose x in f.z;
    then swap({f.z},x,y) = {((f.z)\{x})\/{y}} &Swap(f,x,y).z = ((f.z)\{x})\/{y}
      by Def4,A1,Th31;
    hence thesis;
  end;
  suppose not x in f.z;
    then swap({f.z},x,y) = {(f.z)\/{x}} & (f.z)\/{x} = Swap(f,x,y).z
      by A1,Def4,Th32;
    hence thesis;
  end;
end;

theorem Th39:
 m<>0 implies  bool(Seg (m+2)\{1}) =
    Ext(bool(Seg (m+1)\{1}),1+m,2+m)\/
    swap(bool(Seg (m+1)\{1}),1+m,2+m)
proof
  assume
A1: m<>0;
  set s=Seg (m+1)\{1}, F = bool(s),F1 = bool(Seg (m+2)\{1}),
  E=Ext(F,1+m,2+m), S=swap(F,1+m,2+m);
  1+m+1 > m+1 by NAT_1:13;
  then not m+2 in Seg (m+1) by FINSEQ_1:1;
  then
A2: not 2+m in union F by ZFMISC_1:56;
  then
A3: card S = card F = card E by Th10,Th11;
A4: 2 * card F = card bool (Seg (1+(m+1))\{1}) by Th9
  .= card F1;
  1+m<>2+m;
  then
A5: card (E\/S) = card F+card F by Th22,A2,A3,CARD_2:40
  .= card F1 by A4;
A6: Seg(m+1+1)= Seg(m+1)\/{m+2} & Seg(m+1) = Seg m \/{m+1} by FINSEQ_1:9;
  then Seg(m+1+1)\{1} = s \/({m+2} \{1}) & 1<>m+2 by A1,XBOOLE_1:42;
  then
A7: Seg(m+1+1)\{1} = s \/{m+2} by ZFMISC_1:14;
  m+1 <>1 by A1;
  then
  {m+1} c= Seg(m+1) & not 1 in {m+1} by A6,TARSKI:def 1,XBOOLE_1:7;
  then
A8: Seg(m+1+1)\{1} = s \/ {m+1} \/{m+2} =s\/{m+2}
  by A7,XBOOLE_1:12,ZFMISC_1:34;
A9: S c= F1
  proof
    let x;
    assume
A10:  x in S;
    reconsider x as set by TARSKI:1;
    per cases by A10,XBOOLE_0:def 3;
    suppose x in {(A\{m+1})\/{m+2} where A is Element of F: m+1 in A};
      then consider A be Element of F such that
A11:  x=(A\{m+1})\/{m+2} & m+1 in A;
      x c= s\/{m+2} by A11,XBOOLE_1:13;
      hence thesis by A7;
    end;
    suppose x in {A\/{m+1} where A is Element of F: not m+1 in A & A in F};
      then consider A be Element of F such that
A12:  x = A\/{m+1} & not m+1 in A & A in F;
      x c= s\/{m+1} by A12,XBOOLE_1:13;
      then x c= Seg(m+1+1)\{1} by A8,XBOOLE_1:10;
      hence thesis;
    end;
  end;
  E c= F1
  proof
    let x;
    assume
A13:  x in E;
    reconsider x as set by TARSKI:1;
    per cases by A13,XBOOLE_0:def 3;
    suppose x in {A\/{m+2} where A is Element of F: m+1 in A};
      then consider A be Element of F such that
A14:    x= A\/{m+2} & m+1 in A;
      x c= s \/{m+2} by A14,XBOOLE_1:13;
      hence thesis by A7;
    end;
    suppose x in {A where A is Element of F: not m+1 in A & A in F};
      then consider A be Element of F such that
A15:    x= A & not m+1 in A & A in F;
      x c= s\/{m+2} by A15,XBOOLE_1:10;
      hence thesis by A7;
    end;
  end;
  hence thesis by A5,A9,CARD_2:102,XBOOLE_1:8;
end;

begin :: Function where each Value is Repeated an Even Number of Times

definition
  let f be finite Function;
  attr f is with_evenly_repeated_values means :Def6:
    card (f"{y}) is even;
end;

registration
  cluster empty -> with_evenly_repeated_values for finite Function;
  coherence;
  let x be object;
  cluster <*x,x*> -> with_evenly_repeated_values;
  coherence
  proof
    set xx=<*x,x*>;
    let y;
    rng <*x*> = {x} by FINSEQ_1:38;
    then
A1:   rng xx = {x}\/{x} by FINSEQ_1:31;
    per cases;
    suppose y=x;
      then xx"{y} = dom xx by A1,RELAT_1:134;
      then card (xx"{y})= 2*1 by CARD_1:def 7;
      hence thesis;
    end;
    suppose y<>x;
      then xx"{y}={} by A1,RELAT_1:138,ZFMISC_1:11;
      hence thesis;
    end;
  end;
end;

theorem Th40:
  for f,g be with_evenly_repeated_values FinSequence holds
     f^g is with_evenly_repeated_values
proof
  let f,g be with_evenly_repeated_values FinSequence;
  set fg=f^g;
  let y be object;
  reconsider c1=card (f"{y}),c2=card (g"{y}) as even Nat by Def6;
  card (fg"{y}) = c1+c2 by FINSEQ_3:57;
  hence card (fg"{y}) is even;
end;

definition
  let F be set;
  attr F is with_evenly_repeated_values-member means :Def7:
    for y be object st y in F holds
      y is with_evenly_repeated_values finite Function;
end;

registration
  cluster empty -> with_evenly_repeated_values-member for set;
  coherence;
end;

registration
  let X be FinSequence-membered set;
  cluster -> FinSequence-membered for Element of Fin X;
  coherence
  proof
    let E be Element of Fin X;
    E c= X by FINSUB_1:def 5;
    hence thesis;
  end;
end;

theorem Th41:
  for P1,S1,S2 be FinSequence-membered set holds
     P1^(S1\/S2) = P1^S1 \/ P1^S2
proof
  let P1,S1,S2 be FinSequence-membered set;
  thus P1^(S1\/S2) c= P1^S1 \/ P1^S2
  proof
    let x be object such that
A1:   x in P1^(S1\/S2);
    consider p, q be FinSequence such that
A2:   x = p^q & p in P1 & q in S1\/S2 by A1,POLNOT_1:def 2;
    q in S1 or q in S2 by A2,XBOOLE_0:def 3;
    then x in P1^S1 or x in P1^S2 by A2,POLNOT_1:def 2;
    hence thesis by XBOOLE_0:def 3;
  end;
A3: P1^S1 c= P1^(S1\/S2)
  proof
    let x be object such that
A4:   x in P1^S1;
    consider p, q be FinSequence such that
A5:   x = p^q & p in P1 & q in S1 by A4,POLNOT_1:def 2;
    q in S1\/ S2 by A5,XBOOLE_0:def 3;
    hence thesis by A5,POLNOT_1:def 2;
  end;
  P1^S2 c= P1^(S1\/S2)
  proof
    let x be object such that
A6:   x in P1^S2;
    consider p, q be FinSequence such that
A7:   x = p^q & p in P1 & q in S2 by A6,POLNOT_1:def 2;
    q in S1\/ S2 by A7,XBOOLE_0:def 3;
    hence thesis by A7,POLNOT_1:def 2;
  end;
  hence thesis by A3,XBOOLE_1:8;
end;

theorem Th42:
  for P1,P2,S1 be FinSequence-membered set holds
   (P1\/P2)^S1 = P1^S1 \/ P2^S1
proof
  let P1,P2,S1 be FinSequence-membered set;
  thus (P1\/P2)^S1 c= P1^S1 \/ P2^S1
  proof
    let x be object such that
A1:   x in (P1\/P2)^S1;
    consider p, q be FinSequence such that
A2:   x = p^q & p in P1\/P2 & q in S1 by A1,POLNOT_1:def 2;
    p in P1 or p in P2 by A2,XBOOLE_0:def 3;
    then x in P1^S1 or x in P2^S1 by A2,POLNOT_1:def 2;
    hence thesis by XBOOLE_0:def 3;
  end;
A3: P1^S1 c= (P1\/P2)^S1
  proof
    let x be object such that
A4:   x in P1^S1;
    consider p, q be FinSequence such that
A5:   x = p^q & p in P1 & q in S1 by A4,POLNOT_1:def 2;
    p in P1\/P2 by A5,XBOOLE_0:def 3;
    hence thesis by A5,POLNOT_1:def 2;
  end;
  P2^S1 c= (P1\/P2)^S1
  proof
    let x be object such that
A6:   x in P2^S1;
    consider p, q be FinSequence such that
A7:   x = p^q & p in P2 & q in S1 by A6,POLNOT_1:def 2;
    p in P1\/P2 by A7,XBOOLE_0:def 3;
    hence thesis by A7,POLNOT_1:def 2;
  end;
  hence thesis by A3,XBOOLE_1:8;
end;

theorem Th43:
  for f,g be FinSequence holds
     {f}^{g} = {f^g}
proof
  let f,g be FinSequence;
  thus {f}^{g} c= {f^g}
  proof
    let x;
    assume x in {f}^{g};
    then consider p, q be FinSequence such that
A1:   x = p^q & p in {f} & q in {g} by POLNOT_1:def 2;
    p=f & q=g by A1,TARSKI:def 1;
    hence thesis by A1,TARSKI:def 1;
  end;
  let x;
A2: f in {f} & g in {g} by TARSKI:def 1;
  assume x in {f^g};
  then x = f^g by TARSKI:def 1;
  hence thesis by A2,POLNOT_1:def 2;
end;

registration
  let f be with_evenly_repeated_values finite Function;
  cluster {f} -> with_evenly_repeated_values-member;
  coherence by TARSKI:def 1;
  let g be with_evenly_repeated_values finite Function;
  cluster {f,g} -> with_evenly_repeated_values-member;
  coherence by TARSKI:def 2;
end;

registration
  let F,G be with_evenly_repeated_values-member FinSequence-membered set;
  cluster F^G ->with_evenly_repeated_values-member;
  coherence
  proof
    let y such that
A1:   y in F^G;
    consider p, q be FinSequence such that
A2:   y = p^q & p in F & q in G by A1,POLNOT_1:def 2;
    p is with_evenly_repeated_values & q is with_evenly_repeated_values
      by A2,Def7;
    hence thesis by A2,Th40;
  end;
end;

theorem Th44:
  for f be finite Function, p be Permutation of dom f holds
    f is with_evenly_repeated_values iff f*p is with_evenly_repeated_values
proof
  let f be finite Function, p be Permutation of dom f;
  set fp=f*p;
A1: dom p = dom f = rng p by FUNCT_2:52,def 3;
  then
A2: dom fp = dom f by RELAT_1:27;
  thus f is with_evenly_repeated_values implies
     (f*p) is with_evenly_repeated_values
  proof
    assume
A3:   f is with_evenly_repeated_values;
    let y be object;
    card (fp"{y}) = card (f"{y}) by A2,A1,CLASSES1:77,78;
    hence thesis by A3;
  end;
  assume
A4: f*p is with_evenly_repeated_values;
  let y be object;
  card (fp"{y}) = card (f"{y}) by A2,A1,CLASSES1:77,78;
  hence thesis by A4;
end;

begin :: Cartesian Product of Domains in Finite Sequences

definition
  let F be FinSequence-yielding FinSequence;
  func doms F -> finite Subset of NAT* means :Def8:
    for x be object holds x in it iff
      ex p be FinSequence st p=x & len p = len F &
         for i st i in dom p holds p.i in dom (F.i);
  existence
  proof
    defpred P[object,FinSequence-yielding FinSequence] means
      ex p be FinSequence st p=$1 & len p = len $2 &
        for i st i in dom p holds p.i in dom ($2.i);
    defpred N[Nat] means
      for H be FinSequence-yielding FinSequence st len H=$1
        ex IT be finite FinSequence-membered set st
    for x be object holds x in IT iff P[x,H];
A1:   N[0]
    proof
      let H be FinSequence-yielding FinSequence such that
A2:     len H=0;
      take IT={ {} };
      let x be object;
      thus x in IT implies P[x,H]
      proof
        assume
A3:       x in IT;
        take p={};
        thus thesis by A2,A3;
      end;
      given p be FinSequence such that
A4:     p=x & len p = len H &
      for i st i in dom p holds p.i in dom (H.i);
      p={} by A4,A2;
      hence thesis by A4,TARSKI:def 1;
    end;
A5: N[n] implies N[n+1]
    proof
      set n1=n+1;
      assume
A6:     N[n];
      let H be FinSequence-yielding FinSequence such that
A7:     len H=n1;
A8:     1<= n1 & n<n1 by NAT_1:11,13;
      reconsider Hn=H|n as FinSequence-yielding FinSequence;
A9:     len Hn = n by A7,FINSEQ_1:59,NAT_1:11;
      then consider IT be finite FinSequence-membered set such that
A10:    for x be object holds x in IT iff P[x,Hn] by A6;
      set IT2= { f^<*i*> where f is Element of IT, i is Element of dom (H.n1):
      f in IT & i in dom (H.n1)};
A11:    IT2 is finite
      proof
        per cases;
        suppose
A12:       IT is empty or dom (H.n1) is empty;
          IT2 ={}
          proof
            assume IT2<>{};
            then consider x be object such that
A13:          x in IT2 by XBOOLE_0:def 1;
            ex f be Element of IT, i be Element of dom (H.n1) st x=f^<*i*> &
            f in IT & i in dom (H.n1) by A13;
            hence thesis by A12;
          end;
          hence thesis;
        end;
        suppose
A14:        IT is non empty & dom (H.n1) is non empty;
          then reconsider ITn=IT as non empty FinSequence-membered set;
          reconsider D=dom (H.n1) as non empty set by A14;
          deffunc P(FinSequence,object) =$1^<*$2*>;
          set Pfi={ P(f,i) where f is Element of ITn, i is Element of D:
            f in ITn & i in D};
A15:        D is finite;
A16:        ITn is finite;
          Pfi is finite from FRAENKEL:sch 22(A16,A15);
          hence thesis;
        end;
      end;
      now let x be object;
        assume x in IT2;
        then ex f be Element of IT, i be Element of dom (H.n1) st
          x=f^<*i*> & f in IT& i in dom (H.n1);
        hence x is FinSequence;
      end;
      then reconsider IT2 as finite FinSequence-membered set
        by A11,FINSEQ_1:def 19;
      take IT2;
      let x be object;
      thus x in IT2 implies P[x,H]
      proof
        assume x in IT2;
        then consider fs be Element of IT, i be Element of dom (H.n1) such that
A17:      x=fs^<*i*> & fs in IT & i in dom (H.n1);
        consider f be FinSequence such that
A18:      f=fs & len f = len Hn &
        for i st i in dom f holds f.i in dom (Hn.i) by A17,A10;
        take fH= f^<*i*>;
        thus
A19:      fH=x & len fH = len H by A7,A18,A17,A9,FINSEQ_2:16;
        let k such that
A20:      k in dom fH;
A21:      1<=k & k <= n1 by A7,A20,A19,FINSEQ_3:25;
        per cases by A21,NAT_1:8;
        suppose
A22:        k <=n;
          then
A23:        k in dom f & k in dom Hn by A21,A18,A9,FINSEQ_3:25;
A24:        f.k in dom (Hn.k) by A22,A21,A18,A9,FINSEQ_3:25;
          Hn.k = H.k by A22,FINSEQ_3:112;
          hence thesis by A24,A23,FINSEQ_1:def 7;
        end;
        suppose k=n1;
          hence fH.k in dom (H.k) by A17,A18,A9;
        end;
      end;
      given p be FinSequence such that
A25:    p=x & len p = len H &
      for i st i in dom p holds p.i in dom (H.i);
      set pn=p|n;
A26:    p = p|len p = pn ^ <*p.n1*> by A7,A8,A25,FINSEQ_5:83;
A27:    len pn = len Hn by A9,A25,A7,FINSEQ_1:59,NAT_1:11;
      for i st i in dom pn holds pn.i in dom (Hn.i)
      proof
        let i such that
A28:      i in dom pn;
A29:      i<=n by A28,A27,A9,FINSEQ_3:25;
A30:      dom pn c= dom p by FINSEQ_5:18;
        pn.i = p.i & Hn.i = H.i by A29,FINSEQ_3:112;
        hence thesis by A30,A28,A25;
      end;
      then
A31:    pn in IT by A27,A10;
      p.n1 in dom (H.n1) by A25,A8,A7,FINSEQ_3:25;
      hence x in IT2 by A25,A26,A31;
    end;
    N[n] from NAT_1:sch 2(A1,A5);
    then consider IT be finite FinSequence-membered set such that
A32:  for x be object holds x in IT iff P[x,F];
    IT c= NAT*
    proof
      let x;
      assume x in IT;
      then consider p be FinSequence such that
A33:    p=x & len p = len F &
      for i st i in dom p holds p.i in dom (F.i) by A32;
      rng p c= NAT
      proof
        let y;
        assume y in rng p;
        then consider x such that
A34:      x in dom p & p.x = y by FUNCT_1:def 3;
        p.x in dom (F.x) by A34,A33;
        hence thesis by A34;
      end;
      then p is FinSequence of NAT by FINSEQ_1:def 4;
      hence thesis by A33,FINSEQ_1:def 11;
    end;
    hence thesis by A32;
  end;
  uniqueness
  proof
    defpred P[object] means
      ex p be FinSequence st p=$1 & len p = len F &
        for i st i in dom p holds p.i in dom (F.i);
    let IT1,IT2 be finite Subset of NAT* such that
A35:  for x be object holds x in IT1 iff P[x] and
A36:  for x be object holds x in IT2 iff P[x];
    now let x be object;
      x in IT1 iff P[x] by A35;
      hence x in IT1 iff x in IT2 by A36;
    end;
    hence thesis by TARSKI:2;
  end;
end;

theorem Th45:
  doms F is non empty iff F is non-empty
proof
  thus doms F is non empty implies F is non-empty
  proof
    assume doms F is non empty;
    then consider x be object such that
A1:   x in doms F;
    consider p be FinSequence such that
A2:   p=x & len p = len F &
        for i st i in dom p holds p.i in dom (F.i) by A1,Def8;
    let d be object such that
A3:   d in dom F;
    dom p=dom F by A2,FINSEQ_3:29;
    then p.d in dom (F.d) by A2,A3;
    hence thesis;
  end;
  set L = len F |-> 1;
  assume
A4: F is non-empty;
A5: len L=len F;
  then
A6: dom L=dom F by FINSEQ_3:29;
  for i st i in dom L holds L.i in dom (F.i)
  proof
    let i such that
A7:   i in dom L;
A8:   L.i = 1 by A7,FINSEQ_2:57;
    F.i is non empty by A4,A7,A6;
    then len (F.i) >=1 by NAT_1:14;
    hence thesis by A8,FINSEQ_3:25;
  end;
  hence thesis by Def8,A5;
end;

theorem Th46:
  doms {} = { {} }
proof
  reconsider f={} as FinSequence-yielding FinSequence;
  for i st i in dom f holds f.i in dom (f.i);
  then ex p be FinSequence st p=f & len p = len f &
    for i st i in dom p holds p.i in dom (f.i);
  then
A1: {} in doms f by Def8;
  doms f c= { {} }
  proof
    let y be object;
    assume y in doms f;
    then ex p be FinSequence st p=y & len p = len f &
    for i st i in dom p holds p.i in dom (f.i) by Def8;
    then y=f;
    hence thesis by TARSKI:def 1;
  end;
  hence thesis by A1,ZFMISC_1:33;
end;

registration
  let F be FinSequence-yielding FinSequence;
  cluster doms F -> FinSequence-membered;
  coherence;
end;

theorem Th47:
  p in doms F iff len p = len F &
         for i st i in dom p holds p.i in dom (F.i)
proof
  hereby assume p in doms F;
    then ex q be FinSequence st q=p & len q = len F &
    for i st i in dom q holds q.i in dom (F.i) by Def8;
    hence len p = len F & for i st i in dom p holds p.i in dom (F.i);
  end;
  thus thesis by Def8;
end;

registration
  let F be FinSequence-yielding FinSequence;
  cluster -> NAT-valued for Element of doms F;
  coherence
  proof
    let e be Element of doms F;
    per cases;
    suppose doms F is empty;
      then e={} by SUBSET_1:def 1;
      hence thesis;
    end;
    suppose
A1:   doms F is non empty;
      rng e c= NAT
      proof
        let y such that
A2:       y in rng e;
        consider x such that
A3:       x in dom e & e.x = y by A2,FUNCT_1:def 3;
        e.x in dom (F.x) by A1,Th47,A3;
        hence thesis by A3;
      end;
      hence thesis by RELAT_1:def 19;
    end;
  end;
end;

registration
  let F be non-empty FinSequence-yielding FinSequence;
  cluster doms F -> non empty;
  coherence by Th45;
end;

theorem Th48:
  f in doms F & g in doms G implies f^g in doms (F^G)
proof
  set fg=f^g,FG=F^G;
  assume
A1: f in doms F & g in doms G;
A2: len fg = len f + len g & len FG = len F + len G by FINSEQ_1:22;
A3: len f = len F & len g = len G by A1,Th47;
  for i st i in dom fg holds fg.i in dom (FG.i)
  proof
    let i be Nat such that
A4:   i in dom fg;
    per cases by A4,FINSEQ_1:25;
    suppose
A5:     i in dom f;
      then i in dom F by A3,FINSEQ_3:29;
      then f.i =fg.i & F.i =FG.i by A5,FINSEQ_1:def 7;
      hence thesis by A1,Th47,A5;
    end;
    suppose ex j st j in dom g & i=len f + j;
      then consider j such that
A6:     j in dom g & i=len f+j;
      j in dom G by A6,A3,FINSEQ_3:29;
      then g.j =fg.i & G.j =FG.i by A6,A3,FINSEQ_1:def 7;
      hence thesis by A1,Th47,A6;
    end;
  end;
  hence thesis by A2,A3,Th47;
end;


theorem Th49:
  for P,S be FinSequence-membered set st
    P c= doms F & S c= doms G holds P^S c= doms (F^G)
proof
  let P,S be FinSequence-membered set such that
A1: P c= doms F & S c= doms G;
  let x such that
A2: x in P^S;
  ex p,s be FinSequence st x=p^s & p in P & s in S by A2,POLNOT_1:def 2;
  hence thesis by A1,Th48;
end;

theorem Th50:
  (len f=len F or len g = len G) & f^g in doms (F^G) implies
    f in doms F & g in doms G
proof
  set fg=f^g,FG=F^G;
  assume
A1: (len f=len F or len g = len G) & fg in doms FG;
A2: len fg = len f + len g & len FG = len F + len G & len FG = len fg
    by A1,Th47,FINSEQ_1:22;
A3: dom f= dom F & dom g = dom G by A2,A1,FINSEQ_3:29;
  for i st i in dom f holds f.i in dom (F.i)
  proof
    let i;
    assume i in dom f;
    then i in dom fg & f.i = fg.i & F.i = FG.i
      by A3,FINSEQ_1:26,def 7,TARSKI:def 3;
    hence thesis by A1,Th47;
  end;
  hence f in doms F by A2,A1,Th47;
  for i st i in dom g holds g.i in dom (G.i)
  proof
    let i;
    assume
A4:   i in dom g;
    then
A5:  (len f)+i in dom fg by FINSEQ_1:28;
    g.i = fg.((len f)+i) & G.i = FG.((len F)+i) by A4,A3,FINSEQ_1:def 7;
    hence thesis by A5,A1,A2,Th47;
  end;
  hence g in doms G by A2,A1,Th47;
end;

theorem Th51:
  f in doms <*g*> iff len f = 1 & f.1 in dom g
proof
  set G=<*g*>;
A1: len G=1 & G.1=g by FINSEQ_1:40;
  hereby assume
A2:    f in doms G;
     then len f = 1 by A1,Th47;
     then 1 in dom f by FINSEQ_3:25;
     hence len f = 1 & f.1 in dom g by A1,A2,Th47;
  end;
  assume
A3: len f = 1 & f.1 in dom g;
  now let i such that
A4:    i in dom f;
     1<= i & i <= 1 by A3,A4,FINSEQ_3:25;
     then i=1 by XXREAL_0:1;
    hence f.i in dom (G.i) by A3;
  end;
  hence thesis by A3,A1,Th47;
end;

theorem Th52:
  for F,g,x holds
    doms (F^<* g^<*x*> *>) = doms (F^<* g *>) \/
      {f^<*1 + len g*> where f is Element of doms F:f in doms F}
proof
  let F,g,x;
  set S={f^<*1 + len g*> where f is Element of doms F:f in doms F};
  set gx= g^<*x*>;
A1: len (F^<* gx *>) = 1 + len F & len (F^<* g *>)= 1+len F by FINSEQ_2:16;
  thus doms (F^<* gx *>) c= doms (F^<* g *>)\/S
  proof
    let y;
    assume y in doms (F^<* gx *>);
    then consider p be FinSequence such that
A2:   p=y & len p = len (F^<* gx *>) and
A3:   for i st i in dom p holds p.i in dom ((F^<* gx *>).i) by Def8;
    per cases;
    suppose
A4:     p.(1+len F) in dom g;
      for i st i in dom p holds p.i in dom ((F^<* g *>).i)
      proof
        let i such that
A5:       i in dom p;
        per cases;
        suppose i = 1+len F;
          hence thesis by A4;
        end;
        suppose
A6:         i<> 1+len F;
A7:         1<=i <=len p by A5,FINSEQ_3:25;
          then i < len F+1 by A6,A2,A1,XXREAL_0:1;
          then i <= len F by NAT_1:13;
          then i in dom F by A7,FINSEQ_3:25;
          then (F^<* gx *>).i = F.i & (F^<* g *>).i = F.i by FINSEQ_1:def 7;
          hence thesis by A5,A3;
        end;
      end;
      then p in doms (F^<* g *>) by A2,A1,Th47;
      hence thesis by A2,XBOOLE_0:def 3;
    end;
    suppose
A8:     not p.(1+len F) in dom g;
      1<= 1+len F by NAT_1:11;
      then p.(1+len F) in dom ((F^<* gx *>).(1+len F)) by A3,A2,A1,FINSEQ_3:25;
      then consider n such that
A9:     n in dom <*x*> & p.(1+len F) = len g + n by A8,FINSEQ_1:25;
      set pL=p|len F;
      n in Seg 1 by A9,FINSEQ_1:38;
      then n=1 by FINSEQ_1:2,TARSKI:def 1;
      then
A10:    p = pL^ <* 1 + len g *> by A9,A2,FINSEQ_2:16,FINSEQ_3:55;
A11:    len pL = len F by A2,A1,FINSEQ_3:53;
      for i st i in dom pL holds pL.i in dom (F.i)
      proof
        let i such that
A12:      i in dom pL;
        dom F = Seg (len F) by FINSEQ_1:def 3;
        then
A13:      i in dom p & i in dom F by A12,RELAT_1:57;
        then p.i in dom ((F^<* gx *>).i) by A3;
        then p.i in dom (F.i) by A13,FINSEQ_1:def 7;
        hence thesis by A12,FUNCT_1:47;
      end;
      then pL in doms F by A11,Th47;
      then p in S by A10;
      hence thesis by A2,XBOOLE_0:def 3;
    end;
  end;
  let y such that
A14: y in doms (F^<* g *>)\/S;
  set L= 1 + len g;
  per cases;
  suppose y in S;
    then consider f be Element of doms F such that
A15:  y = f^<*L*> & f in doms F;
A16: len f = len F & len (f^<*L*>) = len f +1 & len gx= L
      by A15,Th47,FINSEQ_2:16;
    then
A17:  dom f=dom F by FINSEQ_3:30;
    for i st i in dom (f^<*L*>) holds (f^<*L*>).i in dom ((F^<* gx *>).i)
    proof
      let i such that
A18:    i in dom (f^<*L*>);
      per cases by A18,FINSEQ_1:25;
      suppose i in dom f;
        then f.i in dom (F.i) & (f^<*L*>).i = f.i & (F^<* gx *>).i = F.i
          by A17,A15,Th47,FINSEQ_1:def 7;
        hence thesis;
      end;
      suppose ex n st n in dom <*L*> & i=len f + n;
        then consider n such that
A19:      n in dom <*L*> & i=len f + n;
A20:      1 <= L by NAT_1:11;
        n in Seg 1 by A19,FINSEQ_1:def 8;
        then n=1 by FINSEQ_1:2,TARSKI:def 1;
        hence thesis by A19,A16,A20,FINSEQ_3:25;
      end;
    end;
    hence thesis by A15,A16,A1,Th47;
  end;
  suppose not y in S;
    then y in doms (F^<* g *>) by A14,XBOOLE_0:def 3;
    then consider p be FinSequence such that
A21:  p=y & len p = len (F^<* g*>) and
A22:  for i st i in dom p holds p.i in dom ((F^<* g*>).i) by Def8;
A23: dom p = dom (F^<* g*>) by A21,FINSEQ_3:30;
    for i st i in dom p holds p.i in dom ((F^<* gx*>).i)
    proof
      let i such that
A24:    i in dom p;
      per cases;
      suppose i in dom F;
        then (F^<* g*>).i = F.i = (F^<* gx*>).i by FINSEQ_1:def 7;
        hence thesis by A24,A22;
      end;
      suppose not i in dom F;
        then consider n such that
A25:      n in dom <*g*> & i = len F+n by A24,A23,FINSEQ_1:25;
        n in Seg 1 by A25,FINSEQ_1:38;
        then
A26:      n=1 by FINSEQ_1:2,TARSKI:def 1;
        then (F^<* g*>).i = g by A25;
        then p.i in dom g by A24,A22;
        hence thesis by A26,A25,FINSEQ_1:26,TARSKI:def 3;
      end;
    end;
    hence y in doms (F^<* gx *>) by A1,Th47,A21;
  end;
end;

theorem
  for F,x holds
    doms (F^<* <*x*> *>) = {f^<* 1 *> where f is Element of doms F:f in doms F}
proof
  let F,x;
  1<= len F+1 & len (F^<* {} *>)=len F+1 by FINSEQ_2:16,NAT_1:11;
  then 1+len F in dom (F^<*{}*>) & (F^<*{}*>).(1+len F)={} by FINSEQ_3:25;
  then not (F^<*{}*>) is non-empty;
  then
A1: doms (F^<* {} *>) ={} by Th45;
  reconsider g={} as FinSequence;
  doms (F^<* g^<*x*> *>) = doms (F^<* g *>) \/
  {f^<*1 + len g*> where f is Element of doms F:f in doms F} by Th52;
  hence thesis by A1;
end;


theorem Th54:
  for F,G be FinSequence-yielding FinSequence holds
     NAT-concatenation .: [:doms F,doms G:] = doms (F^G)
proof
  let F,G be FinSequence-yielding FinSequence;
  set C=NAT-concatenation;
  thus C .: [:doms F,doms G:] c= doms (F^G)
  proof
    let y;
    assume y in C .: [:doms F,doms G:];
    then consider x such that
A1:   x in dom C & x in [:doms F,doms G:] & C.x =y by FUNCT_1:def 6;
    consider f,g be object such that
A2:   f in doms F & g in doms G & x=[f,g] by A1,ZFMISC_1:def 2;
    reconsider f,g as NAT-valued FinSequence by A2;
    C.(f,g) = f^g by FOMODEL0:4;
    then y = f^g by A1,A2,BINOP_1:def 1;
    hence thesis by A2,Th48;
  end;
  let xy be object such that
A3: xy in doms (F^G);
  reconsider fg=xy as NAT-valued FinSequence by A3;
A4: len fg = len (F^G) = len F + len G by A3,Th47,FINSEQ_1:22;
  set f= fg|(len F);
A5: len f=len F by A4,FINSEQ_1:59,NAT_1:11;
  consider g be FinSequence such that
A6: fg = f^g by FINSEQ_1:80;
A7: f in doms F & g in doms G by Th50,A3,A6,A5;
  then
A8: [f,g] in [:doms F,doms G:] by ZFMISC_1:def 2;
  rng f c= NAT & rng g c= NAT by A7,RELAT_1:def 19;
  then f is FinSequence of NAT & g is FinSequence of NAT by FINSEQ_1:def 4;
  then f in NAT* & g in NAT* by FINSEQ_1:def 11;
  then [f,g] in [:NAT*,NAT*:] by ZFMISC_1:def 2;
  then
A9: [f,g] in dom C by FUNCT_2:def 1;
  C.(f,g)= f^g by A7,FOMODEL0:4;
  then C.[f,g] = f^g by BINOP_1:def 1;
  hence thesis by A6,A8,A9,FUNCT_1:def 6;
end;

theorem Th55:
  doms <*f*> = { <*i*> where i is Element of NAT:i in dom f}
proof
  thus doms <*f*> c= { <*i*> where i is Element of NAT:i in dom f}
  proof
    let y;
    assume
A1:   y in doms <*f*>;
    then reconsider y as FinSequence;
A2:   y.1 in dom f by A1,Th51;
    y = <*y.1*> by A1,Th51,FINSEQ_1:40;
    hence thesis by A2;
  end;
  let y;
  assume y in { <*i*> where i is Element of NAT:i in dom f};
  then consider i be Element of NAT  such that
A3: y = <*i*> & i in dom f;
  len <*i*> = 1 & <*i*>.1=i by FINSEQ_1:40;
  hence thesis by A3,Th51;
end;

registration
  let n,F;
  cluster F|n -> FinSequence-yielding;
  coherence;
end;

theorem
  f in doms F implies f|n in doms (F|n)
proof
  assume
A1: f in doms F;
  then
A2: len f = len F by Th47;
  per cases;
  suppose n > len f;
    then f|n=f & F|n=F by A2,FINSEQ_1:58;
    hence thesis by A1;
  end;
  suppose n <=len f;
    then
A3:   len (f|n)=n & len (F|n)=n by A2,FINSEQ_1:59;
    then
A4:   dom (f|n)=dom (F|n) by FINSEQ_3:30;
    for i st i in dom (f|n) holds (f|n).i in dom ((F|n).i)
    proof
      let i;
      assume i in dom (f|n);
      then (f|n).i = f.i & (F|n).i = F.i & i in dom f
        by A4,FUNCT_1:47,RELAT_1:57;
      hence thesis by A1,Th47;
    end;
    hence thesis by A3,Th47;
  end;
end;

theorem
   card doms <*g*> = len g
proof
  set G=<* g *>;
A1: len G=1 by FINSEQ_1:40;
  defpred P[object,object] means
    for f be FinSequence st f=$1 holds f.1=$2;
A2: for x being object st x in doms G
  ex y being object st y in dom g & P[x,y]
  proof
    let x be object;
    assume
A3:   x in doms G;
    then consider p be FinSequence such that
A4:   p=x & len p = len G &
    for i st i in dom p holds p.i in dom (G.i) by Def8;
    take p.1;
    thus thesis by A4,A3,Th51;
  end;
  consider F be Function such that
A5:  dom F=doms G & rng F c= dom g and
A6:  for x being object st x in doms G holds P[x,F.x] from FUNCT_1:sch 6(A2);
A7:  F is one-to-one
  proof
    let x1,x2 be object such that
A8:   x1 in dom F & x2 in dom F & F.x1=F.x2;
    consider p1 be FinSequence such that
A9:   p1=x1 & len p1 = len G &
    for i st i in dom p1 holds p1.i in dom (G.i) by A5,A8,Def8;
    consider p2 be FinSequence such that
A10:  p2=x2 & len p2 = len G &
      for i st i in dom p2 holds p2.i in dom (G.i) by A5,A8,Def8;
    A11:p1=<*p1.1*> & p2=<*p2.1*> by A1,A9,A10,FINSEQ_1:40;
    F.x1= p1.1 & F.x2 =p2.1 by A9,A10,A6,A5,A8;
    hence thesis by A11,A8,A9,A10;
  end;
  dom g c= rng F
  proof
    let i be object;
    assume
A12:  i in dom g;
A13:  len <*i *>=1 &<*i *>.1 =i by FINSEQ_1:40;
    then
A14:  <* i*> in doms G by Th51,A12;
    F.(<*i*>) = <* i*>.1 by A6,Th51,A12,A13;
    hence thesis by A14,A5,FUNCT_1:def 3;
  end;
  then dom g = rng F by A5;
  then card doms G= card dom g by A5,A7,CARD_1:70;
  then card doms G = card Seg len g by FINSEQ_1:def 3;
  hence thesis;
end;

theorem
  card doms (F^<*f*>) = (card doms F) * len f
proof
  defpred D[Nat] means
    for f be FinSequence st len f=$1 holds
      card doms (F^<*f*>) = (card doms F) * len f;
A1: D[0]
  proof
    let f be FinSequence such that
A2:   len f=0;
    1<= len F+1 & len (F^<* f *>)=len F+1 by FINSEQ_2:16,NAT_1:11;
    then 1+len F in dom (F^<*f*>) & (F^<*f*>).(1+len F)=f by FINSEQ_3:25;
    then not (F^<*f*>) is non-empty by A2;
    then doms (F^<* f *>) ={} by Th45;
    hence thesis by A2;
  end;
A3: D[n] implies D[n+1]
  proof
    assume
A4:   D[n];
    let f be FinSequence such that
A5:   len f=n+1;
    set n1=n+1,fn=f|n;
    set S = {f^<*1 + len fn*> where f is Element of doms F:f in doms F};
    n < n1 by NAT_1:13;
    then
A6: len fn=n by A5,FINSEQ_1:59;
    f=fn^<*f.n1*> by A5,FINSEQ_3:55;
    then
A7:   doms (F^<* f *>) = doms (F^<* fn *>) \/ S by Th52;
    defpred P[object,object] means
      for g be FinSequence st g=$1 holds $2 = g^<*1 + len fn*>;
A8:   for x being object st x in doms F
    ex y being object st y in S & P[x,y]
    proof
      let x be object;
      assume
A9:     x in doms F;
      then consider p be FinSequence such that
A10:    p=x & len p = len F &
      for i st i in dom p holds p.i in dom (F.i) by Def8;
      take p^<*1 + len fn*>;
      thus thesis by A10,A9;
    end;
    consider H be Function such that
A11:  dom H=doms F & rng H c= S and
A12:  for x being object st x in doms F holds P[x,H.x]
      from FUNCT_1:sch 6(A8);
A13:  H is one-to-one
    proof
      let x1,x2 be object such that
A14:    x1 in dom H & x2 in dom H & H.x1=H.x2;
      reconsider x1,x2 as FinSequence by A11,A14;
      H.x1 = x1 ^ <*1 + len fn*> & H.x2 = x2 ^ <*1 + len fn*> by A14,A11,A12;
      hence thesis by A14,FINSEQ_2:17;
    end;
    S c= rng H
    proof
      let s be object;
      assume s in S;
      then consider g be Element of doms F such that
A15:    s = g^<*1 + len fn*> & g in doms F;
      H.g=s by A15,A12;
      hence thesis by A15,A11,FUNCT_1:def 3;
    end;
    then rng H=S by A11;
    then
A16:  card doms F = card S by A13,A11,CARD_1:70;
    then reconsider S as finite set;
    doms (F^<* fn *>) misses S
    proof
      assume doms (F^<* fn *>) meets S;
      then consider x be object such that
A17:    x in doms (F^<* fn *>) & x in S by XBOOLE_0:3;
      consider g be Element of doms F such that
A18:    x = g^<*1 + len fn*> & g in doms F by A17;
A19:    len g = len F by A18,Th47;
      consider p be FinSequence such that
A20:    p=x & len p = len (F^<* fn *>) &
      for i st i in dom p holds p.i in dom ((F^<* fn *>).i) by Def8,A17;
      1<= 1+len F & len (F^<* fn *>)=len F+1 by FINSEQ_2:16,NAT_1:11;
      then p.(1+len F) in dom ((F^<* fn *>).(1+len F)) by A20,FINSEQ_3:25;
      then 1 + len fn <=len fn by A20,A18,A19,FINSEQ_3:25;
      hence thesis by NAT_1:13;
    end;
    hence card (doms (F^<* f *>)) = card doms (F^<* fn *>) + card doms F
      by A16,A7,CARD_2:40
      .=(card doms F) *n + card doms F by A6,A4
      .=(card doms F) *len f by A5;
  end;
  D[n] from NAT_1:sch 2(A1,A3);
  hence thesis;
end;

begin :: Some Operations on Finite Sequences

definition
  let F be FinSequence-yielding FinSequence;
  func App F -> FinSequence-yielding Function  means :Def9:
    dom it = doms F &
    for p be FinSequence st p in doms F holds len (it.p) = len p &
      for i st i in dom p holds (it.p).i = F.i.(p.i);
  existence
  proof
    defpred P[object,object] means
    $1 is FinSequence & $2 is FinSequence &
    for p,itp be FinSequence st p=$1 & itp=$2 holds
      len itp = len p & for i st i in dom p holds itp.i = F.i.(p.i);
A1:   for x be object st x in doms F
        ex y be object st P[x,y]
    proof
      let x be object such that
A2:     x in doms F;
      reconsider P =x as FinSequence by A2;
      deffunc itp(Nat) = F.$1.(P.$1);
      consider ITP be FinSequence such that
A3:     len ITP = len P and
A4:     for i st i in dom ITP holds
      ITP.i = itp(i) from FINSEQ_1:sch 2;
      take ITP;
      thus x is FinSequence & ITP is FinSequence by A2;
      let p,itp be FinSequence such that
A5:     p=x & itp=ITP;
      dom ITP=dom P by A3,FINSEQ_3:29;
      hence thesis by A5,A3,A4;
    end;
    consider IT be Function such that
A6: dom IT = doms F & for x be object st x in doms F holds P[x,IT.x]
      from  CLASSES1:sch 1(A1);
    for x be object st x in dom IT holds IT.x is FinSequence by A6;
    then reconsider IT as FinSequence-yielding Function by PRE_POLY:def 3;
    take IT;
    thus thesis by A6;
  end;
  uniqueness
  proof
    let H1,H2 be FinSequence-yielding Function such that
A7:   dom H1 = doms F & for p be FinSequence st p in doms F holds
        len (H1.p) = len p & for i st i in dom p holds (H1.p).i = F.i.(p.i) and
A8:   dom H2 = doms F & for p be FinSequence st p in doms F holds
        len (H2.p) = len p & for i st i in dom p holds (H2.p).i = F.i.(p.i);
    for x be object st x in dom H1 holds H1.x=H2.x
    proof
      let x be object such that
A9:     x in dom H1;
      reconsider p=x as FinSequence by A9,A7;
A10:    len (H1.p) = len p = len (H2.p) by A7,A8,A9;
      then
A11:    dom (H1.p) = dom p = dom (H2.p) by FINSEQ_3:29;
      now let i;
        assume
A12:      i in dom (H1.p);
        then (H1.p).i = F.i.(p.i) by A11,A9,A7;
        hence (H1.p).i = (H2.p).i by A11,A12,A9,A7,A8;
      end;
      hence thesis by A10,FINSEQ_3:29;
    end;
    hence thesis by A7,A8;
  end;
end;

definition
  let D be non empty set;
  let F be D*-valued FinSequence;
  redefine func App F -> Function of doms F,D*;  :: redefines App (HILB10_7, definition)
  coherence
  proof
    set A=App F;
A1:   dom A = doms F by Def9;
    rng A c= D*
    proof
      let y be object such that
A2:     y in rng A;
      consider x be object such that
A3:     x in dom A & A.x = y by A2,FUNCT_1:def 3;
A4:     x in doms F by A3,Def9;
      consider p be FinSequence such that
A5:     p=x & len p = len F &
        for i st i in dom p holds p.i in dom (F.i) by A4,Def8;
A6:     dom p = dom F by A5,FINSEQ_3:29;
      rng (A.p) c= D
      proof
        let i be object such that
A7:       i in rng (A.p);
        len (A.p) = len p by A4,A5,Def9;
        then
A8:       dom (A.p) = dom p by FINSEQ_3:29;
        consider j be object such that
A9:       j in dom (A.p) & (A.p).j = i by A7,FUNCT_1:def 3;
A10:      (A.p).j = F.j.(p.j) by A8,A9,A4,A5,Def9;
        F.j in rng F by A9,A8,A6,FUNCT_1:def 3;
        then F.j is FinSequence of D by FINSEQ_1:def 11;
        then
A11:      rng (F.j) c= D by FINSEQ_1:def 4;
        p.j in dom (F.j) by A5,A9,A8;
        then F.j.(p.j) in rng (F.j) by FUNCT_1:def 3;
        hence thesis by A11,A10,A9;
      end;
      then (A.p) is FinSequence of D by FINSEQ_1:def 4;
      hence thesis by A3,A5,FINSEQ_1:def 11;
    end;
    hence thesis by A1,FUNCT_2:2;
  end;
end;

theorem Th59:
  (App {}).{} = {}
proof
  reconsider E={} as FinSequence;
  E in doms {} by Th46,TARSKI:def 1;
  then len ((App {}).E)=len E by Def9;
  hence thesis;
end;

theorem Th60:
  i in dom f implies (App <*f*>).<*i*> = <*f.i*>
proof
  set I=<*i*>, A=App <*f*>;
A1: len I = 1 & I.1 =i by FINSEQ_1:40;
  assume i in dom f;
  then
A2: I in doms <*f*> by A1,Th51;
A3: 1 in dom I by A1,FINSEQ_3:25;
  <*f*>.1 .(I.1) = f.i;
  then (A.I).1 = f.i by A3,A2,Def9;
  hence thesis by A2,A1,Def9,FINSEQ_1:40;
end;

theorem Th61:
  f in doms F & g in doms G implies
     (App(F^G)).(f^g) = ((App F).f) ^ ((App G).g)
proof
  set FG=F^G,AF=App F,AG=App G,AFG=App FG;
  assume
A1: f in doms F & g in doms G;
  then
A2: f^g in doms FG by Th48;
A3: len (f^g) = len f + len g by FINSEQ_1:22;
  then
A4: len (AF.f) = len f & len (AG.g) = len g &
    len (AFG.(f^g)) = len f + len g by A1,A2,Def9;
A5: len f=len F & len g=len G by A1,Th47;
  then
A6: dom f = dom F & dom g = dom G by FINSEQ_3:30;
  for i st 1<=i & i <= len (AFG.(f^g)) holds
    (AFG.(f^g)).i = ((AF.f) ^ (AG.g)).i
  proof
    let i;
    assume 1<=i & i <= len (AFG.(f^g));
    then
A7:   i in dom (f^g) by A3,A4,FINSEQ_3:25;
    then per cases by FINSEQ_1:25;
    suppose
A8:     i in dom f;
      then i in dom (AF.f) by A4,FINSEQ_3:29;
      hence ((AF.f) ^ (AG.g)).i = (AF.f).i by FINSEQ_1:def 7
      .= (F.i).(f.i) by A8,A1,Def9
      .= (FG.i).(f.i) by A8,A6,FINSEQ_1:def 7
      .= (FG.i).((f^g).i) by A8,FINSEQ_1:def 7
      .= (AFG.(f^g)).i by A2,A7,Def9;
    end;
    suppose ex n st n in dom g & i=len f + n;
      then consider n such that
A9:     n in dom g & i=len f + n;
      n in dom (AG.g) by A4,A9,FINSEQ_3:29;
      hence ((AF.f) ^ (AG.g)).i = (AG.g).n by A9,A4,FINSEQ_1:def 7
      .= (G.n).(g.n) by A9,A1,Def9
      .= (FG.i).(g.n) by A9,A5,A6,FINSEQ_1:def 7
      .= (FG.i).((f^g).i) by A9,FINSEQ_1:def 7
      .= (AFG.(f^g)).i by A2,A7,Def9;
    end;
  end;
  hence thesis by A4,FINSEQ_1:22;
end;

registration
  let D be non empty set;
  let F be non empty D*-valued FinSequence;
  cluster App F -> non-empty;
  coherence
  proof
    now assume {} in rng App F;
      then consider x such that
A1:     x in dom App F & (App F).x={} by FUNCT_1:def 3;
      reconsider x as FinSequence by A1;
      len ((App F).x) = len x = len F by A1,Th47,Def9;
      hence contradiction by A1;
    end;
    hence thesis by RELAT_1:def 9;
  end;
end;

definition
  let D be non empty set;
  let f be D* -valued Function;
  let x be object;
  redefine func f.x -> FinSequence of D;  :: redefines . (FUNCT_1, definition)
  coherence
  proof
    per cases;
    suppose x in dom f;
      then f.x in rng f & rng f c= D* by FUNCT_1:def 3;
      hence thesis by FINSEQ_1:def 11;
    end;
    suppose not x in dom f;
      then f.x=<*>D by FUNCT_1:def 2;
      hence thesis;
    end;
  end;
end;

definition
  let D be non empty set;
  let B be BinOp of D;
  let F be D* -valued Function;
  func B "**" F -> Function of dom F,D means :Def10:
      for x st x in dom F holds it.x = B "**" (F.x);
  existence
  proof
    deffunc F(object) = B "**" F.$1;
    consider f be Function such that
A1:   dom f = dom F &
    for x st x in dom F holds f.x = F(x) from FUNCT_1:sch 3;
    rng f c= D
    proof
      let y be object such that
A2:     y in rng f;
      consider x such that
A3:     x in dom f & f.x=y by A2,FUNCT_1:def 3;
      y = B "**" (F.x) by A3,A1;
      hence thesis;
    end;
    then reconsider f as Function of dom F,D by A1,FUNCT_2:2;
    take f;
    thus thesis by A1;
  end;
  uniqueness
  proof
    let f1,f2 be Function of dom F,D such that
A4:   for x st x in dom F holds f1.x = B "**" F.x and
A5:   for x st x in dom F holds f2.x = B "**" F.x;
    now let x;
      assume
A6:     x in dom F;
      hence f1.x = B "**" F.x by A4
      .= f2.x by A5,A6;
    end;
    hence thesis by FUNCT_2:12;
  end;
end;

reserve
  B,A,M for BinOp of D,
  F,G for D* -valued FinSequence,
  f for FinSequence of D,
  d,d1,d2 for Element of D;

registration
  let D be non empty set;
  let B be BinOp of D;
  let F be D* -valued FinSequence;
  cluster B "**" F -> (len F)-element FinSequence-like;
  coherence
  proof
A1:   dom (B "**" F)=dom F = Seg len F by FINSEQ_1:def 3,FUNCT_2:def 1;
    then reconsider BF= B "**" F as FinSequence by FINSEQ_1:def 2;
    len BF=len F by A1,FINSEQ_1:def 3;
    hence thesis by CARD_1:def 7;
  end;
end;

definition
  let D be set;
  let f be FinSequence of D;
  redefine func <* f *> ->  FinSequence of D*;  :: redefines <* (FINSEQ_1, definition)
  coherence
  proof
    rng <* f *> c= D*
    proof
      let y be object;
      assume y in rng <* f *>;
      then y in {f} by FINSEQ_1:39;
      then y = f by TARSKI:def 1;
      hence thesis by FINSEQ_1:def 11;
    end;
    hence thesis by FINSEQ_1:def 4;
  end;
end;

theorem Th62:
  A "**" <*f*> = <* A "**" f *>
proof
A1: len (A"**"<*f*>)=len <*f*>=1 by CARD_1:def 7;
  then 1 in dom <*f*> & <*f*>.1 = f by FINSEQ_3:25;
  then (A"**"<*f*>).1= A"**" f by Def10;
  hence thesis by A1,FINSEQ_1:40;
end;

theorem Th63:
  A "**" (F^G) = ( A "**" F )^(A "**"G)
proof
  set FG=F^G;
A1: len ( A "**" F ) = len F & len ( A "**" G ) = len G by CARD_1:def 7;
A2: len (A "**" FG) =len FG =len F+len G by CARD_1:def 7,FINSEQ_1:22;
  for n st 1<=n & n <= len F+len G holds (A "**" FG).n =
    (( A "**" F )^(A "**"G)).n
  proof
    let n such that
A3:   1<=n & n <= len F+len G;
    per cases by A3,A2,FINSEQ_1:25,FINSEQ_3:25;
    suppose
A4:     n in dom F;
      then n in dom ( A "**" F ) by A1,FINSEQ_3:29;
      hence (( A "**" F )^(A "**"G)).n = ( A "**" F ).n by FINSEQ_1:def 7
      .= A "**" (F .n) by A4,Def10
      .= A"**" (FG.n) by A4,FINSEQ_1:def 7
      .= (A "**" FG).n by A3,A2,Def10,FINSEQ_3:25;
    end;
    suppose ex k st k in dom G & n=len F + k;
      then consider k such that
A5:     k in dom G & n=len F + k;
      k in dom ( A "**" G ) by A5,A1,FINSEQ_3:29;
      hence (( A "**" F )^(A "**"G)).n = ( A "**" G ).k by A1,A5,FINSEQ_1:def 7
      .= A "**" (G .k) by A5,Def10
      .= A"**" (FG.n) by A5,FINSEQ_1:def 7
      .= (A "**" FG).n by A3,A2,Def10,FINSEQ_3:25;
    end;
  end;
  hence thesis by A2,CARD_1:def 7;
end;

registration
  let f be non empty FinSequence;
  cluster <*f*> -> non-empty;
  coherence;
end;

reserve
  F,G for non-empty non empty FinSequence of D*,
  f for non empty FinSequence of D;

theorem Th64:
  A is commutative associative
implies
  for f,g be non empty FinSequence
    for F be Function of dom f,D, G be Function of dom g,D,
        FG be Function of dom (f^g),D st f=F & g=G & f^g = FG
    holds
  A$$ ([#]dom (f^g),FG) = A.(A$$([#]dom f,F),A$$([#]dom g,G))
proof
  assume
A1: A is commutative associative;
  defpred P[Nat] means
    for f,g be non empty FinSequence st $1=len g
      for F be Function of dom f,D, G be Function of dom g,D,
          FG be Function of dom (f^g),D st f=F & g=G & f^g = FG
    holds
  A$$ ([#]dom (f^g),FG) = A.(A$$([#]dom f,F),A$$([#]dom g,G));
A2: P[1]
  proof
    let f,g be non empty FinSequence such that
A3:   1=len g;
    let F be Function of dom f,D,G be Function of dom g,D,
      FG be Function of dom (f^g),D such that
A4:   f=F & g=G & f^g = FG;
    len (f^g) = len f+1 by A3,FINSEQ_1:22;
    then dom (f^g) = Seg (len f+1) by FINSEQ_1:def 3;
    then
A5:   dom (f^g) = Seg (len f)\/{len f + 1} &
    Seg (len f) = dom f by FINSEQ_1:9,def 3;
    len f + 1 in {len f + 1} by TARSKI:def 1;
    then reconsider L1=len f+1 as Element of dom (f^g) by A5,XBOOLE_0:def 3;
    dom f c= dom (f^g) by FINSEQ_1:26;
    then reconsider Df = dom f as Element of Fin dom (f^g) by FINSUB_1:def 5;
    len f < len f+1 by NAT_1:13;
    then
A6:   not L1 in Df by A5,FINSEQ_1:1;
A7:   g = <*g.1*> by A3,FINSEQ_1:40;
A8:   dom g ={1} & 1 in {1} by A3,FINSEQ_1:2,def 3;
A9:   FG|Df = F|(dom f) by A4;
    A$$ ([#]dom (f^g),FG) = A.(A$$ (Df,FG),FG.L1) by A1,A6,A5,SETWOP_2:2
    .= A.(A$$ (Df,FG),A$$([#]dom g,G)) by A4,A7,A8,A1,SETWISEO:17
    .= A.(A$$([#]dom f,F),A$$([#]dom g,G)) by A9,A1,Th1;
    hence thesis;
  end;
A10: for n st 1<=n holds P[n] implies P[n+1]
  proof
    let n such that
A11:  1<=n and
A12:  P[n];
    set n1=n+1;
    let f,g be non empty FinSequence such that
A13:  n1=len g;
    let F be Function of dom f,D, G be Function of dom g,D,
        FG be Function of dom (f^g),D such that
A14:  f=F & g=G & f^g = FG;
    rng f c= D & rng g c= D by A14,RELAT_1:def 19;
    then reconsider f1=f, g1=g as FinSequence of D by FINSEQ_1:def 4;
    n <n1 by NAT_1:13;
    then
A15:  len (g|n)=n by A13,FINSEQ_1:59;
    reconsider gn=g1|n as non empty FinSequence of D by A11;
    rng (gn) c= D;
    then reconsider Gn = gn as Function of dom (gn),D by FUNCT_2:2;
    f1^(g1|n) = f^gn;
    then rng (f^gn) c= D by FINSEQ_1:def 4;
    then reconsider fgn= f^gn as Function of dom (f^gn),D by FUNCT_2:2;
A16:  g = gn^<*g.n1*> by A13,FINSEQ_3:55;
    <*g.n1*> is FinSequence of D by A16,FINSEQ_1:36;
    then rng <*g.n1*> c= D by FINSEQ_1:def 4;
    then reconsider gn1=<*g.n1*> as Function of dom (<*g.n1*>),D by FUNCT_2:2;
A17:  len <*g.n1*>=1 by FINSEQ_1:40;
    g = gn^<*g.n1*> by A13,FINSEQ_3:55;
    then f^g = (f^gn)^<*g.n1*> by FINSEQ_1:32;
    hence A $$ ([#]dom (f^g),FG)
      = A.(A$$ ([#]dom (f^gn),fgn),A $$([#]dom (<*g.n1*>),gn1)) by A14,A17,A2
     .= A.(A.(A$$([#]dom (f),F),A$$ ([#]dom(gn),Gn)),
           A $$([#]dom (<*g.n1*>),gn1)) by A14,A12,A15
     .= A.(A$$([#]dom (f),F), A.(A$$ ([#]dom(gn),Gn),
           A $$([#]dom (<*g.n1*>),gn1))) by A1,BINOP_1:def 3
     .= A.(A$$([#]dom (f),F),A$$([#]dom(g),G)) by A16,A14,A17,A2;
  end;
A18: for n st 1<=n holds P[n] from NAT_1:sch 8(A2,A10);
  let f,g be non empty FinSequence;
  len g >=1 by NAT_1:14;
  hence thesis by A18;
end;

theorem Th65:
  M is commutative associative
implies
  M $$ ([#]dom (F^G), A "**" (F^G)) =
    M.(M $$ ([#]dom F, A "**" F), M $$ ([#]dom G, A "**" G))
proof
A1: dom (A "**" (F^G) ) = dom (F^G)
    & dom (A "**" F)=dom F & dom (A "**" G)=dom G by FUNCT_2:def 1;
  A "**" (F^G) = (A "**" F) ^ (A "**" G) by Th63;
  hence thesis by A1,Th64;
end;

theorem Th66:
  M is commutative associative
implies
  M $$ ([#]dom <*f*>,A "**" <*f*>) = A "**" f
proof
  assume
A1: M is commutative associative;
A2: dom <*f*> = Seg 1 & 1 in {1} by FINSEQ_1:38,TARSKI:def 1;
  then reconsider O=1 as Element of dom <*f*> by FINSEQ_1:2;
  thus M $$ ([#]dom <*f*>, A "**" <*f*>) = (A "**" <*f*>).O
    by A1,A2,FINSEQ_1:2,SETWISEO:17
    .= <*A "**" f*>.O by Th62
    .= A "**" f;
end;

theorem Th67:
  M is commutative associative & A is commutative associative &
    M is_left_distributive_wrt A
  implies
   for fM be Function of dom f,D st
     for x st x in dom f holds
         fM.x = M.( M$$ ([#]dom F, A "**" F), f.x) holds
   M $$ ([#]dom (F^<*f*>), A "**" (F^<*f*>))= A $$ ([#]dom f,fM)
proof
  assume
A1: M is commutative associative & A is commutative associative &
    M is_left_distributive_wrt A;
  defpred P[Nat] means for f st len f=$1
    for fM be Function of dom f,D st
      for x st x in dom f holds fM.x = M.( M$$ ([#]dom F, A "**" F), f.x)
      holds
        M $$ ([#]dom (F^<*f*>), A "**" (F^<*f*>))= A $$ ([#]dom f,fM);
A2: P[0];
A3: P[n] implies P[n+1]
  proof
    assume
A4:   P[n];
    set n1=n+1;
    let f such that
A5:   len f=n1;
    let fM be Function of dom f,D such that
A6:   for x st x in dom f holds fM.x = M.( M$$ ([#]dom F, A "**" F), f.x);
A7:   1<=n1 by NAT_1:11;
    then n1 in dom f by A5,FINSEQ_3:25;
    then f.n1 in rng f c= D by FUNCT_1:def 3;
    then reconsider fn1=f.n1 as Element of D;
    reconsider N1=n1 as Element of dom f by A7,A5,FINSEQ_3:25;
    dom <*f*> = Seg 1 & 1 in {1} by FINSEQ_1:38,TARSKI:def 1;
    then reconsider O=1 as Element of dom <*f*> by FINSEQ_1:2;
A8:   M $$ ([#]dom <*f*>, A "**" <*f*>) = A "**" f by A1,Th66;
    per cases by NAT_1:14;
    suppose
A9:     n=0;
      then f= <*f.n1*> by A5,FINSEQ_1:40;
      then
A10:    A"**"f = fn1 by FINSOP_1:11;
      dom f = {n1} by A9,A5,FINSEQ_1:2,def 3;
      hence A $$ ([#]dom f,fM) = fM.N1 by A1,SETWISEO:17
        .= M.( M$$ ([#]dom F, A "**" F), A"**"f) by A10,A6
        .= M $$ ([#]dom (F^<*f*>), A "**" (F^<*f*>)) by A8,A1,Th65;
    end;
    suppose
A11:    n>=1;
A12:    n < n1 by NAT_1:13;
      then
A13:    len (f|n) =n by A5,FINSEQ_1:59;
      reconsider fn=f|n as non empty FinSequence of D by A11;
A14:    f = fn^<*fn1*> by A5,FINSEQ_3:55;
      set fM1 = fM|(dom fn);
A15:    dom fn c= dom f by A14,FINSEQ_1:26;
      then reconsider dfn=dom fn as Element of Fin dom f by FINSUB_1:def 5;
      dom fM = dom f by FUNCT_2:def 1;
      then
A16:    dom fM1 = dom fn by A14,FINSEQ_1:26,RELAT_1:62;
      rng fM1 c= D;
      then reconsider fM1 as Function of dom fn,D by A16,FUNCT_2:2;
A17:    fM1|(dom fn) = fM1;
      for x st x in dom fn holds
        fM1.x = M.( M$$ ([#]dom F, A "**" F), fn.x)
      proof
        let x such that
A18:      x in dom fn;
        x in dom f & fM.x = fM1.x & fn.x=f.x by A15,A18,FUNCT_1:47,49;
        hence thesis by A6;
      end;
      then M $$ ([#]dom (F^<*fn*>), A "**" (F^<*fn*>))= A $$ ([#]dom fn,fM1)
          by A4,A13
        .= A $$ (dfn,fM) by A17,A1,Th1;
      then
A19:    A $$ (dfn,fM)
          = M.(M $$ ([#]dom F, A "**" F), M $$ ([#]dom <*fn*>, A "**" <*fn*>))
            by A1,Th65
         .= M.(M $$ ([#]dom F, A "**" F),A "**" fn) by A1,Th66;
      A20: not N1 in dom fn by A12,A13,FINSEQ_3:25;
      A21: dom f = Seg n1 by A5,FINSEQ_1:def 3
        .= Seg n \/{N1} by FINSEQ_1:9
        .= dfn \/{N1} by A13,FINSEQ_1:def 3;
      A"**"f = A.(A"**"fn,fn1) by A14,A11,A13,FINSOP_1:4;
      hence M $$ ([#]dom (F^<*f*>), A "**" (F^<*f*>))
         = M.(M $$ ([#]dom F, A "**" F), A.(A"**"fn,fn1)) by A8,A1,Th65
        .= A.(M.(M $$ ([#]dom F, A "**" F), A"**"fn),
              M.(M $$ ([#]dom F, A "**" F), fn1)) by A1,BINOP_1:def 9
        .= A.(A $$ (dfn,fM),fM.N1) by A19,A6
        .= A $$ ([#]dom f,fM) by A21,A1,A20,SETWOP_2:2;
    end;
  end;
  P[n] from NAT_1:sch 2(A2,A3);
  then P[len f];
  hence thesis;
end;

theorem Th68:
  len F = 1 & M is commutative associative &
    A  is commutative associative implies
  M $$ ([#]dom F, A "**" F) = A $$ ([#]dom App F, M "**" App(F))
proof
  set F1 =F.1;
  assume that
A1: len F=1 and
A2: M is commutative associative & A is commutative associative;
A3: F= <*F.1*> by A1,FINSEQ_1:40;
  then dom F={1} by FINSEQ_1:2,38;
  then
A4: [#]dom F = {.1 .} & 1 is Element of dom F by TARSKI:def 1;
  then M $$ ([#]dom F, A "**" F) = (A "**" F).1 by A2,SETWISEO:17;
  then
A5: M $$ ([#]dom F, A "**" F) = A "**" F1 by A4,Def10;
  set f=M "**" App(F), X = dom App F;
A6: X =doms F by Def9;
  consider G be Function of Fin X, D such that
A7: A $$ ([#]X,f) = G.[#]X and
    for e being Element of D st e is_a_unity_wrt A holds G.{} = e and
A8: for x being Element of X holds G.{x} = f.x and
A9: for B9 being Element of Fin X st
      B9 c= [#]X & B9 <> {} for x being Element of X st
        x in [#]X \ B9 holds G.(B9 \/ {x}) = A.(G.B9,f.x) by A2,SETWISEO:def 3;
A10: len F1 >=1+0 by A4,NAT_1:13;
  then consider s be sequence of D  such that
A11: s.1 = F1.1 and
A12: for n being Nat st 0 <> n & n < len F1 holds s.(n + 1) =
    A.(s.n,F1.(n + 1)) and
A13: A "**" F1 = s.(len F1) by FINSOP_1:1;
  deffunc R(Nat) = { <* i *> where i is Element of NAT: i in Seg $1};
  defpred P[Nat] means $1 <= len F1 implies
    for B9 be Element of Fin X st B9 = R($1) holds G.B9 = s.$1;
A14: P[1]
  proof
    assume
A15:  1<= len F1;
    let B9 be Element of Fin X such that
A16:  B9 = R(1);
A17:  1 in dom F1 by A15,FINSEQ_3:25;
    then F1.1 in rng F1 & rng F1 c= D by FUNCT_1:def 3;
    then reconsider F11=F1.1 as Element of D;
A18:  R(1) c= {<*1*>}
    proof
      let y;
      assume y in R(1);
      then consider i be Element of NAT such that
A19:    <* i *>= y & i in Seg 1;
      i = 1 by A19,FINSEQ_1:2,TARSKI:def 1;
      hence thesis by A19,TARSKI:def 1;
    end;
    {<*1*>} c= R(1)
    proof
      let y be object;
      assume y in {<*1*>};
      then y=<*1*> & 1 in Seg 1 by TARSKI:def 1;
      hence thesis;
    end;
    then
A20:  R(1) = { <*1*>} by A18;
A21:  <*1*> in B9 & B9 c= X by A16,A20,FINSUB_1:def 5,TARSKI:def 1;
    then G.B9 = f.<*1*> by A16,A20,A8;
    then G.B9= M "**" ((App(F)). <*1*>) by A21,Def10;
    then G.B9= M "**" <*F11*> by A3,Th60,A17;
    hence thesis by A11,FINSOP_1:11;
  end;
A22: for j st 1 <= j holds P[j] implies P[j+1]
  proof
    let j such that
A23:  1 <= j and
A24:  P[j];
    set j1=j+1;
    assume
A25:  j1 <= len F1;
    j1 in dom F1 by A25,FINSEQ_3:25,NAT_1:11;
    then F1.j1 in rng F1 & rng F1 c= D by FUNCT_1:def 3;
    then reconsider F1j1=F1.j1 as Element of D;
    let B9 be Element of Fin X such that
A26:  B9=R(j1);
A27: j < len F1 by A25,NAT_1:13;
    R(j) c= X
    proof
      let y;
      assume y in R(j);
      then consider i be Element of NAT such that
A28:    <* i *>= y & i in Seg j;
A29:  1<=i & i <= j by A28,FINSEQ_1:1;
      then i<= len F1 by A27,XXREAL_0:2;
      then <* i *>.1 in dom F1 & len <*i*>=1 by A29,FINSEQ_1:40,FINSEQ_3:25;
      hence thesis by A28,A6,A3,Th51;
    end;
    then reconsider Rj=R(j) as Element of Fin X by FINSUB_1:def 5;
A30:  Rj c= B9
    proof
      let y;
      assume y in Rj;
      then consider i be Element of NAT such that
A31:    <* i *>= y & i in Seg j;
A32:    1<=i & i <= j by A31,FINSEQ_1:1;
      then i<= j1 by NAT_1:13;
      then i in Seg j1 by A32;
      hence thesis by A31,A26;
    end;
    j1 in Seg j1 by FINSEQ_1:4;
    then <*j1*> in B9 by A26;
    then
A33:  {<*j1*>} c= B9 by ZFMISC_1:31;
    B9 c= Rj \/ {<*j1*>}
    proof
      let y;
      assume y in B9;
      then consider i be Element of NAT such that
A34:    <* i *>= y & i in Seg j1 by A26;
      i in (Seg j) \/{j1} by A34,FINSEQ_1:9;
      then i in Seg j or i in {j1} by XBOOLE_0:def 3;
      then i in Seg j or i = j1 by TARSKI:def 1;
      then <*i*> in Rj or <*i*> in {<*j1*>} by TARSKI:def 1;
      hence thesis by A34,XBOOLE_0:def 3;
    end;
    then
A35:  B9 = Rj \/ {<*j1*>} by A33,A30,XBOOLE_1:8;
A36:  G.Rj = s.j by A24,A25,NAT_1:13;
A37:  Rj c= [#]X by FINSUB_1:def 5;
    j in Seg j by A23;
    then
A38:  <*j*> in Rj;
A39:  <*j1*>.1 in dom F1 & len <*j1*>=1 & <*j1*>.1 =j1
      by A25,FINSEQ_1:40,FINSEQ_3:25,NAT_1:11;
    then reconsider J=<*j1*> as Element of X by A6,A3,Th51;
    f.J = M "**" ((App(F)). <*j1*>) by Def10;
    then f.J= M "**" <*F1j1*> by A3,A39,Th60;
    then
A40:  f.J = F1j1 by FINSOP_1:11;
    not J in Rj
    proof
      assume J in Rj;
      then consider i be Element of NAT such that
A41:    <* i *>= J & i in Seg j;
      i <= j & j1=i by A41,FINSEQ_1:1,76;
      hence thesis by NAT_1:13;
    end;
    then J in [#]X \ Rj by XBOOLE_0:def 5;
    then G.B9 = A.(s.j,F1j1) by A40,A36,A35,A37,A38,A9;
    hence thesis by A12,A25,A23,NAT_1:13;
  end;
A42: for i st 1 <= i holds P[i] from NAT_1:sch 8(A14,A22);
  R(len F1)=X
  proof
    thus R(len F1) c= X
    proof
      let y;
      assume y in R(len F1);
      then consider i be Element of NAT such that
A43:    <* i *>= y & i in Seg len F1;
      <* i *>.1 in dom F1 & len <*i*>=1 by A43,FINSEQ_1:40,def 3;
      hence thesis by A43,A6,A3,Th51;
    end;
    let y such that
A44:  y in X;
    reconsider f=y as FinSequence by A44;
    len f = 1 & f.1 in dom F1 by Th51,A44,A3;
    then f=<*f.1*> & f.1 in Seg len F1 by FINSEQ_1:40,def 3;
    hence thesis;
  end;
  hence thesis by A5,A13,A7,A42,A10;
end;

theorem
  M is commutative associative &
  A is commutative associative having_a_unity &
  M is_distributive_wrt A
implies
  M $$ ([#]dom F, A "**" F) = A $$ ([#]dom App F, M "**" App(F))
proof
  assume that
A1: M is commutative associative and
A2: A is commutative associative having_a_unity and
A3: M is_distributive_wrt A;
  defpred R[Nat] means
    for F be non-empty non empty FinSequence of D* st len F=$1 holds
      M $$ ([#]dom F, A "**" F) = A $$ ([#]dom App F, M "**" App(F));
A4: R[0];
A5: R[n] implies R[n+1]
  proof
    assume
A6:   R[n];
    per cases;
    suppose n=0;
      hence thesis by A1,A2,Th68;
    end;
    suppose
A7:     n>0;
      let F be non-empty non empty FinSequence of D* such that
A8:     len F=n+1;
      1<= n+1 by NAT_1:11;
      then len F in dom F by A8,FINSEQ_3:25;
      then reconsider FL=F.len F as non empty FinSequence of D;
      set FF=F|n,GG = <* FL *>;
A9:     len FF=n by A8,FINSEQ_1:59,NAT_1:11;
      reconsider FF as non-empty non empty FinSequence of D* by A7;
A10:    F = FF ^ GG by A8,FINSEQ_3:55;
      defpred P[object,object,object] means
        for f,g be FinSequence st f = $1 & g=$2
          for fg be FinSequence of D st fg= (App(F)).(f^g) holds $3 = M"**" fg;
A11:    for x,y st x in NAT* & y in NAT* ex z be object st z in D & P[x,y,z]
      proof
        let x,y;
        assume x in NAT* & y in NAT*;
        then reconsider x,y as FinSequence;
        reconsider fg=(App(F)).(x^y) as FinSequence of D;
        take M "**" fg;
        thus thesis;
      end;
      consider f being Function of [:NAT*,NAT*:],D such that
A12:    for x,y st x in NAT* & y in NAT* holds P[x,y,f.(x,y)]
        from BINOP_1:sch 1(A11);
      reconsider X=doms FF,Y=doms GG as Element of Fin (NAT*)
        by FINSUB_1:def 5;
      deffunc g(Element of NAT*) = A$$(X, (curry' f).$1);
      consider g be Function of NAT*,D such that
A13:    for e be Element of NAT* holds g.e=g(e) from FUNCT_2:sch 4;
A14:    dom f = [:NAT*,NAT*:] by FUNCT_2:def 1;
A15:    A$$(Y,g) = A$$([#]dom App F, M "**" App(F))
      proof
        set C=NAT-concatenation, s = C| [:X,Y:];
A16:      [:X,Y:] c= [:NAT*,NAT*:] =dom C by FUNCT_2:def 1,ZFMISC_1:96;
        then
A17:      dom s = [:X,Y:] by RELAT_1:62;
        C.:[:X,Y:] = doms (FF^GG) by Th54;
        then
A18:      rng s = doms (FF^GG) by RELAT_1:115;
        then
A19:      rng s = dom App F by A10,Def9;
A20:      s is one-to-one
        proof
          let x1,x2 be object such that
A21:        x1 in dom s & x2 in dom s & s.x1=s.x2;
          consider f1,g1 be object such that
A22:        f1 in X & g1 in Y & x1=[f1,g1] by A21,A17,ZFMISC_1:def 2;
          consider f2,g2 be object such that
A23:        f2 in X & g2 in Y & x2=[f2,g2] by A21,A17,ZFMISC_1:def 2;
          reconsider f1,f2,g1,g2 as NAT-valued FinSequence by A22,A23;
          len f1 = len FF & len f2 = len FF by A22,A23,Th47;
          then
A24:        f1 is (len FF)-element & f2 is (len FF)-element
            by CARD_1:def 7;
          s.x1 = C.x1 & s.x2 = C.x2 by A17,A21,FUNCT_1:49;
          then s.x1= C.(f1,g1) & s.x2= C.(f2,g2) by A22,A23,BINOP_1:def 1;
          then s.x1= f1^g1 & s.x2= f2^g2 by FOMODEL0:4;
          then f1=f2 & g1=g2 by A21,A24,FOMODEL0:41;
          hence thesis by A22,A23;
        end;
A25:      dom (f| [:X,Y:]) = [:X,Y:] by A14,RELAT_1:62,ZFMISC_1:96;
        dom (M "**" App(F)) = dom (App F) by FUNCT_2:def 1;
        then
A26:      dom (M "**" App(F)) = rng s by A10,A18,Def9;
        then
A27:      dom ((M "**" App(F))* s)=dom s by RELAT_1:27;
        for x st x in dom s holds (f| [:X,Y:]).x = ((M "**" App(F))* s).x
        proof
          let x;
          assume
A28:        x in dom s;
          then consider f1,g1 be object such that
A29:        f1 in X & g1 in Y & x=[f1,g1] by A17,ZFMISC_1:def 2;
          reconsider f1,g1 as NAT-valued FinSequence by A29;
          rng f1 c= NAT & rng g1 c= NAT;
          then f1 is FinSequence of NAT & g1 is FinSequence of NAT
            by FINSEQ_1:def 4;
          then
A30:        f1 in NAT* & g1 in NAT* by FINSEQ_1:def 11;
          (f1^g1) in doms (F) by A10,Th48,A29;
          then
A31:       (f1^g1) in dom App(F) by Def9;
          s.x = C.x by A17,A28,FUNCT_1:49;
          then s.x= C.(f1,g1) by A29,BINOP_1:def 1;
          then s.x= f1^g1 by FOMODEL0:4;
          then ((M "**" App(F))* s).x = (M "**" App(F)).(f1^g1)
            by A28,A27,FUNCT_1:12;
          then
A32:        ((M "**" App(F))* s).x = M "**" ((App(F)).(f1^g1)) by A31,Def10;
          (f| [:X,Y:]).x = f.x = f.(f1,g1)
            by A28,A25,A16,A29,BINOP_1:def 1,FUNCT_1:47;
          hence thesis by A32,A12,A30;
        end;
        then f| [:X,Y:] = (M "**" App(F)) * s by A25,A26,A16,RELAT_1:27;
        then A$$([:X,Y:],f) = A$$([#]dom App F, M "**" App(F))
          by A2,A17,A20,A19,SETWOP_2:5;
        hence thesis by A13,A2,MATRIX_3:32;
      end;
A33:    for h be FinSequence st h in Y holds
          g.h = M.( M $$ ([#]dom FF, A "**" FF), FL.(h  .1))
      proof
        let h be FinSequence;
        assume
A34:      h in Y;
        then h in { <*i*> where i is Element of NAT:i in dom FL} by Th55;
        then consider i be Element of NAT such that
A35:      h=<*i*> & i in dom FL;
        reconsider H=h as Element of NAT* by A35;
        FL.i in rng FL by A35,FUNCT_1:def 3;
        then reconsider FLi=FL.i as Element of D;
        set AFF=App(FF);
        defpred P[set] means $1<>{} & $1 c= X implies
          for BF be Element of Fin (dom AFF)
            for BN be Element of Fin (NAT*) st BF=$1 =BN holds
              M.(A $$ (BF, M "**" App(FF)), FL.i) = A$$(BN, (curry' f).H);
A36:      P [{}.(NAT*)];
A37:      for C being Element of Fin (NAT*), b being Element of NAT* holds
        P[C] & not b in C implies P[C \/ {b}]
        proof
          let C be Element of Fin (NAT*), b be Element of NAT* such that
A38:        P[C] & not b in C and
            C \/ {b} <>{} and
A39:        C \/ {b} c= X;
          let BF be Element of Fin (dom AFF), BN be Element of Fin (NAT*)
            such that
A40:        BF= C \/ {b} =BN;
          C c= C \/ {b} by XBOOLE_1:7;
          then
A41:        C c= X by A39;
          then C c= dom AFF by Def9;then
          reconsider CF = C as Element of Fin (dom AFF) by FINSUB_1:def 5;
          b in {b} by TARSKI:def 1;
          then
A42:        b in C \/ {b} by XBOOLE_0:def 3;
          reconsider bF = b as Element of dom AFF by A42,A39,Def9;
A43:        len (AFF.b) = len b & len b= len FF by Def9,Th47,A42,A39;
          [b,H] in dom f by A14;
          then
A44:        (curry' f).H.b=f.(b,H) by FUNCT_5:22;
          (App(GG)).H = <*FLi*> by Th60,A35;
          then
A45:        (App(F)).(b^H) = (AFF.b) ^ (<*FLi*>) by A42,A39,A34,Th61,A10;
A46:        M "**" ((AFF.b) ^ (<*FLi*>))=M.(M "**" (AFF.b),FLi)
            by A43,FINSOP_1:4,NAT_1:14;
          per cases;
          suppose
A47:          C={};
            hence M.(A $$ (BF, M "**" AFF), FL.i)
              = M.((M "**" AFF).bF, FLi) by A2,A40,SETWISEO:17
             .= M.(M "**" (AFF.b),FLi) by Def10
             .= (curry' f).H.b by A44,A12,A45,A46
             .= A$$(BN, (curry' f).H) by A47,A40,A2,SETWISEO:17;
          end;
          suppose
A48:          C<>{};
A49:          (M "**" AFF).bF = M "**" (AFF.b) by Def10;
            thus A$$(BN, (curry' f).H)
              = A.(A$$(C, (curry' f).H),((curry' f).H).b )
                by A2,A38,A40,SETWOP_2:2
             .= A.(M.(A $$ (CF, M "**" AFF), FLi),((curry' f).H).b )
                by A48,A41,A38
             .= A.(M.(A $$ (CF, M "**" AFF), FLi), M.(M "**" (AFF.b),FLi) )
                by A44,A12,A45,A46
             .= M.(A.(A $$ (CF, M "**" AFF),M "**" (AFF.b)),FLi)
                by A3,BINOP_1:11
             .= M.(A $$ (BF, M "**" AFF), FL.i) by A40,A49,A2,A38,SETWOP_2:2;
          end;
        end;
A50:      for B being Element of Fin (NAT*) holds P[B]
            from SETWISEO:sch 2(A36,A37);
        M.( A$$([#]dom App(FF), M "**" App(FF)), FL.i) = A$$(X, (curry' f).H)
          by A50,Def9;
        then M.( A$$([#]dom App(FF), M "**" App(FF)), FL.i) = g.h by A13;
        hence thesis by A35,A9,A6;
      end;
      defpred h[object,object] means for f be Function st f=$1 holds $2=f.1;
A51:    for x st x in Y ex y st y in dom FL & h[x,y]
      proof
        let x;
        assume x in Y;
        then x in { <*i*> where i is Element of NAT:i in dom FL} by Th55;
        then consider i be Element of NAT such that
A52:      x=<*i*> & i in dom FL;
        take i;
        thus thesis by A52;
      end;
      consider h be Function such that
A53:    dom h = Y & rng h c= dom FL & for x be object st
        x in Y holds h[x,h.x] from FUNCT_1:sch 6(A51);
      dom FL c= rng h
      proof
        let y such that
A54:      y in dom FL;
        <*y*> in { <*i*> where i is Element of NAT:i in dom FL} by A54;
        then <*y*> in Y by Th55;
        then h.<*y*> in rng h & h.<*y*> = <*y*>.1 by A53,FUNCT_1:def 3;
        hence thesis;
      end;
      then
A55:    rng h = dom FL by A53;
A56:    h is one-to-one
      proof
        let x1,x2 be object  such that
A57:      x1 in dom h & x2 in dom h & h.x1=h.x2;
        x1 in { <*i*> where i is Element of NAT:i in dom FL} by A53,A57,Th55;
        then consider i1 be Element of NAT such that
A58:      x1=<*i1*> & i1 in dom FL;
        x2 in { <*i*> where i is Element of NAT:i in dom FL} by A53,A57,Th55;
        then consider i2 be Element of NAT such that
A59:      x2=<*i2*> & i2 in dom FL;
        h.x1 = <*i1*>.1 & h.x2 = <*i2*>.1 by A58,A59,A57,A53;
        hence thesis by A58,A59,A57;
      end;
      deffunc fM(object) = M.( M$$ ([#]dom FF, A "**" FF), FL.$1);
A60:    x in dom FL implies fM(x) in D
      proof
        assume x in dom FL;
        then FL.x in rng FL c= D by FUNCT_1:def 3;
        then reconsider FLx =FL.x as Element of D;
        M.( M$$ ([#]dom FF, A "**" FF), FLx) in D;
        hence thesis;
      end;
      consider fM be Function of dom FL,D such that
A61:    x in dom FL implies fM.x = fM(x) from  FUNCT_2:sch 2(A60);
A62:    dom g = NAT* by FUNCT_2:def 1;
A63:    dom fM=dom FL by FUNCT_2:def 1;
      then
A64:    dom (fM * h) = Y by A53,RELAT_1:27;
      x in Y implies (g|Y).x = (fM * h).x
      proof
        assume
A65:      x in Y;
        then x in { <*i*> where i is Element of NAT:i in dom FL} by Th55;
        then consider i be Element of NAT such that
A66:      x=<*i*> & i in dom FL;
A67:      g.x = (g|Y).x by A65,FUNCT_1:49;
A68:      g.x = M.( M $$ ([#]dom FF, A "**" FF),FL.(<*i*>.1)) by A65,A66,A33;
        (fM * h).x = fM.(h.x) & h.x in dom fM & h.x = <*i*>.1
          by A65,A64,A66,A53,FUNCT_1:11,13;
        hence thesis by A68,A67,A61;
      end;
      then g|Y = fM * h by A62,A63,A53,RELAT_1:27;
      then A $$ ([#]dom FL, fM) = A$$(Y,g) by A53,A55,A56,A2,SETWOP_2:5;
      hence thesis by A10,A15,Th67,A61,A1,A2,A3,BINOP_1:def 11;
    end;
  end;
  R[n] from NAT_1:sch 2(A4,A5);
  hence thesis;
end;

begin :: Combination of Sign and Characteristic Functions

definition
  let D be non empty set;
  let B be BinOp of D;
  let f be FinSequence of D;
  let X be set;
  func SignGen(f,B,X) -> FinSequence of D means :Def11:
    dom it = dom f &
    for i st i in dom it holds
      ( i in X implies it.i = (the_inverseOp_wrt B).(f.i)) &
      ( not i in X implies it.i = f.i);
  existence
  proof
    defpred P[object,object] means
      (not $1 in X implies $2 = f.$1) &
      ($1 in X implies $2 = (the_inverseOp_wrt B).(f.$1));
A1:   for k st k in Seg len f ex x being Element of D st P[k,x]
    proof
      let k such that
A2:     k in Seg len f;
      k in dom f by A2,FINSEQ_1:def 3;
      then
A3:     f.k in rng f c= D by FUNCT_1:def 3;
      then reconsider fk = f.k as Element of D;
A4:  (the_inverseOp_wrt B).fk is Element of D;
      per cases;
      suppose k in X;
        hence thesis by A4;
      end;
      suppose not k in X;
        hence thesis by A3;
      end;
    end;
    consider p be FinSequence of D such that
A5:   dom p = Seg len f &
      for k st k in Seg len f holds P[k,p.k] from FINSEQ_1:sch 5(A1);
    take p;
    thus thesis by A5,FINSEQ_1:def 3;
  end;
  uniqueness
  proof
    let it1,it2 be FinSequence of D such that
A6:   dom it1 = dom f and
A7:   for i st i in dom it1 holds
        ( i in X implies it1.i = (the_inverseOp_wrt B).(f.i)) &
        ( not i in X implies it1.i = f.i) and
A8:   dom it2 = dom f and
A9:   for i st i in dom it2 holds
        ( i in X implies it2.i = (the_inverseOp_wrt B).(f.i)) &
        ( not i in X implies it2.i = f.i);
    for i st i in dom it1 holds it1.i=it2.i
    proof
      let i such that
A10:    i in dom it1;
      per cases;
      suppose
A11:      i in X;
        hence it1.i = (the_inverseOp_wrt B).(f.i) by A10,A7
          .= it2.i by A6,A8,A9,A11,A10;
      end;
      suppose
A12:      not i in X;
        hence it1.i=f.i by A7,A10
          .= it2.i by A9,A6,A8,A12,A10;
      end;
    end;
    hence thesis by A6,A8;
  end;
end;

registration
  let D be non empty set;
  let B be BinOp of D;
  let f be FinSequence of D;
  let X be set;
  cluster SignGen(f,B,X) -> len f-element;
  coherence
  proof
    dom SignGen(f,B,X) = dom f by Def11;
    then len SignGen(f,B,X) = len f by FINSEQ_3:29;
    hence thesis by CARD_1:def 7;
  end;
end;

reserve f,g for FinSequence of D,
        a,b,c for set,
        F,F1,F2 for finite set;

theorem Th70:
  X misses dom f implies SignGen(f,B,X) = f
proof
  assume
A1: X misses dom f;
A2: dom f = dom SignGen(f,B,X) by Def11;
  for i st i in dom f holds SignGen(f,B,X).i = f.i
  proof
    let i such that
A3:   i in dom f;
    not i in X by A3,A1,XBOOLE_0:3;
    hence thesis by A2,A3,Def11;
  end;
  hence thesis by A2;
end;

theorem Th71:
  SignGen(f,B,{}) = f
proof
  {} misses dom f;
  hence thesis by Th70;
end;

theorem Th72:
  SignGen(f|n,B,X) = SignGen(f,B,X) |n
proof
A1: len SignGen(f|n,B,X) = len (f|n) & len SignGen(f,B,X) = len f
    by CARD_1:def 7;
  per cases;
  suppose n >= len f;
    then f|n =f & SignGen(f,B,X) |n =SignGen(f,B,X) by A1,FINSEQ_1:58;
    hence thesis;
  end;
  suppose n <len f;
    then
A2:   len (f|n) = n & len SignGen(f|n,B,X) = n & len (SignGen(f,B,X) |n) =n
      by A1,FINSEQ_1:59;
    for i st 1<=i & i <= len SignGen(f|n,B,X) holds SignGen(f|n,B,X).i =
      (SignGen(f,B,X) |n).i
    proof
      let i such that
A3:     1<=i & i <= len SignGen(f|n,B,X);
A4:     i in dom SignGen(f|n,B,X) & i in dom (SignGen(f,B,X)|n)
        by A3,A2,FINSEQ_3:25;
      then
A5:     i in dom SignGen(f,B,X) by RELAT_1:57;
      per cases;
      suppose
A6:       i in X;
        hence SignGen(f|n,B,X).i = (the_inverseOp_wrt B).((f|n).i) by Def11,A4
          .= (the_inverseOp_wrt B).(f.i) by A2,A3,FINSEQ_3:112
          .= SignGen(f,B,X).i by Def11,A5,A6
          .= (SignGen(f,B,X)|n).i by A4,FUNCT_1:47;
      end;
      suppose
A7:       not i in X;
        hence SignGen(f|n,B,X).i = (f|n).i by Def11,A4
          .= f.i by A2,A3,FINSEQ_3:112
          .= SignGen(f,B,X).i by Def11,A5,A7
          .= (SignGen(f,B,X)|n).i by A4,FUNCT_1:47;
      end;
    end;
    hence thesis by A2;
  end;
end;

theorem Th73:
  n+1 = len f & n+1 in X implies
    SignGen(f,B,X) = SignGen(f|n,B,X)^<*(the_inverseOp_wrt B).(f.(n+1))*>
proof
  set n1=n+1, I=(the_inverseOp_wrt B).(f.n1);
  assume
A1: n1 = len f & n1 in X;
  n <=n+1 by NAT_1:13;
  then
A2: len (f|n)=n by A1,FINSEQ_1:59;
  then
A3: len SignGen(f|n,B,X) = n&len <*I*>=1 & len SignGen(f,B,X) = len f
      by CARD_1:def 7;
A4: SignGen(f|n,B,X) = SignGen(f,B,X) |n by Th72;
  for i st 1<= i & i <= len SignGen(f,B,X) holds SignGen(f,B,X).i =
    (SignGen(f|n,B,X)^<*I*>).i
  proof
    let i such that
A5:   1<= i & i <= len SignGen(f,B,X);
    len (SignGen(f|n,B,X)^<*I*>)=n1 by A2,CARD_1:def 7;
    then
A6:   i in dom (SignGen(f|n,B,X)^<*I*>) & i in dom SignGen(f,B,X)
      by A1,A3,A5,FINSEQ_3:25;
    then per cases by FINSEQ_1:25;
    suppose
A7:     i in dom SignGen(f|n,B,X);
      hence (SignGen(f|n,B,X)^<*I*>).i = SignGen(f|n,B,X).i by FINSEQ_1:def 7
        .=SignGen(f,B,X).i by A4,A7,FUNCT_1:47;
    end;
    suppose ex j be Nat st j in dom <*I*> & i=len SignGen(f|n,B,X) + j;
      then consider j be Nat such that
A8:     j in dom <*I*> & i=len SignGen(f|n,B,X) + j;
      j in {1} by A8,FINSEQ_1:2,def 8;
      then j=1 by TARSKI:def 1;
      hence (SignGen(f|n,B,X)^<*I*>).i=SignGen(f,B,X).i by Def11,A6,A1,A8,A3;
    end;
  end;
  hence thesis by A1,A3,FINSEQ_1:22;
end;

theorem Th74:
  n+1 = len f & not n+1 in X implies
    SignGen(f,B,X) = SignGen(f|n,B,X)^<*f.(n+1)*>
proof
  set n1=n+1, I=f.n1;
  assume
A1: n1 = len f & not n1 in X;
  n <=n+1 by NAT_1:13;
  then
A2: len (f|n)=n by A1,FINSEQ_1:59;
  then
A3: len SignGen(f|n,B,X) = n & len <*I*> =1 & len SignGen(f,B,X) = len f
    by CARD_1:def 7;
A4: SignGen(f|n,B,X) = SignGen(f,B,X) |n by Th72;
  for i st 1<= i & i <= len SignGen(f,B,X) holds SignGen(f,B,X).i =
    (SignGen(f|n,B,X)^<*I*>).i
  proof
    let i such that
A5:   1<= i & i <= len SignGen(f,B,X);
    len (SignGen(f|n,B,X)^<*I*>)=n1 by A2,CARD_1:def 7;
    then
A6:   i in dom (SignGen(f|n,B,X)^<*I*>) & i in dom SignGen(f,B,X)
      by A1,A3,A5,FINSEQ_3:25;
    then per cases by FINSEQ_1:25;
    suppose
A7:     i in dom SignGen(f|n,B,X);
      hence (SignGen(f|n,B,X)^<*I*>).i = SignGen(f|n,B,X).i by FINSEQ_1:def 7
        .= SignGen(f,B,X).i by A4,A7,FUNCT_1:47;
    end;
    suppose ex j be Nat st j in dom <*I*> & i=len SignGen(f|n,B,X) + j;
      then consider j be Nat such that
A8:     j in dom <*I*> & i=len SignGen(f|n,B,X) + j;
      j in {1} by A8,FINSEQ_1:2,def 8;
      then j=1 by TARSKI:def 1;
      hence (SignGen(f|n,B,X)^<*I*>).i = SignGen(f,B,X).i by Def11,A6,A1,A8,A3;
    end;
  end;
  hence thesis by A1,A3,FINSEQ_1:22;
end;

theorem
  dom f c= X implies SignGen(f,B,X) = (the_inverseOp_wrt B)*f
proof
  assume
A1: dom f c= X;
  rng f c= D=dom (the_inverseOp_wrt B) by FUNCT_2:def 1;
  then
A2: dom ((the_inverseOp_wrt B)*f) = dom f = dom SignGen(f,B,X)
    by Def11,RELAT_1:27;
  for k st k in dom SignGen(f,B,X) holds SignGen(f,B,X).k=
    ((the_inverseOp_wrt B)*f).k
  proof
    let k such that
A3:   k in dom SignGen(f,B,X);
    SignGen(f,B,X).k = (the_inverseOp_wrt B).(f.k) by A1,A3,A2,Def11;
    hence thesis by A3,A2,FUNCT_1:12;
  end;
  hence thesis by A2;
end;

theorem
  B is having_a_unity associative having_an_inverseOp implies
    SignGen(SignGen(f,B,X),B,X) = f
proof
  set C=SignGen(f,B,X),I=the_inverseOp_wrt B;
  assume
A1: B is having_a_unity associative having_an_inverseOp;
A2: len SignGen(C,B,X) = len C =len f by CARD_1:def 7;
A3: dom f=dom C= dom SignGen(C,B,X) by Def11;
  for k st 1 <= k & k <= len f holds SignGen(C,B,X).k = f.k
  proof
    let k such that
A4:   1 <= k & k <= len f;
A5:   k in dom f by A4,FINSEQ_3:25;
    then
A6:   f.k=f/.k by PARTFUN1:def 6;
    per cases;
    suppose
A7:     k in X;
      then C.k = (the_inverseOp_wrt B).(f.k) by A5,A3,Def11;
      then SignGen(C,B,X).k = I.(I.(f/.k)) by A5,A7,A6,A3,Def11;
      hence thesis by A1,A6,FINSEQOP:62;
    end;
    suppose
A8:     not k in X;
      then C.k = f.k by A5,A3,Def11;
      hence thesis by A5,A8,A3,Def11;
    end;
  end;
  hence thesis by A2;
end;

registration
  let E be non empty set, D be set, p be D-valued FinSequence,
      h be Function of D,E;
  cluster h*p -> (len p)-element FinSequence-like;
  coherence
  proof
    rng p c= D = dom h by FUNCT_2:def 1;
    then
A1:   dom (h*p) = dom p =Seg len p by FINSEQ_1:def 3,RELAT_1:27;
    then reconsider hp=h*p as FinSequence by FINSEQ_1:def 2;
    len hp = len p by A1,FINSEQ_3:29;
    hence thesis by CARD_1:def 7;
  end;
end;

definition
  let D be non empty set;
  let B be BinOp of D;
  let f be FinSequence of D;
  let F be finite set;
  func SignGenOp(f,B,F) -> Function of F,D* means :Def12:
    X in F implies it.X = SignGen(f,B,X);
  existence
  proof
    defpred P[object,object] means
      for X st X=$1 holds $2=SignGen(f,B,X);
A1:   for x st x in F ex y be object st y in D* & P[x,y]
    proof
      let x such that
A2:     x in F;
      reconsider X=x as set by A2;
      take SignGen(f,B,X);
      thus thesis by FINSEQ_1:def 11;
    end;
    consider f be Function of F,D* such that
A3:   for x st x in F holds P[x,f.x] from FUNCT_2:sch 1(A1);
    take f;
    thus thesis by A3;
  end;
  uniqueness
  proof
    let IT1,IT2 be Function of F,D* such that
A4:   X in F implies IT1.X = SignGen(f,B,X) and
A5:   X in F implies IT2.X = SignGen(f,B,X);
    now let x such that
A6:     x in F;
      reconsider X=x as set by A6;
      IT1.x = SignGen(f,B,X) by A4,A6;
      hence IT1.x = IT2.x by A5,A6;
    end;
    hence thesis by FUNCT_2:12;
  end;
end;

theorem Th77:
  for E be Enumeration of {x} holds E = <*x*>
proof
  let E be Enumeration of {x};
A1: len E=card {x} =1 by CARD_1:def 7;
  then 1 in dom E by FINSEQ_3:25;
  then E.1 in rng E by FUNCT_1:def 3;
  then E.1=x by TARSKI:def 1;
  hence thesis by A1,FINSEQ_1:40;
end;

theorem Th78:
 for E be Enumeration of {X} holds SignGenOp(f,B,{X}) * E= <* SignGen(f,B,X) *>
proof
  let E be Enumeration of {X};
A1: X in {X}=dom SignGenOp(f,B,{X}) & E = <*X*>
    by Th77,FUNCT_2:def 1,TARSKI:def 1;
  then SignGenOp(f,B,{X}) * E = <*SignGenOp(f,B,{X}).X*> by FINSEQ_2:34;
  hence thesis by A1,Def12;
end;

theorem Th79:
  for E1 be Enumeration of F1,E2 be Enumeration of F2 st F1 misses F2
    holds E1^E2 is Enumeration of F1\/F2
proof
  let E1 be Enumeration of F1,E2 be Enumeration of F2
    such that
A1: F1 misses F2;
  rng E1=F1 & rng E2=F2 by RLAFFIN3:def 1;
  then E1^E2 is one-to-one&rng (E1^E2) = F1\/F2 by A1,FINSEQ_1:31,FINSEQ_3:91;
  hence thesis by RLAFFIN3:def 1;
end;

theorem Th80:
for E be Enumeration of F st i in dom E or i in dom (SignGenOp(f,B,F)*E)
  holds (SignGenOp(f,B,F) * E).i = SignGen(f,B,E.i)
proof
  let E be Enumeration of F such that
A1: i in dom E or i in dom (SignGenOp(f,B,F)*E);
  set C=SignGenOp(f,B,F);
  i in dom (C*E)
  proof
    assume
A2:   not i in dom (C*E);
    then E.i in rng E = F =dom C
      by A1,FUNCT_1:def 3,FUNCT_2:def 1,RLAFFIN3:def 1;
    hence thesis by A2,A1,FUNCT_1:11;
  end;
  then (C*E).i = C.(E.i) & E.i in dom C = F by FUNCT_1:11,12,FUNCT_2:def 1;
  hence thesis by Def12;
end;

theorem Th81:
  for E1 be Enumeration of F1,E2 be Enumeration of F2,
      E12 be Enumeration of F1\/F2 st E12=E1^E2 holds
  SignGenOp(f,B,F1\/F2) * E12 =
    (SignGenOp(f,B,F1) * E1)^(SignGenOp(f,B,F2) * E2)
proof
  set C1=SignGenOp(f,B,F1),C2=SignGenOp(f,B,F2),C12=SignGenOp(f,B,F1\/F2);
  let E1 be Enumeration of F1,E2 be Enumeration of F2,
      E12 be Enumeration of F1\/F2 such that
A1: E12=E1^E2;
A2: len (C1*E1)= len E1 = card F1 & len (C2*E2)= len E2 = card F2 &
    len (C12*E12)= len E12 = card (F1\/F2) by CARD_1:def 7;
  F1=rng E1 misses rng E2=F2 by A1,FINSEQ_3:91,RLAFFIN3:def 1;
  then
A3: card (F1\/F2)=card F1 + card F2 by CARD_2:40;
A4: len (C12*E12) = len ((C1*E1)^(C2*E2)) by A2,A3,FINSEQ_1:22;
A5: dom E1 = dom (C1*E1) & dom E2 = dom (C2*E2) by A2,FINSEQ_3:30;
  for k st 1 <= k & k <= len (C12*E12) holds (C12*E12).k = ((C1*E1)^(C2*E2)).k
  proof
    let k such that
A6:   1 <= k & k <= len (C12*E12);
A7:   k in dom (C12*E12) by A6,FINSEQ_3:25;
    k in dom ((C1*E1)^(C2*E2)) by A6,A4,FINSEQ_3:25;
    then per cases by FINSEQ_1:25;
    suppose
A8:     k in dom (C1*E1);
      hence ((C1*E1)^(C2*E2)).k = (C1*E1).k by FINSEQ_1:def 7
        .= SignGen(f,B,E1.k) by A8,Th80
        .= SignGen(f,B,E12.k) by A1,A8,A5,FINSEQ_1:def 7
        .= (C12*E12).k by A7,Th80;
    end;
    suppose ex i st i in dom (C2*E2) & k = len (C1*E1)+i;
      then consider i such that
A9:     i in dom (C2*E2) & k = len (C1*E1)+i;
      thus ((C1*E1)^(C2*E2)).k = (C2*E2).i by A9,FINSEQ_1:def 7
        .= SignGen(f,B,E2.i) by A9,Th80
        .= SignGen(f,B,E12.k) by A1,A9,A5,A2,FINSEQ_1:def 7
        .= (C12*E12).k by A7,Th80;
    end;
  end;
  hence thesis by A2,A3,FINSEQ_1:22;
end;

theorem Th82:
  for E be Enumeration of F st
    (B is having_a_unity or len f >= 1)& not 1+len f in union F
  holds
    B "**" (SignGenOp(f^<*d*>,B,F)*E) = B[:](B "**" SignGenOp(f,B,F)*E,d)
proof
  let E be Enumeration of F such that
A1: B is having_a_unity or len f >= 1 and
A2: not 1+len f in union F;
  set fd=f^<*d*>,C=SignGenOp(f,B,F), Cd=SignGenOp(fd,B,F);
  len (Cd*E) = len E =len (C*E) by CARD_1:def 7;
  then
A3: dom (Cd*E) = dom E = dom (C*E) by FINSEQ_3:30;
A4: dom (B"**"(Cd*E)) = dom (Cd*E) by FUNCT_2:def 1;
  for x st x in dom (C*E) holds (B[:](B "**" C*E,d)).x =(B"**"(Cd*E)).x
  proof
    let x such that
A5:   x in dom (C*E);
    E.x in rng E=F by A5,A3,FUNCT_1:def 3,RLAFFIN3:def 1;
    then
A6:   not 1+len f in E.x by A2,TARSKI:def 4;
A7:  fd.(len f+1)= d;
A8:  fd|len f= f;
A9:  len fd = len f+1 by FINSEQ_2:16;
A10: dom (B[:](B "**" C*E,d)) = dom (C*E) by FUNCT_2:def 1;
A11: len SignGen(f,B,E.x) = len f by CARD_1:def 7;
A12: (C*E).x = SignGen(f,B,E.x) by A5,Th80;
    (Cd*E).x = SignGen(fd,B,E.x) by A5,A3,Th80;
    hence (B"**"(Cd*E)).x = B"**" SignGen(fd,B,E.x) by A3,A5,Def10
      .= B"**" (SignGen(f,B,E.x)^<*d*>) by A9,Th74,A6,A8,A7
      .= B.(B"**" SignGen(f,B,E.x),d) by A11,A1,FINSOP_1:4
      .= B.((B"**"(C*E)).x,d) by A12,A5,Def10
      .= (B[:](B"**"(C*E),d)).x by A5,A10,FUNCOP_1:27;
  end;
  hence thesis by A3,A4,FUNCT_2:def 1;
end;

theorem Th83:
  for E be Enumeration of F st
    (B is having_a_unity or len f >= 1) & 1+len f in meet F
  holds
    B "**" (SignGenOp(f^<*d*>,B,F)*E) =
      B[:](B "**" SignGenOp(f,B,F)*E,(the_inverseOp_wrt B).d)
proof
  let E be Enumeration of F such that
A1: B is having_a_unity or len f >= 1 and
A2: 1+len f in meet F;
  set fd=f^<*d*>,C=SignGenOp(f,B,F), Cd=SignGenOp(fd,B,F),
    I=the_inverseOp_wrt B;
  len (Cd*E) = len E =len (C*E) by CARD_1:def 7;
  then
A3: dom (Cd*E) = dom E = dom (C*E) by FINSEQ_3:30;
A4: dom (B"**"(Cd*E)) = dom (Cd*E) by FUNCT_2:def 1;
  for x st x in dom (C*E) holds (B[:](B "**" C*E,I.d)).x =(B"**"(Cd*E)).x
  proof
    let x such that
A5:   x in dom (C*E);
    E.x in rng E=F by A5,A3,FUNCT_1:def 3,RLAFFIN3:def 1;
    then
A6:   1+len f in E.x by A2,SETFAM_1:def 1;
A7:   fd.(len f+1)= d & fd|len f= f & len fd = len f+1 by FINSEQ_2:16;
A8:  dom (B[:](B "**" C*E,I.d)) = dom (C*E) by FUNCT_2:def 1;
A9:  len SignGen(f,B,E.x) = len f by CARD_1:def 7;
A10:  (C*E).x = SignGen(f,B,E.x) by A5,Th80;
    (Cd*E).x = SignGen(fd,B,E.x) by A5,A3,Th80;
    hence (B"**"(Cd*E)).x = B"**" SignGen(fd,B,E.x) by A3,A5,Def10
      .= B"**" (SignGen(f,B,E.x)^<*I.d*>) by A7,Th73,A6
      .= B.(B"**" SignGen(f,B,E.x),I.d) by A9,A1,FINSOP_1:4
      .= B.((B"**"(C*E)).x,I.d) by A10,A5,Def10
      .= (B[:](B"**"(C*E),I.d)).x by A5,A8,FUNCOP_1:27;
  end;
  hence thesis by A3,A4,FUNCT_2:def 1;
end;


theorem Th84:
  for E be Enumeration of F st
    (B is having_a_unity or len f >= 1) & B is associative &
     not 1+len f in union F & not 2+len f in union F
  holds
    B "**"(SignGenOp(f^<*d1*>^<*d2*>,B,F)*E) =
      B"**"(SignGenOp(f^<*B.(d1,d2)*>,B,F)*E)
proof
  let E be Enumeration of F such that
A1: (B is having_a_unity or len f >= 1) and
A2: B is associative and
A3: not 1+len f in union F & not 2+len f in union F;
A4: len (f^<*d1*>) = 1+len f by FINSEQ_2:16;
  then not 1+len (f^<*d1*>) in union F by A3;
  hence B "**" (SignGenOp(f^<*d1*>^<*d2*>,B,F)*E)
    = B[:](B "**" SignGenOp(f^<*d1*>,B,F)*E,d2) by Th82,A4,NAT_1:11
   .= B[:](B[:](B "**" SignGenOp(f,B,F)*E,d1),d2) by A1,Th82,A3
   .= B[:](B "**" SignGenOp(f,B,F)*E,B.(d1,d2)) by A2,FUNCOP_1:63
   .= B"**" (SignGenOp(f^<*B.(d1,d2)*>,B,F)*E) by A1,Th82,A3;
end;

theorem Th85:
  for E be Enumeration of F st
    (B is having_a_unity or len f >= 1) & B is associative &
     not 1+len f in union F & 2+len f in meet F
  holds
    B "**" (SignGenOp(f^<*d1*>^<*d2*>,B,F)*E)
      = B"**" (SignGenOp(f^<*B.(d1,(the_inverseOp_wrt B).d2)*>,B,F)*E)
proof
  let E be Enumeration of F such that
A1:  (B is having_a_unity or len f >= 1) and
A2:  B is associative and
A3:  not 1+len f in union F & 2+len f in meet F;
A4:  len (f^<*d1*>) = 1+len f by FINSEQ_2:16;
  then 1+len (f^<*d1*>) in meet F by A3;
  hence B "**" (SignGenOp(f^<*d1*>^<*d2*>,B,F)*E)
    = B[:](B "**" SignGenOp(f^<*d1*>,B,F)*E,(the_inverseOp_wrt B).d2)
      by Th83,A4,NAT_1:11
   .= B[:](B[:](B "**" SignGenOp(f,B,F)*E,d1),(the_inverseOp_wrt B).d2)
      by A1,Th82,A3
   .= B[:](B "**" SignGenOp(f,B,F)*E,B.(d1,(the_inverseOp_wrt B).d2))
      by A2,FUNCOP_1:63
   .= B"**" (SignGenOp(f^<*B.(d1,(the_inverseOp_wrt B).d2)*>,B,F)*E)
     by A1,Th82,A3;
end;

theorem Th86:
  for E be Enumeration of F st
    B is having_a_unity associative commutative having_an_inverseOp &
    1+len f in meet F & not 2+len f in union F
  holds
    B "**" (SignGenOp(f^<*d1*>^<*d2*>,B,F)*E) =
      B"**" (SignGenOp(f^<*B.(d1,(the_inverseOp_wrt B).d2)*>,B,F)*E)
proof
  set I=the_inverseOp_wrt B;
  let E be Enumeration of F such that
A1: B is having_a_unity associative commutative having_an_inverseOp and
A2: 1+len f in meet F & not 2+len f in union F;
A3: len (f^<*d1*>) = 1+len f by FINSEQ_2:16;
  then not 1+len (f^<*d1*>) in union F by A2;
  hence B "**" (SignGenOp(f^<*d1*>^<*d2*>,B,F)*E)
    = B[:](B "**" SignGenOp(f^<*d1*>,B,F)*E,d2) by Th82,A3,NAT_1:11
   .= B[:](B[:](B "**" SignGenOp(f,B,F)*E,I.d1),d2) by A1,Th83,A2
   .= B[:](B "**" SignGenOp(f,B,F)*E,B.(I.d1,d2)) by A1,FUNCOP_1:63
   .= B[:](B "**" SignGenOp(f,B,F)*E,I.(B.(d1,I.d2))) by Th2,A1
   .= B"**" (SignGenOp(f^<*(B.(d1,I.d2))*>,B,F)*E) by A1,Th83,A2;
end;

theorem Th87:
  for E be Enumeration of F st
    B is having_a_unity associative commutative having_an_inverseOp &
    1+len f in meet F & 2+len f in meet F
  holds
    B "**"(SignGenOp(f^<*d1*>^<*d2*>,B,F)*E) =
      B"**"(SignGenOp(f^<*B.(d1,d2)*>,B,F)*E)
proof
  set I=the_inverseOp_wrt B;
  let E be Enumeration of F such that
A1:  B is having_a_unity associative commutative having_an_inverseOp and
A2:  1+len f in meet F & 2+len f in meet F;
A3:  len (f^<*d1*>) = 1+len f by FINSEQ_2:16;
  then 1+len (f^<*d1*>) in meet F by A2;
  hence B "**" (SignGenOp(f^<*d1*>^<*d2*>,B,F)*E)
    = B[:](B "**" SignGenOp(f^<*d1*>,B,F)*E,I.d2) by Th83,A3,NAT_1:11
   .= B[:](B[:](B "**" SignGenOp(f,B,F)*E,I.d1),I.d2) by A1,Th83,A2
   .= B[:](B "**" SignGenOp(f,B,F)*E,B.(I.d1,I.d2)) by A1,FUNCOP_1:63
   .= B[:](B "**" SignGenOp(f,B,F)*E,I.(B.(d1,I.(I.d2)))) by A1,Th2
   .= B[:](B "**" SignGenOp(f,B,F)*E,I.(B.(d1,d2))) by A1,FINSEQOP:62
   .= B"**" (SignGenOp(f^<*B.(d1,d2)*>,B,F)*E) by A1,Th83,A2;
end;

theorem Th88:
  for E be Enumeration of F st X misses union F holds
    ex Ex be Enumeration of UNION(F,{X}) st
      for i st i in dom E holds Ex.i = X\/E.i
proof
  let E be Enumeration of F such that
A1: X misses union F;
  deffunc F(set)=E.$1\/X;
  consider f be Function such that
A2: dom f=dom E & for A be set st A in dom E holds f.A = F(A)
    from FUNCT_1:sch 5;
  dom E=Seg len E by FINSEQ_1:def 3;
  then reconsider f as FinSequence by A2,FINSEQ_1:def 2;
A3: rng f c= UNION(F,{X})
  proof
    let y be object;
    assume y in rng f;
    then consider x such that
A4:   x in dom f & f.x =y by FUNCT_1:def 3;
A5:   E.x in rng E = F by A2,A4,FUNCT_1:def 3,RLAFFIN3:def 1;
A6:   f.x = (E.x) \/X by A4,A2;
    X in {X} by TARSKI:def 1;
    hence thesis by A4,A6,A5,SETFAM_1:def 4;
  end;
  UNION(F,{X}) c= rng f
  proof
    let xy be object;
    assume xy in UNION(F,{X});
    then consider y,x be set such that
A7:   y in F & x in {X} & xy=y\/x by SETFAM_1:def 4;
    y in rng E by A7,RLAFFIN3:def 1;
    then consider z be object such that
A8:   z in dom E & E.z=y by FUNCT_1:def 3;
    x=X by A7,TARSKI:def 1;
    then f.z=xy by A7,A2,A8;
    hence thesis by A2,A8,FUNCT_1:def 3;
  end;
  then
A9: UNION(F,{X}) = rng f by A3;
  f is one-to-one
  proof
    let x,y such that
A10:  x in dom f & y in dom f & f.x=f.y;
    reconsider x,y as set by TARSKI:1;
    E.x in rng E & E.y in rng E by A10,A2,FUNCT_1:def 3;
    then
A11:  E.x misses X & E.y misses X by A1,XBOOLE_1:63,ZFMISC_1:74;
    f.x=F(x) & f.y = F(y) by A10,A2;
    then E.x = E.y by A10,A11,XBOOLE_1:71;
    hence thesis by A2,A10,FUNCT_1:def 4;
  end;
  then reconsider f as Enumeration of UNION(F,{X}) by A9,RLAFFIN3:def 1;
  take f;
  thus thesis by A2;
end;

theorem Th89:
  SignGen(f,B,X) = SignGen(f,B,X/\dom f)
proof
A1: dom SignGen(f,B,X)= dom f =dom SignGen(f,B,X/\dom f) by Def11;
  for i st i in dom SignGen(f,B,X) holds
    SignGen(f,B,X).i = SignGen(f,B,X/\dom f).i
  proof
    let i such that
A2:   i in dom SignGen(f,B,X);
    per cases;
    suppose i in X;
      then SignGen(f,B,X).i = (the_inverseOp_wrt B).(f.i) & i in X/\dom f
        by Def11,A1,A2,XBOOLE_0:def 4;
      hence thesis by Def11,A1,A2;
    end;
    suppose not i in X;
      then SignGen(f,B,X).i = f.i & not i in X/\dom f
        by Def11,A2,XBOOLE_0:def 4;
      hence thesis by Def11,A1,A2;
    end;
  end;
  hence thesis by A1;
end;

theorem Th90:
  for E1 be Enumeration of F1,E2 be Enumeration of F2 st
    card F1 = card F2 &
    for i st i in dom E1 holds dom f /\ E1.i = dom f /\ E2.i holds
      SignGenOp(f,A,F1)*E1 = SignGenOp(f,A,F2)*E2
proof
  let E1 be Enumeration of F1,E2 be Enumeration of F2 such that
A1: card F1 = card F2 and
A2: for i st i in dom E1 holds dom f /\ E1.i = dom f /\ E2.i;
  set C1=SignGenOp(f,A,F1), C2=SignGenOp(f,A,F2);
A3: len (C1*E1)= len E1 = card F1 &
    len (C2*E2)= len E2 = card F2 by CARD_1:def 7;
  for i st 1<=i <= len E1  holds (C1*E1).i = (C2*E2).i
  proof
    let i;
    assume
A4:   1<= i <= len E1;
    then
A5:   i in dom E1 & i in dom E2 by A1,A3,FINSEQ_3:25;
    hence (C1*E1).i = SignGen(f,A,E1.i) by Th80
      .= SignGen(f,A,dom f /\E1.i) by Th89
      .= SignGen(f,A,dom f /\E2.i) by A4,A2,FINSEQ_3:25
      .= SignGen(f,A,E2.i) by Th89
      .= (C2*E2).i by Th80,A5;
  end;
  hence thesis by A1,A3;
end;

theorem Th91:
  A is having_a_unity associative commutative having_an_inverseOp
implies
  for F be finite non empty set st union F c= dom f
    for F1,F2 be finite set st F1 = UNION(F,bool {len f+1}) &
       F2 = UNION(F,bool {len f+1,len f+2}) holds
    ex E1 be Enumeration of F1,E2 be Enumeration of F2 st
      A "**" (SignGenOp(f^<*d1*>^<*d2*>,A,F2)*E2) = (
         A"**" (SignGenOp(f^<*A.(d1,d2)*>,A,F1)*E1)) ^
        (A"**" (SignGenOp(f^<*A.(d1,(the_inverseOp_wrt A).d2)*>,A,F1)*E1))
proof
  assume
A1: A is having_a_unity associative commutative having_an_inverseOp;
  let F be non empty finite set such that
A2: union F c= dom f;
  let F1,F2 be finite set such that
A3: F1 = UNION(F,bool {len f+1}) &
         F2 = UNION(F,bool {len f+1,len f+2});
  set L=len f;
  set U1= UNION(F,{{L+1}}),U2= UNION(F,{{L+2}}),U12= UNION(F,{{L+1,L+2}});
  set E = the Enumeration of F;
  set I=the_inverseOp_wrt A;
  set f12=f^<*d1*>^<*d2*>,fA = f^<*A.(d1,d2)*>,fAI = f^<*A.(d1,I.d2)*>;
A4: 0+L < 2+L & 1+L < 2+L by XREAL_1:8;
  then
A5: not L+2 in union F by A2,FINSEQ_3:25;
A6: L < L + 1 by NAT_1:13;
  then
A7: not L+1 in union F by A2,FINSEQ_3:25;
  then consider E1 be Enumeration of U1 such that
A8: for i st i in dom E holds E1.i = {L+1}\/E.i by Th88,ZFMISC_1:50;
  L+1 in {L+1} by TARSKI:def 1;
  then
A9: L+1 in {L+1}\/meet F = meet U1 by SETFAM_1:24,XBOOLE_0:def 3;
A10: not L+2 in union U1
  proof
    assume L+2 in union U1;
    then consider XY be set such that
A11:  L+2 in XY in U1 by TARSKI:def 4;
    consider X,Y such that
A12:  X in F & Y in {{L+1}} & XY=X\/Y by A11,SETFAM_1:def 4;
    L+1 <>L+2;
    then not L+2 in {L+1} & {L+1}=Y by A12,TARSKI:def 1;
    then L+2 in X c= union F by A11,A12,XBOOLE_0:def 3,ZFMISC_1:74;
    then L+2 in dom f by A2;
    hence thesis by A4,FINSEQ_3:25;
  end;
  L+2 in {L+2} by TARSKI:def 1;
  then
A13: L+2 in {L+2}\/meet F = meet U2 by SETFAM_1:24,XBOOLE_0:def 3;
A14: not L+1 in union U2
  proof
    assume L+1 in union U2;
    then consider XY be set such that
A15:  L+1 in XY in U2 by TARSKI:def 4;
    consider X,Y such that
A16:  X in F & Y in {{L+2}} & XY=X\/Y by A15,SETFAM_1:def 4;
    L+1 <>L+2;
    then not L+1 in {L+2} & {L+2}=Y by A16,TARSKI:def 1;
    then L+1 in X c= union F by A15,A16,XBOOLE_0:def 3,ZFMISC_1:74;
    then L+1 in dom f by A2;
    hence thesis by A6,FINSEQ_3:25;
  end;
  a in U12 implies L+1 in a & L+2 in a
  proof
    assume a in U12;
    then consider X,Y such that
A17:  X in F & Y in {{L+1,L+2}} & a=X\/Y by SETFAM_1:def 4;
    L+1 in {L+1,L+2} & L+2 in {L+1,L+2} = Y by A17,TARSKI:def 1,def 2;
    hence thesis by A17,XBOOLE_0:def 3;
  end;
  then (a in U12 implies L+1 in a ) &(a in U12 implies L+2 in a);
  then
A18: L+1 in meet U12 & L+2 in meet U12 by SETFAM_1:def 1;
  consider E2 be Enumeration of U2 such that
A19: for i st i in dom E holds E2.i = {L+2}\/E.i by Th88,A5,ZFMISC_1:50;
  consider E12 be Enumeration of U12 such that
A20: for i st i in dom E holds E12.i={L+1,L+2}\/E.i by Th88,A5,A7,ZFMISC_1:51;
  F misses U1
  proof
    assume F meets U1;
    then consider x such that
A21:  x in F & x in U1 by XBOOLE_0:3;
    consider X,Y such that
A22:  X in F & Y in {{L+1}} & x=X\/Y by A21,SETFAM_1:def 4;
    Y = {L+1} by A22,TARSKI:def 1;
    then L+1 in Y by TARSKI:def 1;
    then L+1 in X\/Y by XBOOLE_0:def 3;
    hence thesis by A7,A21,A22,TARSKI:def 4;
  end;
  then reconsider EE1 = E^E1 as Enumeration of F\/U1 by Th79;
  U1 misses U2
  proof
    assume U1 meets U2;
    then consider x such that
A23:  x in U1 & x in U2 by XBOOLE_0:3;
    consider X1,Y1 be set such that
A24:  X1 in F & Y1 in {{L+1}} & x=X1\/Y1 by A23,SETFAM_1:def 4;
    Y1 = {L+1} by A24,TARSKI:def 1;
    then L+1 in Y1 by TARSKI:def 1;
    then L+1 in X1\/Y1 by XBOOLE_0:def 3;
    hence thesis by A14,A23,A24,TARSKI:def 4;
  end;
  then reconsider E2E1 = E2^E1 as Enumeration of U2\/U1 by Th79;
  F misses U12
  proof
    assume F meets U12;
    then consider x such that
A25:  x in F & x in U12 by XBOOLE_0:3;
    consider X,Y such that
A26:  X in F & Y in {{L+1,L+2}} & x=X\/Y by A25,SETFAM_1:def 4;
    Y = {L+1,L+2} by A26,TARSKI:def 1;
    then L+1 in Y by TARSKI:def 2;
    then L+1 in X\/Y by XBOOLE_0:def 3;
    hence thesis by A7,A25,A26,TARSKI:def 4;
  end;
  then reconsider EE12 = E^E12 as Enumeration of F\/U12 by Th79;
A27: card U12 = card F = card U2 by A5,A7,Th8,ZFMISC_1:50,51;
A28: card U12 = card F = card U1 by A5,A7,Th8,ZFMISC_1:50,51;
  len E1 = card U1 & len E12 = card U12 & len E=card F by CARD_1:def 7;
  then
A29: dom E1 = dom E = dom E12 by A28,FINSEQ_3:30;
A30: len fA=L+1 by FINSEQ_2:16;
  then
A31: dom fA = Seg (L+1) by FINSEQ_1:def 3;
  len fAI=L+1 by FINSEQ_2:16;
  then
A32: dom fAI = dom fA by A31,FINSEQ_1:def 3;
  not L+2 in dom fA by A30,A4,FINSEQ_3:25;
  then
A33: {L+2} misses dom fA by ZFMISC_1:50;
A34: for i st i in dom E1 holds dom fA /\ E1.i = dom fA /\ E12.i
  proof
    let i such that
A35:  i in dom E1;
A36:  E12.i = {L+1,L+2}\/E.i by A35,A20,A29;
A37:  E1.i = {L+1}\/E.i by A35,A8,A29;
    {L+1,L+2}={L+1} \/{L+2} by ENUMSET1:1;
    then E12.i = E1.i \/{L+2} by A36,A37,XBOOLE_1:4;
    then dom fA /\ E12.i = (dom fA /\ E1.i)\/(dom fA /\ {L+2}) by XBOOLE_1:23;
    hence thesis by A33;
  end;
A38: for i st i in dom E holds dom fAI /\ E.i = dom fAI /\ E2.i
  proof
    let i such that
A39:  i in dom E;
    E2.i = {L+2}\/E.i by A39,A19;
    then dom fAI /\ E2.i = (dom fAI /\ E.i)\/(dom fAI /\ {L+2}) by XBOOLE_1:23;
    hence thesis by A33,A32;
  end;
  F\/U12 misses U2\/U1
  proof
    assume F\/U12 meets U2\/U1;
    then consider x such that
A40:  x in F\/U12 & x in U2\/U1 by XBOOLE_0:3;
    per cases by A40,XBOOLE_0:def 3;
    suppose
A41:    x in F;
      per cases by A40,XBOOLE_0:def 3;
      suppose x in U2;
        then consider X,Y such that
A42:      X in F & Y in {{L+2}} & x=X\/Y by SETFAM_1:def 4;
        Y = {L+2} by A42,TARSKI:def 1;
        then L+2 in Y by TARSKI:def 1;
        then L+2 in X\/Y by XBOOLE_0:def 3;
        hence thesis by A5,A42,A41,TARSKI:def 4;
      end;
      suppose x in U1;
        then consider X,Y such that
A43:      X in F & Y in {{L+1}} & x=X\/Y by SETFAM_1:def 4;
        Y = {L+1} by A43,TARSKI:def 1;
        then L+1 in Y by TARSKI:def 1;
        then L+1 in X\/Y by XBOOLE_0:def 3;
        hence thesis by A7,A43,A41,TARSKI:def 4;
      end;
    end;
    suppose x in U12;
      then consider X,Y such that
A44:    X in F & Y in {{L+1,L+2}} & x=X\/Y by SETFAM_1:def 4;
A45:    x in U1 or x in U2 by A40,XBOOLE_0:def 3;
      Y = {L+1,L+2} by A44,TARSKI:def 1;
      then L+1 in Y & L+2 in Y by TARSKI:def 2;
      then L+1 in X\/Y & L+2 in X\/Y by XBOOLE_0:def 3;
      hence thesis by A14,A10,A45,A44,TARSKI:def 4;
    end;
  end;
  then reconsider ET = EE12^E2E1 as Enumeration of (F\/U12)\/(U2\/U1) by Th79;
A46: ( {{}}\/{{L+1,L+2}} )\/({{L+1}}\/{{L+2}}) = bool {L+1,L+2}
  proof
    thus ( {{}}\/{{L+1,L+2}} )\/({{L+1}}\/{{L+2}}) c= bool {L+1,L+2}
    proof
      let y be object;
      reconsider a=y as set by TARSKI:1;
      assume y in ( {{}}\/{{L+1,L+2}} )\/({{L+1}}\/{{L+2}});
      then y in {{}}\/{{L+1,L+2}} or y in {{L+1}}\/{{L+2}} by XBOOLE_0:def 3;
      then (y in {{}} or y in {{L+1,L+2}}) or (y in {{L+1}} or y in {{L+2}})
        by XBOOLE_0:def 3;
      then (y = {} or y ={L+1,L+2}) or (y ={L+1} or y = {L+2}) by TARSKI:def 1;
      then a c= {L+1,L+2} by ZFMISC_1:36;
      hence thesis;
    end;
    let y be object such that
A47:  y in bool {L+1,L+2};
    reconsider y as set by TARSKI:1;
    (y = {} or y ={L+1,L+2}) or (y ={L+1} or y = {L+2}) by A47,ZFMISC_1:36;
    then (y in {{}} or y in {{L+1,L+2}}) or (y in {{L+1}} or y in {{L+2}})
      by TARSKI:def 1;
    then y in {{}}\/{{L+1,L+2}} or y in {{L+1}}\/{{L+2}} by XBOOLE_0:def 3;
    hence thesis by XBOOLE_0:def 3;
  end;
A48: F=UNION(F,{{}})
  proof
    thus F c= UNION(F,{{}})
    proof
      let y be object such that
A49:    y in F;
      reconsider y as set by TARSKI:1;
      {} in {{}} by TARSKI:def 1;
      then y\/{} in UNION(F,{{}}) by A49,SETFAM_1:def 4;
      hence thesis;
    end;
    let y such that
A50:  y in UNION(F,{{}});
    consider X,Y such that
A51:  X in F &Y in {{}} & y = X\/Y by A50,SETFAM_1:def 4;
    Y={} by A51;
    hence thesis by A51;
  end;
  then
A52: F\/U12 = UNION(F, {{}}\/{{L+1,L+2}}) &
     U2\/U1 = UNION(F,{{L+1}}\/{{L+2}}) by Th7;
  then reconsider et=ET as Enumeration of F2 by A3,A46,Th7;
A53: F\/U1 = UNION(F, {{}}\/{{L+1}}) by A48,Th7
    .= UNION(F, {{}, {L+1}}) by ENUMSET1:1
    .= F1 by A3,ZFMISC_1:24;
  then reconsider ee1=EE1 as Enumeration of F1;
  take ee1,et;
A54: A "**" (SignGenOp(f12,A,F\/U12)*EE12)
    = A"**"((SignGenOp(f12,A,F)*E) ^ (SignGenOp(f12,A,U12)*E12)) by Th81
   .= (A"**"(SignGenOp(f12,A,F)*E))^(A"**"(SignGenOp(f12,A,U12)*E12)) by Th63
   .= (A "**" (SignGenOp(fA,A,F)*E))^(A"**"(SignGenOp(f12,A,U12)*E12))
     by Th84,A1,A5,A7
   .= (A "**" (SignGenOp(fA,A,F)*E))^(A"**"(SignGenOp(fA,A,U12)*E12))
   by Th87,A1,A18
   .= A "**" ( (SignGenOp(fA,A,F)*E)^(SignGenOp(fA,A,U12)*E12)) by Th63
   .= A "**" ( (SignGenOp(fA,A,F)*E)^(SignGenOp(fA,A,U1)*E1)) by A34,A28,Th90
   .= A "**" (SignGenOp(fA,A,F1)*ee1) by A53,Th81;
A55: A "**" (SignGenOp(f12,A,U2\/U1)*E2E1)
    = A "**" ((SignGenOp(f12,A,U2)*E2)^(SignGenOp(f12,A,U1)*E1)) by Th81
   .= (A "**" (SignGenOp(f12,A,U2)*E2))^(A"**" (SignGenOp(f12,A,U1)*E1))
     by Th63
   .= (A "**" (SignGenOp(f12,A,U2)*E2))^(A "**" (SignGenOp(fAI,A,U1)*E1))
      by Th86,A1,A9,A10
   .= (A "**" (SignGenOp(fAI,A,U2)*E2))^(A "**" (SignGenOp(fAI,A,U1)*E1))
      by Th85,A1,A14,A13
   .= (A "**" (SignGenOp(fAI,A,F)*E))^(A "**" (SignGenOp(fAI,A,U1)*E1))
      by A27,Th90,A38
   .= A "**" ((SignGenOp(fAI,A,F)*E)^(SignGenOp(fAI,A,U1)*E1)) by Th63
   .= A "**" (SignGenOp(fAI,A,F1)*ee1) by A53,Th81;
  SignGenOp(f12,A,F2)*et = SignGenOp(f12,A,(F\/U12)\/(U2\/U1))*ET
    by A3,A46,A52,Th7
    .= (SignGenOp(f12,A,(F\/U12))*EE12)^(SignGenOp(f12,A,(U2\/U1))*E2E1)
     by Th81;
  hence A"**" (SignGenOp(f12,A,F2)*et)
      = (A "**" (SignGenOp(fA,A,F1)*ee1))^ (A "**" (SignGenOp(fAI,A,F1)*ee1))
    by A54,A55,Th63;
end;

begin :: Product over All Combinations of Sings

definition
  let D be non empty set;
  let A be BinOp of D;
  let M be BinOp of D such that
A1: M is commutative associative;
  let f be FinSequence of D;
  let F be finite set;
  func SignGenOp(f,M,A,F)-> Element of D means :Def13:
    for E be Enumeration of bool F holds
      it = M $$ ([#]dom (SignGenOp(f,A,bool F) * E),
          A "**" (SignGenOp(f,A,bool F) * E));
  existence
  proof
    set C=SignGenOp(f,A,bool F);
    set E=the Enumeration of bool F;
    take IT =M $$ ([#]dom (C * E), A "**" (C * E));
    let G be Enumeration of bool F;
A2:   rng E= bool F=rng G by RLAFFIN3:def 1;
    then consider s be Function such that
A3:   dom s = dom E & rng s = dom G & s is one-to-one & E = G*s
      by CLASSES1:77,RFINSEQ:26;
A4:   E,G are_fiberwise_equipotent by A2,RFINSEQ:26;
    len (C*E) = len E & len G = len (C*G) by CARD_1:def 7;
    then
A5:   dom (C*E) = dom E =dom G = dom (C*G) by A4,FINSEQ_3:30,RFINSEQ:3;
A6:   (A "**" (C * E)) | dom s = (A "**" (C * E)) by A3,A5;
A7:   dom (A "**" (C * G)) = dom G & dom (A "**" (C * E)) = dom E
      by A5,FUNCT_2:def 1;
    for x st x in dom s holds (A "**" (C * E)).x = ((A "**" (C * G)) *s).x
    proof
      let x such that
A8:     x in dom s;
      reconsider i=x as Nat by A8,A3;
A9:     s.i in dom G by A3,A8,FUNCT_1:11;
      thus ((A "**" (C * G)) *s).x = (A "**" (C * G)) .(s.i) by A8,FUNCT_1:13
      .= A"**" ((C * G) .(s.i)) by A9,A5,Def10
      .= A"**" (C. (G .(s.i))) by A9,FUNCT_1:13
      .= A"**" (C. (E.i)) by A8,A3,FUNCT_1:13
      .= A"**" ((C *E).i) by A8,A3,FUNCT_1:13
      .= (A "**" (C * E)).x by A8,A3,A5,Def10;
    end;
    then A "**" (C * E) = (A "**" (C * G)) *s by A3,A7,RELAT_1:27;
    hence thesis by A6,A3,A5,A1,SETWOP_2:5;
  end;
  uniqueness
  proof
    let it1,it2 be Element of D such that
A10:  for E be Enumeration of bool F holds
      it1 = M $$ ([#]dom (SignGenOp(f,A,bool F) * E),
            A "**" (SignGenOp(f,A,bool F) * E)) and
A11:  for E be Enumeration of bool F holds
      it2 = M $$ ([#]dom (SignGenOp(f,A,bool F) * E),
            A "**" (SignGenOp(f,A,bool F) * E));
    set E = the Enumeration of bool F;
    it1 = M $$ ([#]dom (SignGenOp(f,A,bool F) * E),
       A "**" (SignGenOp(f,A,bool F) * E)) by A10;
    hence thesis by A11;
  end;
end;

theorem Th92:
  M is commutative associative &
      A is commutative & A is associative & A is having_a_unity &
      A is having_an_inverseOp &
      M is_distributive_wrt A
implies
  for CE1,CE2,CE12 be non-empty non empty FinSequence of D* st
      CE12 = CE1 ^  CE2
  for S1 be Element of Fin dom App CE1, s2 be Element of dom App CE2,
      S12 be Element of Fin dom App CE12 st S12=S1^{s2}
  holds
    M.(A $$ (S1,M "**" App CE1),(M "**" App CE2).s2) =
      A $$ (S12,M "**" App CE12)
proof
  assume
A1:   M is commutative associative &
      A is commutative & A is associative & A is having_a_unity &
      A is having_an_inverseOp &
      M is_distributive_wrt A;
  let CE1,CE2,CE12 be non-empty non empty FinSequence of D* such that
A2: CE12 = CE1^CE2;
  let S1 be Element of Fin dom App CE1,s2 be Element of dom App CE2,
      S12 be Element of Fin dom App CE12 such that
A3: S12=S1^{s2};
  defpred P[set] means
    for S1 be Element of Fin dom App CE1,
      S12 be Element of Fin dom App CE12 st S1=$1 & S12=S1^{s2}
    holds
      M.(A $$ (S1,M "**" App CE1),A $$ ({.s2.},M "**" App CE2)) =
          A $$ (S12,M "**" App CE12);
A4: P[{}.(dom App CE1)]
  proof
    let S1 be Element of Fin dom App CE1,
    S12 be Element of Fin dom App CE12 such that
A5:   S1={}.(dom App CE1) & S12=S1^{s2};
    S1^{s2}={}.(dom App CE12) by A5;
    then
A6:   A $$ (S12,M "**" App CE12) = the_unity_wrt A by A1,A5,SETWISEO:31;
    A $$ (S1,M "**" App CE1) = the_unity_wrt A by A5,A1,SETWISEO:31;
    hence thesis by A6,A1,FINSEQOP:66;
  end;
A7: for B9 being (Element of Fin dom App CE1), b being Element of dom App CE1
    holds P[B9] & not b in B9 implies P[B9 \/ {b}]
  proof
    let B9 be (Element of Fin dom App CE1), b be Element of dom App CE1
      such that
A8:   P[B9] & not b in B9;
    let S1 be Element of Fin dom App CE1,
        S12 be Element of Fin dom App CE12 such that
A9:  S1=B9 \/ {b} & S12=S1^{s2};
A10:  S12 c= dom App CE12 by FINSUB_1:def 5;
    B9 c= S1 by A9,XBOOLE_1:7;
    then B9^{s2} c= S1^{s2} by POLNOT_1:16;
    then B9^{s2} c= dom App CE12 by A9,A10;
    then reconsider Bs=B9^{s2} as Element of Fin dom App CE12
      by FINSUB_1:def 5;
    {b} c= S1 by A9,XBOOLE_1:7;
    then {b}^{s2} c= S1^{s2} by POLNOT_1:16;
    then {b}^{s2} c= dom App CE12 by A9,A10;
    then reconsider bs = {.b.} ^ {.s2.} as Element of Fin dom App CE12
      by FINSUB_1:def 5;
    b^s2 in doms CE12 by Th48,A2;
    then reconsider BS2=b^s2 as Element of dom App CE12 by Def9;
A11:  len ((App CE1).b) >=1 & len ((App CE2).s2) >=1 by NAT_1:14;
    bs = {b^s2} by Th43;
    then
A12:  A $$ (bs,M "**" App CE12) = (M "**" App CE12).BS2
      by A1,SETWISEO:17
    .= M "**" ((App CE12).BS2) by Def10
    .= M "**" (((App CE1).b)^((App CE2).s2)) by A2,Th61
    .= M.((M "**" ((App CE1).b)),(M "**"((App CE2).s2))) by A11,A1,FINSOP_1:5
    .= M.( (M "**" (App CE1)).b,(M "**"((App CE2).s2))) by Def10
    .= M.( (M "**" (App CE1)).b,(M "**"(App CE2)).s2) by Def10
    .= M.( A $$ ({.b.},M "**" App CE1),(M "**"(App CE2)).s2) by A1,SETWISEO:17
    .= M.( A $$ ({.b.},M "**" App CE1), A $$ ({.s2.},M "**" App CE2))
      by A1,SETWISEO:17;
A13:  B9 misses {b} by A8,ZFMISC_1:50;
A14:  Bs misses bs
    proof
      assume Bs meets bs;
      then consider x such that
A15:    x in Bs & x in bs by XBOOLE_0:3;
      consider p1, q1 be FinSequence such that
A16:    x = p1^q1 & p1 in B9 & q1 in {s2} by A15,POLNOT_1:def 2;
      consider p2, q2 be FinSequence such that
A17:    x = p2^q2 & p2 in {b} & q2 in {s2} by A15,POLNOT_1:def 2;
      q1 =s2 = q2 by A16,A17,TARSKI:def 1;
      then p1=p2 by A16,A17,FINSEQ_1:33;
      hence thesis by A16,A17,A8,TARSKI:def 1;
    end;
    S12 = Bs \/ bs by A9,Th42;
    then A $$ (S12,M "**" App CE12) = A.( A $$ (Bs,M "**" App CE12),
      A $$ (bs,M "**" App CE12)) by A14,A1,SETWOP_2:4
    .= A.( M.(A $$ (B9,M "**" App CE1),A $$ ({.s2.},M "**" App CE2)),
      M.(A $$ ({.b.},M "**" App CE1),A $$ ({.s2.},M "**" App CE2))) by A8,A12
    .= M. (A. (A $$ (B9,M "**" App CE1),A $$ ({.b.},M "**" App CE1)),
      A $$ ({.s2.},M "**" App CE2)) by A1,BINOP_1:11
    .= M. (A $$ (S1,M "**" App CE1),A $$ ({.s2.},M "**" App CE2))
      by A9,A13,A1,SETWOP_2:4;
    hence thesis;
  end;
  for B be Element of Fin dom App CE1  holds P[B] from SETWISEO:sch 2(A4,A7);
  then M.(A $$ (S1,M "**" App CE1),A $$ ({.s2.},M "**" App CE2)) =
    A $$ (S12,M "**" App CE12) by A3;
  hence thesis by A1,SETWISEO:17;
end;

theorem Th93:
  M is commutative associative &
  A is commutative & A is associative & A is having_a_unity &
  A is having_an_inverseOp &
  M is_distributive_wrt A
implies
  for CE1,CE2,CE12 be non-empty non empty FinSequence of D* st
    CE12 = CE1 ^ CE2
  for S1 be Element of Fin dom App CE1,S2 be Element of Fin dom App CE2,
    S12 be Element of Fin dom App CE12 st S12=S1^S2
  holds
    M.(A $$ (S1,M "**" App CE1),A $$ (S2,M "**" App CE2)) =
      A $$ (S12,M "**" App CE12)
proof
  assume that
A1: M is commutative associative and
A2: A is commutative & A is associative & A is having_a_unity &
    A is having_an_inverseOp and
A3: M is_distributive_wrt A;
  let CE1,CE2,CE12 be non-empty non empty FinSequence of D* such that
A4: CE12 = CE1^CE2;
  let S1 be Element of Fin dom App CE1;
  set aS1=A $$ (S1,M "**" App CE1);
  defpred P[Nat] means
    for S2 be Element of Fin dom App CE2,
      S12 be Element of Fin dom App CE12 st card S2=$1 & S12=S1^S2
    holds M.(aS1,A $$ (S2,M "**" App CE2)) = A $$ (S12,M "**" App CE12);
A5: P[0]
  proof
    let S2 be Element of Fin dom App CE2,
      S12 be Element of Fin dom App CE12 such that
A6:   card S2=0 & S12=S1^S2;
    S2 is empty by A6;
    then
A7:   S1^S2={}.(dom App CE12);
    S2={}.(dom App CE2) by A6;
    then A $$ (S2,M "**" App CE2) = the_unity_wrt A by A2,SETWISEO:31;
    then M.(aS1,A $$ (S2,M "**" App CE2))=the_unity_wrt A by A2,A3,FINSEQOP:66;
    hence thesis by A7,A6,A2,SETWISEO:31;
  end;
A8: P[n] implies P[n+1]
  proof
    assume
A9:   P[n];
    let S2 be Element of Fin dom App CE2,
        S12 be Element of Fin dom App CE12 such that
A10:  card S2=n+1 & S12=S1^S2;
    S2 is non empty by A10;
    then consider s be object such that
A11:  s in S2;
    S2 c= dom App CE2 by FINSUB_1:def 5;
    then reconsider s as Element of dom App CE2 by A11;
    S2 c= dom App CE2 by FINSUB_1:def 5;
    then S2\{s} c= dom App CE2;
    then reconsider S2s=S2\{s} as Element of Fin dom App CE2 by FINSUB_1:def 5;
A12:  card S2s = n by A10,A11,STIRL2_1:55;
A13:  not s in S2s by ZFMISC_1:56;
A14:  S2s\/{s} = S2 by A11,ZFMISC_1:116;
A15:  S12 c= dom App CE12 by FINSUB_1:def 5;
    S1^S2s c= S1^S2 by POLNOT_1:16;
    then S1^S2s c= dom App CE12 by A15,A10;then
    reconsider S1S2s = S1^S2s as Element of Fin dom App CE12 by FINSUB_1:def 5;
    {s} c= S2 by A11,ZFMISC_1:31;
    then S1^{s} c= S1^S2 by POLNOT_1:16;
    then S1^{s} c= dom App CE12 by A15,A10;
    then reconsider S1s = S1^{.s.} as Element of Fin dom App CE12
      by FINSUB_1:def 5;
A16:  S1s misses S1S2s
    proof
      assume S1s meets S1S2s;
      then consider x such that
A17:    x in S1s & x in S1S2s by XBOOLE_0:3;
      consider p1, q1 be FinSequence such that
A18:    x = p1^q1 & p1 in S1 & q1 in {s} by A17,POLNOT_1:def 2;
      consider p2, q2 be FinSequence such that
A19:    x = p2^q2 & p2 in S1 & q2 in S2\{s} by A17,POLNOT_1:def 2;
      S1 c= dom App CE1 by FINSUB_1:def 5;
      then p1 in dom App CE1 & p2 in dom App CE1 by A18,A19;
      then len p1 = len CE1 =len p2 by Th47;
      then p1 = (p1^q1) | len p1 = p2 by A18,A19,FINSEQ_5:23;
      then s=q1=q2 by A18,A19,FINSEQ_1:33,TARSKI:def 1;
      hence thesis by A19,ZFMISC_1:56;
    end;
A20:  A $$ (S12,M "**" App CE12) = A $$ (S1s\/S1S2s,M "**" App CE12)
        by A10,A14,Th41
      .=A.(A $$ (S1s,M "**" App CE12),A $$ (S1S2s,M "**" App CE12))
        by A16,A2,SETWOP_2:4;
    A $$ (S12,M "**" App CE12) = A.(A $$ (S1s,M "**" App CE12),
      M.(aS1,A $$ (S2s,M "**" App CE2))) by A9,A12,A20
    .= A.(M.(aS1,(M "**" App CE2).s), M.(aS1,A $$ (S2s,M "**" App CE2)))
       by Th92,A1,A2,A3,A4
    .= A.(M.(aS1,A $$ (S2s,M "**" App CE2)),M.(aS1,(M "**" App CE2).s))
       by A2,BINOP_1:def 2
    .=M.(aS1,A.(A $$ (S2s,M "**" App CE2),(M "**" App CE2).s))
      by A3,BINOP_1:11
    .=M.(aS1,A $$ (S2,M "**" App CE2)) by A14,A13,A2,SETWOP_2:2;
    hence thesis;
  end;
  let S2 be Element of Fin dom App CE2;
  P[n] from NAT_1:sch 2(A5,A8);
  then P[card S2];
  hence thesis;
end;

theorem
  for E1 be Enumeration of F1 holds
    doms (SignGenOp(f,A,F1) * E1) c= doms (SignGenOp(f^g,A,F1) * E1)
proof
  let E1 be Enumeration of F1;
  let x such that
A1: x in doms (SignGenOp(f,A,F1) * E1);
  reconsider x as FinSequence by A1;
A2: len (SignGenOp(f,A,F1) * E1)=len E1 by CARD_1:def 7;
  then
A3: len x = len E1 by A1,Th47;
  then
A4: len x = len (SignGenOp(f^g,A,F1) * E1) by CARD_1:def 7;
  then
A5: dom x = dom (SignGenOp(f^g,A,F1) * E1) by FINSEQ_3:30;
A6: dom x = dom (SignGenOp(f,A,F1) * E1) by A2,A3,FINSEQ_3:30;
  for i st i in dom x holds x.i in dom ((SignGenOp(f^g,A,F1) * E1).i)
  proof
    let i such that
A7:   i in dom x;
A8:   dom f c= dom (f^g) by FINSEQ_1:26;
A9:   x.i in dom ((SignGenOp(f,A,F1) * E1).i) by A7,A1,Th47;
    (SignGenOp(f,A,F1) * E1).i = SignGen(f,A,E1.i) by Th80,A7,A6;
    then len((SignGenOp(f,A,F1) * E1).i) = len (f) by CARD_1:def 7;
    then
A10:  dom((SignGenOp(f,A,F1) * E1).i) = dom (f) by FINSEQ_3:30;
    (SignGenOp(f^g,A,F1) * E1).i = SignGen(f^g,A,E1.i) by A7,A5,Th80;
    then len((SignGenOp(f^g,A,F1) * E1).i) = len (f^g) by CARD_1:def 7;
    then dom((SignGenOp(f^g,A,F1) * E1).i) = dom (f^g) by FINSEQ_3:30;
    hence thesis by A8,A9,A10;
  end;
  hence thesis by A4,Th47;
end;

theorem
  A is having_a_unity commutative associative
implies
  for E1 be Enumeration of F1
  for CE1,CE2 be non-empty non empty FinSequence of D* st
    CE1 = SignGenOp(f,A,F1) * E1 & CE2 = SignGenOp(f^g,A,F1) * E1
  for S1 be Element of Fin dom App CE1
  for S2 be Element of Fin dom App CE2 st S1=S2 holds
    A $$ (S1,M "**" App CE1) = A $$ (S2,M "**" App CE2)
proof
  assume
A1: A is having_a_unity commutative associative;
  let E1 be Enumeration of F1;
  let CE1,CE2 be non-empty non empty FinSequence of D* such that
A2: CE1 = SignGenOp(f,A,F1) * E1 & CE2 = SignGenOp(f^g,A,F1) * E1;
  let S1 be Element of Fin dom App CE1;
  let S2 be Element of Fin dom App CE2 such that
A3: S1=S2;
A4: S1 c= dom App CE1 = dom (M "**" App CE1) by FINSUB_1:def 5,FUNCT_2:def 1;
A5: S2 c= dom App CE2 = dom (M "**" App CE2) by FINSUB_1:def 5,FUNCT_2:def 1;
  then
A6: dom ((M "**" App CE2) | S2) = S2 by RELAT_1:62;
  for x st x in dom ((M "**" App CE1) | S1) holds
    ((M "**" App CE1) | S1).x = ((M "**" App CE2) | S2).x
  proof
    let x such that
A7:   x in dom ((M "**" App CE1) | S1);
A8:   x in dom (App CE1) by A7,A4;
    reconsider x as FinSequence by A7;
A9:   x in dom (App CE2) by A7,A5,A3;
    len CE2 = len x = len CE1 by A8,A9,Th47;
    then
A10:  dom CE2 = dom x = dom CE1 by FINSEQ_3:30;
    len ((App CE1).x) = len x = len ((App CE2).x) by A8,A9,Def9;
    then
A11:  dom ((App CE1).x) = dom x = dom ((App CE2).x) by FINSEQ_3:30;
    for i st i in dom ((App CE1).x) holds ((App CE1).x).i = ((App CE2).x).i
    proof
      let i such that
A12:    i in dom ((App CE1).x);
      CE2.i.(x.i) = CE1.i.(x.i)
      proof
A13:      x.i in dom (CE1.i) & x.i in dom (CE2.i) by Th47,A8,A9,A11,A12;
A14:      CE1.i = SignGen(f, A,E1.i) by A2,A12,A10,A11,Th80;
A15:      CE2.i = SignGen(f^g,A,E1.i) by A2,A12,A10,A11,Th80;
A16:      x.i in dom f by Def11,A13,A14;
        per cases;
        suppose
A17:        x.i in E1.i;
          hence CE2.i.(x.i) = (the_inverseOp_wrt A).((f^g).(x.i))
             by A15,Def11,A13
          .= (the_inverseOp_wrt A).(f.(x.i)) by A16,FINSEQ_1:def 7
          .= CE1.i.(x.i) by A14,Def11,A13,A17;
        end;
        suppose
A18:        not x.i in E1.i;
          hence CE2.i.(x.i) = (f^g).(x.i) by A15,Def11,A13
          .= f.(x.i) by A16,FINSEQ_1:def 7
          .= CE1.i.(x.i) by A14,Def11,A13,A18;
        end;
      end;
      hence ((App CE1).x).i = CE2.i.(x.i) by A12,A11,A8,Def9
        .= ((App CE2).x).i by A12,A11,A9,Def9;
    end;
    then
A19:  (App CE1).x = (App CE2).x by A11;
    ((M "**" App CE1) | S1).x = (M "**" App CE1).x by A7,FUNCT_1:49
    .= M "**" ((App CE2).x) by A19,A7,A4,Def10
    .= (M "**" App CE2).x by A7,A5,A3,Def10
    .=((M "**" App CE2) | S2).x by A7,A3,FUNCT_1:49;
    hence thesis;
  end;
  then (M "**" App CE1) | S1 = (M "**" App CE2) |S2 by A3,A4,A6,RELAT_1:62;
  hence thesis by A1,A3,Th1;
end;


theorem Th96:
  for E be Enumeration of F st len E = n + 1 holds
    E|n is Enumeration of F\{E.len E} &
    <*E.len E*> is Enumeration of {E.len E} &
    F = (F\{E.len E}) \/ {E.len E}
proof
  let E be Enumeration of F such that
A1: len E = n + 1;
  set L=len E;
A2: rng <*E.L*> = {E.L} by FINSEQ_1:38;
A3: E = (E|n)^<*E.L*> by A1,FINSEQ_3:55;
  then
A4: E|n is one-to-one & <*E.L*> is one-to-one by FINSEQ_3:91;
A5: F = rng E = rng (E|n) \/ rng <*E.L*> & rng (E|n) misses rng <*E.L*>
    by A3,FINSEQ_1:31,FINSEQ_3:91,RLAFFIN3:def 1;
  then rng (E|n) = F \ {E.L} by A2,XBOOLE_1:88;
  hence thesis by A5,A4,FINSEQ_1:38,RLAFFIN3:def 1;
end;

registration
  let F be with_evenly_repeated_values-member set;
  cluster -> finite Function-like Relation-like for Element of F;
  coherence
  proof
    let E be Element of F;
    per cases;
    suppose F={};
      hence thesis;
    end;
    suppose F<>{};
      hence thesis by Def7;
    end;
  end;
end;

registration
  let F be with_evenly_repeated_values-member set;
  cluster -> with_evenly_repeated_values for Element of F;
  coherence
  proof
    let E be Element of F;
    per cases;
    suppose F={};
      hence thesis by SUBSET_1:def 1;
    end;
    suppose F<>{};
      hence thesis by Def7;
    end;
  end;
end;

theorem Th97:
  for E1 be Enumeration of F1
    for p be Function st union F1 c= dom p & p|union F1 is one-to-one holds
     (.:p)*E1 is Enumeration of .:p.:F1 & card E1 = card ((.:p)*E1)
proof
  let E1 be Enumeration of F1;
  let f be Function such that
A1: union F1 c= dom f & f|union F1 is one-to-one;
  set fu=f|union F1,If = .:f;
A2: rng E1 = F1 by RLAFFIN3:def 1;
  F1 c= bool union F1 c= bool dom f by A1,ZFMISC_1:67,82;
  then F1 c= bool dom f;
  then F1 c= dom If by FUNCT_3:def 1;
  then
A3:dom (If*E1) = dom E1 =Seg len E1 by A2,FINSEQ_1:def 3,RELAT_1:27;
  then reconsider fE1 = If*E1 as FinSequence by FINSEQ_1:def 2;
A4: dom fu = union F1 by A1,RELAT_1:62;
A5:fE1 is one-to-one
  proof
    let x1,x2 be object such that
A6:   x1 in dom fE1 & x2 in dom fE1 & fE1.x1 = fE1.x2;
A7:   x1 in dom E1 & E1.x1 in dom (.:f) & fE1.x1 = If.(E1.x1)
    by A6,FUNCT_1:11,12;
    then
A8:   fE1.x1 = f.:(E1.x1) & E1.x1 in F1 by A2,FUNCT_1:def 3,FUNCT_3:7;
    then
A9:   fE1.x1 = fu.:(E1.x1) by RELAT_1:129,ZFMISC_1:74;
A10: x2 in dom E1 & E1.x2 in dom (.:f) & fE1.x2 = If.(E1.x2)
    by A6,FUNCT_1:11,12;
    then fE1.x2 = f.:(E1.x2) & E1.x2 in F1 by A2,FUNCT_1:def 3,FUNCT_3:7;
    then E1.x2 = fu".:(fu.:(E1.x2)) = fu".:(fu.:(E1.x1)) = E1.x1
    by A1,A4,A6,A8,A9,FUNCT_1:107,RELAT_1:129,ZFMISC_1:74;
    hence thesis by A7,A10,FUNCT_1:def 4;
  end;
A11: rng fE1 c= .:f.:F1
  proof
    let y;
    assume  y in rng fE1;
    then consider x such that
A12: x in dom fE1 & fE1.x=y by FUNCT_1:def 3;
A13: x in dom E1 & E1.x in dom (.:f) & fE1.x = If.(E1.x)
      by A12,FUNCT_1:11,12;
    then fE1.x = f.:(E1.x) & E1.x in F1 by A2,FUNCT_1:def 3,FUNCT_3:7;
    hence thesis by A13,A12,FUNCT_1:def 6;
  end;
  .:f.:F1 c= rng fE1
  proof
    let y be object;
    assume y in .:f.:F1;
    then consider x such that
A14:  x in dom If & x in F1 & y = If.x by FUNCT_1:def 6;
    consider z be object such that
A15:  z in dom E1 & E1.z =x by A2,A14,FUNCT_1:def 3;
    fE1.z = y & z in dom fE1 by A15,A14,FUNCT_1:11,13;
    hence thesis by FUNCT_1:def 3;
  end;
  then rng fE1 = .:f.:F1 by A11;
  hence thesis by A5,A3,FINSEQ_3:29,RLAFFIN3:def 1;
end;

theorem Th98:
  for E1 be Enumeration of F1
    for g be Function st
       union F1 c= dom g & g|union F1 is one-to-one
       for gE1 be Enumeration of .:g.:F1 st gE1 = (.:g)*E1
for fg be FinSequence of D st g.:dom f c= dom fg
for s be FinSequence st s in doms (SignGenOp(f,A,F1) * E1) & rng s c= dom g
   holds
  g*s in doms (SignGenOp(fg,A,.:g.:F1) * gE1)
proof
  let E1 be Enumeration of F1;
  let g be Function such that
A1: union F1 c= dom g & g|union F1 is one-to-one;
  let gE1 be Enumeration of .:g.:F1 such that
A2: gE1 = (.:g)*E1;
A3:len (SignGenOp(f,A,F1) * E1)= len E1=len gE1 =
    len (SignGenOp(f,A,.:g.:F1) * gE1) by A1,A2,Th97,CARD_1:def 7;
  let gf be FinSequence of D such that
A4: g.:dom f c= dom gf;
  let s be FinSequence such that
A5: s in doms (SignGenOp(f,A,F1) * E1)
  and
A6: rng s c= dom g;
A7: dom (g*s) = dom s = Seg len s by A6,FINSEQ_1:def 3,RELAT_1:27;
  then reconsider gs=g*s as FinSequence by FINSEQ_1:def 2;
A8: len s = len  (SignGenOp(f,A,F1) * E1) by A5,Th47;
  then
A9: dom s = dom (SignGenOp(f,A,F1) * E1) by FINSEQ_3:30;
  dom SignGenOp(gf,A,.:g.:F1) = .:g.:F1 = rng gE1 by FUNCT_2:def 1
,RLAFFIN3:def 1;
  then
A10: dom (SignGenOp(gf,A,.:g.:F1) * gE1) = dom gE1 by RELAT_1:27;
  F1 c= bool union F1 c= bool dom g by A1,ZFMISC_1:67,82;
  then F1 c= bool dom g;
  then F1 c= dom (.:g) by FUNCT_3:def 1;
  then rng E1 c= dom (.:g);
  then
A11: dom gE1 = dom E1 by A2,RELAT_1:27;
  len gs = len s by A7,FINSEQ_3:29;
  then
A12: len gs = len (SignGenOp(gf,A,.:g.:F1) * gE1) by A3,A8,A10,FINSEQ_3:29;
  for i st i in dom gs holds gs.i in dom ((SignGenOp(gf,A,.:g.:F1) * gE1).i)
  proof
    let i such that
A13: i in dom gs;
A14:i in dom s & s.i in dom g by A13,FUNCT_1:11;
    then
A15: s.i in dom ((SignGenOp(f,A,F1) * E1).i) by Th47,A5;
    s.i in dom SignGen(f,A,E1.i) by A15,Th80,A9,A14;
    then
A16: s.i in dom f by Def11;
    i in dom E1 by A9,A14,FUNCT_1:11;
    then
A17: (SignGenOp(gf,A,.:g.:F1) * gE1).i = SignGen(gf,A,gE1.i) by Th80,A11;
A18: dom SignGen(gf,A,gE1.i) = dom gf by Def11;
A19: gs.i = g.(s.i) & i in dom gs by A14,FUNCT_1:11,13;
    s.i in dom g by A13,FUNCT_1:11;
    then g.(s.i) in g.:dom f by A16,FUNCT_1:def 6;
    hence thesis by A17,A18,A4,A19;
  end;
  hence thesis by A12,Th47;
end;

theorem Th99:
  for E1 be Enumeration of F1
    for g be Function st
       union F1 c= dom g & g is one-to-one
       for gE1 be Enumeration of .:g.:F1 st gE1 = (.:g)*E1
    for fg be FinSequence of D st fg = (f*g") | dom fg & g.:dom f c= dom fg
    for s be FinSequence st s in doms (SignGenOp(f,A,F1) * E1) & rng s c= dom g
       holds
(App (SignGenOp(f,A,F1) * E1)).s
        = (App (SignGenOp(fg,A,.:g.:F1) * gE1)).(g*s)
proof
  let E1 be Enumeration of F1;
  let g be Function such that
A1:       union F1 c= dom g & g is one-to-one;
  let gE1 be Enumeration of .:g.:F1 such that
A2: gE1 = (.:g)*E1;
A3: g|union F1 is one-to-one by A1,FUNCT_1:52;
  then
A4:len (SignGenOp(f,A,F1) * E1)= len E1=len gE1 =
    len (SignGenOp(f,A,.:g.:F1) * gE1) by A1,A2,Th97,CARD_1:def 7;
  let gf be FinSequence of D such that
A5:  gf = (f*g") | dom gf and
A6: g.:dom f c= dom gf;
  let s be FinSequence such that
A7: s in doms (SignGenOp(f,A,F1) * E1)
  and
A8: rng s c= dom g;
  dom (g*s) = dom s = Seg len s by A8,FINSEQ_1:def 3,RELAT_1:27;
  then reconsider gs=g*s as FinSequence by FINSEQ_1:def 2;
A9: dom (g*s) = dom s = Seg len s by A8,FINSEQ_1:def 3,RELAT_1:27;
  then reconsider gs=g*s as FinSequence by FINSEQ_1:def 2;
A10: len gs = len s = len (SignGenOp(f,A,.:g.:F1) * gE1)
  by A9,Th47,A4,A7,FINSEQ_3:29;
A11: gs in doms (SignGenOp(gf,A,.:g.:F1) * gE1) by A2,A1,A3,A6,Th98,A8,A7;
  len s = len  (SignGenOp(f,A,F1) * E1) by A7,Th47;
  then
A12: dom s = dom (SignGenOp(f,A,F1) * E1) by FINSEQ_3:30;
A13: gs =g*s & gs in doms (SignGenOp(gf,A,.:g.:F1) * gE1)
  by A2,A1,A3,A6,Th98,A8,A7;
A14: len ((App (SignGenOp(f,A,F1) * E1)).s) = len s by Def9,A7;
  for i st 1<=i & i <= len s holds
  ((App (SignGenOp(f,A,F1) * E1)).s).i =
  ((App (SignGenOp(gf,A,.:g.:F1) * gE1)).gs).i
  proof
    let i such that
A15: 1<=i & i <= len s;
A16:i in dom s by A15,FINSEQ_3:25;
A17: s.i in rng s by A16,FUNCT_1:def 3;
A18: gs.i = g.(s.i) & i in dom gs by A17,A8,A16,FUNCT_1:11,13;
    len gs = len (SignGenOp(gf,A,.:g.:F1) * gE1) by A13,Th47;
    then
A19: dom gs = dom (SignGenOp(gf,A,.:g.:F1) * gE1) by FINSEQ_3:30;
    then
A20: (SignGenOp(gf,A,.:g.:F1) * gE1).i = SignGen(gf,A,gE1.i)
    by A17,A8,A16,Th80,FUNCT_1:11;
A21:(SignGenOp(f,A,F1) * E1).i = SignGen(f,A,E1.i)
      by A15,A12,Th80,FINSEQ_3:25;
A22: i in dom gs by A17,A8,A16,FUNCT_1:11;
A23: ((App (SignGenOp(f,A,F1) * E1)).s).i
    = (SignGenOp(f,A,F1) * E1).i.(s.i) by A7,A16,Def9
    .= SignGen(f,A,E1.i) .(s.i) by A15,A12,Th80,FINSEQ_3:25;
A24: ((App (SignGenOp(gf,A,.:g.:F1) * gE1)).gs).i
    = (SignGenOp(gf,A,.:g.:F1) * gE1).i.(gs.i)
    by A17,A8,A16,Def9,A13,FUNCT_1:11
    .= SignGen(gf,A,gE1.i).(gs.i) by A19,A17,A8,A16,Th80,FUNCT_1:11;
A25: s.i in dom SignGen(f,A,E1.i) by A21,A7,A16,Th47;
A26: gs.i in dom SignGen(gf,A,gE1.i) by A20,A22,A13,Th47;
A27:dom SignGen(gf,A,gE1.i) = dom gf by Def11;
A28: i in dom E1 by A12,A16,FUNCT_1:11;
    then E1.i in rng E1 =F1 by FUNCT_1:def 3,RLAFFIN3:def 1;
    then E1.i c= union F1 by ZFMISC_1:74;
    then
A29: E1.i c= dom g by A1;
    then E1.i in bool dom g;
    then
A30:E1.i in dom (.:g) by FUNCT_3:def 1;
    gE1.i = (.:g).(E1.i) by A28,A2,A30,FUNCT_1:11,12;
    then
A31: gE1.i = g.:(E1.i) by A29,FUNCT_3:def 1;
    gs.i in dom (f*g") & gf.(gs.i) = (f*g").(gs.i)
    by A26,A27,A5,FUNCT_1:47,RELAT_1:57;
    then
A32: gf.(gs.i) = f.((g").(gs.i)) by FUNCT_1:12
    .= f.(s.i) by A1,A17,A8,A18,FUNCT_1:34;
    per cases;
    suppose
A33: s.i in E1.i;
      then
A34: SignGen(f,A,E1.i) .(s.i) = (the_inverseOp_wrt A).(f.(s.i)) by A25,Def11;
      gs.i in gE1.i by A31,A17,A8,A33,A18,FUNCT_1:def 6;
      hence thesis by A23,A24,A34,A32,A26,Def11;
    end;
    suppose
A35:  not s.i in E1.i;
      then
A36:  SignGen(f,A,E1.i) .(s.i) = f.(s.i) by A25,Def11;
      not gs.i in gE1.i
      proof
        assume gs.i in gE1.i;
        then ex x st x in dom g & x in E1.i & gs.i = g.x by A31,FUNCT_1:def 6;
        hence thesis by A35,A17,A8,A18,A1;
      end;
      hence thesis by A23,A24,A36,A32,A26,Def11;
    end;
  end;
  hence thesis by A10,Def9,A11,A14;
end;

theorem Th100:
  for E1 be Enumeration of F1 st union F1 c= dom f
    for g be Permutation of dom f
       for gE1 be Enumeration of .:g.:F1 st gE1 = (.:g)*E1
for fg be FinSequence of D st fg = f*g"
  for S1 be Element of Fin dom App (SignGenOp(f,A,F1) * E1)
holds
  {g*s where s is FinSequence of NAT: s in S1} is
      Element of Fin dom App (SignGenOp(fg,A,.:g.:F1) * gE1)
proof
  let E1 be Enumeration of F1 such that
A1: union F1 c= dom f;
  let g be Permutation of dom f;
  let gE1 be Enumeration of .:g.:F1 such that
A2:gE1 = (.:g)*E1;
  let fg be FinSequence of D such that
A3:fg = f*g";
  let S1 be Element of Fin dom App (SignGenOp(f,A,F1) * E1);
A4: union F1 c= dom g by A1,FUNCT_2:52;
A5: g|union F1 is one-to-one by FUNCT_1:52;
  dom (g") = dom f = rng (g") by FUNCT_2:52,def 3;
  then
A6:dom (f*g") = dom f by RELAT_1:27;
A7: g.:dom f c= dom fg by A6,A3;
  {g*s where s is FinSequence of NAT: s in S1}
     c= dom App (SignGenOp(fg,A,.:g.:F1) * gE1)
  proof
    let y be object such that
A8: y in {g*s where s is FinSequence of NAT: s in S1};
    consider s be FinSequence of NAT such that
A9:  y=g*s & s in S1 by A8;
    S1 c= dom App (SignGenOp(f,A,F1) * E1) by FINSUB_1:def 5;
    then
A10: s in dom App (SignGenOp(f,A,F1) * E1) by A9;
    rng s c= dom g
    proof
      let y such that
A11:y in rng s;
      consider x such that
A12:x in dom s & s.x=y by A11,FUNCT_1:def 3;
      reconsider x as Nat by A12;
A13:  s.x in dom ((SignGenOp(f,A,F1) * E1).x) by A12,A10,Th47;
      (SignGenOp(f,A,F1) * E1).x<>{} by A12,A10,Th47;
      then x in dom (SignGenOp(f,A,F1) * E1) by FUNCT_1:def 2;
      then (SignGenOp(f,A,F1) * E1).x = SignGen(f,A,E1.x) by Th80;
      then dom ((SignGenOp(f,A,F1) * E1).x) = dom f by Def11;
      hence thesis by A13,A12,FUNCT_2:52;
    end;
    then g*s in doms (SignGenOp(fg,A,.:g.:F1) * gE1) by Th98,A2,A4,A7,A5,A10;
    hence thesis by A9,Def9;
  end;
  hence thesis by FINSUB_1:def 5;
end;

theorem
  A is having_a_unity commutative associative
implies
  for E1 be Enumeration of F1 st union F1 c= dom f
    for g be Permutation of dom f
       for gE1 be Enumeration of .:g.:F1 st gE1 = (.:g)*E1
for fg be FinSequence of D st fg = f*g"
  for CE1,CE2 be non-empty non empty FinSequence of D* st
        CE1 = SignGenOp(f,A,F1) * E1 & CE2 = SignGenOp(fg,A,.:g.:F1) * gE1
  for S1 be Element of Fin dom App CE1,
      S2 be Element of Fin dom App CE2 st
  S2 = {g*s where s is FinSequence of NAT: s in S1}holds
  A $$ (S1,M "**" App CE1) = A $$ (S2,M "**" App CE2)
proof
  assume
A1:A is having_a_unity commutative associative;
  let E1 be Enumeration of F1 such that
A2:union F1 c= dom f;
  let g be Permutation of dom f;
  let gE1 be Enumeration of .:g.:F1 such that
A3:gE1 = (.:g)*E1;
  let fg be FinSequence of D such that
A4: fg = f*g";
  let CE1,CE2 be non-empty non empty FinSequence of D* such that
A5:CE1 = SignGenOp(f,A,F1) * E1 & CE2 = SignGenOp(fg,A,.:g.:F1) * gE1;
  defpred P[set] means for S1 be Element of Fin dom App CE1,
  S2 be Element of Fin dom App CE2 st S1=$1 &
  S2 = {g*s where s is FinSequence of NAT: s in S1}holds
  A $$ (S1,M "**" App CE1) = A $$ (S2,M "**" App CE2);
A6:P[{}.dom App CE1]
  proof
    let S1 be Element of Fin dom App CE1,
    S2 be Element of Fin dom App CE2 such that
A7: S1={}.dom App CE1 &
    S2 = {g*s where s is FinSequence of NAT: s in S1};
    S2={}
    proof
      assume S2<>{};
      then consider x such that
A8:   x in S2 by XBOOLE_0:def 1;
      ex s be FinSequence of NAT st x= g*s & s in S1 by A8,A7;
      hence thesis by A7;
    end;
    then S2 = {}.dom App CE2;
    then A $$ (S2,M "**" App CE2) = the_unity_wrt A by A1,SETWISEO:31
    .= A $$ (S1,M "**" App CE1) by A7,A1,SETWISEO:31;
    hence thesis;
  end;
A9: for B9 being (Element of Fin dom App CE1),
     b being Element of dom App CE1 holds
  P[B9] & not b in B9 implies P[B9 \/ {b}]
  proof
    let B9 be Element of Fin dom App CE1,
    b be Element of dom App CE1 such that
A10: P[B9 ] & not b in B9;
    let S1 be Element of Fin dom App CE1,
    S2 be Element of Fin dom App CE2 such that
A11: S1=B9 \/ {b} &
    S2 = {g*s where s is FinSequence of NAT: s in S1};
    set B2 = {g*s where s is FinSequence of NAT: s in B9};
    reconsider B2 as Element of Fin dom App CE2 by A2,A3,A4,A5,Th100;
    b in doms CE1;
    then reconsider c =b as FinSequence of NAT by FINSEQ_1:def 11;
A12: B2 c= S2
    proof
      let y such that
A13: y in B2;
      consider s be FinSequence of NAT such that
A14:  y=g*s & s in B9 by A13;
      s in S1 by A14,A11,XBOOLE_0:def 3;
      hence thesis by A14,A11;
    end;
    c in S1 by A11,ZFMISC_1:136;
    then
A15: g*c in S2 by A11;
    then
A16: {g*b} c= S2 by ZFMISC_1:31;
    S2 c= dom App CE2 by FINSUB_1:def 5;
    then reconsider gc = g*c as Element of dom App CE2 by A15;
A17: dom f = dom g by FUNCT_2:52;
A18: rng c c= dom f
    proof
      let y such that
A19: y in rng c;
      consider x such that
A20: x in dom c & c.x = y by A19,FUNCT_1:def 3;
A21: c.x in dom (CE1.x) by A20,Th47;
      then x in dom CE1 by FUNCT_1:def 2,RELAT_1:38;
      then CE1.x = SignGen(f,A,E1.x) by A5,Th80;
      hence thesis by A20,A21,Def11;
    end;
A22: not gc in B2
    proof
      assume gc in B2;
      then consider s be FinSequence of NAT such that
A23:  gc =g*s & s in B9;
A24:  rng s c= dom f
      proof
        let y such that
A25:    y in rng s;
        consider x such that
A26:    x in dom s & s.x = y by A25,FUNCT_1:def 3;
        B9 c= dom App CE1 by FINSUB_1:def 5;
        then s in dom App CE1 by A23;
        then
A27:    s.x in dom (CE1.x) by A26,Th47;
        then x in dom CE1 by FUNCT_1:def 2,RELAT_1:38;
        then CE1.x = SignGen(f,A,E1.x) by A5,Th80;
        hence thesis by A26,A27,Def11;
      end;
      g"*gc = (g"*g)*s by A23,RELAT_1:36;
      then (g"*g)*c = (g"*g)*s & g"*g = id dom g by FUNCT_1:39,RELAT_1:36;
      then (id dom g)*c = s by A24,A17,RELAT_1:53;
      hence thesis by A10,A23,A18,A17,RELAT_1:53;
    end;
    S2 c= B2 \/{g*b}
    proof
      let y such that
A28:  y in S2;
      consider s be FinSequence of NAT such that
A29:  y = g*s & s in S1 by A28,A11;
      s in B9 or s=c by A11,A29,ZFMISC_1:136;
      then y in B2 or y in {g*b} by A29,ZFMISC_1:31;
      hence thesis by XBOOLE_0:def 3;
    end;
    then
A30: B2 \/{gc} = S2 by A16,A12,XBOOLE_1:8;
    dom (g") = dom f = rng (g") by FUNCT_2:52,def 3;
    then
A31:dom (f*g") = dom f by RELAT_1:27;
A32:fg = (f*g") | dom fg by A4;
A33: g.:dom f c= dom fg by A31,A4;
    (App CE1).c = (App CE2).gc by A3,A5,A2,A33,A32,Th99,A18,A17;
    then (M "**" App CE1).c = M "**" (App CE2).gc by Def10
    .= (M "**" App CE2).gc by Def10;
    hence A $$ ( S1,M "**" App CE1)
    = A.(A $$ ( B9, M "**" App CE1), (M "**" App CE2).gc)
    by A1,A10,A11,SETWOP_2:2
    .= A.(A $$ ( B2,M "**" App CE2), (M "**" App CE2).gc) by A10
    .= A $$ ( S2, M "**" App CE2) by A30,A1,A22,SETWOP_2:2;
  end;
  for B being Element of Fin dom App CE1 holds P[B]
    from SETWISEO:sch 2(A6,A9);
  hence thesis;
end;

Lm1: for S be with_evenly_repeated_values-member set st for x be Element of S
  st x in S holds dom x = X
  for p be Permutation of X
    holds {s*p where s is FinSequence of NAT: s in S}
      is with_evenly_repeated_values-member
proof
  let S be with_evenly_repeated_values-member set such that
A1: for x be Element of S st x in S holds dom x = X;
  let p be Permutation of X;
  let y;
  assume y in {s*p where s is FinSequence of NAT: s in S};
  then consider s be FinSequence of NAT such that
A2: y=s*p & s in S;
  dom s = X by A2,A1;
  then reconsider pp=p as Permutation of dom s;
  s*pp is with_evenly_repeated_valuesby A2,Th44;
  hence thesis by A2;
end;

theorem Th102:
  for E1 be Enumeration of F1 st n in dom f holds
    (len E1)|-> n in doms(SignGenOp(f,A,F1) * E1)
proof
  let E1 be Enumeration of F1 such that
A1: n in dom f;
  set CE=SignGenOp(f,A,F1) * E1, s=(len E1)|-> n;
A2: len  CE=len E1 =len s by CARD_1:def 7;
  then
A3: dom s = dom E1= dom CE by FINSEQ_3:29;
  for i st i in dom s holds s.i in dom (CE.i)
  proof
    let i such that
A4:   i in dom s;
    s.i = n & dom f = dom SignGen(f,A,E1.i) by Def11,A4,FINSEQ_2:57;
    hence thesis by A1,A3,A4,Th80;
  end;
  hence thesis by Th47,A2;
end;

theorem Th103:
  B is having_a_unity associative commutative having_an_inverseOp
implies
    (the_inverseOp_wrt B).(B.(d1,d2)) =
         B.((the_inverseOp_wrt B).d1,(the_inverseOp_wrt B).d2)
proof
  set I=the_inverseOp_wrt B;
  assume
A1: B is having_a_unity associative commutative having_an_inverseOp;
  B. (B.(d1,d2), B.(I.d1,I.d2)) = B. (B.(d2,d1), B.(I.d1,I.d2))
    by A1,BINOP_1:def 2
  .= B.(B.(B.(d2,d1),I.d1),I.d2) by A1,BINOP_1:def 3
  .= B.(B.(d2,B.(d1,I.d1)),I.d2) by A1,BINOP_1:def 3
  .= B.(B.(d2,the_unity_wrt B),I.d2) by A1,FINSEQOP:59
  .= B.(d2,I.d2) by A1,SETWISEO:15
  .= the_unity_wrt B by A1,FINSEQOP:59;
  hence thesis by A1,FINSEQOP:60;
end;

registration
  let x be object, n be even Nat;
  cluster n |-> x -> with_evenly_repeated_values;
  coherence
  proof
    let y be object;
    per cases;
    suppose y = x;
      then (n |-> x)"{y}= Seg n by FUNCOP_1:15;
      hence thesis;
    end;
    suppose y <> x;
      then not x in {y} by TARSKI:def 1;
      then (n |-> x)"{y}= {} by FUNCOP_1:16;
      hence thesis;
    end;
  end;
end;

theorem
  for f,g be FinSequence st f^g is with_evenly_repeated_values &
     f is with_evenly_repeated_values holds g is with_evenly_repeated_values
proof
  let f,g be FinSequence such that A1: f^g is with_evenly_repeated_values &
    f is with_evenly_repeated_values;
  let y;
  A2: card ((f^g)"{y}) = card (f"{y})+card (g"{y}) by FINSEQ_3:57;
  card ((f^g)"{y}) is even & card (f"{y}) is even by A1;
  hence thesis by A2;
end;
theorem Th105:
  for f,g be FinSequence st f^g is with_evenly_repeated_values &
    g is with_evenly_repeated_values holds f is with_evenly_repeated_values
proof
  let f,g be FinSequence such that
A1: f^g is with_evenly_repeated_values &
    g is with_evenly_repeated_values;
  let y;
A2: card ((f^g)"{y}) = card (f"{y})+card (g"{y}) by FINSEQ_3:57;
  card ((f^g)"{y}) is even & card (g"{y}) is even by A1;
  hence thesis by A2;
end;

registration
  let x be object, n be even Nat;
  cluster n |-> x -> with_evenly_repeated_values;
  coherence;
end;

registration
  let X,Y be with_evenly_repeated_values-member set;
  cluster X\/Y -> with_evenly_repeated_values-member;
  coherence
proof
  let x be object;
  assume x in X\/Y;
  then x in X or x in Y by XBOOLE_0:def 3;
  hence thesis;
end;
end;

definition
  let n,k be Nat;
  func doms(n,k)-> FinSequence-membered finite set equals
       k-tuples_on Seg n;
  coherence;
end;

registration
  let n,k be Nat;
  cluster -> (Seg n)-valued for Element of doms(n,k);
  coherence
proof
  let e be Element of doms(n,k);
  per cases;
  suppose
A1:   doms(n,k) is empty;
    e={} by A1,SUBSET_1:def 1;
    hence thesis by RELAT_1:171;
  end;
  suppose doms(n,k) is non empty;
    then e in doms(n,k);
    then ex s be Element of (Seg n)* st e=s & len s= k;
    hence thesis;
  end;
end;
end;

registration
  let n be non empty Nat,k be Nat;
  cluster doms(n,k) -> non empty;
  coherence;
  cluster -> k-element for Element of doms(n,k);
  coherence;
end;

theorem Th106:
  for E be Enumeration of F holds
    doms(SignGenOp(f,A,F)*E) = doms(len f,card F)
proof
  let E be Enumeration of F;
A1: len (SignGenOp(f,A,F)*E) = len E = card F by CARD_1:def 7;
  thus doms (SignGenOp(f,A,F)*E) c= doms(len f,card F)
  proof
    let x such that
A2:   x in doms (SignGenOp(f,A,F)*E);
    reconsider x as FinSequence by A2;
A3:   len x = len (SignGenOp(f,A,F)*E) by A2,Th47;
    rng x c= Seg len f
    proof
      let y;
      assume y in rng x;
      then consider i be object such that A4:  i in dom x & y=x.i
        by FUNCT_1:def 3;
      reconsider i as Nat by A4;
A5:     x.i in dom ((SignGenOp(f,A,F)*E).i) by A4,A2,Th47;
      (SignGenOp(f,A,F)*E).i<>{} by A4,A2,Th47;
      then i in dom (SignGenOp(f,A,F)*E) by FUNCT_1:def 2;
      then (SignGenOp(f,A,F) * E).i = SignGen(f,A,E.i) by Th80;
      then x.i in dom f by A5,Def11;
      hence thesis by A4,FINSEQ_1:def 3;
    end;
    then reconsider x as FinSequence of Seg len f by FINSEQ_1:def 4;
    x in (Seg len f)* by FINSEQ_1:def 11;
    hence thesis by A1,A3;
  end;
  let x such that
A6: x in doms(len f,card F);
  consider s be Element of (Seg len f)* such that
A7: x=s & len s= card F by A6;
A8: rng s c= Seg len f =dom f by FINSEQ_1:def 3;
  for i st i in dom s holds s.i in dom ((SignGenOp(f,A,F)*E).i)
  proof
    let i such that
A9:  i in dom s;
A10:  s.i in rng s by A9,FUNCT_1:def 3;
    dom s = dom (SignGenOp(f,A,F)*E) by A1,A7,FINSEQ_3:29;
    then (SignGenOp(f,A,F) * E).i = SignGen(f,A,E.i) by A9,Th80;
    then dom ((SignGenOp(f,A,F)*E).i) = dom f by Def11;
    hence thesis by A8,A10;
  end;
  hence thesis by A7,A1,Th47;
end;

Lm2: for E be Enumeration of F holds
  doms (SignGenOp(f,A,F)*E) = doms(len f,len E)
proof
  let E be Enumeration of F;
  len E=card F by CARD_1:def 7;
  hence thesis by Th106;
end;

Lm3:
  for E be Enumeration of F holds
    dom App (SignGenOp(f,A,F)*E) = doms(len f,card F) &
    dom App (SignGenOp(f,A,F)*E) = doms(len f,len E)
proof
  let E be Enumeration of F;
  dom App (SignGenOp(f,A,F)*E) = doms (SignGenOp(f,A,F)*E) by Def9;
  hence thesis by Lm2,Th106;
end;

theorem Th107:
  for E1 be Enumeration of F1,E2 be Enumeration of F2 st
    card F1 = card F2 & len f <= len g holds
  doms (SignGenOp(f,A,F1)*E1) c= doms (SignGenOp(g,A,F2)*E2)
proof
  let E1 be Enumeration of F1,E2 be Enumeration of F2 such that
A1: card F1= card F2 & len f <= len g;
A2: len (SignGenOp(g,A,F2)*E2) = len E2 = card F2 &
    len (SignGenOp(f,A,F1)*E1) = len E1 = card F1 by CARD_1:def 7;
A3: dom (SignGenOp(f,A,F1)*E1) = dom (SignGenOp(g,A,F2)*E2)
    by A1,A2,FINSEQ_3:29;
  let x such that
A4:x in doms (SignGenOp(f,A,F1)*E1);
  reconsider x as FinSequence by A4;
A5: len x = len (SignGenOp(g,A,F2)*E2) by A2,Th47,A4,A1;
  for i st i in dom x holds x.i in dom ((SignGenOp(g,A,F2)*E2).i)
  proof
    let i such that
A6:   i in dom x;
A7:   x.i in dom ((SignGenOp(f,A,F1)*E1).i) by A6,A4,Th47;
    (SignGenOp(f,A,F1)*E1).i<>{} by A6,A4,Th47;
    then i in dom (SignGenOp(f,A,F1)*E1) by FUNCT_1:def 2;
    then (SignGenOp(g,A,F2) * E2).i = SignGen(g,A,E2.i) &
      (SignGenOp(f,A,F1) * E1).i = SignGen(f,A,E1.i) by A3,Th80;
    then len ((SignGenOp(g,A,F2) * E2).i) = len g &
    len ((SignGenOp(f,A,F1) * E1).i) = len f by CARD_1:def 7;
    then dom ((SignGenOp(f,A,F1) * E1).i) c= dom ((SignGenOp(g,A,F2) * E2).i)
      by A1,FINSEQ_3:30;
    hence thesis by A7;
  end;
  hence thesis by A5,Th47;
end;

theorem
  for E1 be Enumeration of F1,E2 be Enumeration of F2 st
    card F1 = card F2 holds
  doms (SignGenOp(f,A,F1)*E1) = doms (SignGenOp(f,A,F2)*E2)
proof
  let E1 be Enumeration of F1,E2 be Enumeration of F2 such that
A1: card F1= card F2;
A2: len (SignGenOp(f,A,F2)*E2) = len E2 = card F2 &
    len (SignGenOp(f,A,F1)*E1) = len E1 = card F1 by CARD_1:def 7;
A3: dom (SignGenOp(f,A,F1)*E1) = dom (SignGenOp(f,A,F2)*E2)
    by A1,A2,FINSEQ_3:29;
  thus doms (SignGenOp(f,A,F1)*E1) c= doms (SignGenOp(f,A,F2)*E2)
  proof
    let x such that
A4:   x in doms (SignGenOp(f,A,F1)*E1);
    reconsider x as FinSequence by A4;
A5:   len x = len (SignGenOp(f,A,F2)*E2) by A2,Th47,A4,A1;
    for i st i in dom x holds x.i in dom ((SignGenOp(f,A,F2)*E2).i)
    proof
      let i such that
A6:     i in dom x;
A7:     x.i in dom ((SignGenOp(f,A,F1)*E1).i) by A6,A4,Th47;
      (SignGenOp(f,A,F1)*E1).i<>{} by A6,A4,Th47;
      then i in dom (SignGenOp(f,A,F1)*E1) by FUNCT_1:def 2;
      then (SignGenOp(f,A,F2) * E2).i = SignGen(f,A,E2.i) &
      (SignGenOp(f,A,F1) * E1).i = SignGen(f,A,E1.i) by A3,Th80;
      then len ((SignGenOp(f,A,F2) * E2).i) = len f &
      len ((SignGenOp(f,A,F1) * E1).i) = len f by CARD_1:def 7;
      hence thesis by A7,FINSEQ_3:29;
    end;
    hence thesis by A5,Th47;
  end;
  let x such that
A8: x in doms (SignGenOp(f,A,F2)*E2);
  reconsider x as FinSequence by A8;
A9: len x = len (SignGenOp(f,A,F1)*E1) by A2,Th47,A8,A1;
  for i st i in dom x holds x.i in dom ((SignGenOp(f,A,F1)*E1).i)
  proof
    let i such that
A10:  i in dom x;
A11:  x.i in dom ((SignGenOp(f,A,F2)*E2).i) by A10,A8,Th47;
    (SignGenOp(f,A,F2)*E2).i<>{} by A10,A8,Th47;
    then i in dom (SignGenOp(f,A,F2)*E2) by FUNCT_1:def 2;
    then (SignGenOp(f,A,F2) * E2).i = SignGen(f,A,E2.i) &
      (SignGenOp(f,A,F1) * E1).i = SignGen(f,A,E1.i) by A3,Th80;
    then len ((SignGenOp(f,A,F2) * E2).i) = len f &
      len ((SignGenOp(f,A,F1) * E1).i) = len f by CARD_1:def 7;
    hence thesis by A11,FINSEQ_3:29;
  end;
  hence thesis by A9,Th47;
end;

theorem Th109:
   for E be Enumeration of F, p be Permutation of dom E holds
    E*p is Enumeration of F
proof
  let E be Enumeration of F,p be Permutation of dom E;
  reconsider Ep = E*p as FinSequence;
  dom p = dom E = rng p by FUNCT_2:52,def 3;
  then rng Ep = rng E =F by RELAT_1:28,RLAFFIN3:def 1;
  hence thesis by RLAFFIN3:def 1;
end;

theorem Th110:
  for E be Enumeration of F, p be Permutation of dom E
    for s be FinSequence st s in doms (SignGenOp(f,A,F) * E)
      holds s*p in doms (SignGenOp(f,A,F) * (E * p))
proof
  let E be Enumeration of F,
      p be Permutation of dom E;
  let s be FinSequence such that
A1: s in doms (SignGenOp(f,A,F) * E);
  reconsider Ep=E*p as Enumeration of F by Th109;
A2: len (SignGenOp(f,A,F) * Ep) = len Ep = card F by CARD_1:def 7;
A3: len s = len (SignGenOp(f,A,F) * E) = len E =card F by Th47,A1,CARD_1:def 7;
  then
A4: dom E = dom s by FINSEQ_3:30;
  dom p = dom E = rng p by FUNCT_2:52,def 3;
  then
A5: dom (s*p) = dom s = Seg len s by A4,FINSEQ_1:def 3,RELAT_1:27;
  reconsider sp=s*p as FinSequence by A4;
A6: len sp = len s by A5,FINSEQ_3:29;
  for i st i in dom sp holds sp.i in dom ((SignGenOp(f,A,F) * Ep).i)
  proof
    let i;
    assume i in dom sp;
    then
A7:   i in dom p & p.i in dom s by FUNCT_1:11;
    then
A8:   s.(p.i) in dom ((SignGenOp(f,A,F) * E).(p.i)) & s.(p.i)=sp.i
      by A1,Th47,FUNCT_1:13;
    ((SignGenOp(f,A,F) * E).(p.i)) = ((SignGenOp(f,A,F) * E)*p).i
      by A7,FUNCT_1:13
    .= (SignGenOp(f,A,F) * Ep).i by RELAT_1:36;
    hence thesis by A8;
  end;
  hence thesis by A2,A3,A6,Th47;
end;


theorem Th111:
  for E be Enumeration of F, p be Permutation of dom E
    for s be FinSequence st s in doms (SignGenOp(f,A,F) * E) holds
     ((App (SignGenOp(f,A,F) * E)).s)*p =
        ((App (SignGenOp(f,A,F) * (E*p))).(s*p))
proof
  let E be Enumeration of F, p be Permutation of dom E;
  set C=SignGenOp(f,A,F);
  let s be FinSequence such that
A1: s in doms (C * E);
A2: s*p in doms (C * (E * p)) by A1,Th110;
  then reconsider sp=s*p as FinSequence;
A3: len s = len (C * E) = len E by Th47,A1,CARD_1:def 7;
  then
A4: dom E = dom (C*E) = dom s by FINSEQ_3:30;
A5: dom p = dom E = rng p by FUNCT_2:52,def 3;
  then
A6: dom sp = dom s by A4,RELAT_1:27;
A7: len ((App (C * (E*p))).sp) = len sp by A2,Def9;
  then
A8: dom ((App (C * (E*p))).sp) = dom sp by FINSEQ_3:29;
  len ((App (C * E)).s) = len s by A1,Def9;
  then
A9: dom ((App (C * E)).s) = dom s by FINSEQ_3:29;
  then
A10: dom (((App (C * E)).s)*p) = dom p by A5,A3,FINSEQ_3:30,RELAT_1:27;
  for i st i in dom ((App (C * (E*p))).sp) holds
    (((App (C * E)).s)*p).i = ((App (C * (E*p))).sp).i
  proof
    let i such that A11: i in dom ((App (C * (E*p))).sp);
    i in dom sp by A7,A11,FINSEQ_3:29;
    then
A12: ((App (C * (E*p))).sp).i = (C * (E*p)).i.(sp.i) & sp.i =s.(p.i)
      by A2,Def9,FUNCT_1:12;
A13: i in dom p & p.i in dom s by A11,A8,FUNCT_1:11;
    (((App (C * E)).s)*p).i = ((App (C * E)).s).(p.i) &
      i in dom p & p.i in dom ((App (C * E)).s)
      by A5,A4,A11,A8,A10,A6,FUNCT_1:11,12;
    then
A14:  (((App (C * E)).s)*p).i = ((C*E)).(p.i).(sp.i) by A1,Def9,A9,A12;
    ((C * E)).(p.i) = ((C*E)*p).i by A13,FUNCT_1:13;
    hence thesis by A12,A14,RELAT_1:36;
  end;
  hence thesis by A8,A10,A4,A6,FUNCT_2:52;
end;

theorem Th112:
  M is commutative associative
implies
  for E be Enumeration of F, p be Permutation of dom E
    for s be FinSequence st
      s in doms (SignGenOp(f,A,F) * E) & (len s >=1 or M is having_a_unity)
    holds
      (M "**" App (SignGenOp(f,A,F) * E)).s =
      (M "**" App (SignGenOp(f,A,F) * (E*p))).(s*p)
proof
  assume
A1: M is commutative associative;
  let E be Enumeration of F,p be Permutation of dom E;
  let s be FinSequence such that
A2: s in doms (SignGenOp(f,A,F) * E) & (len s >=1 or M is having_a_unity);
  set Ep=E*p,sp=s*p;
  s*p in doms (SignGenOp(f,A,F) * Ep) by A2,Th110;
  then s*p in dom App (SignGenOp(f,A,F) * Ep) by Def9;
  then
A3: (M "**" App (SignGenOp(f,A,F) * Ep)).sp =
  M "**" ((App (SignGenOp(f,A,F) * Ep)).sp) by Def10;
A4: len s = len (SignGenOp(f,A,F) * E) = len E by Th47,A2,CARD_1:def 7;
  len s = len ((App (SignGenOp(f,A,F) * E)).s) by Def9,A2;
  then
A5: dom E=dom ((App (SignGenOp(f,A,F) * E)).s) by A4,FINSEQ_3:29;
  s in dom App (SignGenOp(f,A,F) * E) by A2,Def9;
  then
A6: (M "**" App (SignGenOp(f,A,F) * E)).s =
    M "**" ((App (SignGenOp(f,A,F) * E)).s) by Def10;
A7:  M is having_a_unity or len ((App (SignGenOp(f,A,F) * E)).s) >=1
   by A2,Def9;
  (App (SignGenOp(f,A,F) * Ep)).sp = ((App (SignGenOp(f,A,F) * E)).s)*p
    by A2,Th111;
  hence thesis by A3,A6,A1,A5,A7,FINSOP_1:7;
end;

theorem Th113:
  for E be Enumeration of F, p be Permutation of dom E
  for S be Element of Fin dom App (SignGenOp(f,A,F) * E)
     holds
   {s*p where s is FinSequence of NAT: s in S}
     is Element of Fin dom App (SignGenOp(f,A,F) * (E*p))
proof
  let E be Enumeration of F, p be Permutation of dom E;
  let S be Element of Fin dom App (SignGenOp(f,A,F) * E);
  {s*p where s is FinSequence of NAT: s in S} c=
    dom App (SignGenOp(f,A,F) * (E*p))
  proof
    let y;
    assume y in {s*p where s is FinSequence of NAT: s in S};
    then consider s be FinSequence of NAT such that
A1:   y=s*p & s in S;
    S c= dom App (SignGenOp(f,A,F) * E) by FINSUB_1:def 5;
    then s in dom App (SignGenOp(f,A,F) * E) by A1;
    then s*p in doms (SignGenOp(f,A,F) * (E*p)) by Th110;
    hence thesis by A1,Def9;
  end;
  hence thesis by FINSUB_1:def 5;
end;

theorem
  for E be Enumeration of F, p be Permutation of dom E
  for S be Element of Fin doms(n,card F) holds
   {s*p where s is FinSequence of NAT: s in S}
     is Element of Fin doms(n,card F)
proof
  let E be Enumeration of F, p be Permutation of dom E;
  reconsider Ep = E*p as Enumeration of F by Th109;
  set D = the non empty set;
  set f = the n-element FinSequence of D;
  set A = the BinOp of D;
A1: len f = n by CARD_1:def 7;
  let S be Element of Fin doms(n,card F);
    {s*p where s is FinSequence of NAT: s in S} c= doms(n,card F)
  proof
    let y;
    assume y in {s*p where s is FinSequence of NAT: s in S};
    then consider s be FinSequence of NAT such that
A2:   y=s*p & s in S;
    S c= doms(n,card F) by FINSUB_1:def 5;
    then S c= dom App (SignGenOp(f,A,F) * E) by A1,Lm3;
    then s in dom App (SignGenOp(f,A,F) * E) by A2;
    then s*p in doms (SignGenOp(f,A,F) * Ep) by Th110;
    hence thesis by A2,A1,Th106;
  end;
  hence thesis by FINSUB_1:def 5;
end;

theorem Th115:
  M is commutative associative &
  A is having_a_unity commutative associative
implies
  for E be Enumeration of F, p be Permutation of dom E st
    M is having_a_unity or len E >= 1
  for CE,CEp be non-empty non empty FinSequence of D* st
    CE = SignGenOp(f,A,F) * E & CEp=SignGenOp(f,A,F) * (E*p)
  for S be Element of Fin dom App CE,
      Sp be Element of Fin dom App CEp st
    Sp = {s*p where s is FinSequence of NAT: s in S}
  holds
   A$$(S, M "**" App CE) = A$$(Sp,M "**" App CEp)
proof
  assume that
A1: M is commutative associative and
A2: A is having_a_unity commutative associative;
  let E be Enumeration of F,p be Permutation of dom E such that
A3: M is having_a_unity or len E>=1;
 let CE,CEp be non-empty non empty FinSequence of D* such that
A4: CE = SignGenOp(f,A,F) * E & CEp=SignGenOp(f,A,F) * (E*p);
 defpred P[set] means for S be Element of Fin dom App CE,
   Sp be Element of Fin dom App CEp st S=$1 &
   Sp = {s*p where s is FinSequence of NAT: s in S}
   holds A $$ (S,M "**" App CE) = A $$ (Sp,M "**" App CEp);
A5: dom p = dom E = rng p by FUNCT_2:52,def 3;
A6: P[{}.dom App CE]
  proof
    let S be Element of Fin dom App CE, Sp be Element of Fin dom App CEp
      such that
A7:   S={}.dom App CE & Sp = {s*p where s is FinSequence of NAT: s in S};
    Sp={}
    proof
      assume Sp<>{};
      then consider x such that
A8:     x in Sp by XBOOLE_0:def 1;
      ex s be FinSequence of NAT st x= s*p & s in S by A8,A7;
      hence thesis by A7;
    end;
    then Sp = {}.dom App CEp;
    then A $$ (Sp,M "**" App CEp) = the_unity_wrt A by A2,SETWISEO:31
    .= A $$ (S,M "**" App CE) by A7,A2,SETWISEO:31;
    hence thesis;
  end;
A9: for B9 being (Element of Fin dom App CE), b being Element of dom App CE
    holds P[B9] & not b in B9 implies P[B9 \/ {b}]
  proof
    let B9 be Element of Fin dom App CE, b be Element of dom App CE such that
A10:  P[B9] & not b in B9;
    let S1 be Element of Fin dom App CE,
        S2 be Element of Fin dom App CEp such that
A11:  S1=B9 \/ {b} & S2 = {s*p where s is FinSequence of NAT: s in S1};
    set B2 = {s*p where s is FinSequence of NAT: s in B9};
    reconsider B2 as Element of Fin dom App CEp by A4,Th113;
A12:  len b = len CE = len E by Th47,A4,CARD_1:def 7;
    then
A13:  dom E = dom b by FINSEQ_3:30;
    b in doms CE;
    then reconsider c =b as FinSequence of NAT by FINSEQ_1:def 11;
A14:  B2 c= S2
    proof
      let y such that
A15:    y in B2;
      consider s be FinSequence of NAT such that
A16:    y=s*p & s in B9 by A15;
      s in S1 by A16,A11,XBOOLE_0:def 3;
      hence thesis by A16,A11;
    end;
    c in S1 by A11,ZFMISC_1:136;
    then
A17:  c*p in S2 by A11;
    then
A18:  {c*p} c= S2 by ZFMISC_1:31;
    S2 c= dom App CEp by FINSUB_1:def 5;
    then reconsider cp = c*p as Element of dom App CEp by A17;
A19:  not cp in B2
    proof
      assume cp in B2;
      then consider s be FinSequence of NAT such that
A20:    cp =s*p & s in B9;
      B9 c= dom App CE by FINSUB_1:def 5;
      then s in dom App CE by A20;
      then len s = len CE by Th47;
      then
A21:    dom E = dom s by A12,FINSEQ_3:30;
A22:    p*p" = id (rng p) by FUNCT_1:39;
      (c*p)*p" = s*(p*p") by A20,RELAT_1:36;
      then c*(p*p") = s*(p*p") by RELAT_1:36;
      then c*(p*p") = s by A22,A5,A21,RELAT_1:52;
      hence thesis by A20,A10,A22,A5,A13,RELAT_1:52;
    end;
    S2 c= B2 \/{b*p}
    proof
      let y such that
A23:    y in S2;
      consider s be FinSequence of NAT such that
A24:    y = s*p & s in S1 by A23,A11;
      s in B9 or s=c by A11,A24,ZFMISC_1:136;
      then y in B2 or y in {b*p} by A24,ZFMISC_1:31;
      hence thesis by XBOOLE_0:def 3;
    end;
    then
A25:  B2 \/{cp} = S2 by A18,A14,XBOOLE_1:8;
    (M "**" App CE).c = (M "**" App CEp).cp by Th112,A1,A4,A12,A3;
    hence A $$ ( S1, M "**" App CE)
     = A.(A $$ ( B9, M "**" App CE), (M "**" App CEp).cp)
       by A2,A10,A11,SETWOP_2:2
    .= A.(A $$ ( B2, M "**" App CEp), (M "**" App CEp).cp) by A10
    .= A $$ ( S2, M "**" App CEp) by A25,A2,A19,SETWOP_2:2;
  end;
  for B being Element of Fin dom App CE  holds
  P[B] from SETWISEO:sch 2(A6,A9);
  hence thesis;
end;

theorem Th116:
  A is having_a_unity associative having_an_inverseOp
implies
  for F, Fb be finite set st Fb = UNION(F,bool {len f+1}) & union F c= dom f
    for E1 be Enumeration of Fb
      ex E2 be Enumeration of Fb st
    SignGenOp(f^<* d1 *>,A,Fb)*E1 =
      SignGenOp(f^<*(the_inverseOp_wrt A).d1 *>,A,Fb)*E2
proof
  set I = the_inverseOp_wrt A;
  assume
A1: A is having_a_unity associative having_an_inverseOp;
  let F, Fb be finite set such that
A2: Fb = UNION(F,bool {len f+1}) and
A3: union F c= dom f;
  let E1 be Enumeration of Fb;
  defpred P[object,object] means $2 in dom E1 &
    (1+len f in (E1.$1) implies E1.$2 = (E1.$1)\{1+ len f}) &
    (not 1+len f in E1.$1 implies E1.$2 = (E1.$1)\/{1+ len f});
A4: rng E1 = Fb by RLAFFIN3:def 1;
A5: for x st x in dom E1 ex y st P[x,y]
  proof
    let x;
    assume x in dom E1;
    then E1.x in Fb by A4,FUNCT_1:def 3;
    then consider X,Y such that
A6:   X in F & Y in bool {len f+1} & E1.x = X \/ Y by A2,SETFAM_1:def 4;
    1+len f > len f by NAT_1:13;
    then
A7:   not 1+len f in dom f by FINSEQ_3:25;
A8:   X c= union F by A6,ZFMISC_1:74;
    then
A9:   not 1+len f in X by A7,A3;
    per cases by A6,ZFMISC_1:33;
    suppose
A10:    Y={1+len f};
      {} c= {len f+1};
      then (E1.x)\{1+ len f} = X & {} in bool {len f+1}
        by A6,A10,A9,ZFMISC_1:117;
      then ((E1.x)\{1+ len f})\/{} in Fb by A2,A6,SETFAM_1:def 4;
      then consider y such that
A11:    y in dom E1 & E1.y = (E1.x)\{1+ len f} by A4,FUNCT_1:def 3;
      take y;
      thus thesis by A11,A10,A6,ZFMISC_1:136;
    end;
    suppose
A12:    Y={};
      {len f+1} c= {len f+1};
      then (E1.x)\/ {len f+1} in Fb by A2,A6,A12,SETFAM_1:def 4;
      then consider y such that
A13:    y in dom E1 & E1.y = (E1.x)\/{1+ len f} by A4,FUNCT_1:def 3;
      take y;
      thus thesis by A13,A12,A6,A8,A7,A3;
    end;
  end;
  consider p be Function such that
A14: dom p = dom E1 and
A15: for x st x in dom E1 holds P[x,p.x] from CLASSES1:sch 1(A5);
  rng p c= dom E1
  proof
    let y;
    assume y in rng p;
    then ex x st x in dom p & p.x = y by FUNCT_1:def 3;
    hence thesis by A14,A15;
  end;
  then reconsider p as Function of dom E1,dom E1 by A14,FUNCT_2:2;
  dom E1 c= rng p
  proof
    let x;
    assume
A16:  x in dom E1;
    then E1.x in Fb by A4,FUNCT_1:def 3;
    then consider X,Y such that
A17:  X in F & Y in bool {len f+1} & E1.x = X \/ Y by A2,SETFAM_1:def 4;
    1+len f > len f by NAT_1:13;
    then
A18:  not 1+len f in dom f by FINSEQ_3:25;
A19:  X c= union F by A17,ZFMISC_1:74;
    then
A20:  not 1+len f in X by A18,A3;
    per cases by A17,ZFMISC_1:33;
    suppose
A21:    Y={1+len f};
      then
A22:    1+len f in E1.x by A17,ZFMISC_1:136;
      {} c= {len f+1};
      then (E1.x)\{1+ len f} = X & {} in bool {len f+1}
        by A17,A21,A20,ZFMISC_1:117;
      then ((E1.x)\{1+ len f})\/{} in Fb by A2,A17,SETFAM_1:def 4;
      then consider z be object  such that
A23:    z in dom E1 & E1.z = (E1.x)\{1+ len f} by A4,FUNCT_1:def 3;
      not 1+ len f in E1.z by A23,ZFMISC_1:56;
      then E1.(p.z) = (E1.z)\/ {1+ len f} & p.z in dom E1 by A23,A15;
      then p.z = x by A16,A23,A22,FUNCT_1:def 4,ZFMISC_1:116;
      hence thesis by A14,A23,FUNCT_1:def 3;
    end;
    suppose
A24:    Y={};
      then
A25:    not 1+len f in E1.x by A17,A19,A18,A3;
      {len f+1} c= {len f+1};
      then (E1.x)\/ {len f+1} in Fb by A17,A24,A2,SETFAM_1:def 4;
      then consider z be object such that
A26:    z in dom E1 & E1.z = (E1.x)\/{1+ len f} by A4,FUNCT_1:def 3;
      1+ len f in E1.z by A26,ZFMISC_1:136;
      then
A27:    E1.(p.z) = (E1.z)\ {1+ len f} & p.z in dom E1 by A26,A15;
      then E1.(p.z) = E1.x by A26,A25,ZFMISC_1:117;
      then p.z = x by A27,A16,FUNCT_1:def 4;
      hence thesis by A14,A26,FUNCT_1:def 3;
    end;
  end;
  then dom E1 =rng p;
  then
A28: p is onto & card dom E1 = card dom E1 by FUNCT_2:def 3;
  then p is one-to-one by FINSEQ_4:63;
  then reconsider p as Permutation of dom E1 by A28;
  reconsider E1p=E1*p as Enumeration of Fb by Th109;
  take E1p;
A29: len (SignGenOp(f^<* d1 *>,A,Fb)*E1) = len E1 = card Fb &
    len (SignGenOp(f^<* I.d1 *>,A,Fb)*E1p) = len E1p = card Fb by CARD_1:def 7;
  for i st 1 <= i <= len (SignGenOp(f^<* d1 *>,A,Fb)*E1) holds
    (SignGenOp(f^<* d1 *>,A,Fb)*E1).i = (SignGenOp(f^<* I.d1 *>,A,Fb)*E1p).i
  proof
    let i such that
A30:  1 <= i <= len (SignGenOp(f^<* d1 *>,A,Fb)*E1);
    i in dom (SignGenOp(f^<* d1 *>,A,Fb)*E1) &
    i in dom (SignGenOp(f^<* I.d1 *>,A,Fb)*E1p) by A29,A30,FINSEQ_3:25;
    then
A31:  (SignGenOp(f^<* d1 *>,A,Fb)*E1).i = SignGen(f^<*d1*>,A,E1.i)&
    (SignGenOp(f^<* I.d1 *>,A,Fb)*E1p).i = SignGen(f^<*I.d1*>,A,E1p.i) by Th80;
    i in dom E1p by A30,A29,FINSEQ_3:25;
    then
A32:  i in dom p & E1p.i = E1.(p.i) by FUNCT_1:11,12;
A33:  len (f^<* d1 *>) = 1+ len f = len (f^<*I.d1*>) by FINSEQ_2:16;
A34:  (f^<* d1 *>)|(len f) = f =(f^<* I.d1 *>)|(len f);
A35:  (f^<* d1 *>).(1+len f) = d1 & (f^<* I.d1 *>).(1+len f) =I.d1;
    1+len f > len f by NAT_1:13;
    then not 1+len f in dom f by FINSEQ_3:25;
    then
A36:  {1+len f} misses dom f by ZFMISC_1:50;
    per cases;
    suppose
A37:    1+ len f in (E1.i);
      E1.(p.i) = (E1.i)\{1+len f} by A37,A15,A32;
      then not 1+len f in E1p.i by A32,ZFMISC_1:56;
      then
A38:    SignGen(f^<*I.d1*>,A,E1p.i) = SignGen(f,A,E1p.i)^<*I.d1*>
        by A33,A34,A35,Th74;
      (E1p.i) /\ dom f = ((E1.i)\{1+len f})/\dom f by A37,A15,A32
      .= (dom f /\ (E1.i)) \ (dom f /\ {1+len f}) by XBOOLE_1:50
      .= dom f /\ (E1.i) by A36;
      then SignGen(f,A,E1p.i) = SignGen(f,A,(E1.i) /\dom f) by Th89
      .= SignGen(f,A,E1.i) by Th89;
      hence thesis by A37,A33,A34,A35,Th73,A38,A31;
    end;
    suppose
A39:    not 1+ len f in (E1.i);
      E1.(p.i) = (E1.i)\/{1+len f} by A39,A15,A32;
      then 1+len f in E1p.i by A32,ZFMISC_1:136;
      then
A40:    SignGen(f^<*I.d1*>,A,E1p.i) = SignGen(f,A,E1p.i)^<*I.(I.d1)*>
        by A33,A34,A35,Th73;
A41:    I.(I.d1) = d1 by A1,FINSEQOP:62;
      (E1p.i) /\ dom f = (dom f)/\((E1.i)\/{1+len f}) by A39,A15,A32
      .= (dom f /\ (E1.i)) \/ (dom f /\ {1+len f}) by XBOOLE_1:23
      .= dom f /\ (E1.i) by A36;
      then SignGen(f,A,E1p.i) = SignGen(f,A,(E1.i) /\dom f) by Th89
      .= SignGen(f,A,E1.i) by Th89;
      hence thesis by A39,A33,A34,A35,Th74,A40,A31,A41;
    end;
  end;
  hence thesis by A29;
end;

theorem Th117:
  A is having_a_unity associative commutative having_an_inverseOp
implies
  for F be finite non empty set st union F c= dom f
      for F1,F2 be finite set st F1 = UNION(F,bool {len f+1}) &
            F2 = UNION(F,bool {len f+1,len f+2}) holds
     ex E1,E2 be Enumeration of F1,
        E be Enumeration of F2 st
A "**" (SignGenOp(f^<*d1*>^<*d2*>,A,F2)*E) = (
     A"**" (SignGenOp(f^<*A.(d1,d2)*>,A,F1)*E1)) ^
    (A"**" (SignGenOp(f^<*A.((the_inverseOp_wrt A).d1,d2)*>,A,F1)*E2))
proof
  set I=the_inverseOp_wrt A;
  assume
A1: A is having_a_unity associative commutative having_an_inverseOp;
  let F be finite non empty set such that
A2: union F c= dom f;
  let F1,F2 be finite set such that
A3: F1 = UNION(F,bool {len f+1}) & F2 = UNION(F,bool {len f+1,len f+2});
  consider E1 be Enumeration of F1,E2 be Enumeration of F2 such that
A4: A "**" (SignGenOp(f^<*d1*>^<*d2*>,A,F2)*E2) =
    (A"**" (SignGenOp(f^<*A.(d1,d2)*>,A,F1)*E1)) ^
    (A"**" (SignGenOp(f^<*A.(d1,I.d2)*>,A,F1)*E1)) by A1,A2,A3,Th91;
  consider E3 be Enumeration of F1 such that
A5: SignGenOp(f^<* A.(d1,I.d2) *>,A,F1)*E1 =
  SignGenOp(f^<*I.(A.(d1,I.d2)) *>,A,F1)*E3 by A1,A2,A3,Th116;
  take E1,E3,E2;
  thus thesis by A4,A5,A1,Th2;
end;

theorem Th118:
  A is having_a_unity
implies
  for E be Enumeration of F
    for s be FinSequence st F={} & s in doms (SignGenOp(f,B,F) * E) holds
     (A "**" App (SignGenOp(f,B,F) * E)).s = the_unity_wrt A
proof
  assume
A1: A is having_a_unity;
  let E be Enumeration of F;
  let s be FinSequence such that
A2: F={} & s in doms (SignGenOp(f,B,F) * E);
  len s = len (SignGenOp(f,B,F) * E) = len E = card F by A2,Th47;
  then
A3: SignGenOp(f,B,F) * E={} & s={} by A2;
  s in dom App (SignGenOp(f,B,F) * E) by A2,Def9;
  hence (A "**" App (SignGenOp(f,B,F) * E)).s = A"**" <*>D by A3,Th59,Def10
  .= the_unity_wrt A by A1,FINSOP_1:10;
end;

theorem Th119:
  for E be Enumeration of F, p be Permutation of dom E
    for S be Subset of doms(n,card F) holds
     {s*p where s is FinSequence of NAT: s in S} is Subset  of doms(n,card F)
proof
  let E be Enumeration of F, p be Permutation of dom E;
  reconsider Ep = E*p as Enumeration of F by Th109;
  set D = the non empty set;
  set f = the n-element FinSequence of D;
  set A = the BinOp of D;
A1: len f = n by CARD_1:def 7;
  let S be Subset of  doms(n,card F);
    {s*p where s is FinSequence of NAT: s in S} c= doms(n,card F)
  proof
    let y;
    assume y in {s*p where s is FinSequence of NAT: s in S};
    then consider s be FinSequence of NAT such that
A2:   y=s*p & s in S;
    S c= doms(n,card F);
    then S c= dom App (SignGenOp(f,A,F) * E) by A1,Lm3;
    then s in dom App (SignGenOp(f,A,F) * E) by A2;
    then s*p in doms (SignGenOp(f,A,F) * Ep) by Th110;
    hence thesis by A2,A1,Th106;
  end;
  hence thesis;
end;

theorem Th120:
  for f,g be FinSequence st
    (len f=n or len g = m) & f^g in doms(k,n+m) holds
  f in doms(k,n) & g in doms(k,m)
proof
  let f,g be FinSequence;
  set fg=f^g;
  assume
A1: (len f=n or len g = m) & f^g in doms(k,n+m);
  then consider s be Element of (Seg k)* such that
A2: f^g = s & len s = n+m;
  reconsider s as FinSequence of Seg k;
A3: len (f^g) = len f+len g by FINSEQ_1:22;
  rng f c= rng s & rng g c= rng s & rng s c= Seg k
     by A2,FINSEQ_1:29,30;
  then rng f c= Seg k & rng g c= Seg k;
  then f is FinSequence of Seg k & g is FinSequence of Seg k
    by FINSEQ_1:def 4;
  then f in (Seg k)* & g in (Seg k)* by FINSEQ_1:def 11;
  hence thesis by A3,A1,A2;
end;

theorem Th121:
  for f be FinSequence st f in doms(n,k) holds len f = k
proof
  let f be FinSequence;
  assume f in doms(n,k);
  then ex s be Element of (Seg n)* st f=s & len s= k;
  hence thesis;
end;

theorem Th122:
  for f,g be FinSequence holds
    f in doms(k,n) & g in doms(k,m) implies f^g in doms(k,n+m)
proof
  let f,g be FinSequence;
  assume
A1: f in doms(k,n) & g in doms(k,m);
  then consider p1 be Element of (Seg k)* such that
A2: p1=f & len p1= n;
  consider s1 be Element of (Seg k)* such that
A3: s1=g & len s1= m by A1;
A4: len (f^g) = n+m by A2,A3,FINSEQ_1:22;
A5: rng (f^g) = rng f \/ rng g by FINSEQ_1:31;
  rng s1 c= Seg k & rng p1 c= Seg k;
  then f^g is FinSequence of (Seg k) by A5,A2,A3,FINSEQ_1:def 4,XBOOLE_1:8;
  then f^g is Element of (Seg k)* by FINSEQ_1:def 11;
  hence thesis by A4;
end;

theorem Th123:
  doms(k,n)^doms(k,m) = doms(k,n+m)
proof
  thus doms(k,n)^doms(k,m) c= doms(k,n+m)
  proof
    let y;
    assume y in doms(k,n)^doms(k,m);
    then ex p,s be FinSequence st y=p^s & p in doms(k,n) & s in doms(k,m)
      by POLNOT_1:def 2;
    hence thesis by Th122;
  end;
  let y;
  assume
A1: y in doms(k,n+m);
  then consider p be Element of (Seg k)* such that
A2: p=y & len p= n+m;
  consider q be FinSequence such that
A3: p=(p|n)^q by FINSEQ_1:80;
  len (p|n) =n by A2,FINSEQ_1:59,NAT_1:11;
  then p|n in doms(k,n) & q in doms(k,m) by A1,A2,A3,Th120;
  hence thesis by A2,A3,POLNOT_1:def 2;
end;

theorem Th124:
   for E be Enumeration of F, p be Permutation of dom E
   for s be FinSequence st s in doms(m,card F)
     holds s*p in doms(m,card F)
proof
  let E be Enumeration of F,p be Permutation of dom E;
  let s be FinSequence such that
A1: s in doms(m,card F);
  reconsider s1=s as Element of doms(m,card F) by A1;
  reconsider Ep=E*p as Enumeration of F by Th109;
A2: len s =card F =card E by Th121,A1,CARD_1:def 7;
  then
A3: dom E = dom s by FINSEQ_3:30;
A4: dom p = dom E = rng p by FUNCT_2:52,def 3;
  then
A5: dom (s*p) = dom s = Seg len s by A3,FINSEQ_1:def 3,RELAT_1:27;
  reconsider sp=s*p as FinSequence by A3;
A6: len sp = len s by A5,FINSEQ_3:29;
A7: rng s1 c= Seg m;
  rng sp = rng s by A3,A4,RELAT_1:28;
  then sp is FinSequence of Seg m by A7,FINSEQ_1:def 4;
  then sp in (Seg m)* by FINSEQ_1:def 11;
  hence thesis by A2,A6;
end;

theorem Th125:
  k <= n implies doms(k,m) c= doms(n,m)
proof
  assume k <= n;
  then
A1: Seg k c= Seg n by FINSEQ_1:5;
  let y;
  assume y in doms(k,m);
  then consider p be Element of (Seg k)* such that
A2: y=p & len p = m;
  rng p c= Seg n by A1;
  then p is FinSequence of Seg n by FINSEQ_1:def 4;
  then p in (Seg n)* by FINSEQ_1:def 11;
  hence thesis by A2;
end;

theorem Th126:
  A is commutative associative having_a_unity having_an_inverseOp &
  M is associative commutative having_a_unity &
  M is_distributive_wrt A
implies
  for E1 be Enumeration of F1, E2 be Enumeration of F2 st
    union F1 c= Seg (1+m) & union F2 c= Seg (1+m)
  for Ee be Enumeration of Ext(F1,1+m,2+m),
      Es be Enumeration of swap(F2,1+m,2+m) st
    Ee = Ext(E1,1+m,2+m) & Es = Swap(E2,1+m,2+m)
  for Ees be Enumeration of Ext(F1,1+m,2+m)\/swap(F2,1+m,2+m) st Ees=Ee^Es
  for s1,s2 be FinSequence st
    s1 in doms(m+1,card F1) & s2 in doms(m+1,card F2) &
      s1^s2 is with_evenly_repeated_values &
    card (s1"{1+m}) = card (s2"{1+m})
  ex S be Subset of doms(m+2,card F1+card F2) st
    (card (s1"{1+m}) = 0 implies s1^s2 in S) &
    S is with_evenly_repeated_values-member &
    for CE1,CE2 be FinSequence of D*, f,d1,d2 st len f = m &
      CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F1) * E1 &
      CE2 = SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,F2) * E2
    for CFes be non-empty non empty FinSequence of D* st
        CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
               Ext(F1,1+len f,2+len f)\/swap(F2,1+len f,2+len f) ) * Ees
    for Sd be Element of Fin dom App CFes st S = Sd holds
       M.((M "**" App CE1).s1,(M "**" App CE2).s2)= A$$(Sd,M"**"App CFes) &
       for h be FinSequence,i st h in Sd & i in dom h holds
         ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
         ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i)
proof
  assume that
A1: A is commutative associative having_a_unity having_an_inverseOp and
A2: M is associative commutative having_a_unity and
A3: M is_distributive_wrt A;
  defpred P[Nat] means
    for F1,F2
      for E1 be Enumeration of F1,E2 be Enumeration of F2 st
        union F1 c= Seg (1+m) & union F2 c= Seg (1+m)
    for Ee be Enumeration of Ext(F1,1+m,2+m),
        Es be Enumeration of swap(F2,1+m,2+m) st
       Ee = Ext(E1,1+m,2+m) & Es = Swap(E2,1+m,2+m)
    for Ees be Enumeration of Ext(F1,1+m,2+m)\/swap(F2,1+m,2+m)
      st Ees=Ee^Es
    for s1,s2 be FinSequence st
       s1 in doms(m+1,card F1) & s2 in doms(m+1,card F2) &
       s1^s2 is with_evenly_repeated_values &
       card (s1"{1+m}) = $1 = card (s2"{1+m})
    ex S be Subset of doms(m+2,card F1+card F2) st
      (card (s1"{1+m}) = 0 implies s1^s2 in S) &
      S is with_evenly_repeated_values-member &
      for CE1,CE2 be FinSequence of D*, f,d1,d2 st len f = m &
        CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F1) * E1 &
        CE2 = SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,F2) * E2
      for CFes be non-empty non empty FinSequence of D* st
        CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
           Ext(F1,1+len f,2+len f)\/swap(F2,1+len f,2+len f) ) * Ees
      for Sd be Element of Fin dom App CFes st S = Sd holds
        M.((M "**" App CE1).s1,(M "**" App CE2).s2)= A$$(Sd,M"**"App CFes) &
      for h be FinSequence,i st h in Sd & i in dom h holds
        ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
        ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i);
A4: P[n] implies P[n+1]
  proof
    assume
A5:   P[n];
    let F1,F2;
    set Fe = Ext(F1,1+m,2+m), Fs=swap(F2,1+m,2+m);set n1=n+1;
    let E1 be Enumeration of F1, E2 be Enumeration of F2 such that
A6:   union F1 c= Seg (1+m) & union F2 c= Seg (1+m);
    let Ee be Enumeration of Fe,
        Es be Enumeration of Fs such that
A7:   Ee = Ext(E1,1+m,2+m) & Es = Swap(E2,1+m,2+m);
A8:   1+m <> 2+m;
A9:   not 2+m in Seg (1+m) by FINSEQ_1:1,XREAL_1:6;
    let Ees be Enumeration of Fe\/Fs such that
A10:  Ees=Ee^Es;
    let s1,s2 be FinSequence such that
A11:  s1 in doms(m+1,card F1) & s2 in doms(m+1,card F2) &
    s1^s2 is with_evenly_repeated_values &
      card (s1"{1+m}) = n1 = card (s2"{1+m});
A12:  len E1 =card F1=len s1 & len E2 =card F2 =len s2 by A11,CARD_1:def 7;
    then
A13:  Seg len s1 = dom E1 & Seg len s2 = dom E2 by FINSEQ_1:def 3;
A14:  s1"{1+m}<>{} by A11;
    then consider p1 be Permutation of Seg (len s1) such that
A15:  (s1*p1) . (len s1) = 1+m & p1 = p1" by Th5;
A16:  s2"{1+m}<>{} by A11;
    then consider p2 be Permutation of Seg (len s2) such that
A17:  (s2*p2) . (len s2) = 1+m & p2 = p2" by Th5;
    reconsider E1p = E1*p1 as Enumeration of F1 by A13,Th109;
    reconsider E2p = E2*p2 as Enumeration of F2 by A13,Th109;
A18:  s1*p1 in doms (1+m,card F1) by A13,Th124,A11;
    then reconsider s1p1=s1*p1 as FinSequence;
A19:  s2*p2 in doms (1+m,card F2) by A13,Th124,A11;
    then reconsider s2p2=s2*p2 as FinSequence;
A20:  dom p1 = Seg (len s1) = rng p1 & Seg (len s1) = dom s1
      by FINSEQ_1:def 3,FUNCT_2:52,def 3;
    then
A21:  dom s1p1 = dom s1 by RELAT_1:27;
    then
A22:  len s1p1=len s1 by FINSEQ_3:29;
A23:  dom p2 = Seg (len s2) = rng p2 & Seg (len s2) = dom s2
      by FINSEQ_1:def 3,FUNCT_2:52,def 3;
    then
A24:  dom s2p2 = dom s2 by RELAT_1:27;
    then
A25:  len s2p2=len s2 by FINSEQ_3:29;
    len s1 in dom s1p1 by A15,FUNCT_1:def 2;
    then 1<= len s1 by FINSEQ_3:25;
    then reconsider ls1=len s1-1 as Nat;
    len s2 in dom s2p2 by A17,FUNCT_1:def 2;
    then 1<= len s2 by FINSEQ_3:25;
    then reconsider ls2=len s2-1 as Nat;
    set F1p = F1\{E1p.len E1p}, F2p = F2\{E2p.len E2p};
A26:  len E1p = card F1 & len E2p = card F2 by CARD_1:def 7;
A27:  len E1p = ls1+1 & len E2p = ls2+1 by A12,CARD_1:def 7;
    then reconsider E1pn=E1p|ls1 as Enumeration of F1p by Th96;
    reconsider E2pn=E2p|ls2 as Enumeration of F2p by Th96,A27;
    reconsider e1 = <*E1p.len E1p*> as Enumeration of {E1p.len E1p}
      by Th96,A27;
    reconsider e2 = <*E2p.len E2p*> as Enumeration of {E2p.len E2p}
      by Th96,A27;
A28:  F1 = F1p \/ {E1p.len E1p} & F2 = F2p \/ {E2p.len E2p} by Th96,A27;
A29:  E1p = E1pn ^ e1 & E2p = E2pn ^ e2 by A27,FINSEQ_3:55;
    set P1=s1p1|ls1,P2=s2p2|ls2;
A30: ls1+1>= ls1 & ls2+1>= ls2 & ls1+1>= 1 & ls2+1>= 1 by NAT_1:11;
A31: len P1 = ls1 & len P2 = ls2 & len E1pn = ls1 & len E2pn = ls2
      by A22,A25,A27,FINSEQ_1:59,NAT_1:11;
    then
A32:  card F1p = ls1 & card F2p = ls2 by CARD_1:def 7;
    len s1p1 = ls1+1 & len s2p2 = ls2+1 by A21,A24,FINSEQ_3:29;
    then
A33:  s1p1 = P1 ^<*s1p1.len s1p1*> &
    s2p2 = P2 ^<*s2p2.len s2p2*> by FINSEQ_3:55;
    then
A34:  P1 in doms(m+1,ls1) & P2 in doms(m+1,ls2) &
      <*s1p1.len s1p1*> in doms(m+1,1) & <*s2p2.len s2p2*> in doms(m+1,1)
      by A31,Th120,A19,A26,A27,A18;
    s1p1,s1 are_fiberwise_equipotent & s2p2,s2 are_fiberwise_equipotent
      by A20,A23,A21,A24,CLASSES1:80;
    then
A35:  card (s2p2"{1+m}) = n1 = card (s1p1"{1+m}) by A11,CLASSES1:78;
    rng <*s1p1.len s1p1*> = {1+m} & rng <*s2p2.len s2p2*> = {1+m}
      by A15,A17,A22,A25,FINSEQ_1:38;
    then <*s1p1.len s1p1*>"{1+m} =dom <*s1p1.len s1p1*>=Seg 1 &
      <*s2p2.len s2p2*>"{1+m} =dom <*s2p2.len s2p2*>=Seg 1
      by FINSEQ_1:38,RELAT_1:134;
    then card (<*s1p1.len s1p1*>"{1+m})=1 & card (<*s2p2.len s2p2*>"{1+m})=1;
    then
A36: n1 = card (P1"{1+m})+1 & n1 = card (P2"{1+m})+1 by A33,A35,FINSEQ_3:57;
    set eF=Ext(F1p,1+m,2+m),sF=swap(F2p,1+m,2+m);
    union F1p c= union F1 & union F2p c= union F2  by ZFMISC_1:77;
    then
A37:  union F1p c= Seg (1+m) & union F2p c= Seg (1+m) by A6;
A38:  not 2+m in Seg (1+m) by FINSEQ_1:1,XREAL_1:6;
A39:  not 2+m in union F1p by A37,FINSEQ_1:1,XREAL_1:6;
    reconsider eE1pn = Ext(E1pn,1+m,2+m) as Enumeration of eF by A9,A37,Th28;
A40:  not 2+m in union F2p by A37,FINSEQ_1:1,XREAL_1:6;
    reconsider eE2pn = Swap(E2pn,1+m,2+m) as Enumeration of sF by Th27,A37,A9;
    reconsider esE=eE1pn^eE2pn as Enumeration of eF\/sF
      by Th79,A8,A39,A40,Th22;
A41:  i = 1+m or i = 2+m implies <*i,i*> in doms(m+2,2)
    proof
      reconsider S=Seg (m+2) as non empty set;
      assume
A42:    i = 1+m or i = 2+m;
      1 <= 1+m <= 1+m+1 & 1<= 1+m+1 by NAT_1:11;
      then i in S by A42;
      then reconsider i as Element of S;
      len <*i,i*>=2 by FINSEQ_1:44;
      hence thesis;
    end;
    then
A43:  <*1+m,1+m*> in doms(m+2,2) & <*2+m,2+m*> in doms(m+2,2);
    reconsider II = <*1+m,1+m*>,JJ = <*2+m,2+m*> as Element of doms(m+2,2)
      by A41;
    set eF1 = Ext({E1p.len E1p},1+m,2+m),
    sF2 = swap({E2p.len E2p},1+m,2+m);
    union {E1p.len E1p} c= union F1 by A28,XBOOLE_1:7,ZFMISC_1:77;
    then
A44:  not 2+m in union {E1p.len E1p} by A38,A6;
    then reconsider Ee1 = Ext(e1,1+m,2+m) as Enumeration of eF1 by Th28;
    union {E2p.len E2p} c= union F2 by A28,XBOOLE_1:7,ZFMISC_1:77;
    then
A45:  not 2+m in union {E2p.len E2p} by A6,A38;
    then reconsider Se2 = Swap(e2,1+m,2+m) as Enumeration of sF2 by Th27;
    reconsider ESe=Ee1^Se2 as Enumeration of eF1\/sF2 by Th79,A8,A44,A45,Th22;
    set I=the_inverseOp_wrt A;
    per cases;
    suppose eF \/sF is empty;
      then
A46:    F1p ={} & F2p={};
A47:    card F1 = 1 = card F2 by A28,A46,CARD_1:30;
A48:    E1pn = {} = E2pn by A46;
      reconsider S={II,JJ} as Subset of doms(m+2,card F1+card F2) by A47;
      take S;
      thus (card (s1"{1+m}) = 0 implies s1^s2 in S) by A11;
      thus S is with_evenly_repeated_values-member;
      let CE1,CE2 be FinSequence of D*,f,d1,d2 such that
A49:    len f = m and
A50:    CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F1) * E1 &
        CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F2) * E2;
      set I=the_inverseOp_wrt A,fD=f^<*A . (d1,d2)*>,fDD=f^<*d1*>^<*d2*>,
        fDID=f^<*A.( I.d1,d2)*>;
A51:    len (f^<*d1*>^<*d2*>) = 1 + len (f^<*d1*>) by FINSEQ_2:16
      .= 1+(1 + len f) by FINSEQ_2:16
      .= 2+len f;
A52:    len (f^<*A.(d1,d2)*>) = 1 + len f by FINSEQ_2:16;
A53:    len (f^<*A.(I.d1,d2)*>) = 1 + len f by FINSEQ_2:16;
A54:    1<= len f+1 by NAT_1:11;
A55:    1+len f <= 2+len f & 1+0 <= 2+len f by XREAL_1:8;
      then
A56:    1+len f in dom fDD & 2+len f in dom fDD by A51,A54,FINSEQ_3:25;
      dom <*d1,d2*>={1,2} by FINSEQ_1:92;
      then
A57:    1 in dom <*d1,d2*> & 2 in dom <*d1,d2*> by TARSKI:def 2;
      fDD = f^<*d1,d2*> by FINSEQ_1:32;
      then
A58:    fDD.(1+len f) = <*d1,d2*>.1 =d1 & fDD.(2+len f) = <*d1,d2*>.2 =d2
        by A57,FINSEQ_1:def 7;
A59:    fD.(1+len f) = A.(d1,d2) & fDID.(1+len f) = A.(I.d1,d2);
      let CFes be non-empty non empty FinSequence of D* such that
A60:    CFes = SignGenOp(fDD,A,Ext(F1,1+len f,2+len f)\/
          swap(F2,1+len f,2+len f))* Ees;
A61:    doms(m+1,card F1)=doms CE1 & doms(m+1,card F2)=doms CE2
        by A50,Lm2,A52,A53,A49,A12;
A62:    doms (1+m,card F1) = doms (SignGenOp(fD,A,F1) * E1p) by Th106,A52,A49;
A63:    doms (1+m,card F2) = doms (SignGenOp(fDID,A,F2) * E2p)
        by Th106,A53,A49;
      rng (SignGenOp(fD,A,F1p)*E1pn) c= D* &
        rng (SignGenOp(fDID,A,F2p) * E2pn) c= D*;
      then reconsider ce1 = SignGenOp(fD,A,F1p) * E1pn,
         ce2 = SignGenOp(fDID,A,F2p) *
        E2pn as FinSequence of D* by FINSEQ_1:def 4;
A64:    SignGenOp(fD,A,F1) * E1p = ce1^(SignGenOp(fD,A,{E1p.len E1p}) * e1) &
        SignGenOp(fDID,A,F2) * E2p = ce2^(SignGenOp(fDID,A,{E2p.len E2p}) * e2)
        by A29,Th81,A28;
A65:    len ce1 = len E1pn & len ce2 = len E2pn by CARD_1:def 7;
A66:    P1 in doms ce1 & P2 in doms ce2 &
        <*s1p1.len s1p1*> in doms (SignGenOp(fD,A,{E1p.len E1p}) * e1) &
        <*s2p2.len s2p2*> in doms (SignGenOp(fDID,A,{E2p.len E2p}) * e2)
        by A33,A31,A64,A65,Th50,A18,A19,A62,A63;
      rng (SignGenOp(fDD,A,eF) * eE1pn) c= D*;
      then reconsider eCF=SignGenOp(fDD,A,eF) * eE1pn as FinSequence of D*
        by FINSEQ_1:def 4;
      rng (SignGenOp(fDD,A,sF) * eE2pn) c= D*;
      then reconsider sCF=SignGenOp(fDD,A,sF) * eE2pn as FinSequence of D*
        by FINSEQ_1:def 4;
A67:    s1p1 in dom App(SignGenOp(fD,A,F1) * E1p) by A62,A18,Def9;
A68:    s2p2 in dom App(SignGenOp(fDID,A,F2) * E2p) by A63,A19,Def9;
A69:    1+len f in dom fD by A52,A54,FINSEQ_3:25;
A70:    dom SignGen(fD,A,E1p.len E1p) = dom fD by Def11;
A71:    SignGenOp(fD,A,{E1p.len E1p}) * e1 = <* SignGen(fD,A,E1p.len E1p) *>
        by Th78;
A72:    (App (SignGenOp(fD,A,F1) * E1p)).s1p1 = ((App ce1).P1)^
           ((App(SignGenOp(fD,A,{E1p.len E1p}) * e1)).(<*1+len f*>))
        by A33,A64,Th61,A15,A49,A22,A66;
      SignGen(fD,A,E1p.len E1p).(1+len f) in rng SignGen(fD,A,E1p.len E1p) c= D
        by A69,A70,FUNCT_1:def 3;
      then reconsider fD1 = SignGen(fD,A,E1p.len E1p).(1+len f)
        as Element of D;
A73:    1+len f in dom fDID by A53,A54,FINSEQ_3:25;
A74:    dom SignGen(fDID,A,E2p.len E2p) = dom fDID by Def11;
A75:    SignGenOp(fDID,A,{E2p.len E2p})*e2 = <* SignGen(fDID,A,E2p.len E2p) *>
        by Th78;
      s2p2.len s2p2 = 1+len f by A17,A49,A24,FINSEQ_3:29;
      then
A76:   (App (SignGenOp(fDID,A,F2) * E2p)).s2p2 = ((App ce2).P2)^
        ((App (SignGenOp(fDID,A,{E2p.len E2p}) * e2)).(<*1+len f*>))
        by A66,A33,A64,Th61;
      SignGen(fDID,A,E2p.len E2p).(1+len f)
        in rng SignGen(fDID,A,E2p.len E2p) c= D
        by A73,A74,FUNCT_1:def 3;
      then reconsider fD2 = SignGen(fDID,A,E2p.len E2p).(1+len f)
        as Element of D;
A77:    (M "**" App CE1).s1 = (M "**" App (SignGenOp(fD,A,F1) * E1p)).s1p1
        by A2,A50,A13,A11,A61,Th112
      .= M "**" ((App (SignGenOp(fD,A,F1) * E1p)).s1p1) by Def10,A67
      .= M.(M"**"(App ce1).P1,
      M"**" ((App (SignGenOp(fD,A,{E1p.len E1p}) * e1)).(<*1+len f*>)))
        by A72,A2,FINSOP_1:5
      .= M.(M"**"(App ce1).P1, M"**" (<* fD1 *>))
        by A71,A70,A52,A54,Th60,FINSEQ_3:25
      .= M.(M"**"(App ce1).P1, fD1) by FINSOP_1:11;
A78:    (M "**" App CE2).s2 = (M "**" App (SignGenOp(fDID,A,F2) * E2p)).s2p2
        by A2,A50,A13,A11,A61,Th112
      .= M "**" ((App (SignGenOp(fDID,A,F2) * E2p)).s2p2) by Def10,A68
      .= M.(M"**"(App ce2).P2,
         M"**" ((App(SignGenOp(fDID,A,{E2p.len E2p}) * e2)).(<*1+len f*>)))
        by A76,A2,FINSOP_1:5
      .= M.(M"**"(App ce2).P2, M"**" (<* fD2 *>))
        by A75,A53,A54,A74,Th60,FINSEQ_3:25
      .= M.(M"**"(App ce2).P2, fD2) by FINSOP_1:11;
A79:    M.((M "**" App CE1).s1,(M "**" App CE2).s2) =
        M.(M.(M"**"(App ce1).P1, fD1),M.(fD2,M"**"(App ce2).P2))
        by A2,A77,A78,BINOP_1:def 2
      .= M.(M.(M.(M"**"(App ce1).P1, fD1), fD2),M"**"(App ce2).P2)
        by A2,BINOP_1:def 3
      .= M.(M.( M"**"(App ce1).P1, M.( fD1, fD2)),M"**"(App ce2).P2)
        by A2,BINOP_1:def 3
      .= M.(M.(M.( fD1, fD2), M"**"(App ce1).P1),M"**"(App ce2).P2)
        by A2,BINOP_1:def 2
      .= M.( M.( fD1, fD2), M.(M"**"(App ce1).P1,M"**"(App ce2).P2))
        by A2,BINOP_1:def 3;
      set eF1 = Ext({E1p.len E1p},1+len f,2+len f),
      sF2 = swap({E2p.len E2p},1+len f,2+len f);
      union {E1p.len E1p} c= union F1 by A28,XBOOLE_1:7,ZFMISC_1:77;
      then
A80:    not 2+len f in union {E1p.len E1p} by A38,A49,A6;
      then reconsider Ee1 = Ext(e1,1+len f,2+len f) as Enumeration of eF1
        by Th28;
      union {E2p.len E2p} c= union F2 by A28,XBOOLE_1:7,ZFMISC_1:77;
      then
A81:    not 2+len f in union {E2p.len E2p} by A6,A49,A38;
      then reconsider Se2 = Swap(e2,1+len f,2+len f) as Enumeration of sF2
        by Th27;
      reconsider ESe=Ee1^Se2 as Enumeration of eF1\/sF2
        by Th79,A8,A80,A49,A81,Th22;
      set cESe = SignGenOp(fDD,A,eF1\/sF2) * ESe;
A82:    cESe = (SignGenOp(fDD,A,eF1) * Ee1)^ (SignGenOp(fDD,A,sF2) * Se2)
        by Th81;
A83:    for x st x in dom cESe holds cESe.x is non empty
      proof
        let x;
        assume x in dom cESe;
        then cESe.x = SignGen(fDD,A,ESe.x) by Th80;
        hence thesis;
      end;
      rng cESe c= D*;
      then reconsider cESe as non-empty non empty FinSequence of D*
        by A83,FINSEQ_1:def 4,FUNCT_1:def 9;
A84:  len Ee1 = card eF1 = card {E1p.len E1p} =1 & len Se2 = card sF2 =
        card {E2p.len E2p} =1 by Th10,Th11,A80,A81,CARD_1:def 7;
      then
A85:    len cESe = len ESe = 1+1 by CARD_1:def 7;
A86:  <*1+len f,1+len f*> in doms cESe & <*2+len f,2+len f*> in doms cESe
        by A43,A49,A85,A51,Lm2;
      reconsider ii=II,jj=JJ as Element of dom App cESe
        by A86,A49,Def9;
A87:    len (SignGenOp(fDD,A,eF1) * Ee1) =len Ee1 &
      len (SignGenOp(fDD,A,sF2) * Se2) = len Se2 by CARD_1:def 7;
      len <*1+len f*> =1 by FINSEQ_1:39;
      then <*1+len f*> in doms (SignGenOp(fDD,A,eF1) * Ee1) &
        <*1+len f*> in doms (SignGenOp(fDD,A,sF2) * Se2)
        by A86,A84,A87,Th50,A82;
      then
A88:    (App cESe).ii = ((App(SignGenOp(fDD,A,eF1) * Ee1)).<*1+len f*>)^
        ((App(SignGenOp(fDD,A,sF2) * Se2)).<*1+len f*>) by A49,Th61,A82;
      len <*2+len f*> =1 by FINSEQ_1:39;
      then <*2+len f*> in doms (SignGenOp(fDD,A,eF1) * Ee1) &
        <*2+len f*> in doms (SignGenOp(fDD,A,sF2) * Se2)
        by A86,A84,A87,Th50,A82;
      then
A89:    (App cESe).jj = ((App(SignGenOp(fDD,A,eF1) * Ee1)).<*2+len f*>)^
          ((App(SignGenOp(fDD,A,sF2) * Se2)).<*2+len f*>) by A49,Th61,A82;
A90:   (M"**"App cESe).ii = M"**" ((App cESe).ii) &
         (M"**"App cESe).jj = M"**" ((App cESe).jj) by Def10;
A91:   1+len f<>2+len f;
      then II<>JJ by A49,FINSEQ_1:77;
      then
A92:    A$$({.ii,jj.}, M"**"App cESe)=
          A.(M "**"((App cESe).ii), M"**"((App cESe).jj)) by A1,A90,SETWOP_2:1;
A93:    A$$({.ii,jj.}, M"**"App cESe) = M.(fD1,fD2)
      proof
A94:      dom SignGen(fDD,A,(E1p.len E1p) \/ {2+len f}) = dom fDD by Def11;
A95:      dom SignGen(fDD,A,E1p.len E1p) = dom fDD by Def11;
A96:      dom SignGen(fDD,A, ( (E2p.len E2p) \ {1+len f}) \/ {2+len f}) =
            dom fDD
          by Def11;
A97:      dom SignGen(fDD,A, (E2p.len E2p) \/ {1+len f}) = dom fDD by Def11;
A98:      A. (M.(d1, d2), M.(d2, I.d1)) =
        A. (M.(d1, d2), M.(I.d1,d2)) by A2,BINOP_1:def 2
        .= A. (M.(d1, d2), I.(M.(d1,d2))) by A1,A3,FINSEQOP:67
        .= the_unity_wrt A by A1,FINSEQOP:59;
        per cases;
        suppose
A99:        1+len f in (E1p.len E1p);
          then 1+len f in (E1p.len E1p) \/ {2+len f} &
          2+len f in (E1p.len E1p) \/ {2+len f} by ZFMISC_1:136;
          then
A100:       SignGen(fDD,A,(E1p.len E1p)\/{2+len f}).(1+len f) =
              I.(fDD.(1+len f)) &
            SignGen(fDD,A,(E1p.len E1p)\/{2+len f}).(2+len f) =
              I.(fDD.(2+len f))
            by A94,A56,Def11;
A101:       fD1 = I.(A.(d1,d2)) & eF1 = {(E1p.len E1p) \/ {2+len f}}
            by A99,Def11,A59,A69,A70,Th29;
          then SignGenOp(fDD,A,eF1) * Ee1 =
            <* SignGen(fDD,A,(E1p.len E1p)\/{2+len f}) *> by Th78;
          then
A102:       (App(SignGenOp(fDD,A,eF1) * Ee1)). <*1+len f*> = <*I.d1 *> &
            (App(SignGenOp(fDD,A,eF1) * Ee1)). <*2+len f*> = <*I.d2 *>
            by Th60,A55,A51,A54,A94,A100,A58,FINSEQ_3:25;
          per cases;
          suppose
A103:         1+len f in (E2p.len E2p);
            not 1+len f in ((E2p.len E2p)\ {1+len f}) by ZFMISC_1:56;
            then not 1+len f in ((E2p.len E2p)\ {1+len f}) \/ {2+len f} &
              2+len f in ((E2p.len E2p)\ {1+len f}) \/ {2+len f}
              by A91,ZFMISC_1:136;
            then
A104:         SignGen(fDD,A,(E2p.len E2p)\ {1+len f} \/ {2+len f}).(1+len f)
              = fDD.(1+len f) &
              SignGen(fDD,A,(E2p.len E2p)\ {1+len f} \/ {2+len f}).(2+len f)
              = I.(fDD.(2+len f)) by A96,A56,Def11;
            fD2 = I.(A.(I.d1,d2)) & sF2 = {(E2p.len E2p)\{1+len f}\/{2+len f}}
              by A103,Def11,A59,A73,A74,Th31;
            then
            SignGenOp(fDD,A,sF2) * Se2 =
            <* SignGen(fDD,A,(E2p.len E2p)\ {1+len f} \/ {2+len f}) *> by Th78;
            then (App cESe).II=<*I.d1,d1*> & (App cESe).JJ=<*I.d2,I.d2*>
              by A102,A88,A89,Th60,A55,A51,A54,A96,A104,A58,FINSEQ_3:25;
            then M"**"((App cESe).II) = M.(I.d1,d1) & M"**"((App cESe).JJ)
             = M.(I.d2,I.d2) by FINSOP_1:12;
            then
A105:         A$$({.ii,jj.}, M"**"App cESe) =
              A.( I.(M.(d1,d1)), M.(I.d2,I.d2)) by A1,A3,A92,FINSEQOP:67
            .= A.( I.(M.(d1,d1)), I.(M.(d2,I.d2))) by A1,A3,FINSEQOP:67
            .= A.( I.(M.(d1,d1)), I.(I.(M.(d2,d2)))) by A1,A3,FINSEQOP:67
            .= A.( I.(M.(d1,d1)), M.(d2,d2)) by A1,FINSEQOP:62;
            M.(fD1,fD2) = M.(I.(A.(d1,d2)),I.(A.(I.d1,d2)))
              by A101,A103,Def11,A59,A73,A74
            .= I.(M.((A.(d1,d2)),I.(A.(I.d1,d2)) )) by A1,A3,FINSEQOP:67
            .= I.(I.(M.(A.(d1,d2), A.(I.d1,d2)))) by A1,A3,FINSEQOP:67
            .= M.(A.(d1,d2), A.(I.d1,d2)) by A1,FINSEQOP:62
            .= A.(M.(d1,A.(I.d1,d2)),M.(d2,A.(I.d1,d2)))
              by A3,BINOP_1:def 10,def 11
            .= A.(A.(M.(d1,I.d1),M.(d1,d2)),M.(d2,A.(I.d1,d2)))
              by A3,BINOP_1:11
            .= A.(A.(M.(d1,I.d1),M.(d1,d2)),A.(M.(d2, I.d1),M.(d2,d2)))
              by A3,BINOP_1:11
            .= A.(M.(d1,I.d1),A.(M.(d1,d2),A.(M.(d2, I.d1),M.(d2,d2))))
               by A1,BINOP_1:def 3
            .= A.( M.(d1, I.d1),A. ( the_unity_wrt A, M.(d2,d2)))
              by A98,A1,BINOP_1:def 3
            .= A.( M.(d1, I.d1),M.(d2,d2))
              by A1,SETWISEO:15
            .= A$$({.ii,jj.},M"**"App cESe) by A105,A1,A3,FINSEQOP:67;
            hence thesis;
          end;
          suppose
A106:         not 1+len f in (E2p.len E2p);
            not 2+len f in (E2p.len E2p) by A81,ZFMISC_1:25;
            then 1+len f in (E2p.len E2p) \/ {1+len f} &
            not 2+len f in (E2p.len E2p) \/ {1+len f} by A91,ZFMISC_1:136;
            then
A107:         SignGen(fDD,A,(E2p.len E2p)\/{1+len f}).(1+len f)=
              I.(fDD.(1+len f))&
              SignGen(fDD,A,(E2p.len E2p)\/ {1+len f}).(2+len f) =
              fDD.(2+len f)
              by A97,A56,Def11;
            fD2 = A.(I.d1,d2) & sF2 = {(E2p.len E2p)\/{1+len f}}
              by A106,Def11,A59,A73,A74,Th32;
            then SignGenOp(fDD,A,sF2)*Se2 =
              <*SignGen(fDD,A,(E2p.len E2p)\/ {1+len f})*> by Th78;
            then (App cESe).II = <*I.d1,I.d1*> & (App cESe).JJ = <*I.d2,d2*>
              by A102,A88,A89,Th60,A55,A51,A54,A97,A107,A58,FINSEQ_3:25;
            then M"**" ((App cESe).ii) = M.(I.d1,I.d1) &
              M"**"((App cESe).jj) = M.(I.d2,d2) by FINSOP_1:12;
            then
A108:         A$$({.ii,jj.},M"**"App cESe) =
              A.( I.(M.(d1,I.d1)), M.(I.d2,d2)) by A1,A3,A92,FINSEQOP:67
            .= A.( I.(I.(M.(d1,d1))), M.(I.d2,d2)) by A1,A3,FINSEQOP:67
            .= A.( M.(d1,d1), M.(I.d2,d2)) by A1,FINSEQOP:62
            .= A.( M.(d1,d1), I.(M.(d2,d2))) by A1,A3,FINSEQOP:67;
            M.(fD1,fD2) = M.(I.(A.(d1,d2)),A.(I.d1,d2))
              by A101,A106,Def11,A59,A73,A74
            .= I.(M.((A.(d1,d2)),A.(I.d1,d2))) by A1,A3,FINSEQOP:67
            .= I.(A. (M.(d1, A.(I.d1,d2)),M.(d2, A.(I.d1,d2))))
              by A3,BINOP_1:def 10,def 11
            .= I.(A.(A.(M.(d1,I.d1),M.(d1,d2)),M.(d2,A.(I.d1,d2))))
              by A3,BINOP_1:11
            .= I.(A.(A.(M.(d1,I.d1),M.(d1,d2)),A.(M.(d2,I.d1),M.(d2,d2))))
              by A3,BINOP_1:11
            .= I.(A.(M.(d1,I.d1),A.(M.(d1,d2),A.(M.(d2, I.d1),M.(d2,d2)))))
              by A1,BINOP_1:def 3
            .= I.(A.(M.(d1,I.d1),A.(A.(M.(d1,d2),M.(d2,I.d1)),M.(d2,d2))))
              by A1,BINOP_1:def 3
            .= I.(A.(M.(d1,I.d1),M.(d2,d2))) by A98,A1,SETWISEO:15
            .= I.(A.( I.(M.(d1,d1)),M.(d2,d2))) by A1,A3,FINSEQOP:67
            .= A$$({.ii,jj.},M"**"App cESe) by A108,Th2,A1;
            hence thesis;
          end;
        end;
        suppose
A109:       not 1+len f in (E1p.len E1p);
          not 2+len f in (E1p.len E1p) by A80,ZFMISC_1:25;
          then
A110:       SignGen(fDD,A,(E1p.len E1p)).(1+len f) = (fDD.(1+len f)) &
            SignGen(fDD,A,(E1p.len E1p)).(2+len f) = (fDD.(2+len f))
            by A95,A56,A109,Def11;
          fD1=A.(d1,d2) & eF1={(E1p.len E1p)} by A109,Def11,A59,A69,A70,Th30;
          then SignGenOp(fDD,A,eF1) * Ee1 = <* SignGen(fDD,A,E1p.len E1p) *>
            by Th78;
          then
A111:       (App(SignGenOp(fDD,A,eF1) * Ee1)).<*1+len f*> = <*d1*> &
            (App(SignGenOp(fDD,A,eF1) * Ee1)).<*2+len f*> = <*d2*>
            by Th60,A55,A51,A54,A95,A110,A58,FINSEQ_3:25;
          per cases;
          suppose
A112:         1+len f in (E2p.len E2p);
            not 1+len f in ((E2p.len E2p)\ {1+len f}) by ZFMISC_1:56;
            then not 1+len f in ((E2p.len E2p)\ {1+len f}) \/ {2+len f} &
            2+len f in ((E2p.len E2p)\{1+len f})\/{2+len f}
              by A91,ZFMISC_1:136;
            then
A113:         SignGen(fDD,A,(E2p.len E2p)\ {1+len f} \/ {2+len f}).(1+len f) =
              fDD.(1+len f) &
              SignGen(fDD,A,(E2p.len E2p)\ {1+len f} \/ {2+len f}).(2+len f) =
              I.(fDD.(2+len f)) by A96,A56,Def11;
A114:         fD2=I.(A.(I.d1,d2)) & sF2={(E2p.len E2p)\{1+len f}\/{2+len f}}
              by A112,Def11,A59,A73,A74,Th31;
            then SignGenOp(fDD,A,sF2)*Se2
              =<*SignGen(fDD,A,(E2p.len E2p)\{1+len f}\/{2+len f})*> by Th78;
            then (App cESe).II = <*d1, d1*> & (App cESe).JJ = <*d2,I.d2*>
              by A111,A88,A89,Th60,A55,A51,A54,A96,A113,A58,FINSEQ_3:25;
            then M"**" ((App cESe).II) = M.(d1,d1) &
                 M"**" ((App cESe).JJ) = M.(d2,I.d2) by FINSOP_1:12;
            then
A115:         A$$({.ii,jj.},M"**"App cESe) =
               A.( M.(d1,d1), I.(M.(d2,d2))) by A1,A3,A92,FINSEQOP:67;
            M.(fD1,fD2) = M.(A.(d1,d2),I.(A.(I.d1,d2)))
              by A109,Def11,A59,A69,A70,A114
            .= I.(M.((A.(d1,d2)),A.(I.d1,d2))) by A1,A3,FINSEQOP:67
            .= I.(A. (M.(d1, A.(I.d1,d2)),M.(d2, A.(I.d1,d2))))
              by A3,BINOP_1:def 10,def 11
            .= I.(A.( A.(M.(d1,I.d1),M.(d1, d2)),M.(d2, A.(I.d1,d2))))
              by A3,BINOP_1:11
            .= I.(A.(A. (M.(d1,I.d1),M.(d1,d2)),A.(M.(d2,I.d1),M.(d2,d2))))
              by A3,BINOP_1:11
            .= I.(A.(M.(d1,I.d1),A.(M.(d1,d2),A.(M.(d2,I.d1),M.(d2,d2)))))
              by A1,BINOP_1:def 3
            .= I.(A.(M.(d1,I.d1),A.(A.(M.(d1,d2),M.(d2,I.d1)),M.(d2,d2))))
              by A1,BINOP_1:def 3
            .= I.(A.(M.(d1,I.d1),M.(d2,d2))) by A98,A1,SETWISEO:15
            .= I.(A.(I.(M.(d1,d1)),M.(d2,d2))) by A1,A3,FINSEQOP:67
            .= A$$({.ii,jj.},M"**"App cESe) by A115,A1,Th2;
            hence thesis;
          end;
          suppose
A116:         not 1+len f in (E2p.len E2p);
            not 2+len f in (E2p.len E2p) by A81,ZFMISC_1:25;
            then 1+len f in (E2p.len E2p) \/ {1+len f} &
            not 2+len f in (E2p.len E2p) \/ {1+len f} by A91,ZFMISC_1:136;
            then
A117:         SignGen(fDD,A,(E2p.len E2p)\/{1+len f}).(1+len f)=
              I.(fDD.(1+len f)) &
              SignGen(fDD,A,(E2p.len E2p)\/{1+len f}).(2+len f)=fDD.(2+len f)
              by A97,A56,Def11;
A118:         fD2 = A.(I.d1,d2) & sF2 = {(E2p.len E2p) \/ {1+len f}}
              by A116,Def11,A59,A73,A74,Th32;
            then SignGenOp(fDD,A,sF2)*Se2=
              <*SignGen(fDD,A,(E2p.len E2p)\/{1+len f})*>
              by Th78;
            then (App cESe).II = <*d1,I.d1*> & (App cESe).JJ = <*d2,d2*>
              by A111,A88,A89,Th60,A55,A51,A54,A97,A117,A58,FINSEQ_3:25;
            then A119: M"**" ((App cESe).II) = M.(d1,I.d1) &
              M"**" ((App cESe).JJ) = M.(d2,d2) by FINSOP_1:12;
            M.(fD1,fD2) =M.(A.(d1,d2),A.(I.d1,d2))
              by A109,Def11,A59,A69,A70,A118
            .= A. (M.(d1, A.(I.d1,d2)),M.(d2, A.(I.d1,d2)))
              by A3,BINOP_1:def 10,def 11
            .= A.(A.(M.(d1,I.d1),M.(d1,d2)),M.(d2,A.(I.d1,d2)))
              by A3,BINOP_1:11
            .= A.(A.(M.(d1,I.d1),M.(d1,d2)),A.(M.(d2,I.d1),M.(d2,d2)))
              by A3,BINOP_1:11
            .= A.(M.(d1, I.d1),A.(M.(d1,d2),A.(M.(d2,I.d1),M.(d2,d2))))
              by A1,BINOP_1:def 3
            .= A.(M.(d1,I.d1),A.(A.(M.(d1,d2),M.(d2,I.d1)),M.(d2,d2)))
              by A1,BINOP_1:def 3
            .= A.(M.(d1,I.d1),M.(d2,d2)) by A98,A1,SETWISEO:15
            .= A.(I.(M.(d1,d1)),M.(d2,d2)) by A1,A3,FINSEQOP:67;
            hence thesis by A119,A1,A3,A92,FINSEQOP:67;
          end;
        end;
      end;
      set esCF=SignGenOp(fDD,A,eF \/ sF ) * esE;
      let Sd be Element of Fin dom App CFes such that
A120:   S = Sd;
      (M"**"(App ce1)).P1 = the_unity_wrt M =(M"**"(App ce2)).P2
        & P1 in dom (App ce1) & P2 in dom (App ce2)
        by Th118,A66,A2,Def9,A46;
      then M"**"((App ce1).P1) = the_unity_wrt M =M"**"((App ce2).P2)
        by Def10;
      then
A121:   M.(M"**"(App ce1).P1, M"**"(App ce2).P2) = the_unity_wrt M
        by A2,SETWISEO:15;
A122: E1 = <* E1.1 *> & E1p = <* E1p.1 *>
        by A12,A26,A28,A46,CARD_1:30,FINSEQ_1:40;
      then E1.1 in {E1.1} = rng E1= F1= rng E1p = {E1p.1}
        by FINSEQ_1:38,RLAFFIN3:def 1,TARSKI:def 1;
      then
A123:   Ext(E1,m+1,m+2) = Ee1 by A49,A29,A48,A122,TARSKI:def 1;
A124:   E2 = <* E2.1 *> & E2p = <* E2p.1 *>
        by A12,A26,A28,A46,CARD_1:30,FINSEQ_1:40;
      then E2.1 in {E2.1} = rng E2= F2= rng E2p = {E2p.1}
        by FINSEQ_1:38,RLAFFIN3:def 1,TARSKI:def 1;
      then Es = Se2 by A49,A7,A48,A29,A124,TARSKI:def 1;
      hence M.((M"**"App CE1).s1,(M"**"App CE2).s2)= A$$(Sd,M"**"App CFes)
        by A28,A46,A60,A10,A123,A7,A121,A79,A2,A93,A120,SETWISEO:15;
      let h be FinSequence,i such that
A125:   h in Sd & i in dom h;
      consider o1 be object such that
A126:   o1 in s1"{1+len f} by A14,A49,XBOOLE_0:def 1;
      consider o2 be object such that
A127:   o2 in s2"{1+len f} by A16,A49,XBOOLE_0:def 1;
A128:   o1 in dom s1 & s1.o1 in {1+len f} & o2 in dom s2 &
      s2.o2 in {1+len f} by A126,A127,FUNCT_1:def 7;
      then reconsider o1,o2 as Nat;
      1<= o1 <=1 & 1<= o2 <= 1 by A12,A47,A128,FINSEQ_3:25;
      then
A129:   o1=1 =o2 by XXREAL_0:1;
A130:   h = II or h = JJ by A120,A125,TARSKI:def 2;
      then len h=2 by FINSEQ_1:44;
      then 1<= i <=1+1 by A125,FINSEQ_3:25;
      then 1<=i <=1 or i=2 by NAT_1:8;
      then
A131:   i = 1 or i =2 by XXREAL_0:1;
      thus (s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}
      proof
        (h.1 = 1+len f or h.1 = 2+len f) & (h.2 = 1+len f or h.2 = 2+len f)
          by A130,A49;
        hence thesis by A131,TARSKI:def 2;
      end;
      s1.1 = 1+len f & s2.1 = 1+len f by A129,A128,TARSKI:def 1;
      then s1 = <*1+len f*> & s2 = <*1+len f*>
        by A12,A28,A46,CARD_1:30,FINSEQ_1:40;
      then s1^s2 = <*1+len f,1+len f*>;
      hence (s1^s2).i <> 1+len f implies h.i =(s1^s2).i by A131;
    end;
    suppose
A132: eF \/sF is non empty;
A133:   P1^P2 is with_evenly_repeated_values
      proof
        let y;
A134:     card (s1p1"{y}) = card (s1"{y}) & card (s2p2"{y}) = card (s2"{y})
          by A20,A21,A23,A24,CLASSES1:77,78;
A135:     card (s2p2"{y}) = card (P2"{y})+card (<*1+m*>"{y})
          by A33,A17,A25,FINSEQ_3:57;
        card ((s1^s2)"{y}) is even by A11;
        then consider n be Nat such that
A136:     card ((s1^s2)"{y}) = 2*n by ABIAN:def 2;
        (card (<*1+m,1+m*>"{y})) is even by Def6;
        then consider k be Nat such that
A137:     card (<*1+m,1+m*>"{y}) = 2*k by ABIAN:def 2;
        2*n = card (s1"{y})+card (s2"{y}) by A136,FINSEQ_3:57
        .= (card (P1"{y})+card (<*1+m*>"{y}))+(card (P2"{y})+
           card (<*1+m*>"{y})) by A135,A33,A15,A22,A134,FINSEQ_3:57
        .= (card (P1"{y})+card (P2"{y}))+ ( card (<*1+m*>"{y}) +
          card (<*1+m*>"{y}))
        .=(card (P1"{y})+card (P2"{y}))+ ( card (<*1+m,1+m*>"{y}))
          by FINSEQ_3:57
        .=card ((P1^P2)"{y})+ (2*k) by A137,FINSEQ_3:57;
        hence thesis;
      end;
A138:   eF \/ eF1 = Fe & sF \/sF2 = Fs by Th16,Th13,A28;
A139:   (eF \/ sF) \/ (eF1\/sF2) =
      sF \/ (eF \/ (eF1\/sF2)) by XBOOLE_1:4
      .= sF \/ ((eF \/ eF1)\/sF2) by XBOOLE_1:4
      .= (sF \/sF2) \/ (eF \/ eF1) by XBOOLE_1:4;
A140:   eF misses sF2 & sF misses eF1 by A8,A39,A40,A44,A45,Th22;
      {E1p.len E1p} misses F1p & {E2p.len E2p} misses F2p by XBOOLE_1:79;
      then eF misses eF1 & sF misses sF2 by Th33,Th34,A8,A39,A40,A44,A45;
      then eF misses (eF1\/sF2) & sF misses (eF1\/sF2) by A140,XBOOLE_1:70;
      then (eF \/ sF) misses (eF1\/sF2) by XBOOLE_1:70;
      then reconsider E = esE^ESe as Enumeration of Fe \/ Fs by Th79,A139,A138;
A141: 1+m <>2+m;
      not 2+m in union F1 & not 2+m in union F2 by A6,FINSEQ_1:1,XREAL_1:6;
      then card Fe= card F1 & card Fs= card F2 & Fe misses Fs
        by A141,Th11,Th10,Th22;
      then
A142: card (Fe \/ Fs) = (ls1+1)+(ls2+1) by A12,CARD_2:40;
      then
A143:   len E = (ls1+1)+(ls2+1) by CARD_1:def 7;
      then
A144:   dom E= Seg ((ls1+1)+(ls2+1)) by FINSEQ_1:def 3;
      consider S be Subset of doms(m+2,card F1p+card F2p) such that
      (card (P1"{1+m}) = 0 implies P1^P2 in S) and
A146:   S is with_evenly_repeated_values-member and
A147:   for CE1,CE2 be FinSequence of D*, f,d1,d2 st
          len f = m &
          CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F1p) * E1pn &
          CE2 = SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,F2p) * E2pn
        for CFes be non-empty non empty FinSequence of D* st
          CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
            Ext(F1p,1+len f,2+len f)\/swap(F2p,1+len f,2+len f) ) * esE
        for Sd be Element of Fin dom App CFes st S = Sd holds
          M.((M "**" App CE1).P1,(M "**" App CE2).P2)= A$$(Sd,M"**"App CFes) &
        for h be FinSequence,i st h in Sd & i in dom h holds
          ((P1^P2).i = 1+len f implies h.i in {1+len f,2+len f}) &
          ((P1^P2).i <> 1+len f implies h.i =(P1^P2).i)
          by A5,A133,A37,A34,A36,A32;
      defpred H[object,object] means
        ( $1 = ls1+ls2+1 implies $2 = p1.(ls1+1) ) &
        ( $1 = ls1+ls2+2 implies $2 = (ls1+1)+ p2.(ls2+1) ) &
        (for i st i = $1 & 1<= i <= ls1 holds $2 = p1.i) &
        (for i st i +ls1 = $1 & 1<= i <= ls2 holds $2 = (ls1+1)+ p2.i);
A148:   for x st x in Seg (ls1+ls2+2) ex y st H[x,y]
      proof
        let x such that
A149:     x in Seg (ls1+ls2+2);
        reconsider i=x as Nat by A149;
        1<=i<= ls1+ls2+1+1 by A149,FINSEQ_1:1;
        then i <= ls1+ls2+1 or i = ls1+ls2+1+1 by NAT_1:8;
        then per cases by NAT_1:8;
        suppose
A150:       i = ls1+ls2+2;
          take pp = (ls1+1)+p2.(ls2+1);
          thus (x = ls1+ls2+1 implies pp = p1.(ls1+1)) &
            (x = ls1+ls2+2 implies pp = (ls1+1)+ p2.(ls2+1)) by A150;
          thus for j st j = x & 1<= j <= ls1 holds pp = p1.j
          proof
            let j such that
A151:         j =x & 1<= j<=ls1;
            ls1 <= ls1+(ls2+1) by NAT_1:11;
            then j <= ls1+ls2+1 by A151,XXREAL_0:2;
            then j < ls1+ls2+1+1 by NAT_1:13;
            hence thesis by A150,A151;
          end;
          thus for j st j+ls1 = x & 1<= j <= ls2 holds pp = (ls1+1)+ p2.j
          proof
            let j such that
A152:         j+ls1 =x & 1<= j<=ls2;
            j+ls1 <= ls1+ls2 by A152,XREAL_1:7;
            then j+ls1 < ls1+ls2+1 by NAT_1:13;
            then j+ls1 < ls1+ls2+1+1 by NAT_1:13;
            hence thesis by A150,A152;
          end;
        end;
        suppose
A153:       i = ls1+ls2+1;
          take pp = p1.(ls1+1);
          thus ( x = ls1+ls2+1 implies pp = p1.(ls1+1) ) &
            ( x = ls1+ls2+2 implies pp = (ls1+1)+p2.(ls2+1) ) by A153;
          thus for j st j = x & 1<= j <= ls1 holds pp = p1.j
          by A153,NAT_1:11,13;
          thus for j st j+ls1 = x & 1<= j <= ls2 holds pp = (ls1+1)+p2.j
          proof
            let j such that
A154:         j+ls1 =x & 1<= j<=ls2;
            j+ls1 <= ls1+ls2 by A154,XREAL_1:7;
            hence thesis by A153,A154,NAT_1:13;
          end;
        end;
        suppose
A155:       i <= ls1+ls2;
          then i < ls1+ls2+1 by NAT_1:13;
          then
A156:       i < ls1+ls2+1+1 by NAT_1:13;
          per cases;
          suppose
A157:         i <=ls1;
            take pp = p1.i;
            for j st j+ls1 = x & 1<= j <= ls2 holds pp = (ls1+1)+p2.j
            proof
              let j such that
A158:           j+ls1 =x & 1<= j<=ls2;
              ls1 <= j+ls1 by NAT_1:11;
              then 0+ls1 = j + ls1 by A157,A158,XXREAL_0:1;
              hence thesis by A158;
            end;
            hence thesis by A155,A156,NAT_1:13;
          end;
          suppose
A159:         i > ls1;
            then reconsider ii=i-ls1 as Nat by NAT_1:21;
            take pp = (ls1+1)+p2.ii;
            thus thesis by A159,A155,A156,NAT_1:13;
          end;
        end;
      end;
      consider h be Function such that
A160:   dom h = Seg (ls1+ls2+2) &
        for x st x in Seg(ls1+ls2+2) holds H[x,h.x] from CLASSES1:sch 1(A148);
      1<= ls2+1 & 1<= ls1 +1 by NAT_1:11;
      then ls2+1 in dom p2 & ls1+1 in dom p1 by A23,A20;
      then
A161:   p1.(ls1+1) in rng p1 & p2.(ls2+1) in rng p2 by FUNCT_1:def 3;
A162:   ls1+1 <= (ls1+1)+(ls2+1) & ls2+1 <= (ls1+1)+(ls2+1) by NAT_1:11;
A163:   Seg (ls1+1) c=Seg ((ls1+1)+(ls2+1)) by FINSEQ_1:5,NAT_1:11;
A164:   rng h c= Seg (ls1+ls2+2)
      proof
        let y such that
A165:     y in rng h;
        consider i be object such that
A166:     i in dom h & h.i = y by A165,FUNCT_1:def 3;
        reconsider i as Nat by A166,A160;
A167:     1<=i<= ls1+ls2+1+1 by A166,A160,FINSEQ_1:1;
        then i <= ls1+ls2+1 or  i = ls1+ls2+1+1 by NAT_1:8;
        then per cases by NAT_1:8;
        suppose i = ls1+ls2+2;
          then h.i = (ls1+1)+ p2.(ls2+1) by A160,A166;
          then h.i in Seg ((ls1+1)+(ls2+1)) by A161,FINSEQ_1:60;
          hence thesis by A166;
        end;
        suppose i = ls1+ls2+1;
          then h.i = p1.(ls1+1) by A160,A166;
          hence thesis by A161,A163,A166;
        end;
        suppose
A168:       i <= ls1+ls2;
          per cases;
          suppose i <= ls1;
            then
A169:         h.i = p1.i & i <= ls1+1 by A166,A167,A160,NAT_1:13;
            then i in dom p1 by A167,A20;
            then h.i in rng p1 by A169,FUNCT_1:def 3;
            hence thesis by A163,A166;
          end;
          suppose
A170:         i > ls1;
            then reconsider ii=i-ls1 as Nat by NAT_1:21;
            ii<>0 & ii+ls1 <= ls2+ls1 by A168,A170;
            then
A171:         1<= ii<= ls2 & ii+ls1 = i by NAT_1:14,XREAL_1:6;
            then h.i = (ls1+1)+p2.ii & ii <= ls2 +1 by A166,A160,NAT_1:13;
            then ii in dom p2 by A171,A23;
            then p2.ii in rng p2 by FUNCT_1:def 3;
            then (ls1+1)+p2.ii in Seg ((ls1+1)+(ls2+1)) by FINSEQ_1:60;
            hence thesis by A171,A166,A160;
          end;
        end;
      end;
      Seg (ls1+ls2+2) c= rng h
      proof
        let x such that
A172:     x in Seg (ls1+ls2+2);
        reconsider x as Nat by A172;
A173:     1<= x <= (ls1+1)+(ls2+1) by A172,FINSEQ_1:1;
        per cases;
        suppose  x <= ls1+1;
          then x in rng p1 by A173,A20;
          then consider i be object such that
A174:       i in dom p1 & p1.i = x by FUNCT_1:def 3;
          reconsider i as Nat by A174;
A175:       1<=i <= 1+ls1  by A174,FINSEQ_1:1;
          then per cases by NAT_1:8;
          suppose
A176:         i = 1+ls1;
            1<= ls1+ls2+1 <= ls1+ls2+1+1 by NAT_1:11;
            then
A177:         ls1+ls2+1 in dom h by A160;
            then h.(ls1+ls2+1) = x by A176,A160,A174;
            hence thesis by A177,FUNCT_1:def 3;
          end;
          suppose
A178:         i <= ls1;
            i <= (ls1+1)+(ls2+1) by A162,A175,XXREAL_0:2;
            then
A179:         i in dom h by A160,A175;
            then h.i = x by A178,A175,A160,A174;
            hence thesis by A179,FUNCT_1:def 3;
          end;
        end;
        suppose
A180:       x > ls1+1;
          then reconsider ii = x-(ls1+1) as Nat by NAT_1:21;
          ii<>0 & ii+(ls1+1) <= (ls2+1)+(ls1+1) by A172,A180,FINSEQ_1:1;
          then 1<= ii<= (ls2+1) by NAT_1:14,XREAL_1:6;
          then ii in rng p2 by A23;
          then consider i be object such that
A181:       i in dom p2 & p2.i = ii by FUNCT_1:def 3;
          reconsider i as Nat by A181;
A182:       1<=i <= 1+ls2  by A181,FINSEQ_1:1;
          then per cases by NAT_1:8;
          suppose
A183:         i = 1+ls2;
            1<= ls1+ls2+1+1 by NAT_1:11;
            then
A184:         ls1+ls2+1+1 in dom h by A160;
            then h.(ls1+ls2+1+1) = x by A183,A160,A181;
            hence thesis by A184,FUNCT_1:def 3;
          end;
          suppose
A185:         i<= ls2;
            i+ls1 <= (ls2+1)+ls1 by A182,XREAL_1:6;
            then 1+0 <= i+ls1 <= (ls2+1)+ls1+1 by A182,NAT_1:13;
            then
A186:         (i+ls1) in dom h by A160;
            then h.(i +ls1) = (ls1+1) + ii by A185,A182,A160,A181;
            hence thesis by A186,FUNCT_1:def 3;
          end;
        end;
      end;
      then
A187:   Seg (ls1+ls2+2) = rng h by A164;
      then reconsider h as Function of dom E,dom E by A144,A160,FUNCT_2:1;
A188:   card dom E=card dom E;
A189:   h is onto by A187,A143,FINSEQ_1:def 3,FUNCT_2:def 3;
      then h is one-to-one by A188,FINSEQ_4:63;
      then reconsider h as Permutation of dom E by A189;
A190:   dom (h") = rng h & rng (h")= dom h by FUNCT_1:33;
      reconsider Eh= E*(h") as Enumeration of Fe \/ Fs by Th109;
A191:   len Eh = card (Fe \/ Fs) =len E by CARD_1:def 7;
      len Ees = card (Fe \/ Fs) by CARD_1:def 7;
      then dom E=dom Ees by A191,FINSEQ_3:29;
      then reconsider Eesh= Ees*h as Enumeration of Fe \/ Fs by Th109;
A192:   len Ees = card (Fe \/ Fs) =len Eesh by CARD_1:def 7;
A193:   len eE1pn = len E1pn & len eE2pn = len E2pn by CARD_1:def 7;
A194:   len Ee = len E1 & len Es = len E2 by A7,CARD_1:def 7;
A195:   len esE = len eE1pn + len eE2pn by FINSEQ_1:22;
        len E1p in dom E1p & len E2p in dom E2p by A30,A27,FINSEQ_3:25;
      then
A196:   Ee1 = <* Ext(E1p,1+m,2+m) .(len E1p)*>&
        Se2 = <* Swap(E2p,1+m,2+m) .(len E2p)*> by Th35,Th36;
A197:   len Ee1 = card eF1 = card {E1p.len E1p} =1 &
        len Se2 = card sF2 = card {E2p.len E2p} =1
        by Th10,Th11,A44,A45,CARD_1:def 7;
A198:   dom Ees c= dom E by A192,A191,FINSEQ_3:29;
A199:   for i st 1<=i<= len Eesh holds E.i = Eesh.i
      proof
        let i such that
A200:     1<=i<= len Eesh;
A201:     eE1pn = Ext(E1p,1+m,2+m) | Seg (ls1) by Th26;
A202:     Ext(E1p,1+m,2+m) = Ee * p1 by A7,Th25;
A203:     eE2pn = Swap(E2p,1+m,2+m) | Seg (ls2) by Th24;
A204:     Swap(E2p,1+m,2+m) = Es * p2 by A7,Th23;
        i in dom Eesh by A200,FINSEQ_3:25;
        then
A205:     Eesh.i = Ees.(h.i) & i in dom h & h.i in dom Ees
          by FUNCT_1:11,12;
        per cases by A200,A191,A192,FINSEQ_1:25,FINSEQ_3:25;
        suppose
A206:       i in dom esE;
          then
A207:       E.i = esE.i by FINSEQ_1:def 7;
          per cases by A206,FINSEQ_1:25;
          suppose
A208:         i in dom eE1pn;
            then
A209:         E.i = eE1pn.i by A207,FINSEQ_1:def 7;
A210:         1<=i <= ls1 by A208,A193,A31,FINSEQ_3:25;
            then
A211:         h.i = p1.i & i < ls1+1 & i in Seg ls1 by A160,A205,NAT_1:13;
            then
A212:         i in dom p1 by A210,A20;
            then p1.i in Seg (len s1) by A20,FUNCT_1:def 3;
            then
A213:         p1.i in dom Ee by A194,A12,FINSEQ_1:def 3;
            then
A214:         i in dom (Ee * p1) & (Ee * p1).i = Ee.(p1.i)
              by A212,FUNCT_1:11,13;
            E.i = Ee.(p1.i) by A201,A202,A211,A209,A214,FUNCT_1:49;
            hence thesis by A205,A211,A10,A213,FINSEQ_1:def 7;
          end;
          suppose ex n st n in dom eE2pn & i=len eE1pn + n;
            then consider n such that
A215:         n in dom eE2pn & i=len eE1pn + n;
A216:         E.i = eE2pn.n by A215,A207,FINSEQ_1:def 7;
A217:         1<=n <= ls2 by A215,A193,A31,FINSEQ_3:25;
            then
A218:         h.i = (ls1+1)+ p2.n & n < ls2+1 & n in Seg ls2
              by A160,A205,A215,A193,A31,NAT_1:13;
            then
A219:         n in dom p2 by A217,A23;
            then p2.n in Seg (len s2) by A23,FUNCT_1:def 3;
            then
A220:         p2.n in dom Es by A194,A12,FINSEQ_1:def 3;
            then
A221:         n in dom (Es * p2) & (Es * p2).n = Es.(p2.n)
              by A219,FUNCT_1:11,13;
            E.i = Es.(p2.n) by A203,A204,A218,A216,A221,FUNCT_1:49;
            hence thesis by A205,A218,A12,A10,A220,A194,FINSEQ_1:def 7;
          end;
        end;
        suppose ex n st n in dom ESe & i=len esE + n;
          then consider n such that
A222:       n in dom ESe & i=len esE + n;
A223:       E.i = ESe.n by A222,FINSEQ_1:def 7;
A224:       len esE = ls1+ls2 by A31,CARD_1:def 7;
          per cases by A222,FINSEQ_1:25;
          suppose
A225:         n in dom Ee1;
            1<=n <=1 by A225,A197,FINSEQ_3:25;
            then
A226:         n=1 by XXREAL_0:1;
            then
A227:         h.i = p1.(ls1+1) by A160,A205,A193,A195,A31,A222;
            1<= ls1+1 by NAT_1:11;
            then
A228:         (ls1+1) in dom p1 by A20;
            then p1.(ls1+1) in Seg (len s1) by A20,FUNCT_1:def 3;
            then
A229:         p1.(ls1+1) in dom Ee by A194,A12,FINSEQ_1:def 3;
            then (ls1+1) in dom (Ee*p1) & (Ee*p1).(ls1+1) = Ee.(p1.(ls1+1))
              by A228,FUNCT_1:11,13;
            hence thesis
              by A227,A27,A196,A202,A223,A226,A205,A229,A10,FINSEQ_1:def 7;
          end;
          suppose ex m st m in dom Se2 & n=len Ee1 + m;
            then consider m such that
A230:         m in dom Se2 & n=len Ee1 + m;
            1<=m <=1 by A230,A197,FINSEQ_3:25;
            then
A231:         m= 1 by XXREAL_0:1;
            then
A232:         h.i = (ls1+1)+p2.(ls2+1) by A160,A205,A224,A222,A230,A197;
            1<= ls2+1 by NAT_1:11;
            then
A233:         (ls2+1) in dom p2 by A23;
            then p2.(ls2+1) in Seg (len s2) by A23,FUNCT_1:def 3;
            then p2.(ls2+1) in dom Es by A194,A12,FINSEQ_1:def 3;
            then Eesh.i=Es.(p2.(ls2+1))
              by A194,A12,A232,A205,A10,FINSEQ_1:def 7;
            hence thesis by A27,A204,A233,A196,A223,A230,A231,FUNCT_1:13;
          end;
        end;
      end;
      E = Eesh by A199,A191,A192;
      then
A234:   Eh = Ees*(h*(h")) by RELAT_1:36
      .= Ees*(id rng h) by FUNCT_1:39
      .= Ees*(id dom E) by A143,A187,FINSEQ_1:def 3
      .= Ees by A198,RELAT_1:51;
      doms(m+2,card F1p+card F2p)^doms(m+2,2)
        = doms(m+2,card F1p+card F2p+2) by Th123;
      then reconsider SIJ=S^{II,JJ} as Subset of doms(m+2,card F1+card F2)
        by A32,A12,POLNOT_1:16;
      reconsider SH= {s*(h") where s is FinSequence of NAT: s in SIJ}
        as Subset of doms(m+2,card F1+card F2)
        by Th119,A12,A142;
      take SH;
      thus (card (s1"{1+m}) = 0 implies s1^s2 in SH) by A11;
      for x be Element of SIJ st x in SIJ holds dom x = dom E
      proof
        let x be Element of SIJ such that
A235:     x in SIJ;
        reconsider x as FinSequence;
        len x=len E by A12,A143,Th121,A235;
        hence thesis by FINSEQ_3:29;
      end;
      hence SH is with_evenly_repeated_values-member by A146,Lm1;
      let CE1,CE2 be FinSequence of D*,f,d1,d2 such that
A236:   len f = m and
A237:   CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F1) * E1 &
        CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F2) * E2;
      set I=the_inverseOp_wrt A,fD=f^<*A . (d1,d2)*>,fDD=f^<*d1*>^<*d2*>,
          fDID=f^<*A.( I.d1,d2)*>;
A238:   len (f^<*d1*>^<*d2*>) = 1 + len (f^<*d1*>) by FINSEQ_2:16
      .= 1+(1 + len f) by FINSEQ_2:16
      .= 2+len f;
A239:   len (f^<*A.(d1,d2)*>) = 1 + len f by FINSEQ_2:16;
A240:   len (f^<*A.(I.d1,d2)*>) = 1 + len f by FINSEQ_2:16;
A241:   1<= len f+1 by NAT_1:11;
A242:   1+len f <= 2+len f & 1+0 <= 2+len f by XREAL_1:8;
      then
A243:   1+len f in dom fDD & 2+len f in dom fDD by A238,A241,FINSEQ_3:25;
      dom <*d1,d2*>={1,2} by FINSEQ_1:92;
      then
A244:   1 in dom <*d1,d2*> & 2 in dom <*d1,d2*> by TARSKI:def 2;
      fDD = f^<*d1,d2*> by FINSEQ_1:32;
      then
A245:   fDD.(1+len f) = <*d1,d2*>.1 =d1 & fDD.(2+len f) = <*d1,d2*>.2 =d2
        by A244,FINSEQ_1:def 7;
A246:   fD.(1+len f) = A.(d1,d2) & fDID.(1+len f) = A.(I.d1,d2);
      let CFes be non-empty non empty FinSequence of D* such that
A247:   CFes = SignGenOp(fDD,A,
        Ext(F1,1+len f,2+len f)\/swap(F2,1+len f,2+len f)) * Ees;
      let Sdd be Element of Fin dom App CFes such that
A248:   SH = Sdd;
A249:   doms(m+1,card F1)=doms CE1 & doms(m+1,card F2)=doms CE2
        by A237,Lm2,A239,A240,A236,A12;
A250:   doms (1+m,card F1) = doms (SignGenOp(fD,A,F1) * E1p)
        by Th106,A239,A236;
A251:   doms (1+m,card F2) = doms (SignGenOp(fDID,A,F2) * E2p)
        by Th106,A240,A236;
      rng (SignGenOp(fD,A,F1p) * E1pn) c= D*&
        rng (SignGenOp(fDID,A,F2p) * E2pn) c= D*;
      then reconsider ce1 = SignGenOp(fD,A,F1p) * E1pn,
        ce2 = SignGenOp(fDID,A,F2p) * E2pn as FinSequence of D*
        by FINSEQ_1:def 4;
A252: SignGenOp(fD,A,F1) * E1p = ce1^(SignGenOp(fD,A,{E1p.len E1p}) * e1) &
        SignGenOp(fDID,A,F2) * E2p = ce2^(SignGenOp(fDID,A,{E2p.len E2p}) * e2)
        by A29,Th81,A28;
A253:   len  ce1 = len E1pn & len  ce2 = len E2pn by CARD_1:def 7;
A254:   P1 in doms ce1 & P2 in doms ce2 &
        <*s1p1.len s1p1*> in doms (SignGenOp(fD,A,{E1p.len E1p}) * e1) &
        <*s2p2.len s2p2*> in doms (SignGenOp(fDID,A,{E2p.len E2p}) * e2)
        by A33,A31,A252,A253,Th50,A18,A19,A250,A251;
      rng (SignGenOp(fDD,A,eF) * eE1pn) c= D*;
      then reconsider eCF=SignGenOp(fDD,A,eF) * eE1pn as FinSequence of D*
        by FINSEQ_1:def 4;
      rng (SignGenOp(fDD,A,sF) * eE2pn) c= D*;
      then reconsider sCF=SignGenOp(fDD,A,sF) * eE2pn as FinSequence of D*
        by FINSEQ_1:def 4;
A255:   s1p1 in dom App(SignGenOp(fD,A,F1) * E1p) by A250,A18,Def9;
A256:   s2p2 in dom App(SignGenOp(fDID,A,F2) * E2p) by A251,A19,Def9;
A257:   1+len f in dom fD by A239,A241,FINSEQ_3:25;
A258:   dom SignGen(fD,A,E1p.len E1p) = dom fD by Def11;
A259:   SignGenOp(fD,A,{E1p.len E1p}) * e1 = <* SignGen(fD,A,E1p.len E1p) *>
          by Th78;
A260:   (App (SignGenOp(fD,A,F1) * E1p)).s1p1 = ((App ce1).P1)^
        ((App (SignGenOp(fD,A,{E1p.len E1p}) * e1)).(<*1+len f*>))
        by A33,A252,Th61,A15,A236,A22,A254;
      SignGen(fD,A,E1p.len E1p).(1+len f) in rng SignGen(fD,A,E1p.len E1p) c= D
        by A257,A258,FUNCT_1:def 3;
      then reconsider fD1 = SignGen(fD,A,E1p.len E1p).(1+len f)
        as Element of D;
A261:   1+len f in dom fDID by A240,A241,FINSEQ_3:25;
A262:   dom SignGen(fDID,A,E2p.len E2p) = dom fDID by Def11;
A263:   SignGenOp(fDID,A,{E2p.len E2p}) * e2=<* SignGen(fDID,A,E2p.len E2p) *>
        by Th78;
      s2p2.len s2p2 = 1+len f by A17,A236,A24,FINSEQ_3:29;
      then
A264:   (App (SignGenOp(fDID,A,F2) * E2p)).s2p2 = ((App ce2).P2)^
        ((App(SignGenOp(fDID,A,{E2p.len E2p}) * e2)).(<*1+len f*>))
        by A254,A33,A252,Th61;
      SignGen(fDID,A,E2p.len E2p).(1+len f)
        in rng SignGen(fDID,A,E2p.len E2p) c= D
        by A261,A262,FUNCT_1:def 3;
      then reconsider fD2 = SignGen(fDID,A,E2p.len E2p).(1+len f)
        as Element of D;
A265:   (M "**" App CE1).s1= (M "**" App (SignGenOp(fD,A,F1) * E1p)).s1p1
        by A2,A237,A13,A11,A249,Th112
      .= M "**" ((App (SignGenOp(fD,A,F1) * E1p)).s1p1) by Def10,A255
      .= M.(M"**"(App ce1).P1,
         M"**" ((App(SignGenOp(fD,A,{E1p.len E1p})*e1)).(<*1+len f*>)))
        by A260,A2,FINSOP_1:5
      .= M.(M"**"(App ce1).P1,M"**" (<* fD1 *>))
        by A259,A258,A239,A241,Th60,FINSEQ_3:25
      .= M.(M"**"(App ce1).P1,fD1) by FINSOP_1:11;
A266: (M "**" App CE2).s2 = (M "**" App (SignGenOp(fDID,A,F2) * E2p)).s2p2
        by A2,A237,A13,A11,A249,Th112
      .= M "**" ((App (SignGenOp(fDID,A,F2) * E2p)).s2p2) by Def10,A256
      .= M.(M"**"(App ce2).P2,
             M"**"((App(SignGenOp(fDID,A,{E2p.len E2p}) * e2)).(<*1+len f*>)))
        by A264,A2,FINSOP_1:5
      .= M.(M"**"(App ce2).P2,M"**" (<* fD2 *>))
      by A263,A240,A241,A262,Th60,FINSEQ_3:25
      .= M.(M"**"(App ce2).P2,fD2) by FINSOP_1:11;
A267:   M.((M "**" App CE1).s1,(M "**" App CE2).s2) =
      M.(M.(M"**"(App ce1).P1, fD1),M.(fD2,M"**"(App ce2).P2))
        by A2,A265,A266,BINOP_1:def 2
      .= M.(M.(M.(M"**"(App ce1).P1, fD1), fD2),M"**"(App ce2).P2)
        by A2,BINOP_1:def 3
      .= M.(M.( M"**"(App ce1).P1, M.( fD1, fD2)),M"**"(App ce2).P2)
        by A2,BINOP_1:def 3
      .= M.(M.(M.( fD1, fD2), M"**"(App ce1).P1),M"**"(App ce2).P2)
        by A2,BINOP_1:def 2
      .= M.( M.( fD1, fD2), M.(M"**"(App ce1).P1,M"**"(App ce2).P2))
        by A2,BINOP_1:def 3;
      set eF1 = Ext({E1p.len E1p},1+len f,2+len f),
      sF2 = swap({E2p.len E2p},1+len f,2+len f);
      union {E1p.len E1p} c= union F1 by A28,XBOOLE_1:7,ZFMISC_1:77;
      then
A268:   not 2+len f in union {E1p.len E1p} by A38,A236,A6;
      then reconsider Ee1 = Ext(e1,1+len f,2+len f) as Enumeration of eF1
        by Th28;
      union {E2p.len E2p} c= union F2 by A28,XBOOLE_1:7,ZFMISC_1:77;
      then
A269:  not 2+len f in union {E2p.len E2p} by A6,A236,A38;
      then reconsider Se2 = Swap(e2,1+len f,2+len f) as Enumeration of sF2
        by Th27;
      reconsider ESe=Ee1^Se2 as Enumeration of eF1\/sF2
        by Th79,A8,A268,A236,A269,Th22;
      set cESe = SignGenOp(fDD,A,eF1\/sF2) * ESe;
A270:   cESe = (SignGenOp(fDD,A,eF1) * Ee1)^ (SignGenOp(fDD,A,sF2) * Se2)
        by Th81;
A271:   for x st x in dom cESe holds cESe.x is non empty
      proof
        let x;
        assume x in dom cESe;
        then cESe.x = SignGen(fDD,A,ESe.x) by Th80;
        hence thesis;
      end;
      rng cESe c= D*;
      then reconsider cESe as non-empty non empty FinSequence of D*
        by A271,FINSEQ_1:def 4,FUNCT_1:def 9;
      len cESe = len ESe = 1+1 by A197,A236,CARD_1:def 7;
      then
A272:   doms cESe = doms(m+2,2) by A238,A236,Lm2;
      reconsider ii=II,jj=JJ as Element of dom App cESe
        by A272,Def9;
A273:   len (SignGenOp(fDD,A,eF1) * Ee1) =len Ee1 &
        len (SignGenOp(fDD,A,sF2) * Se2) = len Se2 by CARD_1:def 7;
      len <*1+len f*> =1 by FINSEQ_1:39;
      then <*1+len f*> in doms (SignGenOp(fDD,A,eF1) * Ee1) &
        <*1+len f*> in doms (SignGenOp(fDD,A,sF2) * Se2)
        by A43,A236,A272,A197,A273,Th50,A270;
      then
A274:  (App cESe).ii = ((App(SignGenOp(fDD,A,eF1) * Ee1)).<*1+len f*>)^
        ((App(SignGenOp(fDD,A,sF2) * Se2)).<*1+len f*>) by A236,Th61,A270;
      len <*2+len f*> =1 by FINSEQ_1:39;
      then <*2+len f*> in doms (SignGenOp(fDD,A,eF1) * Ee1) &
      <*2+len f*> in doms (SignGenOp(fDD,A,sF2) * Se2)
        by A236,A43,A272,A197,A273,Th50,A270;
      then
A275:   (App cESe).jj = ((App(SignGenOp(fDD,A,eF1) * Ee1)).<*2+len f*>)^
        ((App(SignGenOp(fDD,A,sF2) * Se2)).<*2+len f*>) by A236,Th61,A270;
A276: (M"**"App cESe).ii = M"**" ((App cESe).ii) &
        (M"**"App cESe).jj = M"**" ((App cESe).jj) by Def10;
A277:   1+len f<>2+len f;
      then II<>JJ by A236,FINSEQ_1:77;
      then
A278:   A$$({.ii,jj.}, M"**"App cESe)=
        A.(M "**"((App cESe).ii),M"**"((App cESe).jj)) by A1,A276,SETWOP_2:1;
A279:   A$$({.ii,jj.},M"**"App cESe) = M.(fD1,fD2)
      proof
A280:     dom SignGen(fDD,A,(E1p.len E1p) \/ {2+len f}) = dom fDD by Def11;
A281:     dom SignGen(fDD,A,E1p.len E1p) = dom fDD by Def11;
A282:     dom SignGen(fDD,A, ( (E2p.len E2p)\{1+len f})\/{2+len f}) = dom fDD
          by Def11;
A283:     dom SignGen(fDD,A, (E2p.len E2p) \/ {1+len f}) = dom fDD by Def11;
A284:     A. (M.(d1, d2), M.(d2, I.d1)) =
        A.(M.(d1, d2), M.(I.d1,d2)) by A2,BINOP_1:def 2
        .= A. (M.(d1, d2), I.(M.(d1,d2))) by A1,A3,FINSEQOP:67
        .= the_unity_wrt A by A1,FINSEQOP:59;
        per cases;
        suppose
A285:       1+len f in (E1p.len E1p);
          then 1+len f in (E1p.len E1p) \/ {2+len f} &
          2+len f in (E1p.len E1p) \/ {2+len f} by ZFMISC_1:136;
          then
A286:       SignGen(fDD,A,(E1p.len E1p) \/ {2+len f}).(1+len f) =
            I.(fDD.(1+len f)) &
            SignGen(fDD,A,(E1p.len E1p) \/ {2+len f}).(2+len f) =
              I.(fDD.(2+len f))
            by A280,A243,Def11;
A287:     fD1 = I.(A.(d1,d2)) & eF1 = {(E1p.len E1p) \/ {2+len f}}
            by A285,Def11,A246,A257,A258,Th29;
          then SignGenOp(fDD,A,eF1) * Ee1 =
            <* SignGen(fDD,A,(E1p.len E1p) \/ {2+len f}) *> by Th78;
          then
A288:       (App(SignGenOp(fDD,A,eF1) * Ee1)). <*1+len f*> = <*I.d1 *> &
            (App(SignGenOp(fDD,A,eF1) * Ee1)). <*2+len f*> = <*I.d2*>
            by Th60,A242,A238,A241,A280,A286,A245,FINSEQ_3:25;
          per cases;
          suppose
A289:         1+len f in (E2p.len E2p);
            not 1+len f in ((E2p.len E2p)\ {1+len f}) by ZFMISC_1:56;
            then not 1+len f in ((E2p.len E2p)\ {1+len f}) \/ {2+len f} &
             2+len f in ((E2p.len E2p)\ {1+len f}) \/ {2+len f}
              by A277,ZFMISC_1:136;
            then
A290:         SignGen(fDD,A,(E2p.len E2p)\ {1+len f} \/
                {2+len f}).(1+len f) = fDD.(1+len f) &
              SignGen(fDD,A,(E2p.len E2p)\ {1+len f} \/
              {2+len f}).(2+len f) = I.(fDD.(2+len f)) by A282,A243,Def11;
            fD2 = I.(A.(I.d1,d2)) &
              sF2 = {(E2p.len E2p)\ {1+len f} \/ {2+len f}}
              by A289,Def11,A246,A261,A262,Th31;
            then
            SignGenOp(fDD,A,sF2) * Se2
              = <* SignGen(fDD,A,(E2p.len E2p)\ {1+len f} \/ {2+len f}) *>
              by Th78;
            then (App cESe).II = <*I.d1, d1*> & (App cESe).JJ=<*I.d2, I.d2*>
              by A288,A274,A275,Th60,A242,A238,A241,A282,A290,A245,FINSEQ_3:25;
            then M"**" ((App cESe).II) = M.(I.d1,d1) & M"**" ((App cESe).JJ)
              = M.(I.d2,I.d2) by FINSOP_1:12;
            then
A291:         A$$({.ii,jj.},M"**"App cESe) =
              A.( I.(M.(d1,d1)), M.(I.d2,I.d2)) by A1,A3,A278,FINSEQOP:67
            .= A.( I.(M.(d1,d1)), I.(M.(d2,I.d2))) by A1,A3,FINSEQOP:67
            .= A.( I.(M.(d1,d1)), I.(I.(M.(d2,d2)))) by A1,A3,FINSEQOP:67
            .= A.( I.(M.(d1,d1)), M.(d2,d2)) by A1,FINSEQOP:62;
            M.(fD1,fD2) = M.(I.(A.(d1,d2)),I.(A.(I.d1,d2)) )
              by A287,A289,Def11,A246,A261,A262
            .= I.(M.((A.(d1,d2)),I.(A.(I.d1,d2)) )) by A1,A3,FINSEQOP:67
            .= I.(I.(M.(A.(d1,d2), A.(I.d1,d2)))) by A1,A3,FINSEQOP:67
            .= M.(A.(d1,d2), A.(I.d1,d2)) by A1,FINSEQOP:62
            .= A. (M.(d1, A.(I.d1,d2)),M.(d2, A.(I.d1,d2)))
              by A3,BINOP_1:def 10,def 11
            .= A.( A.( M.(d1,I.d1),M.(d1,d2)),M.(d2,A.(I.d1,d2)))
              by A3,BINOP_1:11
            .= A.(A.(M.(d1, I.d1),M.(d1,d2)),A.(M.(d2,I.d1),M.(d2,d2)))
              by A3,BINOP_1:11
            .= A.(M.(d1,I.d1),A.(M.(d1,d2),A.(M.(d2,I.d1),M.(d2,d2))))
              by A1,BINOP_1:def 3
            .= A.(M.(d1, I.d1),A.(the_unity_wrt A,M.(d2,d2)))
              by A284,A1,BINOP_1:def 3
            .= A.( M.(d1, I.d1),M.(d2,d2)) by A1,SETWISEO:15
            .= A$$({.ii,jj.},M"**"App cESe) by A291,A1,A3,FINSEQOP:67;
            hence thesis;
          end;
          suppose
A292:         not 1+len f in (E2p.len E2p);
            not 2+len f in (E2p.len E2p) by A269,ZFMISC_1:25;
            then 1+len f in (E2p.len E2p) \/ {1+len f} &
            not 2+len f in (E2p.len E2p) \/ {1+len f} by A277,ZFMISC_1:136;
            then
A293:         SignGen(fDD,A,(E2p.len E2p) \/ {1+len f}).(1+len f)
              = I.(fDD.(1+len f)) &
              SignGen(fDD,A,(E2p.len E2p)\/ {1+len f}).(2+len f) =
              fDD.(2+len f) by A283,A243,Def11;
            fD2 = A.(I.d1,d2) & sF2 = {(E2p.len E2p) \/ {1+len f}}
              by A292,Def11,A246,A261,A262,Th32;
            then SignGenOp(fDD,A,sF2) * Se2
              = <* SignGen(fDD,A,(E2p.len E2p)\/ {1+len f}) *> by Th78;
            then (App cESe).II = <*I.d1, I.d1*> &
                 (App cESe).JJ = <*I.d2, d2*>
              by A288,A274,A275,Th60,A242,A238,A241,A283,A293,A245,FINSEQ_3:25;
            then M"**" ((App cESe).ii) = M.(I.d1,I.d1) &
              M"**" ((App cESe).jj) = M.(I.d2,d2) by FINSOP_1:12;
            then
A294:         A$$({.ii,jj.},M"**"App cESe) =
              A.( I.(M.(d1,I.d1)), M.(I.d2,d2)) by A1,A3,A278,FINSEQOP:67
            .= A.( I.(I.(M.(d1,d1))), M.(I.d2,d2)) by A1,A3,FINSEQOP:67
            .= A.( M.(d1,d1), M.(I.d2,d2)) by A1,FINSEQOP:62
            .= A.( M.(d1,d1), I.(M.(d2,d2))) by A1,A3,FINSEQOP:67;
            M.(fD1,fD2) = M.(I.(A.(d1,d2)),A.(I.d1,d2))
              by A287,A292,Def11,A246,A261,A262
            .= I.(M.((A.(d1,d2)),A.(I.d1,d2))) by A1,A3,FINSEQOP:67
            .= I.(A. (M.(d1, A.(I.d1,d2)),M.(d2, A.(I.d1,d2))))
              by A3,BINOP_1:def 10,def 11
            .= I.(A.( A.( M.(d1,I.d1),M.(d1,d2)),M.(d2, A.(I.d1,d2))))
              by A3,BINOP_1:11
            .= I.(A.(A.(M.(d1,I.d1),M.(d1,d2)),A.(M.(d2, I.d1),M.(d2,d2))))
              by A3,BINOP_1:11
            .= I.(A.(M.(d1,I.d1),A.(M.(d1,d2),A.(M.(d2,I.d1),M.(d2,d2)))))
              by A1,BINOP_1:def 3
            .= I.(A.(M.(d1, I.d1),A.(A.(M.(d1,d2),M.(d2,I.d1)),M.(d2,d2))))
              by A1,BINOP_1:def 3
            .= I.(A.( M.(d1, I.d1),M.(d2,d2)))
              by A284,A1,SETWISEO:15
            .= I.(A.( I.(M.(d1,d1)),M.(d2,d2)))
              by A1,A3,FINSEQOP:67
            .= A$$({.ii,jj.},M"**"App cESe) by A294,Th2,A1;
            hence thesis;
          end;
        end;
        suppose
A295:       not 1+len f in (E1p.len E1p);
          not 2+len f in (E1p.len E1p) by A268,ZFMISC_1:25;
          then
A296:       SignGen(fDD,A,(E1p.len E1p)).(1+len f) = (fDD.(1+len f)) &
            SignGen(fDD,A,(E1p.len E1p)).(2+len f) = (fDD.(2+len f))
            by A281,A243,A295,Def11;
          fD1 = A.(d1,d2) & eF1 = {(E1p.len E1p)}
            by A295,Def11,A246,A257,A258,Th30;
          then SignGenOp(fDD,A,eF1) * Ee1 = <* SignGen(fDD,A,E1p.len E1p) *>
            by Th78;
          then
A297:       (App(SignGenOp(fDD,A,eF1)*Ee1)). <*1+len f*> = <*d1*> &
            (App(SignGenOp(fDD,A,eF1)*Ee1)). <*2+len f*> = <*d2*>
          by Th60,A242,A238,A241,A281,A296,A245,FINSEQ_3:25;
          per cases;
          suppose
A298:         1+len f in (E2p.len E2p);
            not 1+len f in ((E2p.len E2p)\ {1+len f}) by ZFMISC_1:56;
            then not 1+len f in ((E2p.len E2p)\ {1+len f}) \/ {2+len f} &
            2+len f in ((E2p.len E2p)\ {1+len f}) \/ {2+len f}
              by A277,ZFMISC_1:136;
            then
A299:         SignGen(fDD,A,(E2p.len E2p)\ {1+len f} \/ {2+len f}).(1+len f) =
              fDD.(1+len f) &
              SignGen(fDD,A,(E2p.len E2p)\ {1+len f} \/ {2+len f}).(2+len f) =
              I.(fDD.(2+len f)) by A282,A243,Def11;
A300:         fD2 = I.(A.(I.d1,d2)) &
              sF2 = {(E2p.len E2p)\ {1+len f} \/ {2+len f}}
              by A298,Def11,A246,A261,A262,Th31;
            then SignGenOp(fDD,A,sF2) * Se2
              = <* SignGen(fDD,A,(E2p.len E2p)\ {1+len f} \/ {2+len f}) *>
              by Th78;
            then (App cESe).II = <*d1, d1*> & (App cESe).JJ = <*d2, I.d2*>
              by A297,A274,A275,Th60,A242,A238,A241,A282,A299,A245,FINSEQ_3:25;
            then M"**" ((App cESe).II) = M.(d1,d1) &
              M"**" ((App cESe).JJ) = M.(d2,I.d2) by FINSOP_1:12;
            then
A301:         A$$({.ii,jj.},M"**"App cESe) =
              A.( M.(d1,d1), I.(M.(d2,d2))) by A1,A3,A278,FINSEQOP:67;
            M.(fD1,fD2) = M.(A.(d1,d2),I.(A.(I.d1,d2)))
              by A295,Def11,A246,A257,A258,A300
            .= I.(M.((A.(d1,d2)),A.(I.d1,d2)) ) by A1,A3,FINSEQOP:67
            .= I.(A. (M.(d1, A.(I.d1,d2)),M.(d2, A.(I.d1,d2))))
              by A3,BINOP_1:def 10,def 11
            .= I.(A.(A.( M.(d1,I.d1),M.(d1,d2)),M.(d2,A.(I.d1,d2))))
              by A3,BINOP_1:11
            .= I.(A.(A.(M.(d1,I.d1),M.(d1,d2)),A.(M.(d2,I.d1),M.(d2,d2))))
              by A3,BINOP_1:11
            .= I.(A.(M.(d1, I.d1),A.(M.(d1,d2),A.(M.(d2,I.d1),M.(d2,d2)))))
              by A1,BINOP_1:def 3
            .= I.(A.(M.(d1,I.d1),A.(A.(M.(d1,d2),M.(d2,I.d1)),M.(d2,d2))))
              by A1,BINOP_1:def 3
            .= I.(A.( M.(d1, I.d1),M.(d2,d2))) by A284,A1,SETWISEO:15
            .= I.(A.( I.(M.(d1,d1)),M.(d2,d2))) by A1,A3,FINSEQOP:67
            .= A$$({.ii,jj.},M"**"App cESe) by A301,A1,Th2;
            hence thesis;
          end;
          suppose
A302:         not 1+len f in (E2p.len E2p);
            not 2+len f in (E2p.len E2p) by A269,ZFMISC_1:25;
            then 1+len f in (E2p.len E2p) \/ {1+len f} &
            not 2+len f in (E2p.len E2p) \/ {1+len f} by A277,ZFMISC_1:136;
            then
A303:         SignGen(fDD,A,(E2p.len E2p)\/{1+len f}).(1+len f)=
                I.(fDD.(1+len f)) &
              SignGen(fDD,A,(E2p.len E2p)\/ {1+len f}).(2+len f) =
                fDD.(2+len f)
              by A283,A243,Def11;
A304:       fD2 = A.(I.d1,d2) & sF2 = {(E2p.len E2p) \/ {1+len f}}
              by A302,Def11,A246,A261,A262,Th32;
            then SignGenOp(fDD,A,sF2) * Se2
              = <* SignGen(fDD,A,(E2p.len E2p)\/ {1+len f}) *> by Th78;
            then (App cESe).II = <*d1, I.d1*> & (App cESe).JJ = <*d2, d2*>
              by A297,A274,A275,Th60,A242,A238,A241,A283,A303,A245,FINSEQ_3:25;
            then
A305:         M"**" ((App cESe).II) = M.(d1,I.d1) &
              M"**" ((App cESe).JJ) = M.(d2,d2) by FINSOP_1:12;
            M.(fD1,fD2) =M.(A.(d1,d2), A.(I.d1,d2))
              by A295,Def11,A246,A257,A258,A304
            .= A.(M.(d1,A.(I.d1,d2)),M.(d2, A.(I.d1,d2)))
              by A3,BINOP_1:def 10,def 11
            .= A.(A.(M.(d1, I.d1),M.(d1, d2)),M.(d2,A.(I.d1,d2)))
              by A3,BINOP_1:11
            .= A.(A.(M.(d1,I.d1),M.(d1,d2)),A.(M.(d2,I.d1),M.(d2,d2)))
              by A3,BINOP_1:11
            .= A.(M.(d1, I.d1),A.(M.(d1,d2),A.(M.(d2, I.d1),M.(d2,d2))))
              by A1,BINOP_1:def 3
            .= A.(M.(d1,I.d1),A.(A.(M.(d1,d2),M.(d2,I.d1)),M.(d2,d2)))
              by A1,BINOP_1:def 3
            .= A.( M.(d1, I.d1),M.(d2,d2)) by A284,A1,SETWISEO:15
            .= A.( I.(M.(d1, d1)),M.(d2,d2)) by A1,A3,FINSEQOP:67;
            hence thesis by A305,A1,A3,A278,FINSEQOP:67;
          end;
        end;
      end;
      set esCF=SignGenOp(fDD,A,eF \/ sF ) * esE;
A306: for x st x in dom esCF holds esCF.x is non empty
      proof
        let x;
        assume x in dom esCF;
        then esCF.x = SignGen(fDD,A,esE.x) by Th80;
        hence thesis;
      end;
      rng esCF c= D*;
      then reconsider esCF as non-empty non empty FinSequence of D*
        by A132,A306,FINSEQ_1:def 4,FUNCT_1:def 9;
      set CE = SignGenOp(fDD,A,Fe\/Fs) * E;
A307:   for x st x in dom CE holds CE.x is non empty
      proof
        let x;
        assume x in dom CE;
        then CE.x = SignGen(fDD,A,E.x) by Th80;
        hence thesis;
      end;
      rng CE c= D*;
      then reconsider CE as non-empty non empty FinSequence of D*
        by A307,FINSEQ_1:def 4,FUNCT_1:def 9;
A308:   CE = esCF^cESe by A236,Th81,A138,A139;
      dom App esCF = doms(m+2,card F1p+card F2p)
        by A236,A238,Lm3,A195,A193,A31,A32;
      then reconsider S9=S as Element of Fin dom App esCF by FINSUB_1:def 5;
      dom App CE = doms(m+2,card F1+card F2) by A236,A238,Lm3,A12,A142;
      then reconsider SIJ9=SIJ as Element of Fin dom App CE by FINSUB_1:def 5;
      for f,d1,d2 st len f = m &
        ce1 = SignGenOp(f^<*A . (d1,d2)*>,A,F1p) * E1pn &
        ce2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F2p) * E2pn
      for CFes be non-empty non empty FinSequence of D* st
        CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
        Ext(F1p,1+m,2+m)\/swap(F2p,1+m,2+m) ) * esE
      for Sd be Element of Fin dom App CFes st S = Sd holds
        M.((M "**" App ce1).P1,(M "**" App ce2).P2)=
        A$$(Sd,M"**"App CFes) &
        for h be FinSequence,i st h in Sd & i in dom h holds
        ((P1^P2).i = 1+len f implies h.i in {1+len f,2+len f}) &
        ((P1^P2).i <> 1+len f implies h.i =(P1^P2).i) by A147;
      then
A309:   M.((M "**" App ce1).P1,(M "**" App ce2).P2)=
        A$$(S9,M"**"App esCF) &
      for h be FinSequence,i st h in S9 & i in dom h holds
      ((P1^P2).i = 1+len f implies h.i in {1+len f,2+len f}) &
      ((P1^P2).i <> 1+len f implies h.i =(P1^P2).i) by A236;
      doms(m+1,ls1) = dom (App ce1) & doms(m+1,ls2) = dom (App ce2)
      by A236,A239,A240,A31,Lm3;
      then (M "**" App ce1).P1 = M "**" ((App ce1).P1) &
      (M "**" App ce2).P2 = M "**" ((App ce2).P2) by Def10,A34;
      hence M.((M "**" App CE1).s1,(M "**" App CE2).s2) =
        M.( A$$(S9,M"**"App esCF), A$$({.ii,jj.},M"**"App cESe) )
        by A2,A279,A309,A267,BINOP_1:def 2
      .= A $$ (SIJ9,M "**" App CE) by Th93,A1,A2,A3,A308
      .= A $$ (Sdd,M "**" App CFes) by A236,A248,A247,A234,A1,A2,Th115;
      let g be FinSequence,i such that
A311:   g in Sdd & i in dom g;
      consider s be FinSequence of NAT such that
A312:   g = s*(h") & s in SIJ by A311,A248;
      consider q1,q2 be FinSequence such that
A313:   s = q1^q2 & q1 in S & q2 in {.II,JJ.} by A312,POLNOT_1:def 2;
      q2 = II or q2 = JJ by A313,TARSKI:def 2;
      then
A314:   len q2=2 by FINSEQ_1:44;
      S9 c= dom App esCF by FINSUB_1:def 5;
      then S9 c= doms esCF by Def9;
      then
A315:   len q1 = len esCF =len esE by A313,Th47,CARD_1:def 7;
A316:   i in dom (h") & (h").i in dom s & g.i = s.((h").i)
        by A312,A311,FUNCT_1:11,12;
      then
A317:   1<=i <= ls1+ls2+2 by A164,A190,FINSEQ_1:1;
      per cases;
      suppose i <= ls1+1;
        then
A318:     i in Seg (ls1+1) by A317;
        then consider j be object such that
A319:     j in dom p1 & p1.j = i by A20,FUNCT_1:def 3;
        reconsider j as Nat by A319;
A320:     j in dom h by A160,A163,A319;
A321:     ls1 <= ls1+ls2 by NAT_1:11;
        i in dom s1 by A318,FINSEQ_1:def 3;
        then
A322:     (s1^s2).i = s1.i by FINSEQ_1:def 7;
A323:     1<=j<=ls1+1 by A319,FINSEQ_1:1;
        then per cases by NAT_1:8;
        suppose
A324:       j <=ls1;
          then h.j = i by A319,A323,A320,A160;
          then
A325:       (h").i = j by A320,FUNCT_1:32;
          j <= len esE by A31,A193,A195,A321,A324,XXREAL_0:2;
          then
A326:       j in dom q1 by A323,A315,FINSEQ_3:25;
          then
A327:       q1.j = (q1^q2).j by FINSEQ_1:def 7;
          j in dom P1 by A31,A324,A323,FINSEQ_3:25;
          then
A328:       P1.j = (P1^P2).j by FINSEQ_1:def 7;
A329:       s1.i = (s1*p1).j = P1.j by A319,A324,FINSEQ_3:112,FUNCT_1:13;
          hence (s1^s2).i = 1+len f implies g.i in {1+len f,2+len f}
            by A313,A325,A316,A327,A309,A326,A322,A328;
          thus thesis by A316,A325,A327,A313,A322,A329,A326,A328,A309;
        end;
        suppose
A330:       j=ls1+1;
          1<= ls1+ls2+1<= ls1+ls2+1+1 by NAT_1:11;
          then
A331:       ls1+ls2+1 in dom h by A160;
          then h.(ls1+ls2+1) = i by A319,A330,A160;
          then
A332:       (h").i = (ls1+ls2+1) by A331,FUNCT_1:32;
          1 in dom q2 by A314,FINSEQ_3:25;
          then
A333:       g.i = q2.1 by A313,A316,A332,A315,A31,A193,A195,FINSEQ_1:def 7;
          q2 = II or q2 =JJ by A313,TARSKI:def 2;
          hence thesis by A15,A330,A322,A319,A333,A236,FUNCT_1:13,TARSKI:def 2;
        end;
      end;
      suppose
A334:     i > ls1+1;
        then reconsider ii=i-(ls1+1) as Nat by NAT_1:21;
        ii<>0 & ii+(ls1+1) <= (ls2+1)+(ls1+1)
          by A334,A316,A164,A190,FINSEQ_1:1;
        then 1<=ii<=ls2+1 by NAT_1:14,XREAL_1:6;
        then
A335:     ii in Seg (ls2+1);
        then consider j be object such that
A336:     j in dom p2 & p2.j = ii by A23,FUNCT_1:def 3;
        reconsider j as Nat by A336;
A337:     1<=j<=ls2+1 by A336,FINSEQ_1:1;
A338:     ls1+j>=0+1 by A337,XREAL_1:7;
        ls1+j <=ls1+(ls2+1) by A337,XREAL_1:6;
        then ls1+j <=ls1+(ls2+1)+1 by NAT_1:13;
        then
A339:     ls1+j in dom h by A160,A338;
        ii in dom s2 by A335,FINSEQ_1:def 3;
        then
A340:     (s1^s2).(ii+(ls1+1)) = s2.ii by FINSEQ_1:def 7;
        per cases by A337,NAT_1:8;
        suppose
A341:       j <=ls2;
          then h.(ls1+j) = (ls1+1)+ii by A336,A337,A339,A160;
          then
A342:       (h").i = (ls1+j) by A339,FUNCT_1:32;
          ls1+j <= len esE by A31,A193,A195,A341,XREAL_1:6;
          then
A343:       ls1+j in dom q1 by A338,A315,FINSEQ_3:25;
          then
A344:       q1.(ls1+j) = (q1^q2).(ls1+j) by FINSEQ_1:def 7;
          j in dom P2 by A31,A341,A337,FINSEQ_3:25;
          then
A345:       P2.j = (P1^P2).(ls1+j) by A31,FINSEQ_1:def 7;
A346:       s2.ii = (s2*p2).j = P2.j by A336,A341,FINSEQ_3:112,FUNCT_1:13;
          thus (s1^s2).i = 1+len f implies g.i in {1+len f,2+len f}
          proof
            assume (s1^s2).i = 1+len f;
            then q1.(ls1+j) in {1+len f,2+len f}
              by A313,A343,A346,A345,A340,A309;
            hence thesis by A316,A342,A313,A343,FINSEQ_1:def 7;
          end;
          thus thesis by A316,A342,A344,A313,A340,A346,A345,A343,A309;
        end;
        suppose
A347:       j=ls2+1;
          1<= ls1+ls2+1+1 by NAT_1:11;
          then
A348:       ls1+ls2+2 in dom h by A160;
          then
A349:       h.(ls1+ls2+2) = i by A336,A347,A160;
          2 in dom q2 by A314,FINSEQ_3:25;
          then
A350:       (q1^q2).(ls1+ls2+2) = q2.2 by A315,A31,A193,A195,FINSEQ_1:def 7;
A351:       g.i = q2.2 by A316,A349,A348,A350,A313,FUNCT_1:32;
          q2 = II or q2 =JJ by A313,TARSKI:def 2;
          then q2.2 = 1+len f or q2.2 = 2+len f by A236;
          hence thesis by A17,A340,A336,A347,A351,A236,FUNCT_1:13,TARSKI:def 2;
        end;
      end;
    end;
  end;
A352: P[0]
  proof
    let F1,F2;
    set Fe = Ext(F1,1+m,2+m), Fs=swap(F2,1+m,2+m);
    let E1 be Enumeration of F1, E2 be Enumeration of F2 such that
A353: union F1 c= Seg (1+m) & union F2 c= Seg (1+m);
    let Ee be Enumeration of Fe,
        Es be Enumeration of Fs such that
A354: Ee = Ext(E1,1+m,2+m) & Es = Swap(E2,1+m,2+m);
A355: not 2+m in Seg (1+m) by FINSEQ_1:1,XREAL_1:6;
    let Ees be Enumeration of Fe\/Fs such that
A356: Ees=Ee^Es;
    let s1,s2 be FinSequence such that
A357: s1 in doms(m+1,card F1) & s2 in doms(m+1,card F2) &
    s1^s2 is with_evenly_repeated_values &
      card (s1"{1+m}) = 0 = card (s2"{1+m});
    m+1 <= m+1+1 by NAT_1:11;
    then s1^s2 in doms(m+1,card F1+card F2) c= doms(m+2,card F1+card F2)
      by Th125,Th122,A357;
    then reconsider s12=s1^s2 as Element of doms(m+2,card F1+card F2);
    reconsider S = {s12} as Subset of doms(m+2,card F1+card F2);
    take S;
    thus (card (s1"{1+m}) = 0 implies s1^s2 in S) by TARSKI:def 1;
    thus S is with_evenly_repeated_values-member by A357;
    let CE1,CE2 be FinSequence of D*, f,d1,d2 such that
A358: len f = m and
A359: CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F1) * E1 &
    CE2 = SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,F2) * E2;
    let CFes be non-empty non empty FinSequence of D* such that
A360: CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
      Ext(F1,1+len f,2+len f)\/swap(F2,1+len f,2+len f) ) * Ees;
    let Sd be Element of Fin dom App CFes such that
A361: S = Sd;
    set I=the_inverseOp_wrt A,fD=f^<*A . (d1,d2)*>,fDD=f^<*d1*>^<*d2*>,
      fDID=f^<*A.( I.d1,d2)*>;
A362: len (f^<*d1*>^<*d2*>) = 1 + len (f^<*d1*>) by FINSEQ_2:16
      .= 1+(1 + len f) by FINSEQ_2:16
      .= 2+len f;
A363: len (f^<*A.(d1,d2)*>) = 1 + len f by FINSEQ_2:16;
A364: len (f^<*A.(I.d1,d2)*>) = 1 + len f by FINSEQ_2:16;
A365: s1 in doms CE1 & s2 in doms CE2 by A357,A359,Th106,A358,A363,A364;
    set CFe = SignGenOp(fDD,A,Fe) * Ee,
    CFs = SignGenOp(fDD,A,Fs) * Es;
A366: card F1=card Fe by A355,A353,Th10;
    then
A367: doms (SignGenOp(fD,A,F1) * E1)
    c= doms (SignGenOp(fDD,A,Fe) * Ee) by A362,A363,Th107,XREAL_1:6;
A368: card F2=card Fs by A355,A353,Th11;
    then
A369: doms (SignGenOp(fDID,A,F2) * E2) c= doms (SignGenOp(fDD,A,Fs) * Es)
      by A362,A364,Th107,XREAL_1:6;
A370: s1 in dom App CE1 & s2 in dom App CE2 by A365,Def9;
A371: len CFe = len s1 = len CE1 by Th47,A365,A367,A359;
A372: len CFs = len s2 = len CE2 by Th47,A359,A365,A369;
A373: CFe^CFs = CFes by A358,A360,A356,Th81;
A374: len ((App CFe).s1) = len s1 = len ((App CE1).s1)
      by A359,A365,A367,Def9;
    for k st 1 <= k & k <= len ((App CFe).s1) holds ((App CFe).s1).k
      = ((App CE1).s1).k
    proof
      let k such that
A375:   1<=k & k <= len ((App CFe).s1);
A376:   k in dom s1 & k in dom CE1 & k in dom CFe
        by A374,A375,A371,FINSEQ_3:25;
      then
A377:   ((App CFe).s1).k = CFe.k.(s1.k) &
        ((App CE1).s1).k = CE1.k.(s1.k) by A367,A359,A365,Def9;
      reconsider s1k=s1.k as Nat by A365;
A378:   s1.k <> 1+len f
      proof
        assume s1.k = 1+len f;
        then s1.k in {1+len f} by TARSKI:def 1;
        then k in s1"{1+len f} by A376,FUNCT_1:def 7;
        hence thesis by A357,A358;
      end;
A379: CFe.k = SignGen(fDD,A,Ee.k) by A376,Th80;
A380: CE1.k = SignGen(f^<*A.(d1,d2)*>,A,E1.k)
        by A374,A375,A371,Th80,A359,FINSEQ_3:25;
      then
A381: len (CE1.k) = 1+len f by A363,CARD_1:def 7;
A382: s1.k in dom (CE1.k) & s1.k in dom (CFe.k) by A376,A359,A365,A367,Th47;
      then
A383:1 <= s1k <= 1+ len f by A381,FINSEQ_3:25;
      then
A384: s1k < (1+len f)+1 & s1k < 1+len f by A378,NAT_1:13,XXREAL_0:1;
      then s1k <= len f by NAT_1:13;
      then s1k in dom f c= dom (f^<*d1*>) by A383,FINSEQ_1:26,FINSEQ_3:25;
      then
A385: (f^<*A.(d1,d2)*>).s1k = f.s1k = (f^<*d1*>).s1k &
      s1k in dom (f^<*d1*>)
      by FINSEQ_1:def 7;
      CE1.k.s1k = CFe.k.s1k
      proof
        per cases;
        suppose
A386:       s1k in E1.k;
          then
A387:       s1k in Ee.k by A358,A354,Th20,A384;
          thus CE1.k.s1k =
            (the_inverseOp_wrt A).((f^<*A.(d1,d2)*>).s1k)
           by A380,A382,Def11,A386
          .=(the_inverseOp_wrt A).((f^<*d1*>^<*d2*>).s1k)
            by A385,FINSEQ_1:def 7
          .= CFe.k.s1k by A379,A382,Def11,A387;
        end;
        suppose
A388:       not s1k in E1.k;
          then
A389:       not s1k in Ee.k by A358,A354,Th20,A384;
          thus CE1.k.s1k =
          (f^<*A.(d1,d2)*>).s1k by A380,A382,Def11,A388
          .= (f^<*d1*>^<*d2*>).s1k by A385,FINSEQ_1:def 7
          .= CFe.k.s1k by A379,A382,Def11,A389;
        end;
      end;
      hence thesis by A377;
    end;
    then
A390: (App CFe).s1 = (App CE1).s1 by A374;
    len Ees = card F1+card F2 by A356,A366,A368,CARD_1:def 7;
    then
    reconsider S12=s12 as Element of dom App CFes by A358,A360,A362,Lm3;
A391:  len ((App CFs).s2) = len s2 = len ((App CE2).s2)
      by A365,A369,A359,Def9;
    for k st 1 <= k & k <= len ((App CFs).s2)
      holds ((App CFs).s2).k = ((App CE2).s2).k
    proof
      let k such that
A392:   1<=k & k <= len ((App CFs).s2);
A393:   k in dom s2 & k in dom CE2 & k in dom CFs
        by A391,A392,A372,FINSEQ_3:25;
      then
A394: ((App CFs).s2).k = CFs.k.(s2.k) &
      ((App CE2).s2).k = CE2.k.(s2.k) by A359,A369,A365,Def9;
      reconsider s2k=s2.k as Nat by A365;
A395: s2.k <> 1+len f
      proof
        assume s2.k = 1+len f;
        then s2.k in {1+len f} by TARSKI:def 1;
        then k in s2"{1+len f} by A393,FUNCT_1:def 7;
        hence thesis by A357,A358;
      end;
      dom CFs = dom CE2 by A372,FINSEQ_3:29;then
A396:   CFs.k = SignGen(fDD,A,Es.k) by A391,A392,A372,Th80,FINSEQ_3:25;
A397:   CE2.k = SignGen(f^<*A.(I.d1,d2)*>,A,E2.k)
        by A391,A392,A372,Th80,A359,FINSEQ_3:25;
      then
A398: len (CE2.k) = 1+len f by A364,CARD_1:def 7;
A399: s2.k in dom (CE2.k) & s2.k in dom (CFs.k)
        by A393,A365,A359,A369,Th47;
      then
A400: 1 <= s2k <= 1+ len f by A398,FINSEQ_3:25;
      then
A401: s2k < (1+len f)+1 & s2k < 1+len f by A395,NAT_1:13,XXREAL_0:1;
      then s2k <= len f by NAT_1:13;
      then s2k in dom f c= dom (f^<*d1*>) by A400,FINSEQ_1:26,FINSEQ_3:25;
      then
A402: (f^<*A.(I.d1,d2)*>).s2k = f.s2k = (f^<*d1*>).s2k &
      s2k in dom (f^<*d1*>) by FINSEQ_1:def 7;
      CE2.k.s2k = CFs.k.s2k
      proof
        per cases;
        suppose
A403:     s2k in E2.k;
          then
A404:     s2k in Es.k by A358,A354,Th21,A401;
          thus  CE2.k.s2k =
          (the_inverseOp_wrt A).((f^<*A.(I.d1,d2)*>).s2k)
            by A397,A399,Def11,A403
          .=(the_inverseOp_wrt A).((f^<*d1*>^<*d2*>).s2k)
            by A402,FINSEQ_1:def 7
          .= CFs.k.s2k by A396,A399,Def11,A404;
        end;
        suppose
A405:     not s2k in E2.k;
          then
A406:     not s2k in Es.k by A358,A354,Th21,A401;
          thus CE2.k.s2k =
          (f^<*A.(I.d1,d2)*>).s2k by A397,A399,Def11,A405
          .= (f^<*d1*>^<*d2*>).s2k by A402,FINSEQ_1:def 7
          .= CFs.k.s2k by A396,A399,Def11,A406;
        end;
      end;
      hence thesis by A394;
    end;
    then
A407: (App CFs).s2 = (App CE2).s2 by A391;
    thus A$$(Sd,M"**"App CFes) = (M"**"App CFes).S12 by A361,A1,SETWISEO:17
    .= M "**" ((App CFes).s12) by Def10
    .=M "**" ((App CFe).s1)^((App CFs).s2) by A373,Th61,A365,A359,A367,A369
    .= M.(M "**" ((App CFe).s1),M"**"((App CFs).s2)) by A2,FINSOP_1:5
    .= M.(M "**" ((App CE1).s1),M"**"((App CE2).s2)) by A390,A407
    .= M.((M "**" (App CE1)).s1,M"**"((App CE2).s2)) by Def10,A370
    .= M.((M "**" App CE1).s1,(M"**" App CE2).s2) by Def10,A370;
    let h be FinSequence,i such that A408: h in Sd & i in dom h;
    h=s1^s2 by A361,A408,TARSKI:def 1;
    hence thesis by TARSKI:def 2;
  end;
  P[n] from NAT_1:sch 2(A352,A4);
  hence thesis;
end;

theorem Th127:
  A is commutative associative having_a_unity having_an_inverseOp &
  M is associative commutative having_a_unity &
  M is_distributive_wrt A
implies
  for E1 be Enumeration of F1 st union F1 c= Seg (1+m)
    for Ee be Enumeration of Ext(F1,1+m,2+m) st
        Ee = Ext(E1,1+m,2+m)
    ex S be Subset of doms(m+2,card F1) st
      S = (len E1)-tuples_on {1+m,2+m} &
      for CFe be non-empty non empty FinSequence of D*,f,d1,d2 st
        len f=m &
        CFe = SignGenOp(f^<*d1*>^<*d2*>,A,Ext(F1,1+len f,2+len f) ) * Ee
      for Sd be Element of Fin dom App CFe st Sd = S holds
      (M "**" App (SignGenOp(f^<*A .(d1,d2)*>,A,F1)*E1)).(len E1|->(1+ len f))
        = A$$(Sd,M"**"App CFe)
proof
  set I=the_inverseOp_wrt A;
  assume that
A1: A is commutative associative having_a_unity
    having_an_inverseOp and
A2:M is associative commutative having_a_unity and
A3: M is_distributive_wrt A;
  defpred P[Nat] means
    for F1 for E1 be Enumeration of F1 st union F1 c= Seg (1+m) & len E1=$1
    for Ee be Enumeration of Ext(F1,1+m,2+m) st
    Ee = Ext(E1,1+m,2+m)
    ex S be Subset of doms(m+2,card F1) st
    S = (len E1)-tuples_on {1+m,2+m} &
    for CFe be non-empty non empty FinSequence of D*,f,d1,d2 st len f=m &
    CFe = SignGenOp(f^<*d1*>^<*d2*>,A, Ext(F1,1+len f,2+len f) ) * Ee
    for Sd be Element of Fin dom App CFe st Sd=S holds
     (M "**" App (SignGenOp(f^<*A . (d1,d2)*>,A,F1) * E1)).(len E1|->(1+len f))
       = A$$(Sd,M"**"App CFe);
A4: P[0]
  proof
    let F1;
    let E1 be Enumeration of F1 such that
A5:   union F1 c= Seg (1+m) & len E1=0;
    set Fe=Ext(F1,1+m,2+m);
    let Ee be Enumeration of Fe such that
    Ee = Ext(E1,1+m,2+m);
A6:   len E1=card F1 by CARD_1:def 7;
    then doms(m+2,card F1) = {<*>Seg (m+2)} by A5,FINSEQ_2:94;
    then reconsider S= {<*>{1+m,2+m}} as Subset of doms(m+2,card F1);
    take S;
    thus S = (len E1)-tuples_on {1+m,2+m} by A5,FINSEQ_2:94;
    let CFe be non-empty non empty FinSequence of D*,f,d1,d2 such that
A7:   len f=m and
A8: CFe = SignGenOp(f^<*d1*>^<*d2*>,A, Ext(F1,1+len f,2+len f) ) * Ee;
    1+len f < 1+len f+1 by NAT_1:13;
    then not 2+len f in union F1 by A7,A5,FINSEQ_1:1;
    then card F1 = card Fe =len Ee by A7,Th10,CARD_1:def 7;
    hence thesis by A6,A5,A8;
  end;
A9:P[n] implies P[n+1]
  proof
    set n1=n+1;
    assume
A10: P[n];
    let F1;
    let E1 be Enumeration of F1 such that
A11:union F1 c= Seg (1+m) & len E1=n1;
    set Fe=Ext(F1,1+m,2+m);
    let Ee be Enumeration of Fe such that
A12:Ee = Ext(E1,1+m,2+m);
    set sij=(len E1)-tuples_on {1+m,2+m};
A13: len E1=card F1 by CARD_1:def 7;
A14: Seg (1+m+1) = Seg (1+m)\/{1+m+1} by FINSEQ_1:9;
    1+m in Seg (m+2) & 1+m+1 in Seg (m+2) by A14,FINSEQ_1:4,ZFMISC_1:136;
    then {1+m,2+m} c= Seg (m+2) by ZFMISC_1:32;
    then reconsider sij as Subset of doms(m+2,card F1) by A13,SRINGS_5:5;
    take sij;
    thus sij = (len E1)-tuples_on {1+m,2+m};
    let CFe be non-empty non empty FinSequence of D*,f,d1,d2 such that
A15:len f=m and
A16:CFe = SignGenOp(f^<*d1*>^<*d2*>,A, Ext(F1,1+len f,2+len f) ) * Ee;
    set fD=f^<*A.(d1,d2)*>,fDD=f^<*d1*>^<*d2*>;
    let Sd be Element of Fin dom App CFe such that
A17: Sd=sij;
    set CE= (SignGenOp(fD,A,F1) * E1);
A18: len fD=len f+1 >=1 by FINSEQ_2:16,NAT_1:11;
    1+len f < 1+len f+1 by NAT_1:13;
    then
A19: not 2+len f in union F1 by A15,A11,FINSEQ_1:1;
A20: len fDD = 1 + len (f^<*d1*>) by FINSEQ_2:16
    .= 1+(1 + len f) by FINSEQ_2:16
    .= 2+len f;
A21:  1+len f <= 2+len f & 1+0 <= 2+len f by XREAL_1:8;
    then
A22:1+len f in dom fDD & 2+len f in dom fDD by A18,A20,FINSEQ_3:25;
    dom <*d1,d2*>={1,2} by FINSEQ_1:92;
    then
A23: 1 in dom <*d1,d2*> & 2 in dom <*d1,d2*> by TARSKI:def 2;
    fDD = f^<*d1,d2*> by FINSEQ_1:32;
    then
A24: fDD.(1+len f) = <*d1,d2*>.1 =d1 &
    fDD.(2+len f) = <*d1,d2*>.2 =d2 by A23,FINSEQ_1:def 7;
    set F1n=F1\{E1.n1};
    reconsider E1n= E1|n as Enumeration of F1n by Th96,A11;
    reconsider En= <*E1.n1*> as Enumeration of {E1.n1} by Th96,A11;
    set CEn=SignGenOp(fD,A,F1n) * E1n;
A25: n< n1 by NAT_1:13;
    then
A26: len E1n = n by A11,FINSEQ_1:59;
A27:len fD in dom fD by A18,FINSEQ_3:25;
    then
A28:n |-> (len fD) in doms CEn by A26,Th102;
    len En = 1 by FINSEQ_1:40;
    then
A29: 1 |-> (len fD) in doms(SignGenOp(fD,A,{E1.n1}) * En)
      by A27,Th102;
    n1 |-> (len fD) in doms CE by A27,A11,Th102;
    then
A30: n1 |-> (len fD) in dom App CE by Def9;
A31: n1 |-> (len fD) = (n |-> (len fD))^(1 |-> (len fD))
      by FINSEQ_2:123;
A32: F1 = F1n\/ {E1.n1} by Th96,A11;
    then
A33: union F1n c= union F1 & union {E1.n1} c= union F1
      by XBOOLE_1:7,ZFMISC_1:77;
    then
A34:  not 2+len f in union F1n & not 2+len f in union {E1.n1}  by A19;
    reconsider EE1n = Ext(E1n,1+len f,2+len f) as Enumeration of
    Ext(F1n,1+len f,2+len f) by A33,A19,Th28;
    reconsider EEn = Ext(En,1+len f,2+len f) as Enumeration of
    Ext({E1.n1},1+len f,2+len f) by A33,A19,Th28;
    set CEE1n=(SignGenOp(fDD,A, Ext(F1n,1+len f,2+len f) ) * EE1n),
    CEEn = (SignGenOp(fDD,A, Ext({E1.n1},1+len f,2+len f) ) * EEn);
A35:E1 = E1n ^ En by A11,FINSEQ_3:55;
    then CE = (SignGenOp(fD,A,F1n) * E1n)^
    (SignGenOp(fD,A,{E1.n1}) * En) by Th81,A32;
    then
A36: (App CE).(n1 |-> (len fD)) =
    (( App CEn ).(n |-> (len fD)))^
    (( App (SignGenOp(fD,A,{E1.n1}) * En)).(1 |-> (len fD)))
    by A28,A31,A29,Th61;
A37: (M "**" App CE).(len E1|-> (1+ len f))
    = M "**" ((App CE).(n1|-> (len fD))) by A18,Def10,A11,A30
    .= M. (M"**"( App CEn).(n |-> (len fD)),
    M"**"( App (SignGenOp(fD,A,{E1.n1}) * En)).(1 |-> (len fD)))
    by A2,A36,FINSOP_1:5;
A38: Fe = Ext(F1n,1+len f,2+len f)\/ Ext({E1.n1},1+len f,2+len f)
    by A15,Th16,A32;
    Ee = EE1n^EEn by A15,A12,A35,Th19;
    then
A39: CFe = CEE1n^CEEn by A15,A16,A38,Th81;
A40: for x st x in dom CEEn holds CEEn.x is non empty
    proof
      let x;
      assume x in dom CEEn;
      then CEEn.x = SignGen(fDD,A,EEn.x) by Th80;
      hence thesis;
    end;
    rng CEEn c= D*;
    then reconsider CEEn as non-empty non empty FinSequence of D*
    by A40,FINSEQ_1:def 4,FUNCT_1:def 9;
A41: len fD in dom fD = dom SignGen(fD,A,E1.n1) by Def11,A18,FINSEQ_3:25;
    then SignGen(fD,A,E1.n1).(len fD) in rng SignGen(fD,A,E1.n1)
      by FUNCT_1:def 3;
    then
    reconsider temp= SignGen(fD,A,E1.n1).(len fD) as Element of D;
A42:  SignGenOp(fD,A,{E1.n1}) * En = <* SignGen(fD,A,E1.n1) *> by Th78;
A43: M"**"(( App (<* SignGen(fD,A,E1.n1) *>)).(1 |-> (len fD)))=
    M"**"( App (<* SignGen(fD,A,E1.n1) *>)).<*len fD*> by FINSEQ_2:59
    .= M"**" <* temp *> by A41,Th60
    .= SignGen(fD,A,E1.n1).(len fD) by FINSOP_1:11;
    1<=n1 by NAT_1:11;
    then
A44: n1 in dom E1 by A11,FINSEQ_3:25;
A45: Ext({E1.n1},1+len f,2+len f) = {Ee.n1} by A15,A12,A44,Th37;
A46: CEEn= <* SignGen(fDD,A,Ee.n1) *> by A45,Th78;
A47: dom SignGen(fDD,A,Ee.n1) = dom fDD by Def11;
A48: len <* 1+len f *> = 1 & len <* 2+len f *> = 1 by FINSEQ_1:40;
    <* 1+len f *>.1 in dom fDD & <* 2+len f *>.1 in dom fDD
    by A21,A18,A20,FINSEQ_3:25;
    then <* 1+len f *> in doms CEEn & <* 2+len f *> in doms CEEn
    by A47,A48,A46,Th51;
    then reconsider II=<* 1+len f *>,JJ= <* 2+len f *>
    as Element of dom App CEEn by Def9;
A49: rng <* 1+len f *> = { 1+len f} &
     rng <* 2+len f *> = { 2+len f} by FINSEQ_1:39;
A50:SignGen(fD,A,E1.n1).(len fD) = A$$({.II,JJ.},M"**"App CEEn)
    proof
      SignGen(fDD,A,Ee.n1).(1+len f) in rng SignGen(fDD,A,Ee.n1)
      by A22,A47,FUNCT_1:def 3;
      then reconsider t1=SignGen(fDD,A,Ee.n1).(1+len f) as Element of D;
      SignGen(fDD,A,Ee.n1).(2+len f) in rng SignGen(fDD,A,Ee.n1)
        by A22,A47,FUNCT_1:def 3;
      then reconsider t2=SignGen(fDD,A,Ee.n1).(2+len f) as Element of D;
      (App CEEn).II = <* t1 *> &
      (App CEEn).JJ = <* t2 *> by Th60,A46,A47,A21,A18,A20,FINSEQ_3:25;
      then
A51:  M"**"((App CEEn).II) = t1 & M"**"((App CEEn).JJ) = t2
      by FINSOP_1:11;
      II.1 =len f +1 & JJ.1=len f+2;
      then II <>JJ;
      then
A52:  A$$({.II,JJ.},M"**"App CEEn) =
      A.( (M"**"App CEEn).II,(M"**"App CEEn).JJ) by A1,SETWOP_2:1
      .= A.( M"**"((App CEEn).II),(M"**"App CEEn).JJ) by Def10
      .= A. (SignGen(fDD,A,Ee.n1).(1+len f), SignGen(fDD,A,Ee.n1).(2+len f))
        by Def10,A51;
A53:  fD.(len fD) = A.(d1,d2) by A18;
      per cases;
      suppose
A54:    len fD in E1.n1;
        then
A55:    SignGen(fD,A,E1.n1).(len fD) = I. (A.(d1,d2))
          by A41,Def11,A53;
        {E1.n1 \/{2+len f}} = Ext({E1.n1},1+len f,2+len f) by A18,A54,Th29;
        then Ee.n1 = E1.n1 \/{2+len f} by A45,ZFMISC_1:18;
        then 1+len f in Ee.n1 & 2+len f in Ee.n1 by A54,A18,ZFMISC_1:136;
        then SignGen(fDD,A,Ee.n1).(1+len f) = I.d1 &
        SignGen(fDD,A,Ee.n1).(2+len f) = I.d2 by A24,A47,A22,Def11;
        hence thesis by A1,Th103,A55,A52;
      end;
      suppose
A56:    not len fD in E1.n1;
        {E1.n1} = Ext({E1.n1},1+len f,2+len f) by A18,A56,Th30;
        then not 1+len f in Ee.n1 & not 2+len f in Ee.n1
          by A56,A18,A34,A45,ZFMISC_1:18,25;
        then SignGen(fDD,A,Ee.n1).(1+len f) = d1 &
        SignGen(fDD,A,Ee.n1).(2+len f) = d2 by A24,A47,A22,Def11;
        hence thesis by A56,A41,Def11,A53,A52;
      end;
    end;
    per cases;
    suppose
A57: n<>0;
A58: for x st x in dom CEE1n holds CEE1n.x is non empty
      proof
        let x;
        assume x in dom CEE1n;
        then CEE1n.x = SignGen(fDD,A,EE1n.x) by Th80;
        hence thesis;
      end;
      rng CEE1n c= D*;
      then reconsider CEE1n as non-empty non empty FinSequence of D*
        by A58,A26,A57,FINSEQ_1:def 4,FUNCT_1:def 9;
      union F1n c= Seg (1+len f) by A15,A33,A11;
      then consider S be Subset of doms(m+2,card F1n) such that
A59:  S = (len E1n)-tuples_on {1+m,2+m} and
A60:  for CFe be non-empty non empty FinSequence of D*,f,d1,d2 st
      len f=m &
      CFe = SignGenOp(f^<*d1*>^<*d2*>,A, Ext(F1n,1+len f,2+len f) ) * EE1n
      for Sd be Element of Fin dom App CFe st Sd=S
      holds
      (M "**" App (SignGenOp(f^<*A . (d1,d2)*>,A,F1n) * E1n)).
      (len E1n|-> (1+ len f)) = A$$(Sd,M"**"App CFe)
        by A15,A10,A25,A11,FINSEQ_1:59;
      len EE1n = len E1n =card F1n by CARD_1:def 7;
      then dom App CEE1n = doms(m+2,card F1n) by A20,A15,Lm3;
      then reconsider S1=S as Element of Fin dom App CEE1n by FINSUB_1:def 5;
      S1 c= dom App CEE1n & {.II,JJ.} c= dom App CEEn by FINSUB_1:def 5;
      then S1 c= doms CEE1n & {.II,JJ.} c= doms CEEn by Def9;
      then S1^{.II,JJ.} c= doms CFe by A39,Th49;
      then S1^{.II,JJ.} c= dom App CFe by Def9;
      then reconsider SIJ=S1^{.II,JJ.} as Element of Fin dom App CFe
      by FINSUB_1:def 5;
A61:  n |-> (len fD) in dom App CEn by A28,Def9;
A62:  SIJ = (len E1)-tuples_on {1+len f,2+len f}
      proof
        thus SIJ c= (len E1)-tuples_on {1+len f,2+len f}
        proof
          let y such that
A63:      y in SIJ;
          consider s,ij be FinSequence such that
A64:      y=s^ij & s in S & ij in {.II,JJ.} by A63,POLNOT_1:def 2;
          reconsider s as Element of (len E1n)-tuples_on {1+len f,2+len f}
          by A15,A64,A59;
A65:      ij=II or ij=JJ by A64,TARSKI:def 2;
          then reconsider ij as FinSequence of {1+len f,2+len f}
          by A49,FINSEQ_1:def 4,ZFMISC_1:7;
          len (s^ij) = len E1 by A11,A26,A65,CARD_1:def 7;
          hence thesis by A64;
        end;
        let y such that
A66:    y in (len E1)-tuples_on {1+len f,2+len f};
        reconsider y as Element of (len E1)-tuples_on {1+len f,2+len f} by A66;
A67:    len y = len E1=1+len E1n by A11,A25,CARD_1:def 7,FINSEQ_1:59;
        then
A68:    y = (y|(len E1n))^<*y.(1+len E1n)*> by FINSEQ_3:55;
        len (y|(len E1n)) = len E1n by A11,A26,CARD_1:def 7;
        then
A69:    y|(len E1n) is Element of
        (len E1n)-tuples_on {1+len f,2+len f} by FINSEQ_2:92;
        1<= 1+len E1n by NAT_1:11;
        then (1+len E1n) in dom y by A67,FINSEQ_3:25;
        then y.(1+len E1n) in rng y by FUNCT_1:def 3;
        then y.(1+len E1n) = 1+len f or y.(1+len E1n) = 2+len f
          by TARSKI:def 2;
        then <*y.(1+len E1n)*> in {.II,JJ.} by TARSKI:def 2;
        hence thesis by A68,A15,A69,A59,POLNOT_1:def 2;
      end;
      thus A$$(Sd,M"**"App CFe) =
      M.(A $$ (S1,M "**" App CEE1n),SignGen(fD,A,E1.n1).(len fD))
        by A50,A39,Th93,A1,A2,A3,A15,A62,A17
      .= M.( (M "**" App (CEn)).(len E1n|-> (1+ len f)),
        M"**"(( App (<* SignGen(fD,A,E1.n1) *>)).(1 |-> (len fD))))
        by A15,A60,A43
      .= M.((M "**" App (CEn)).( n |-> (len fD)),
        M"**"(( App (<* SignGen(fD,A,E1.n1) *>)).(1 |-> (len fD))))
        by A25,A11,A18,FINSEQ_1:59
      .= (M "**" App CE).(len E1|-> (1+ len f)) by A37,A42,Def10,A61;
    end;
    suppose
A70:  n=0;
      then
A71:  E1n= {};
      then
A72:  E1=En & F1n={} by A35;
A73:  CEE1n={} by A71;
      reconsider SIJ={.II,JJ.} as Element of Fin dom App CFe by A39,A73;
A74:  SIJ = (len E1)-tuples_on {1+len f,2+len f}
      proof
        thus SIJ c= (len E1)-tuples_on {1+len f,2+len f}
        proof
          let y be object;
          assume y in SIJ;
          then
A75:      y=II or y=JJ by TARSKI:def 2;
          then reconsider y as FinSequence of {1+len f,2+len f}
            by A49,FINSEQ_1:def 4,ZFMISC_1:7;
          y is Element of (len E1)-tuples_on {1+len f,2+len f}
            by A11,A70,A75,A48,FINSEQ_2:92;
          hence thesis;
        end;
        let y be object;
        assume y in (len E1)-tuples_on {1+len f,2+len f};
        then reconsider y as Element of (len E1)-tuples_on {1+len f,2+len f};
        len y = 1 by A70,A11,CARD_1:def 7;
        then 1 in dom y by FINSEQ_3:25;
        then y.1 in rng y c= {1+len f,2+len f} by FUNCT_1:def 3;
        then y.1 = 1+len f or y.1 = 2+len f by TARSKI:def 2;
        then y =II or y = JJ by A70,A11,CARD_1:def 7,FINSEQ_1:40;
        hence thesis by TARSKI:def 2;
      end;
      thus (M "**" App CE).(len E1|-> (1+ len f)) = A$$(Sd, M"**"App CFe)
      by A15,A73,A39,A74,A17,Def10,A18,A30,A50,A43,A72,A32,A42,A70,A11;
    end;
  end;
  P[n] from NAT_1:sch 2(A4,A9);
  hence thesis;
end;

theorem Th128:
  A is commutative associative having_a_unity having_an_inverseOp
implies
  for E1 be Enumeration of F1 st union F1 c= Seg (1+len f)
    for Ee be Enumeration of Ext(F1,1+len f,2+len f),
        Es be Enumeration of swap(F1,1+len f,2+len f) st
        Ee = Ext(E1,1+len f,2+len f) & Es = Swap(E1,1+len f,2+len f)
for CFe be non-empty non empty FinSequence of D*,
    CFs be non-empty non empty FinSequence of D* st
   CFe = SignGenOp(f^<*d1*>^<*d2*>,A, Ext(F1,1+len f,2+len f) ) * Ee &
   CFs = SignGenOp(f^<*(the_inverseOp_wrt A).d1*>^<*d2*>,
     A, swap(F1,1+len f,2+len f) ) * Es
for S1 be Element of Fin dom App CFe,S2 be Element of Fin dom App CFs st
  S1=S2 holds
A$$(S1,M"**"App CFe) = A$$(S2,M"**"App CFs)
proof
  assume
A1: A is commutative associative having_a_unity having_an_inverseOp;
  set I=the_inverseOp_wrt A,fDD=f^<*d1*>^<*d2*>,fID=f^<*I.d1*>^<*d2*>;
  let E1 be Enumeration of F1 such that
A2: union F1 c= Seg (1+len f);
  let Ee be Enumeration of Ext(F1,1+len f,2+len f),
      Es be Enumeration of swap(F1,1+len f,2+len f) such that
A3: Ee = Ext(E1,1+len f,2+len f) & Es = Swap(E1,1+len f,2+len f);
  let CFe be non-empty non empty FinSequence of D*,
      CFs be non-empty non empty FinSequence of D* such that
A4: CFe = SignGenOp(fDD,A, Ext(F1,1+len f,2+len f) ) * Ee &
  CFs = SignGenOp(fID,A, swap(F1,1+len f,2+len f) ) * Es;
  defpred P[Nat] means
  for S1 be Element of Fin dom App CFe,S2 be Element of Fin dom App CFs st
    S1=S2 & card S1=$1 holds A$$(S1,M"**"App CFe) = A$$(S2,M"**"App CFs);
A5: P[0]
  proof
    let S1 be Element of Fin dom App CFe,S2 be Element of Fin dom App CFs;
    assume S1=S2 & card S1=0;
    then
A6:   S1={}.(dom App CFe) & S2={}.(dom App CFs);
    hence A$$(S1,M"**"App CFe) = the_unity_wrt A by A1,SETWISEO:31
      .= A$$(S2,M"**"App CFs) by A1,A6,SETWISEO:31;
  end;
  A7:P[n] implies P[n+1]
  proof
    set n1=n+1;
    assume
A8:   P[n];
    let S1 be Element of Fin dom App CFe,S2 be Element of Fin dom App CFs
      such that
A9:   S1=S2 & card S1=n1;
    consider s1 be object such that
A10:  s1 in S1 by A9,XBOOLE_0:def 1,def 2;
    set S11= S1\{s1},S22=S2\{s1};
A11:  S1 c= dom App CFe & S2 c= dom App CFs by FINSUB_1:def 5;
    then reconsider s1 as Element of dom App CFe by A10;
    reconsider s2=s1 as Element of dom App CFs by A9,A10,A11;
A12:  S11 c= dom App CFe & S22 c= dom App CFs  by A11;
    then reconsider S11 as Element of Fin dom App CFe by FINSUB_1:def 5;
    reconsider S22 as Element of Fin dom App CFs by A12,FINSUB_1:def 5;
A13:  S1 = S11\/{.s1.} & S2 = S22\/{.s2.} by A9,A10,ZFMISC_1:116;
A14:  not s1 in S11 & not s2 in S22  by ZFMISC_1:56;
A15:  card S11 = n by A9,A10,STIRL2_1:55;
A16:  (M"**"App CFe).s1 = M"**"((App CFe).s1) &
    (M"**"App CFs).s2 = M"**"((App CFs).s2) by Def10;
A17:  len ((App CFe).s1) = len s1 = len ((App CFs).s2) by Def9;
    for i st 1<=i<=len s1 holds ((App CFe).s1).i=((App CFs).s2).i
    proof
      let i such that
A18:    1<=i<=len s1;
      len s1 = len CFe = len Ee by A4,Th47,CARD_1:def 7;
      then
A19:    i in dom CFe =dom Ee=dom E1  by A18,A3,Def5,FINSEQ_3:25,30;
      then
A20:    CFe.i = SignGen(fDD,A,Ee.i) by A4,Th80;
      then
A21:    dom (CFe.i) = dom fDD by Def11;
    len s2 = len CFs = len Es by A4,Th47,CARD_1:def 7;
      then
A22:    CFs.i = SignGen(fID,A,Es.i) by A4,Th80,A18,FINSEQ_3:25;
A23:    i in dom s1 by A18,FINSEQ_3:25;
      then A24: ((App CFe).s1).i = CFe.i.(s1.i) &
        ((App CFs).s2).i = CFs.i.(s2.i) by Def9;
A25:    s1.i in dom (CFe.i) & s2.i in dom (CFs.i) by A23,Th47;
      reconsider s1i=s1.i as Nat by Th47;
A26:    dom <*d1,d2*>={1,2} by FINSEQ_1:92;
      then
A27:    1 in dom <*d1,d2*> & 2 in dom <*d1,d2*> by TARSKI:def 2;
A28:    fDD = f^<*d1,d2*> by FINSEQ_1:32;
      then
A29:    fDD.(1+len f) = <*d1,d2*>.1 =d1 &
      fDD.(2+len f) = <*d1,d2*>.2 =d2 by A27,FINSEQ_1:def 7;
      dom <*I.d1,d2*>={1,2} by FINSEQ_1:92;
      then
A30:    1 in dom <*I.d1,d2*> & 2 in dom <*I.d1,d2*> by TARSKI:def 2;
A31:    fID = f^<*I.d1,d2*> by FINSEQ_1:32;
      then
A32:    fID.(1+len f) = <*I.d1,d2*>.1 =I.d1 &
      fID.(2+len f) = <*I.d1,d2*>.2 =d2 by A30,FINSEQ_1:def 7;
      per cases;
      suppose
A33:      1+len f in E1.i;
        then
A34:      Ee.i = (E1.i)\/{2+len f} & Es.i = (E1.i)\{1+len f} \/{2+len f}
          by A19,A3,Def4,Def5;
        per cases by A21,A28,A25,FINSEQ_1:25;
        suppose
A35:        s1.i in dom f;
          then
A36:        fDD.s1i =f.s1i & fID.s1i =f.s1i by A28,A31,FINSEQ_1:def 7;
          s1i <=len f by A35,FINSEQ_3:25;
          then
A37:        s1i <len f+1 by NAT_1:13;
          then
A38:        s1i <len f+1+1 by NAT_1:13;
          per cases;
          suppose
A39:          s1i in Ee.i;
            then
A40:          CFe.i.s1i = I.(fDD.s1i) by A20,A25,Def11;
            s1i in (E1.i)\{1+len f} by A37,A34,A38,A39,ZFMISC_1:56,136;
            then s1i in Es.i by A34,ZFMISC_1:136;
            hence thesis by A24,A36,A40,A25,A22,Def11;
          end;
          suppose
A41:          not s1.i in Ee.i;
            then
A42:          CFe.i.(s1.i) = fDD.(s1.i) by A20,A25,Def11;
            not s1i in (E1.i)\{1+len f} by A34,A41,ZFMISC_1:136;
            then not s1i in Es.i by A34,A38,ZFMISC_1:136;
            hence thesis by A24,A36,A42,A25,A22,Def11;
          end;
        end;
        suppose ex k st k in dom <*d1,d2*> & s1.i = len f+k;
          then consider k such that
A43:        k in dom <*d1,d2*> & s1.i = len f+k;
          per cases by A43,A26,TARSKI:def 2;
          suppose
A44:          k=1;
            then s1i in Ee.i by A33,A43,A34,XBOOLE_0:def 3;
            then
A45:          CFe.i.s1i = I.d1 by A29,A43,A44,A20,A25,Def11;
A46:          s1i <> 2+len f by A43,A44;
            not s1i in (E1.i)\{1+len f} by A43,A44,ZFMISC_1:56;
            then not s1i in Es.i by A46,A34,ZFMISC_1:136;
            hence thesis by A24,A45,A43,A44,A32,A25,A22,Def11;
          end;
          suppose
A47:          k=2;
            then s1i in Ee.i by A43,A34,ZFMISC_1:136;
            then
A48:          CFe.i.s1i = I.d2 by A29,A43,A47,A20,A25,Def11;
            s1i in Es.i by A34,A43,A47,ZFMISC_1:136;
            hence thesis by A24,A48,A43,A47,A32,A25,A22,Def11;
          end;
        end;
      end;
      suppose
A49:      not 1+len f in E1.i;
        then
A50:      Ee.i = E1.i & Es.i = (E1.i)\/{1+len f} by A19,A3,Def4,Def5;
        per cases by A21,A28,A25,FINSEQ_1:25;
        suppose
A51:        s1.i in dom f;
          then
A52:        fDD.s1i =f.s1i & fID.s1i =f.s1i by A28,A31,FINSEQ_1:def 7;
          s1i <=len f by A51,FINSEQ_3:25;
          then
A53:        s1i <len f+1 by NAT_1:13;
          per cases;
          suppose
A54:          s1i in Ee.i;
            then
A55:          CFe.i.s1i = I.(fDD.s1i) by A20,A25,Def11;
            s1i in Es.i by A50,A54,ZFMISC_1:136;
            hence thesis by A24,A52,A55,A25,A22,Def11;
          end;
          suppose
A56:          not s1.i in Ee.i;
            then
A57:          CFe.i.(s1.i) = fDD.(s1.i) by A20,A25,Def11;
            not s1i in Es.i by A50,A56,A53,ZFMISC_1:136;
            hence thesis by A24,A52,A57,A25,A22,Def11;
          end;
        end;
        suppose ex k st k in dom <*d1,d2*> & s1.i = len f+k;
          then consider k such that
A58:        k in dom <*d1,d2*> & s1.i = len f+k;
          per cases by A58,A26,TARSKI:def 2;
          suppose
A59:          k=1;
            then
A60:          CFe.i.s1i = d1 by A29,A49,A58,A50,A20,A25,Def11;
            s1i in Es.i by A50,A58,A59,ZFMISC_1:136;
            then CFs.i.s1i = I.(fID.s1i) by A25,A22,Def11;
            hence thesis by A24,A60,A1,A58,A59,A32,FINSEQOP:62;
          end;
          suppose
A61:          k=2;
            E1.i in rng E1 = F1 by A19,FUNCT_1:def 3,RLAFFIN3:def 1;
            then E1.i c= union F1 by ZFMISC_1:74;
            then
A62:          E1.i c= Seg (1+len f) by A2;
            1+len f < 1+len f+1 by NAT_1:13;
            then
A63:          not s1i in E1.i by A58,A61,A62,FINSEQ_1:1;
            then
A64:          CFe.i.s1i = d2 by A29,A58,A61,A50,A20,A25,Def11;
            s1i <> 1+len f by A58,A61;
            then not s1i in Es.i by A63,A50,ZFMISC_1:136;
            hence thesis by A24,A64,A58,A61,A32,A25,A22,Def11;
          end;
        end;
      end;
    end;
    then
A65: (App CFe).s1 = (App CFs).s2 by A17;
    thus A$$(S1,M"**"App CFe) = A.(A$$(S11,M"**"App CFe),(M"**"App CFe).s1)
      by A1,A13,A14,SETWOP_2:2
      .= A.(A$$(S22,M"**"App CFs),(M"**"App CFs).s2) by A8,A9,A15,A65,A16
      .= A$$(S2,M"**"App CFs) by A1,A13,A14,SETWOP_2:2;
  end;
A66:P[n] from NAT_1:sch 2(A5,A7);
  let S1 be Element of Fin dom App CFe,S2 be Element of Fin dom App CFs;
  P[card S1] by A66;
  hence thesis;
end;

theorem Th129:
   A is commutative associative having_a_unity having_an_inverseOp &
    M is associative commutative having_a_unity &
   M is_distributive_wrt A implies
for E1 be Enumeration of F1 st union F1 c= Seg (1+m)
    for Es be Enumeration of swap(F1,1+m,2+m) st
        Es = Swap(E1,1+m,2+m)
ex S be Subset of doms(m+2,card F1) st
    S = (len E1)-tuples_on {1+m,2+m} &
    for CFs be non-empty non empty FinSequence of D*,f,d1,d2 st
        len f=m &
        CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es
    for Sd be Element of Fin dom App CFs st Sd=S
  holds
(M "**" App (SignGenOp(f^<*A . ((the_inverseOp_wrt A).d1,d2)*>,A,F1) * E1))
    .(len E1|-> (1+ len f))
    = A$$(Sd,M"**"App CFs)
proof
  set I=the_inverseOp_wrt A;
  assume that A1:
  A is commutative associative having_a_unity having_an_inverseOp and
  A2: M is associative commutative having_a_unity and
  A3: M is_distributive_wrt A;
  let E1 be Enumeration of F1 such that
  A4:union F1 c= Seg (1+m);
  let Es be Enumeration of swap(F1,1+m,2+m) such that
A5:        Es = Swap(E1,1+m,2+m);
  1+m < 1+m+1 by NAT_1:13;
  then not 2+m in Seg (1+m) by FINSEQ_1:1;
  then reconsider Ee = Ext(E1,1+m,2+m) as
    Enumeration of Ext(F1,1+m,2+m) by A4,Th28;
  consider S be Subset of doms(m+2,card F1) such that
A6:    S = (len E1)-tuples_on {1+m,2+m} and
A7:    for CFe be non-empty non empty FinSequence of D*,f,d1,d2 st
        len f=m &
        CFe = SignGenOp(f^<*d1*>^<*d2*>,A, Ext(F1,1+len f,2+len f) ) * Ee
    for Sd be Element of Fin dom App CFe st Sd=S
  holds
(M "**" App (SignGenOp(f^<*A . (d1,d2)*>,A,F1) * E1)).(len E1|-> (1+ len f))
    = A$$(Sd,M"**"App CFe) by A1,A2,A3,A4,Th127;
  take S;
  thus S = (len E1)-tuples_on {1+m,2+m} by A6;
  let CFs be non-empty non empty FinSequence of D*,f,d1,d2 such that
A8: len f=m and
A9:  CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es;
  let Sd be Element of Fin dom App CFs such that
A10: Sd=S;
  set  CFe = SignGenOp(f^<*I.d1*>^<*d2*>,A, Ext(F1,1+len f,2+len f) ) * Ee;
A11: for x st x in dom CFe holds CFe.x is non empty
  proof
    let x;
    assume x in dom CFe;
    then CFe.x = SignGen(f^<*I.d1*>^<*d2*>,A,Ee.x) by A8,Th80;
    hence thesis;
  end;
  CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(F1,1+m,2+m) ) * Es by A8,A9;
  then
A12: len CFs = len Es =len E1 = card F1 by A5,CARD_1:def 7;
A13: F1 is non empty by A12;
  rng CFe c= D*;
  then reconsider CFe as non-empty non empty FinSequence of D*
   by A13,A8,A11,FINSEQ_1:def 4,FUNCT_1:def 9;
A14: len (f^<*I.d1*>^<*d2*>) = 1 + len (f^<*I.d1*>) by FINSEQ_2:16
  .= 1+(1 + len f) by FINSEQ_2:16;
A15: len (f^<*d1*>^<*d2*>) = 1 + len (f^<*d1*>) by FINSEQ_2:16
  .= 1+(1 + len f) by FINSEQ_2:16;
  1+len f < 1+len f+1 by NAT_1:13;
  then not 2+len f in Seg (1+len f) by FINSEQ_1:1;
  then card swap(F1,1+len f,2+len f) = card F1 = card Ext(F1,1+len f,2+len f)
  by A8,A4,Th10,Th11;
  then
A16: doms CFe = doms CFs by A8,A9,A14,A15,Th107;
A17: dom App CFs = doms(m+2,card F1) by A9,A8,A12,A15,Lm3;
  then reconsider Ss=S as Element of Fin dom App CFs by FINSUB_1:def 5;
  S c= dom App CFs by A17;
  then S c= doms CFe by A16,Def9;
  then S c= dom App CFe by Def9;
  then reconsider Se=S as Element of Fin dom App CFe by FINSUB_1:def 5;
A18:(M "**" App (SignGenOp(f^<*A . (I.d1,d2)*>,A,F1) * E1)).
  (len E1|-> (1+ len f))= A$$(Se,M"**"App CFe) by A8,A7;
  I.(I.d1)=d1 by A1,FINSEQOP:62;
  hence thesis by A8,A18,A10,A1,A4,A5,A9,Th128;
end;

theorem Th130:
   A is having_a_unity associative commutative having_an_inverseOp &
   M is commutative associative & len f <> 0
implies
  SignGenOp(f^<*d1*>^<*d2*>,M,A,Seg (2+len f)\{1}) =
    M.(SignGenOp(f^<*A.(d1,d2)*>,M,A,Seg (1+len f)\{1}),
     SignGenOp(f^<*A.((the_inverseOp_wrt A).d1,d2)*>,M,A,Seg (1+len f)\{1}))
proof
  set I=the_inverseOp_wrt A;
  assume that
A1:A is having_a_unity associative commutative having_an_inverseOp
  and
A2: M is commutative associative
  and
A3: len f<>0;
  set S = Seg (len f)\{1},F= bool S;
  set F1 = UNION(F,bool {len f+1});
  set F2 = UNION(F,bool {len f+1,len f+2});
  1<>1+len f by A3;
  then
A4: {1+len f}\{1} = {1+len f} by ZFMISC_1:14;
  1<>1+len f+1 by A3;
  then
A5: {2+len f}\{1} = {2+len f} by ZFMISC_1:14;
  Seg (len f+1) = Seg (len f) \/ {1+len f} by FINSEQ_1:9;
  then
A6: Seg (1+len f)\{1} = S \/ ({1+len f}) by A4,XBOOLE_1:42;
  then
A7: bool (Seg (1+len f)\{1}) = F1 by Th6;
  union F = Seg (len f)\{1} by ZFMISC_1:81;
  then union F c= Seg (len f) by XBOOLE_1:36;
  then union F c= dom f by FINSEQ_1:def 3;
  then consider E1,E2 be Enumeration of F1, E be Enumeration of F2 such that
A8: A "**" (SignGenOp(f^<*d1*>^<*d2*>,A,F2)*E) =
  (A"**" (SignGenOp(f^<*A.(d1,d2)*>,A,F1)*E1)) ^
  (A"**" (SignGenOp(f^<*A.(I.d1,d2)*>,A,F1)*E2)) by Th117,A1;
  set f1 = A"**" (SignGenOp(f^<*A.(d1,d2)*>,A,F1)*E1);
  set f2 = A"**" (SignGenOp(f^<*A.(I.d1,d2)*>,A,F1)*E2);
  rng f1 c= D;
  then reconsider G1= f1 as Function of dom f1,D by FUNCT_2:2;
  rng f2 c= D;
  then reconsider G2= f2 as Function of dom f2,D by FUNCT_2:2;
  rng (f1^f2) c= D;
  then reconsider G12= f1^f2 as Function of dom (f1^f2),D by FUNCT_2:2;
  dom (SignGenOp(f^<*A.(d1,d2)*>,A,F1)*E1) = dom f1 by FUNCT_2:def 1;
  then
A9: M$$([#]dom f1,G1)=
  SignGenOp(f^<*A.(d1,d2)*>,M,A,Seg (1+len f)\{1}) by A7,Def13,A2;
  dom (SignGenOp(f^<*A.(I.d1,d2)*>,A,F1)*E2) = dom f2 by FUNCT_2:def 1;
  then
A10: M$$([#]dom f2,G2)
  = SignGenOp(f^<*A.(I.d1,d2)*>,M,A,Seg (1+len f)\{1}) by A7,Def13,A2;
A11: dom (A "**" (SignGenOp(f^<*d1*>^<*d2*>,A,F2)*E)) =
  dom ((SignGenOp(f^<*d1*>^<*d2*>,A,F2)*E)) by FUNCT_2:def 1;
  Seg (1+len f+1) = Seg (1+len f) \/ {2+len f} by FINSEQ_1:9;
  then Seg (2+len f)\{1} = Seg (1+len f)\{1} \/ {2+len f} by A5,XBOOLE_1:42;
  then Seg (2+len f)\{1} = S \/ ({1+len f} \/ {2+len f}) by A6,XBOOLE_1:4;
  then Seg (2+len f)\{1} = S \/ ({1+len f,2+len f}) by ENUMSET1:1;
  then bool (Seg (2+len f)\{1}) = F2 by Th6;
  then SignGenOp(f^<*d1*>^<*d2*>,M,A,Seg (2+len f)\{1})=
  M$$ ([#]dom (f1^f2),G12) by Def13,A2,A11,A8;
  hence thesis by A2,Th64,A9,A10;
end;

theorem
   for E be Enumeration of F st union F c= Seg (1+len f)
      for Ee be Enumeration of Ext(F,1+len f,2+len f) st
          Ee = Ext(E,1+len f,2+len f)
       for CE1,CEE be FinSequence of D* st
          CE1 = SignGenOp(f^<*d*>,A,F) * E &
          CEE = SignGenOp(f^<*d1*>^<*d2*>,A,Ext(F,1+len f,2+len f)) * Ee
       for s be FinSequence st s in doms CE1 & rng s c= dom f holds
           s in doms CEE & (App CE1).s = (App CEE).s
proof
  set I=the_inverseOp_wrt A;
  let E be Enumeration of F such that
A1:union F c= Seg (1+len f);
  set EF=Ext(F,1+len f,2+len f);
  let Ee be Enumeration of EF such that
A2: Ee = Ext(E,1+len f,2+len f);
  let CE1,CEE be FinSequence of D* such that
A3: CE1 = SignGenOp(f^<*d*>,A,F) * E &
  CEE = SignGenOp(f^<*d1*>^<*d2*>,A,EF) * Ee;
  let s be FinSequence such that
A4: s in doms CE1 & rng s c= dom f;
A5: 1+len f < 1+len f+1  by NAT_1:13;
  then
A6: not 2+len f in union F by A1,FINSEQ_1:1;
A7: len (f^<*d1*>^<*d2*>) = len (f^<*d1*>)+1 by FINSEQ_2:16
  .=len f+1+1 by FINSEQ_2:16;
  len (f^<*d*>) = len f+1  by FINSEQ_2:16;
  then
A8: doms CE1 c= doms CEE by A3,A5,A6,A7,Th10,Th107;
  hence  s in doms CEE by A4;
A9:len E= len CE1 = len s = len CEE  by A3,A8,Th47,A4,CARD_1:def 7;
A10:len ((App CEE).s) = len s = len ((App CE1).s) by A8,A4,Def9;
  for i st 1<= i <= len s holds ((App CE1).s).i = ((App CEE).s).i
  proof
    let i such that
A11: 1<= i <= len s;
    reconsider si=s.i as Nat by A4;
A12: i in dom CE1 & i in dom CEE & i in dom E & i in dom s
    by A11,A9,FINSEQ_3:25;
    then
A13: ((App CE1).s).i = CE1.i.si & CE1.i = SignGen(f^<*d*>,A,E.i) &
    ((App CEE).s).i = CEE.i.si & CEE.i = SignGen(f^<*d1*>^<*d2*>,A,Ee.i)
    by A3,A4,A8,Def9,Th80;
A14: si in rng s by A12,FUNCT_1:def 3;
    then
A15:  si <= len f < len f+2 by A4,FINSEQ_3:25,NAT_1:16;
    dom f c= dom (f^<*d*>) by FINSEQ_1:26;
    then si in dom (f^<*d*>) by A14,A4;
    then
A16:si in dom SignGen(f^<*d*>,A,E.i) by Def11;
A17: f^<*d1*>^<*d2*> = f^<*d1,d2*> by FINSEQ_1:32;
    dom f c= dom (f^<*d1,d2*>) by FINSEQ_1:26;
    then si in dom (f^<*d1*>^<*d2*>) by A14,A4,A17;
    then
A18:si in dom SignGen(f^<*d1*>^<*d2*>,A,Ee.i) by Def11;
    per cases;
    suppose
A19:  si in E.i;
      then
A20:  SignGen(f^<*d*>,A,E.i).si = I.((f^<*d*>).si) by A16,Def11
      .= I.(f.si) by A14,A4,FINSEQ_1:def 7;
      per cases;
      suppose 1+len f in E.i;
        then Ee.i = (E.i)\/{2+len f} by A2,A12,Def5;
        then si in Ee.i by A19,ZFMISC_1:136;
        then SignGen(f^<*d1*>^<*d2*>,A,Ee.i).si =
        I.((f^<*d1,d2*>).si) by A17,A18,Def11
        .= I.(f.si) by A14,A4,FINSEQ_1:def 7;
        hence thesis by A20,A13;
      end;
      suppose not 1+len f in E.i;
        then si in Ee.i by A19,A2,A12,Def5;
        then SignGen(f^<*d1*>^<*d2*>,A,Ee.i).si =
        I.((f^<*d1,d2*>).si) by A17,A18,Def11
        .= I.(f.si) by A14,A4,FINSEQ_1:def 7;
        hence thesis by A20,A13;
      end;
    end;
    suppose
A21:  not si in E.i;
      then
A22:  SignGen(f^<*d*>,A,E.i).si = (f^<*d*>).si by A16,Def11
      .= f.si by A14,A4,FINSEQ_1:def 7;
      per cases;
      suppose 1+len f in E.i;
        then Ee.i = (E.i)\/{2+len f} by A2,A12,Def5;
        then not si in Ee.i by A15,A21,ZFMISC_1:136;
        then SignGen(f^<*d1*>^<*d2*>,A,Ee.i).si =
        (f^<*d1,d2*>).si by A17,A18,Def11
        .= f.si by A14,A4,FINSEQ_1:def 7;
        hence thesis by A22,A13;
      end;
      suppose not 1+len f in E.i;
        then not si in Ee.i by A21,A2,A12,Def5;
        then SignGen(f^<*d1*>^<*d2*>,A,Ee.i).si =
        (f^<*d1,d2*>).si by A17,A18,Def11
        .= f.si by A14,A4,FINSEQ_1:def 7;
        hence thesis by A22,A13;
      end;
    end;
  end;
  hence thesis by A10;
end;

theorem
   for E be Enumeration of F st union F c= Seg (1+len f)
      for Es be Enumeration of swap(F,1+len f,2+len f) st
          Es = Swap(E,1+len f,2+len f)
       for CE1,CES be FinSequence of D* st
          CE1 = SignGenOp(f^<*d*>,A,F) * E &
          CES = SignGenOp(f^<*d1*>^<*d2*>,A,swap(F,1+len f,2+len f)) * Es
       for s be FinSequence st s in doms CE1 & rng s c= dom f holds
           s in doms CES & (App CE1).s = (App CES).s
proof
  set I=the_inverseOp_wrt A;
  let E be Enumeration of F such that
A1:union F c= Seg (1+len f);
  set EF=swap(F,1+len f,2+len f);
  let Ee be Enumeration of EF such that
A2:Ee = Swap(E,1+len f,2+len f);
  let CE1,CEE be FinSequence of D* such that
A3:  CE1 = SignGenOp(f^<*d*>,A,F) * E &
     CEE = SignGenOp(f^<*d1*>^<*d2*>,A,EF) * Ee;
  let s be FinSequence such that
A4: s in doms CE1 & rng s c= dom f;
A5: 1+len f < 1+len f+1  by NAT_1:13;
  then
A6: not 2+len f in union F by A1,FINSEQ_1:1;
A7: len (f^<*d1*>^<*d2*>) = len (f^<*d1*>)+1 by FINSEQ_2:16
  .=len f+1+1 by FINSEQ_2:16;
  len (f^<*d*>) = len f+1  by FINSEQ_2:16;
  then
A8: doms CE1 c= doms CEE by A3,A5,A6,A7,Th11,Th107;
  hence s in doms CEE by A4;
A9:len E= len CE1 = len s = len CEE  by A3,A8,Th47,A4,CARD_1:def 7;
A10:len ((App CEE).s) = len s = len ((App CE1).s) by A8,A4,Def9;
  for i st 1<= i <= len s holds ((App CE1).s).i = ((App CEE).s).i
  proof
    let i such that
A11: 1<= i <= len s;
    reconsider si=s.i as Nat by A4;
A12: i in dom CE1 & i in dom CEE & i in dom E & i in dom s
    by A11,A9,FINSEQ_3:25;
    then
A13: ((App CE1).s).i = CE1.i.si & CE1.i = SignGen(f^<*d*>,A,E.i) &
    ((App CEE).s).i = CEE.i.si & CEE.i = SignGen(f^<*d1*>^<*d2*>,A,Ee.i)
    by A3,A4,A8,Def9,Th80;
A14: si in rng s by A12,FUNCT_1:def 3;
    then
A15:  si <= len f < len f+2 & len f < len f+1 by A4,FINSEQ_3:25,NAT_1:16;
    dom f c= dom (f^<*d*>) by FINSEQ_1:26;
    then si in dom (f^<*d*>) by A14,A4;
    then
A16:si in dom SignGen(f^<*d*>,A,E.i) by Def11;
A17: f^<*d1*>^<*d2*> = f^<*d1,d2*> by FINSEQ_1:32;
    dom f c= dom (f^<*d1,d2*>) by FINSEQ_1:26;
    then si in dom (f^<*d1*>^<*d2*>) by A14,A4,A17;
    then
A18:si in dom SignGen(f^<*d1*>^<*d2*>,A,Ee.i) by Def11;
    per cases;
    suppose
A19:    si in E.i;
      then
A20:    SignGen(f^<*d*>,A,E.i).si = I.((f^<*d*>).si) by A16,Def11
      .= I.(f.si) by A14,A4,FINSEQ_1:def 7;
      per cases;
      suppose 1+len f in E.i;
        then
A21:      Ee.i = (E.i)\{1+len f}\/{2+len f} by A2,A12,Def4;
        si in (E.i)\{1+len f} by A15,A19,ZFMISC_1:56;
        then si in Ee.i by A21,ZFMISC_1:136;
        then SignGen(f^<*d1*>^<*d2*>,A,Ee.i).si = I.((f^<*d1,d2*>).si)
        by A17,A18,Def11
        .= I.(f.si) by A14,A4,FINSEQ_1:def 7;
        hence thesis by A20,A13;
      end;
      suppose not 1+len f in E.i;
        then Ee.i = (E.i)\/{1+len f} by A2,A12,Def4;
        then si in Ee.i by A19,XBOOLE_0:def 3;
        then SignGen(f^<*d1*>^<*d2*>,A,Ee.i).si = I.((f^<*d1,d2*>).si)
        by A17,A18,Def11
        .= I.(f.si) by A14,A4,FINSEQ_1:def 7;
        hence thesis by A20,A13;
      end;
    end;
    suppose
A22:  not si in E.i;
      then
A23:  SignGen(f^<*d*>,A,E.i).si = (f^<*d*>).si by A16,Def11
      .= f.si by A14,A4,FINSEQ_1:def 7;
      per cases;
      suppose 1+len f in E.i;
        then
A24:    Ee.i = (E.i)\{1+len f}\/{2+len f} by A2,A12,Def4;
        not si in (E.i)\{1+len f} by A22;
        then not si in Ee.i by A24,A15,ZFMISC_1:136;
        then SignGen(f^<*d1*>^<*d2*>,A,Ee.i).si =
        (f^<*d1,d2*>).si by A17,A18,Def11 .= f.si by A14,A4,FINSEQ_1:def 7;
        hence thesis by A23,A13;
      end;
      suppose not 1+len f in E.i;
        then Ee.i = (E.i)\/{1+len f} by A2,A12,Def4;
        then not si in Ee.i by A15,A22,ZFMISC_1:136;
        then SignGen(f^<*d1*>^<*d2*>,A,Ee.i).si = (f^<*d1,d2*>).si
        by A17,A18,Def11
        .= f.si by A14,A4,FINSEQ_1:def 7;
        hence thesis by A23,A13;
      end;
    end;
  end;
  hence thesis by A10;
end;

theorem Th133:
  for E1 be Enumeration of F1
    for CE1,CE2 be D*-valued FinSequence st
      CE1 = SignGenOp(f^<*d1*>,A,F1) * E1 &
      CE2 = SignGenOp(f^<*d2*>,A,F1) * E1
    for s be FinSequence st s in doms CE1 & not 1+len f in rng s holds
      s in doms CE2 & (App CE1).s = (App CE2).s
proof
  set I=the_inverseOp_wrt A;
  let E1 be Enumeration of F1;
  let CE1,CE2 be D*-valued FinSequence such that
A1: CE1 = SignGenOp(f^<*d1*>,A,F1) * E1 &
    CE2 = SignGenOp(f^<*d2*>,A,F1) * E1;
  let s be FinSequence such that
A2: s in doms CE1 & not 1+len f in rng s;
A3: len (f^<*d1*>) = len f+1 by FINSEQ_2:16;
  len (f^<*d2*>) = len f+1  by FINSEQ_2:16;
  then
A4: doms CE1 c= doms CE2 by A1,A3,Th107;
  hence s in doms CE2 by A2;
A5: len CE1 = len s = len CE2  by A4,Th47,A2;
A6:len ((App CE2).s) = len s = len ((App CE1).s) by A4,A2,Def9;
  for i st 1<= i <= len s holds ((App CE1).s).i = ((App CE2).s).i
  proof
    let i such that
A7: 1<= i <= len s;
    reconsider si=s.i as Nat by A2;
A8: i in dom CE1 & i in dom CE2 & i in dom s by A7,A5,FINSEQ_3:25;
    then
A9: ((App CE1).s).i = CE1.i.si & CE1.i = SignGen(f^<*d1*>,A,E1.i) &
    ((App CE2).s).i = CE2.i.si & CE2.i = SignGen(f^<*d2*>,A,E1.i)
    by A1,A2,A4,Def9,Th80;
A10: si <> 1+len f by A2,A8,FUNCT_1:def 3;
    si in dom (CE1.i) by A2,A8,Th47;
    then si in dom (f^<*d1*>) by A9,Def11;
    then
A11: 1<=si <= len f+1 by A3,FINSEQ_3:25;
    then si < len f+1 by A10,XXREAL_0:1;
    then
A12: si <= len f by NAT_1:13;
    then
A13: si in dom f by A11,FINSEQ_3:25;
    dom f c= dom (f^<*d1*>) & dom f c= dom (f^<*d2*>) by FINSEQ_1:26;
    then si in dom (f^<*d1*>) & si in dom (f^<*d2*>) by A12,A11,FINSEQ_3:25;
    then
A14: si in dom SignGen(f^<*d1*>,A,E1.i) & si in dom SignGen(f^<*d2*>,A,E1.i)
    by Def11;
    per cases;
    suppose
A15: si in E1.i;
      then
A16:  SignGen(f^<*d1*>,A,E1.i).si = I.((f^<*d1*>).si) by A14,Def11
      .= I.(f.si) by A13,FINSEQ_1:def 7;
      SignGen(f^<*d2*>,A,E1.i).si = I.((f^<*d2*>).si) by A15,A14,Def11
      .= I.(f.si) by A13,FINSEQ_1:def 7;
      hence thesis by A16,A9;
    end;
    suppose
A17:  not si in E1.i;
      then
A18:  SignGen(f^<*d1*>,A,E1.i).si = (f^<*d1*>).si by A14,Def11
      .= f.si by A13,FINSEQ_1:def 7;
      SignGen(f^<*d2*>,A,E1.i).si = (f^<*d2*>).si by A17,A14,Def11
      .= f.si by A13,FINSEQ_1:def 7;
      hence thesis by A18,A9;
    end;
  end;
  hence thesis by A6;
end;

theorem Th134:
  for s be FinSequence st card (s"{y})=k
    ex p be Permutation of dom s,s1 be FinSequence st
      s*p = s1^(k|->y) & not y in rng s1
proof
  let s be FinSequence such that
A1: card (s"{y})=k;
  per cases;
  suppose
A2: k=0;
    take p=id dom s,s;
    s * p = s & k|->y ={}  by A2,RELAT_1:52;
    hence s*p = s^(k|->y);
    assume y in rng s;
    then consider x such that
A3: x in dom s & s.x =y by FUNCT_1:def 3;
    s.x in {y} by A3,TARSKI:def 1;
    then x in s"{y} by A3,FUNCT_1:def 7;
    hence thesis by A2,A1;
  end;
  suppose k<>0;
    then s"{y} is non empty by A1;
    then consider x such that
A4: x in s"{y};
    x in dom s & s.x in {y} by A4,FUNCT_1:def 7;
    then y = s.x in rng s by FUNCT_1:def 3,TARSKI:def 1;
    then reconsider L={y} as Subset of rng s by ZFMISC_1:31;
    L``=L;
    then consider p be Permutation of dom s such that
A5: (s-L)^(s-L`) = s*p by FINSEQ_3:115;
    take p,s1 = s-L;
    L` = (rng s) \L by SUBSET_1:def 4;
    then s"(L`) = s"(rng s) \ s"(L) by FUNCT_1:69;
    then s"(L`) = (dom s) \ s"(L) by RELAT_1:134;
    then card (s"(L`)) = card (dom s) -card  (s"(L)) by CARD_2:44,RELAT_1:132;
    then card (s"(L`)) = card (Seg len s) -card  (s"(L)) by FINSEQ_1:def 3;
    then
A6:len (s-L`) = len s - (len s - k) by A1,FINSEQ_3:59;
    rng (s-L`) = rng s \ L` by FINSEQ_3:65
    .= rng s \ (rng s \L) by SUBSET_1:def 4
    .= rng s /\L by XBOOLE_1:48
    .= L by XBOOLE_1:28;
    then s-L` = dom (s-L`) --> y by FUNCOP_1:9;
    hence s*p = s1^(k|->y) by A5,A6,FINSEQ_1:def 3;
    rng (s-L) = (rng s) \L & y in {y} by FINSEQ_3:65,TARSKI:def 1;
    hence thesis by XBOOLE_0:def 5;
  end;
end;

theorem Th135:
  for f be FinSequence of D st
    A is commutative associative having_a_unity having_an_inverseOp &
    M is associative commutative having_a_unity &
    M is_distributive_wrt A & n in dom f holds
  for E be Enumeration of F
    for D be Subset of dom E st (for i holds i in D iff n in E.i) holds
      (card D is even implies
        (M "**" (App (SignGenOp(f,A,F) * E))).(len E |-> n) =
         M "**" (len E |-> f/.n)) &
       (card D is odd implies
         (M "**" (App (SignGenOp(f,A,F) * E))).(len E |-> n) =
         (the_inverseOp_wrt A).(M "**" (len E |-> f/.n)))
proof
  let f be FinSequence of D;
  assume that
A1: A is commutative associative having_a_unity having_an_inverseOp and
A2: M is associative commutative having_a_unity and
A3:M is_distributive_wrt A and
A4:n in dom f;
  set IA=the_inverseOp_wrt A;
  defpred P[Nat] means
  for F st card F=$1 for E be Enumeration of F
  for I be Subset of dom E st (for i holds i in I iff n in E.i) holds
  (card I is even implies
  (M "**" (App (SignGenOp(f,A,F) * E))).(len E |-> n) =
  M "**" (len E |-> f/.n)) &
  (card I is odd implies
  (M "**" (App (SignGenOp(f,A,F) * E))).(len E |-> n) =
  IA.(M "**" (len E |-> f/.n)));
A5: P[0]
  proof
    let F such that
A6: card F=0;
    let E be Enumeration of F;
    let I be Subset of dom E such that  i in I iff n in E.i;
A7: F={} by A6;
A8: dom E={} by A6;
A9:(M "**" (App (SignGenOp(f,A,F) * E))).(len E |-> n) = the_unity_wrt M
    by Th102,A4,A2,A7,Th118;
    len E |-> f/.n = {}=<*>D by A6;
    hence thesis by A8,A9,A2,FINSOP_1:10;
  end;
A10:P[j] implies P[j+1]
  proof
    assume
A11: P[j];
    let F such that
A12: card F=j+1;
    let E be Enumeration of F;
    let I be Subset of dom E such that
A13: (for i holds i in I iff n in E.i);
    set Fj=F\{E.len E},F1={E.len E};
A14:len E= card F by CARD_1:def 7;
    then reconsider Ej=E|j as Enumeration of Fj by Th96,A12;
    reconsider E1 = <*E.len E*> as Enumeration of F1 by Th96,A12,A14;
A15:F = Fj \/ F1 by Th96,A12,A14;
A16: j < j+1 by NAT_1:13;
A17: len Ej =j by A12,CARD_1:def 7;
    then dom Ej = Seg j by FINSEQ_1:def 3;
    then
A18: dom E = Seg (j+1)= (dom Ej)\/{j+1} by A12,A14,FINSEQ_1:9,def 3;
    I\{j+1} c= (dom E)\{j+1} by XBOOLE_1:33;
    then I\{j+1} c= (dom Ej)\{j+1} c= (dom Ej) by A18,XBOOLE_1:36,40;
    then reconsider Ij = I\{j+1} as Subset of dom Ej by XBOOLE_1:1;
A19: for i holds i in Ij iff n in Ej.i
    proof
      let i;
      thus i in Ij implies n in Ej.i
      proof
        assume
A20:    i in Ij;
        then n in E.i by A13,ZFMISC_1:56;
        hence thesis by A20,FUNCT_1:47;
      end;
      assume
A21:  n in Ej.i;
      then i in dom Ej by FUNCT_1:def 2;
      then n in E.i & i <=j by A21,A17,FINSEQ_3:25,FUNCT_1:47;
      hence i in Ij by A13,A16,ZFMISC_1:56;
    end;
    card Fj = j by A17,CARD_1:def 7;
    then
A22:(card Ij is even implies
    (M "**" (App (SignGenOp(f,A,Fj) * Ej))).(len Ej |-> n) =
    M "**" (len Ej |-> f/.n)) &
    (not card Ij is even implies
    (M "**" (App (SignGenOp(f,A,Fj) * Ej))).(len Ej |-> n) =
    (the_inverseOp_wrt A).(M "**" (len Ej |-> f/.n)))
    by A11,A19;
    set En = (len E) |-> n,E1n = (len E1) |-> n, Ejn = (len Ej) |-> n;
A23: Ejn in doms (SignGenOp(f,A,Fj) * Ej) &
    E1n in doms (SignGenOp(f,A,F1) * E1) &
    En in doms (SignGenOp(f,A,F) * E) by A4,Th102;
    then
A24: En in dom App (SignGenOp(f,A,F) * E) &
    Ejn in dom App (SignGenOp(f,A,Fj) * Ej) &
    E1n in doms (SignGenOp(f,A,F1) * E1) by Def9;
A25: len E1=1 by FINSEQ_1:40;
    then
A26: En = Ejn^E1n by A12,A14,A17,FINSEQ_2:123;
    E = Ej^E1 by A14,A12,FINSEQ_3:55;
    then SignGenOp(f,A,F) * E =
      (SignGenOp(f,A,Fj) * Ej)^(SignGenOp(f,A,F1) * E1) by A15,Th81;
    then
A27: (App(SignGenOp(f,A,F) * E)).En =
    ((App (SignGenOp(f,A,Fj) * Ej)).Ejn) ^ ((App (SignGenOp(f,A,F1) * E1)).E1n)
    by A23,Th61,A26;
A28: n in dom SignGen(f,A,E.len E) by A4,Def11;
    SignGen(f,A,E.len E).n in rng SignGen(f,A,E.len E) by A28,FUNCT_1:def 3;
    then reconsider cc = SignGen(f,A,E.len E).n as Element of D;
    SignGenOp(f,A,F1) * E1 = <* SignGen(f,A,E.len E) *> & E1n = <*n*>
    by Th78,A25,FINSEQ_2:59;
    then (App (SignGenOp(f,A,F1) * E1)).E1n = <* cc *> by A28,Th60;
    then
A29: M"**"((App (SignGenOp(f,A,F1) * E1)).E1n) = cc by FINSOP_1:11;
A30: (M "**" App(SignGenOp(f,A,F) * E)).En =
    M"**" ((App(SignGenOp(f,A,F) * E)).En) by A24,Def10
    .= M. (M"**"((App (SignGenOp(f,A,Fj) * Ej)).Ejn),
    M"**"((App (SignGenOp(f,A,F1) * E1)).E1n))
    by A2,A27,FINSOP_1:5
    .= M. ( (M"**"(App (SignGenOp(f,A,Fj) * Ej))).Ejn, cc)
    by A24,Def10,A29;
A31:len E1 |-> f/.n = <*f/.n*> by A25,FINSEQ_2:59;
A32: (len E |-> f/.n) = (len Ej |-> f/.n)^(len E1 |-> f/.n)
    by A12,A14,A17,A25,FINSEQ_2:123;
A33: f.n = f/.n by A4,PARTFUN1:def 6;
    per cases;
    suppose
A34:  n in E.len E;
A35:  not j+1 in Ij by ZFMISC_1:56;
      I = Ij \/{j+1} by A34,A13,A12,A14,ZFMISC_1:116;
      then
A36:  card I = card Ij+1 by A35,CARD_2:41;
      thus card I is even implies
      (M "**" (App (SignGenOp(f,A,F) * E))).En = M "**" (len E |-> f/.n)
      proof
        assume card I is even;
        hence (M "**" App(SignGenOp(f,A,F) * E)).En
        = M. (IA.(M "**" (len Ej |-> f/.n)),IA.(f/.n))
        by A34,A33,A28,Def11,A30,A36,A22
        .= IA. (M. (IA.(M "**" (len Ej |-> f/.n)),f/.n)) by A1,A3,FINSEQOP:67
        .= IA.(IA. (M. (M "**" (len Ej |-> f/.n),f/.n))) by A1,A3,FINSEQOP:67
        .= M. (M "**" (len Ej |-> f/.n),f/.n) by A1,FINSEQOP:62
        .= M"**" (len E |-> f/.n) by A32,A31,A2,FINSOP_1:4;
      end;
      assume not card I is even;
      hence (M "**" App(SignGenOp(f,A,F) * E)).En
      = M. (M "**" (len Ej |-> f/.n),IA.(f/.n))
      by A34,A33,A28,Def11,A30,A36,A22
      .= IA. (M. (M "**" (len Ej |-> f/.n),f/.n)) by A1,A3,FINSEQOP:67
      .= IA.(M"**" (len E |-> f/.n)) by A32,A31,A2,FINSOP_1:4;
    end;
    suppose
A37:  not n in E.len E;
      thus card I is even implies
      (M "**" (App (SignGenOp(f,A,F) * E))).En = M "**" (len E |-> f/.n)
      proof
        assume card I is even;
        hence (M "**" App(SignGenOp(f,A,F) * E)).En =
        M. (M "**" (len Ej |-> f/.n),f/.n)
        by A37,A33,A28,Def11,A30,A13,A12,A14,A22,ZFMISC_1:57
        .= M"**" (len E |-> f/.n) by A32,A31,A2,FINSOP_1:4;
      end;
      assume not card I is even;
      hence (M "**" App(SignGenOp(f,A,F) * E)).En =
      M. (IA.(M "**" (len Ej |-> f/.n)),f/.n)
      by A37,A33,A28,Def11,A13,A12,A14,A30,A22,ZFMISC_1:57
      .= IA. (M. (M "**" (len Ej |-> f/.n),f/.n)) by A1,A3,FINSEQOP:67
      .= IA.(M"**" (len E |-> f/.n)) by A32,A31,A2,FINSOP_1:4;
    end;
  end;
  P[j] from NAT_1:sch 2(A5,A10);
  hence thesis;
end;

theorem Th136:
    M is commutative associative having_a_unity &
    A is commutative associative having_a_unity having_an_inverseOp &
    M is_distributive_wrt A  implies
for f be FinSequence of D
  for E1 be Enumeration of F1, E2 be Enumeration of F2
    for s1,s2 be FinSequence st
       s1 in doms (SignGenOp(f^<*d1*>,A,F1) * E1) &
       s2 in doms (SignGenOp(f^<*d2*>,A,F2) * E2) &
       card (s1"{1+len f}) = card (s2"{1+len f})
holds
  M.((M "**" App (SignGenOp(f^<*d1*>,A,F1) * E1)).s1,
   (M "**" App (SignGenOp(f^<*d2*>,A,F2) * E2)).s2) =
  M.((M "**" App (SignGenOp(f^<*d2*>,A,F1) * E1)).s1,
   (M "**" App (SignGenOp(f^<*d1*>,A,F2) * E2)).s2)
proof
  set I=the_inverseOp_wrt A;
  assume that
A1:M is commutative associative having_a_unity and
A2: A is commutative associative having_a_unity having_an_inverseOp and
A3: M is_distributive_wrt A;
  let f be FinSequence of D;
  let E1 be Enumeration of F1, E2 be Enumeration of F2;
  set L=1+len f;
  let s1,s2 be FinSequence such that
A4:s1 in doms (SignGenOp(f^<*d1*>,A,F1) * E1) &
  s2 in doms (SignGenOp(f^<*d2*>,A,F2) * E2) & card (s1"{L}) = card (s2"{L});
A5: len (f^<*d1*>)=L =len (f^<*d2*>) by FINSEQ_2:16;
  then
A6: doms (SignGenOp(f^<*d1*>,A,F1) * E1) =
  doms (SignGenOp(f^<*d2*>,A,F1) * E1) &
  doms (SignGenOp(f^<*d2*>,A,F2) * E2) =
  doms (SignGenOp(f^<*d1*>,A,F2) * E2) by Th107;
  set k=card (s1"{L});
A7:len s1=len (SignGenOp(f^<*d1*>,A,F1) * E1) =
  len E1 & len s2=len (SignGenOp(f^<*d2*>,A,F2) * E2) =len E2
  by Th47,A4,CARD_1:def 7;
  then
A8:dom s1 =dom E1 & dom s2 =dom E2 by FINSEQ_3:29;
  set kL=k|->L;
A9: len kL = k;
  consider p1 be Permutation of dom s1,S1 be FinSequence such that
A10: s1*p1 = S1^kL & not L in rng S1 by Th134;
  reconsider E1p=E1*p1 as Enumeration of F1 by A8,Th109;
A11:len E1p = card F1 = len E1 by CARD_1:def 7;
  dom p1 = dom s1 = rng p1 by FUNCT_2:52,def 3;
  then
A12:len S1+k=len (S1^kL) = len s1
  by A10,A9,FINSEQ_1:22,FINSEQ_3:29,RELAT_1:27;
  set e1pS = E1p|len S1;
  consider e1pK be FinSequence such that
A13: E1p = e1pS ^ e1pK by FINSEQ_1:80;
  set F1S = rng e1pS, F1K= rng e1pK;
A14: len e1pS = len S1 by A7,A11,A12,FINSEQ_1:59,NAT_1:11;
A15: len E1p = len e1pS +len  e1pK by A13,FINSEQ_1:22;
A16: e1pS is one-to-one & e1pK is one-to-one & F1S misses F1K
  by A13,FINSEQ_3:91;
  then reconsider E1pS=e1pS as Enumeration of F1S by RLAFFIN3:def 1;
  reconsider E1pK=e1pK as Enumeration of F1K by A16,RLAFFIN3:def 1;
  consider p2 be Permutation of dom s2,S2 be FinSequence such that
A17: s2*p2 = S2^kL & not L in rng S2 by A4,Th134;
  reconsider E2p=E2*p2 as Enumeration of F2 by A8,Th109;
A18:len E2p = card F2 = len E2 by CARD_1:def 7;
  dom p2 = dom s2 = rng p2 by FUNCT_2:52,def 3;
  then
A19: len S2+k=len (S2^kL) = len s2
  by A17,A9,FINSEQ_1:22,FINSEQ_3:29,RELAT_1:27;
  set e2pS = E2p|len S2;
A20:len e2pS = len S2 by A7,A18,A19,FINSEQ_1:59,NAT_1:11;
  consider e2pK be FinSequence such that
A21: E2p = e2pS ^ e2pK by FINSEQ_1:80;
  set F2S = rng e2pS, F2K= rng e2pK;
A22: len E2p = len e2pS +len  e2pK by A21,FINSEQ_1:22;
A23: e2pS is one-to-one & e2pK is one-to-one & F2S misses F2K
  by A21,FINSEQ_3:91;
  then reconsider E2pS=e2pS as Enumeration of F2S by RLAFFIN3:def 1;
  reconsider E2pK=e2pK as Enumeration of F2K by A23,RLAFFIN3:def 1;
A24: F1 = rng E1p = F1S\/F1K & F2 = rng E2p = F2S\/F2K
  by A13,A21,FINSEQ_1:31,RLAFFIN3:def 1;
  then
A25: SignGenOp(f^<*d1*>,A,F1) * E1p =
  (SignGenOp(f^<*d1*>,A,F1S) * E1pS)^(SignGenOp(f^<*d1*>,A,F1K) * E1pK) &
  SignGenOp(f^<*d2*>,A,F2) * E2p =
  (SignGenOp(f^<*d2*>,A,F2S) * E2pS)^(SignGenOp(f^<*d2*>,A,F2K) * E2pK)
  by A13,A21,Th81;
A26: SignGenOp(f^<*d2*>,A,F1) * E1p =
  (SignGenOp(f^<*d2*>,A,F1S) * E1pS)^(SignGenOp(f^<*d2*>,A,F1K) * E1pK) &
  SignGenOp(f^<*d1*>,A,F2) * E2p =
  (SignGenOp(f^<*d1*>,A,F2S) * E2pS)^(SignGenOp(f^<*d1*>,A,F2K) * E2pK)
  by A13,A21,Th81,A24;
A27: s1*p1 in doms (SignGenOp(f^<*d1*>,A,F1) * E1p) &
  s2*p2 in doms (SignGenOp(f^<*d2*>,A,F2) * E2p) by A4,A8,Th110;
  then
A28: s1*p1 in dom (App (SignGenOp(f^<*d1*>,A,F1) * E1p)) &
  s2*p2 in dom (App (SignGenOp(f^<*d2*>,A,F2) * E2p)) by Def9;
A29: s1*p1 in doms (SignGenOp(f^<*d2*>,A,F1) * E1p) &
  s2*p2 in doms (SignGenOp(f^<*d1*>,A,F2) * E2p) by A4,A8,Th110,A6;
  then
A30: s1*p1 in dom (App (SignGenOp(f^<*d2*>,A,F1) * E1p)) &
  s2*p2 in dom (App (SignGenOp(f^<*d1*>,A,F2) * E2p)) by Def9;
  len (SignGenOp(f^<*d1*>,A,F1K) * E1pK) = len kL
  by A15,A7,A11,A14,A12,CARD_1:def 7;
  then
A31: S1 in doms (SignGenOp(f^<*d1*>,A,F1S) * E1pS) &
  kL in doms (SignGenOp(f^<*d1*>,A,F1K) * E1pK)
  by A27,Th50,A10,A25;
  len (SignGenOp(f^<*d2*>,A,F1K) * E1pK) = len kL by A15,A7,A11,A14,A12,
CARD_1:def 7; then
A32: S1 in doms (SignGenOp(f^<*d2*>,A,F1S) * E1pS) &
  kL in doms (SignGenOp(f^<*d2*>,A,F1K) * E1pK) by A29,Th50,A10,A26;
  s2*p2 in doms (SignGenOp(f^<*d2*>,A,F2) * E2p) by A4,A8,Th110;
  then
A33: s2*p2 in dom (App (SignGenOp(f^<*d2*>,A,F2) * E2p)) by Def9;
  len (SignGenOp(f^<*d2*>,A,F2K) * E2pK) = len kL
  by A22,A7,A20,A19,A18,CARD_1:def 7;
  then
A34: S2 in doms (SignGenOp(f^<*d2*>,A,F2S) * E2pS) &
  kL in doms (SignGenOp(f^<*d2*>,A,F2K) * E2pK)
  by A27,Th50,A17,A25;
  s2*p2 in doms (SignGenOp(f^<*d1*>,A,F2) * E2p) by A6,A4,A8,Th110;
  then
A35: s2*p2 in dom (App (SignGenOp(f^<*d1*>,A,F2) * E2p)) by Def9;
  len (SignGenOp(f^<*d1*>,A,F2K) * E2pK) = len kL
  by A22,A7,A20,A19,A18,CARD_1:def 7;
  then
A36: S2 in doms (SignGenOp(f^<*d1*>,A,F2S) * E2pS) &
  kL in doms (SignGenOp(f^<*d1*>,A,F2K) * E2pK)
  by A29,Th50,A17,A26;
A37:(M "**" App (SignGenOp(f^<*d1*>,A,F1) * E1)).s1 =
  (M "**" App (SignGenOp(f^<*d1*>,A,F1) * E1p)).(s1*p1) by A1,A4,A8,Th112
  .= M "**" (App (SignGenOp(f^<*d1*>,A,F1) * E1p)).(s1*p1) by A28,Def10
  .= M "**" (((App (SignGenOp(f^<*d1*>,A,F1S) * E1pS)).S1)^
  ((App(SignGenOp(f^<*d1*>,A,F1K) * E1pK)).kL)) by Th61,A25,A10,A31
  .= M.(M "**" ((App(SignGenOp(f^<*d1*>,A,F1S) * E1pS)).S1),
  M "**" ((App(SignGenOp(f^<*d1*>,A,F1K) * E1pK)).kL)) by A1,FINSOP_1:5;
A38:(M "**" App (SignGenOp(f^<*d2*>,A,F2) * E2)).s2 =
  (M "**" App (SignGenOp(f^<*d2*>,A,F2) * E2p)).(s2*p2) by A1,A4,A8,Th112
  .= M "**" (App (SignGenOp(f^<*d2*>,A,F2) * E2p)).(s2*p2) by A33,Def10
  .= M "**" (((App (SignGenOp(f^<*d2*>,A,F2S) * E2pS)).S2)^
  ((App(SignGenOp(f^<*d2*>,A,F2K) * E2pK)).kL)) by Th61,A25,A17,A34
  .= M.(M "**" ((App(SignGenOp(f^<*d2*>,A,F2S) * E2pS)).S2),
  M "**" ((App(SignGenOp(f^<*d2*>,A,F2K) * E2pK)).kL)) by A1,FINSOP_1:5;
A39: (App(SignGenOp(f^<*d2*>,A,F2S) * E2pS)).S2 =
  (App(SignGenOp(f^<*d1*>,A,F2S) * E2pS)).S2 by A17,A34,Th133;
A40: (App(SignGenOp(f^<*d1*>,A,F1S) * E1pS)).S1 =
  (App(SignGenOp(f^<*d2*>,A,F1S) * E1pS)).S1 by Th133,A32,A10;
A41: M.( M "**" ((App(SignGenOp(f^<*d1*>,A,F1K) * E1pK)).kL),
  M "**" ((App(SignGenOp(f^<*d2*>,A,F2K) * E2pK)).kL))
  = M.( M "**" ((App(SignGenOp(f^<*d2*>,A,F1K) * E1pK)).kL),
  M "**" ((App(SignGenOp(f^<*d1*>,A,F2K) * E2pK)).kL))
  proof
    defpred P1[object] means L in E1pK.$1;
    consider D1 be set such that
A42: x in D1 iff x in dom E1pK & P1[x] from XBOOLE_0:sch 1;
    D1 c= dom E1pK by A42;
    then reconsider D1 as Subset of dom E1pK;
A43: for i holds i in D1 iff L in E1pK.i
    proof
      let i;
      thus i in D1 implies L in E1pK.i by A42;
      assume
A44:    L in E1pK.i;
      then i in dom E1pK by FUNCT_1:def 2;
      hence thesis by A44,A42;
    end;
    defpred P2[object] means L in E2pK.$1;
    consider D2 be set such that
A45: x in D2 iff x in dom E2pK & P2[x] from XBOOLE_0:sch 1;
    D2 c= dom E2pK by A45;
    then reconsider D2 as Subset of dom E2pK;
A46: for i holds i in D2 iff L in E2pK.i
    proof
      let i;
      thus i in D2 implies L in E2pK.i by A45;
      assume
A47:    L in E2pK.i;
      then i in dom E2pK by FUNCT_1:def 2;
      hence thesis by A47,A45;
    end;
    1<=L by NAT_1:11;
    then
A48: L in dom (f^<*d1*>) & L in dom (f^<*d2*>) by A5,FINSEQ_3:25;
    then
A49:(f^<*d1*>)/.L = (f^<*d1*>).L=d1 & (f^<*d2*>)/.L = (f^<*d2*>).L=d2
    by PARTFUN1:def 6;
    kL in dom App(SignGenOp(f^<*d1*>,A,F1K) * E1pK) &
    kL in dom App(SignGenOp(f^<*d2*>,A,F1K) * E1pK) &
    kL in dom App(SignGenOp(f^<*d1*>,A,F2K) * E2pK) &
    kL in dom App(SignGenOp(f^<*d2*>,A,F2K) * E2pK)
    by Def9,A31,A32,A34,A36; then
A50: M "**" ((App(SignGenOp(f^<*d1*>,A,F1K) * E1pK)).kL) =
    (M "**" (App(SignGenOp(f^<*d1*>,A,F1K) * E1pK))).kL &
    M "**" ((App(SignGenOp(f^<*d2*>,A,F1K) * E1pK)).kL) =
    (M "**" (App(SignGenOp(f^<*d2*>,A,F1K) * E1pK))).kL &
    M "**" ((App(SignGenOp(f^<*d1*>,A,F2K) * E2pK)).kL) =
    (M "**" (App(SignGenOp(f^<*d1*>,A,F2K) * E2pK))).kL &
    M "**" ((App(SignGenOp(f^<*d2*>,A,F2K) * E2pK)).kL) =
    (M "**" (App(SignGenOp(f^<*d2*>,A,F2K) * E2pK))).kL by Def10;
    per cases;
    suppose card D1 is even; then
A51:  (M "**" (App (SignGenOp(f^<*d1*>,A,F1K) * E1pK))).kL =
      M "**" (k |-> d1) &
      (M "**" (App (SignGenOp(f^<*d2*>,A,F1K) * E1pK))).kL =
      M "**" (k |-> d2)
      by A49,A15,A7,A11,A14,A12,Th135,A48,A43,A1,A2,A3;
      per cases;
      suppose  card D2 is even;
        then (M "**" (App (SignGenOp(f^<*d1*>,A,F2K) * E2pK))).kL =
        M "**" (k |-> d1) &
        (M "**" (App (SignGenOp(f^<*d2*>,A,F2K) * E2pK))).kL =
        M "**" (k |-> d2)
        by A49,A22,A7,A20,A19,A18,Th135,A48,A46,A1,A2,A3;
        hence thesis by A51,A50,A1,BINOP_1:def 2;
      end;
      suppose not card D2 is even;
        then
A52:    (M "**" (App (SignGenOp(f^<*d1*>,A,F2K) * E2pK))).kL =
        I.(M "**" (k |-> d1)) &
        (M "**" (App (SignGenOp(f^<*d2*>,A,F2K) * E2pK))).kL =
        I.(M "**" (k |-> d2)) by A49,A22,A7,A20,A19,A18,Th135,A48,A46,A1,A2,A3;
        hence M.( M "**" ((App(SignGenOp(f^<*d1*>,A,F1K) * E1pK)).kL),
        M "**" ((App(SignGenOp(f^<*d2*>,A,F2K) * E2pK)).kL))
        = M. (I.(M "**" (k |-> d2)), M "**" (k |-> d1))
        by A51,A50,A1,BINOP_1:def 2
        .= I.(M. (M "**" (k |-> d2), M "**" (k |-> d1))) by A2,A3,FINSEQOP:67
        .= M.( M "**" ((App(SignGenOp(f^<*d2*>,A,F1K) * E1pK)).kL),
        M "**" ((App(SignGenOp(f^<*d1*>,A,F2K) * E2pK)).kL))
        by A51,A52,A50,A2,A3,FINSEQOP:67;
      end;
    end;
    suppose not card D1 is even; then
A53:  (M "**" (App (SignGenOp(f^<*d1*>,A,F1K) * E1pK))).kL =
      I.(M "**" (k |-> d1)) &
      (M "**" (App (SignGenOp(f^<*d2*>,A,F1K) * E1pK))).kL =
      I.(M "**" (k |-> d2)) by A49,A15,A7,A11,A14,A12,Th135,A48,A43,A1,A2,A3;
      per cases;
      suppose  card D2 is even;
        then
A54:    (M "**" (App (SignGenOp(f^<*d1*>,A,F2K) * E2pK))).kL =
        M "**" (k |-> d1) &
        (M "**" (App (SignGenOp(f^<*d2*>,A,F2K) * E2pK))).kL =
        M "**" (k |-> d2)
        by A49,A22,A7,A20,A19,A18,Th135,A48,A46,A1,A2,A3;
        hence M.( M "**" ((App(SignGenOp(f^<*d1*>,A,F1K) * E1pK)).kL),
        M "**" ((App(SignGenOp(f^<*d2*>,A,F2K) * E2pK)).kL))
        = M. (M "**" (k |-> d2), I.(M "**" (k |-> d1)))
        by A53,A50,A1,BINOP_1:def 2
        .= I.(M. (M "**" (k |-> d2), M "**" (k |-> d1)))
        by A2,A3,FINSEQOP:67
        .= M.( M "**" ((App(SignGenOp(f^<*d2*>,A,F1K) * E1pK)).kL),
        M "**" ((App(SignGenOp(f^<*d1*>,A,F2K) * E2pK)).kL))
        by A53,A54,A50,A2,A3,FINSEQOP:67;
      end;
      suppose  not card D2 is even;
        then (M "**" (App (SignGenOp(f^<*d1*>,A,F2K) * E2pK))).kL =
        I.(M "**" (k |-> d1)) &
        (M "**" (App (SignGenOp(f^<*d2*>,A,F2K) * E2pK))).kL =
        I.(M "**" (k |-> d2)) by A49,A22,A7,A20,A19,A18,Th135,A48,A46,A1,A2,A3;
        hence thesis by A53,A50,A1,BINOP_1:def 2;
      end;
    end;
  end;
A55: (M "**" App (SignGenOp(f^<*d2*>,A,F1) * E1)).s1 =
  (M "**" App (SignGenOp(f^<*d2*>,A,F1) * E1p)).(s1*p1) by A1,A4,A8,Th112,A6
  .= M "**" (App (SignGenOp(f^<*d2*>,A,F1) * E1p)).(s1*p1) by A30,Def10
  .= M "**" (((App (SignGenOp(f^<*d2*>,A,F1S) * E1pS)).S1)^
  ((App(SignGenOp(f^<*d2*>,A,F1K) * E1pK)).kL)) by Th61,A26,A10,A32
  .= M.(M "**" ((App(SignGenOp(f^<*d2*>,A,F1S) * E1pS)).S1),
  M "**" ((App(SignGenOp(f^<*d2*>,A,F1K) * E1pK)).kL)) by A1,FINSOP_1:5;
A56: (M "**" App (SignGenOp(f^<*d1*>,A,F2) * E2)).s2 =
  (M "**" App (SignGenOp(f^<*d1*>,A,F2) * E2p)).(s2*p2) by A1,A4,A8,Th112,A6
  .= M "**" (App (SignGenOp(f^<*d1*>,A,F2) * E2p)).(s2*p2) by A35,Def10
  .= M "**" (((App (SignGenOp(f^<*d1*>,A,F2S) * E2pS)).S2)^
  ((App(SignGenOp(f^<*d1*>,A,F2K) * E2pK)).kL))
  by Th61,A26,A17,A36
  .= M.(M "**" ((App(SignGenOp(f^<*d1*>,A,F2S) * E2pS)).S2),
  M "**" ((App(SignGenOp(f^<*d1*>,A,F2K) * E2pK)).kL)) by A1,FINSOP_1:5;
  M.((M "**" App (SignGenOp(f^<*d1*>,A,F1) * E1)).s1,
  (M "**" App (SignGenOp(f^<*d2*>,A,F2) * E2)).s2)
  = M.(M "**" ((App(SignGenOp(f^<*d2*>,A,F1S) * E1pS)).S1),
  M.( M "**" ((App(SignGenOp(f^<*d1*>,A,F1K) * E1pK)).kL),
  M.(M "**" ((App(SignGenOp(f^<*d1*>,A,F2S) * E2pS)).S2),
  M "**" ((App(SignGenOp(f^<*d2*>,A,F2K) * E2pK)).kL))))
  by A37,A38,A39,A40,A1,BINOP_1:def 3
  .= M.(M "**" ((App(SignGenOp(f^<*d2*>,A,F1S) * E1pS)).S1),
  M.( M "**" ((App(SignGenOp(f^<*d1*>,A,F1K) * E1pK)).kL),
  M.(M "**" ((App(SignGenOp(f^<*d2*>,A,F2K) * E2pK)).kL),
  M "**" ((App(SignGenOp(f^<*d1*>,A,F2S) * E2pS)).S2))))
  by A1,BINOP_1:def 2
  .= M.(M "**" ((App(SignGenOp(f^<*d2*>,A,F1S) * E1pS)).S1),
  M.( M.( M "**" ((App(SignGenOp(f^<*d1*>,A,F1K) * E1pK)).kL),
  M "**" ((App(SignGenOp(f^<*d2*>,A,F2K) * E2pK)).kL)),
  M "**" ((App(SignGenOp(f^<*d1*>,A,F2S) * E2pS)).S2)))
  by A1,BINOP_1:def 3
  .= M.(M "**" ((App(SignGenOp(f^<*d2*>,A,F1S) * E1pS)).S1),
  M.( M "**" ((App(SignGenOp(f^<*d2*>,A,F1K) * E1pK)).kL),
  M.( M "**" ((App(SignGenOp(f^<*d1*>,A,F2K) * E2pK)).kL),
  M "**" ((App(SignGenOp(f^<*d1*>,A,F2S) * E2pS)).S2))))
  by A41,A1,BINOP_1:def 3
  .= M.(M.( M "**" ((App(SignGenOp(f^<*d2*>,A,F1S) * E1pS)).S1),
  M "**" ((App(SignGenOp(f^<*d2*>,A,F1K) * E1pK)).kL)),
  M.( M "**" ((App(SignGenOp(f^<*d1*>,A,F2K) * E2pK)).kL),
  M "**" ((App(SignGenOp(f^<*d1*>,A,F2S) * E2pS)).S2)))
  by A1,BINOP_1:def 3
  .= M.( (M "**" App (SignGenOp(f^<*d2*>,A,F1) * E1)).s1,
  (M "**" App (SignGenOp(f^<*d1*>,A,F2) * E2)).s2) by A55,A56,A1,BINOP_1:def 2;
  hence thesis;
end;

theorem Th137:
    M is commutative associative having_a_unity &
    A is commutative associative having_a_unity having_an_inverseOp &
    M is_distributive_wrt A  implies
 for E1 be Enumeration of F1 st union F1 c= Seg (1+m) & len E1 is even
     for Ee be Enumeration of Ext(F1,1+m,2+m),
         Es be Enumeration of swap(F1,1+m,2+m) st
         Ee = Ext(E1,1+m,2+m) & Es = Swap(E1,1+m,2+m)
  ex se,ss be Subset of doms(m+2,card F1) st
    se c= (len E1)-tuples_on {1+m,2+m} &
    ss c= (len E1)-tuples_on {1+m,2+m} &
    se is with_evenly_repeated_values-member &
    ss is with_evenly_repeated_values-member &
  for CFe,CFs be non-empty non empty FinSequence of D*,f,d1,d2 st
       len f=m &
       CFe = SignGenOp(f^<*d1*>^<*d2*>,A, Ext(F1,1+len f,2+len f) ) * Ee &
      CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es
  for Se be Element of Fin dom App CFe,
     Ss be Element of Fin dom App CFs st
  Se = se & Ss  = ss holds
  A. ((M "**" App (SignGenOp(f^<*A . (d1,d2)*>,A,F1) * E1)).
    (len E1|-> (1+ len f)),
    (M "**" App (SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,F1)* E1))
         .(len E1|-> (1+ len f))) =
  A. ( A$$(Se,M"**"App CFe), A$$(Ss,M"**"App CFs))
proof
  set I=the_inverseOp_wrt A;
  assume
A1:M is commutative associative having_a_unity &
   A is commutative associative having_a_unity having_an_inverseOp &
   M is_distributive_wrt A;
  let E1 be Enumeration of F1 such that
A2: union F1 c= Seg (1+m) & len E1 is even;
  set LE = len E1,L1=1+m,L2=2+m;
  let Ee be Enumeration of Ext(F1,1+m,2+m),
    Es be Enumeration of swap(F1,1+m,2+m) such that
A3: Ee = Ext(E1,1+m,2+m) & Es = Swap(E1,1+m,2+m);
  consider se be Subset of doms(m+2,card F1) such that
A4:se = (len E1)-tuples_on {1+m,2+m} and
A5: for CFe be non-empty non empty FinSequence of D*,f,d1,d2 st
  len f=m &
  CFe = SignGenOp(f^<*d1*>^<*d2*>,A, Ext(F1,1+len f,2+len f) ) * Ee
  for Sd be Element of Fin dom App CFe st Sd=se
  holds
  (M "**" App (SignGenOp(f^<*A . (d1,d2)*>,A,F1) * E1)).(len E1|-> (1+ len f))
  = A$$(Sd,M"**"App CFe) by Th127,A2,A3,A1;
  consider ss be Subset of doms(m+2,card F1) such that
A6: ss = (len E1)-tuples_on {1+m,2+m} and
A7: for CFs be non-empty non empty FinSequence of D*,f,d1,d2 st
  len f=m &
  CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es
  for Sd be Element of Fin dom App CFs st Sd=ss
  holds
  (M "**" App (SignGenOp(f^<*A . (I.d1,d2)*>,A,F1) * E1))
  .(len E1|-> (1+ len f)) = A$$(Sd,M"**"App CFs) by Th129,A2,A3,A1;
  set C = canFS (LE-tuples_on {1+m,2+m});
A8:rng C = LE-tuples_on {1+m,2+m} by FUNCT_2:def 3;
  defpred P[Nat] means $1 <= len C implies
  ex SIs1,RIs1,Ss1,Rs1 be Subset of doms(m+2,card F1) st
  SIs1 c= rng (C|$1) & RIs1 = rng (C|$1) = Rs1 &
  Ss1 c= rng (C|$1) &
  SIs1 is with_evenly_repeated_values-member &
  Ss1 is with_evenly_repeated_values-member &
  for CFs,CFIs be non-empty non empty FinSequence of D*,f,d1,d2 st
  len f=m &
  CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es &
  CFIs = SignGenOp(f^<*I.d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es
  for SIs,RIs be Element of Fin dom App CFIs,
  Ss,Rs be Element of Fin dom App CFs st SIs1=SIs & RIs1 =RIs &
  Ss1=Ss & Rs1 = Rs holds
  A. ( A$$(SIs,M"**"App CFIs), A$$(Ss,M"**"App CFs)) =
  A. ( A$$(RIs,M"**"App CFIs), A$$(Rs,M"**"App CFs));
A9:P[0]
  proof
    assume 0<=len C;
    {} c= doms(m+2,card F1);
    then reconsider E={} as Subset of doms(m+2,card F1);
    take E,E,E,E;
    thus E c= rng (C|0) & E = rng (C|0) = E &
    E c= rng (C|0) &
    E is with_evenly_repeated_values-member &
    E is with_evenly_repeated_values-member;
    let CFs,CFIs be non-empty non empty FinSequence of D*,f;
    thus thesis;
  end;
A10: len Es =len E1 =len Ee by A3,CARD_1:def 7;
A11: len E1 = card F1 by CARD_1:def 7;
A12: card Ext(F1,1+m,2+m) = len Ee = len E1 = card F1  by A3,CARD_1:def 7;
A13:P[n] implies P[n+1]
  proof
    set n1=n+1;
    assume that
A14: P[n] and
A15: n1 <= len C;
A16: n1 in dom C by A15,FINSEQ_3:25,NAT_1:11;
    then C|n1 = (C|n)^<*C.n1*> by FINSEQ_5:10;
    then
A17: rng (C|n1) = rng (C|n)\/ rng <*C.n1*> by FINSEQ_1:31;
    then
A18: rng (C|n1) = rng (C|n)\/ { C.n1 } by FINSEQ_1:39;
A19: C.n1 in rng C by A16,FUNCT_1:def 3;
    then reconsider Cn1 = C.n1 as Element of LE-tuples_on {1+m,2+m};
A20:not Cn1 in rng (C|n)
    proof
      assume Cn1 in rng(C|n);
      then consider x such that
A21:  x in dom (C|n) & Cn1 = (C|n).x by FUNCT_1:def 3;
A22:  x in dom C & x in Seg n & (C|n).x = C.x by A21,FUNCT_1:47,RELAT_1:57;
      then x=n1 by A21,A16,FUNCT_1:def 4;
      then n1 <=n by A22,FINSEQ_1:1;
      hence thesis by NAT_1:13;
    end;
    consider sIs,rIs,ss,rs be Subset of doms(m+2,card F1) such that
A23: sIs c= rng (C|n) & rIs = rng (C|n) = rs & ss c= rng (C|n) &
    sIs is with_evenly_repeated_values-member &
    ss is with_evenly_repeated_values-member  and
A24: for CFs,CFIs be non-empty non empty FinSequence of D*,f,d1,d2 st
    len f=m &
    CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es &
    CFIs = SignGenOp(f^<*I.d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es
    for SIs,RIs be Element of Fin dom App CFIs,
    Ss,Rs be Element of Fin dom App CFs st sIs=SIs & rIs =RIs &
    ss=Ss & rs = Rs holds
    A. ( A$$(SIs,M"**"App CFIs), A$$(Ss,M"**"App CFs))=
    A. ( A$$(RIs,M"**"App CFIs), A$$(Rs,M"**"App CFs)) by A14,A15,NAT_1:13;
    reconsider cn1=Cn1 as Element of doms(m+2,card F1) by A4,A19,A8;
    per cases;
    suppose
A25:  Cn1 is with_evenly_repeated_values;
      take sIsE = sIs\/{ cn1 }, rIsE = rIs\/{ cn1 },
      ssE = ss\/{ cn1 }, rsE = rs\/{ cn1 };
      thus sIsE c= rng (C|n1) & rIsE = rng (C|n1) = rsE &
      ssE c= rng (C|n1) by A18,A23,XBOOLE_1:9;
      thus sIsE is with_evenly_repeated_values-member &
      ssE is with_evenly_repeated_values-member by A23,A25;
      let CFs,CFIs be non-empty non empty FinSequence of D*,f,d1,d2 such that
A26:  len f=m and
A27:  CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(F1,1+len f,2+len f)) * Es &
      CFIs = SignGenOp(f^<*I.d1*>^<*d2*>,A, swap(F1,1+len f,2+len f))* Es;
      CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(F1,1+m,2+m) ) * Es by A27,A26;
      then
A28:  len CFs = len Es =len E1 =len Ee by A3,CARD_1:def 7;
A29:  Ext(F1,1+m,2+m) is non empty by A28;
      set fDD=f^<*d1*>^<*d2*>,fIDD=f^<*I.d1*>^<*d2*>,
      fD=f^<*A . (d1,d2)*>, fID = f^<*A . (I.d1,d2)*>;
A30:  len fDD = len (f^<*d1*>)+1 & len (f^<*d1*>)= len f+1 by FINSEQ_2:16;
A31:  len fIDD = len (f^<*I.d1*>)+1 & len (f^<*I.d1*>) = len f +1
      by FINSEQ_2:16;
      set CFe = SignGenOp(fDD,A, Ext(F1,1+len f,2+len f) ) * Ee;
A32:  for x st x in dom CFe holds CFe.x is non empty
      proof
        let x;
        assume x in dom CFe;
        then CFe.x = SignGen(fDD,A,Ee.x) by A26,Th80;
        hence thesis;
      end;
      rng CFe c= D*;
      then reconsider CFe as non-empty non empty FinSequence of D*
      by A26,A29,A32,FINSEQ_1:def 4,FUNCT_1:def 9;
A33:  se c= doms(m+2,card F1)=dom App CFe &
      doms(m+2,card F1)=dom App CFs by A30,A27,A26,A11,A28,Lm3;
      then reconsider Se = se as Element of Fin dom App CFe by FINSUB_1:def 5;
      L1 < L1+1 by NAT_1:13;
      then not L2 in union F1 by A2,FINSEQ_1:1;
      then card Ext(F1,L1,L2)=card F1=card swap(F1,L1,L2) by Th10,Th11;
      then
A34:  Se c= dom App CFe = doms CFe = doms CFIs=dom App CFIs
      by A26,A30,A31,A27,Th107,Def9,FINSUB_1:def 5;
      then reconsider SIs = Se as Element of Fin dom App CFIs;
      reconsider SIs = sIs,RIs=rIs
      as Element of Fin dom App CFIs by A33,A34,FINSUB_1:def 5;
      reconsider Ss=ss,Rs=rs as Element of Fin dom App CFs
      by A33,FINSUB_1:def 5;
      reconsider Cn1I = Cn1 as Element of dom App CFIs by A34,A4;
      reconsider Cn1S = Cn1 as Element of dom App CFs by A33,A4;
      let SIsE,RIsE be Element of Fin dom App CFIs,
      SsE,RsE be Element of Fin dom App CFs such that
A35:  SIsE=sIsE & RIsE =rIsE & SsE=ssE & RsE = rsE;
      not Cn1 in SIs by A20,A23;
      then
A36:  A$$(SIsE,M"**"App CFIs)=A.(A$$(SIs,M"**"App CFIs),(M"**"App CFIs).Cn1I)
      by A1,A35,SETWOP_2:2;
A37:  A. ( A$$(SIs,M"**"App CFIs), A$$(Ss,M"**"App CFs))=
      A. ( A$$(RIs,M"**"App CFIs), A$$(Rs,M"**"App CFs)) by A26,A27,A24;
      not Cn1 in Ss by A20,A23;
      then
A38:  A$$(SsE,M"**"App CFs)= A.(A$$(Ss,M"**"App CFs),(M"**"App CFs).Cn1S)
      by A1,A35,SETWOP_2:2;
A39:  A$$(RIsE,M"**"App CFIs)= A.(A$$(RIs,M"**"App CFIs),(M"**"App CFIs).Cn1I)
      by A20,A23,A1,A35,SETWOP_2:2;
A40:  A$$(RsE,M"**"App CFs)= A.(A$$(Rs,M"**"App CFs),(M"**"App CFs).Cn1S)
      by A20,A23,A1,A35,SETWOP_2:2;
A41:  (M"**"App CFs).Cn1 = M"**"((App CFs).Cn1S) by Def10;
      thus A. ( A$$(SIsE,M"**"App CFIs), A$$(SsE,M"**"App CFs))
      = A. ( A.((M"**"App CFIs).Cn1I,A$$(SIs,M"**"App CFIs)),
      A$$(SsE,M"**"App CFs)) by A36,A1,BINOP_1:def 2
      .= A. ( (M"**"App CFIs).Cn1I,A.(A$$(SIs,M"**"App CFIs),
      A$$(SsE,M"**"App CFs))) by A1,BINOP_1:def 3
      .= A. ( (M"**"App CFIs).Cn1I,
      A.(A.(A$$(RIs,M"**"App CFIs) ,A$$(Rs,M"**"App CFs)),(M"**"App CFs).Cn1))
      by A37,A1,A38,BINOP_1:def 3
      .= A. ( (M"**"App CFIs).Cn1I,
      A.(A$$(RIs,M"**"App CFIs) ,A.(A$$(Rs,M"**"App CFs),(M"**"App CFs).Cn1)))
      by A1,A41,BINOP_1:def 3
      .= A. (A. ((M"**"App CFIs).Cn1I,A$$(RIs,M"**"App CFIs)),
      A$$(RsE,M"**"App CFs)) by A1,A40,BINOP_1:def 3
      .= A. (A$$(RIsE,M"**"App CFIs), A$$(RsE,M"**"App CFs))
      by A39,A1,BINOP_1:def 2;
    end;
    suppose
A42:  not Cn1 is with_evenly_repeated_values;
      take sIsE = sIs, rIsE = rIs\/{ cn1 },
      ssE = ss, rsE = rs\/{ cn1 };
      thus sIsE c= rng (C|n1) & rIsE = rng (C|n1) = rsE &
      ssE c= rng (C|n1) by A17,A23,FINSEQ_1:39,XBOOLE_1:10;
      thus sIsE is with_evenly_repeated_values-member &
      ssE is with_evenly_repeated_values-member by A23;
      let CFs,CFIs be non-empty non empty FinSequence of D*,f,d1,d2 such that
A43:  len f=m and
A44:  CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es &
      CFIs = SignGenOp(f^<*I.d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es;
      set fDD=f^<*d1*>^<*d2*>,fIDD=f^<*I.d1*>^<*d2*>,
      fD=f^<*A . (d1,d2)*>, fID = f^<*A . (I.d1,d2)*>;
A45:  len fDD = len (f^<*d1*>)+1 & len (f^<*d1*>) = len f+1 by FINSEQ_2:16;
A46:  len fIDD = len (f^<*I.d1*>)+1 & len (f^<*I.d1*>) = len f +1
      by FINSEQ_2:16;
      1 <= 1+len f+1 & 1 <= len f +1 & len f+1<= 1+len f+1 by NAT_1:11;
      then
A47:  L1 in dom fDD & L2 in dom fDD & L1 in dom fIDD & L2 in dom fIDD &
      L1 in dom (f^<*I.d1*>) & L1 in dom (f^<*d1*>) by A43,A45,A46,FINSEQ_3:25;
      set CFe = SignGenOp(fDD,A, Ext(F1,1+len f,2+len f) ) * Ee;
      swap(F1,1+m,2+m) is non empty by A44;
      then
A48:  F1 is non empty by Th12;
A49:  for x st x in dom CFe holds CFe.x is non empty
      proof
        let x;
        assume x in dom CFe;
        then CFe.x = SignGen(fDD,A,Ee.x) by A43,Th80;
        hence thesis;
      end;
      rng CFe c= D*;
      then reconsider CFe as non-empty non empty FinSequence of D*
        by A43,A48,A49,FINSEQ_1:def 4,FUNCT_1:def 9;
A50:  se c= doms(m+2,card F1)=dom App CFe &
      doms(m+2,card F1)=dom App CFs  by A45,A44,A43,A11,A10,Lm3;
      then reconsider Se = se as Element of Fin dom App CFe by FINSUB_1:def 5;
      L1 < L1+1 by NAT_1:13;
      then not L2 in union F1 by A2,FINSEQ_1:1;
      then card Ext(F1,L1,L2)=card F1=card swap(F1,L1,L2) by Th10,Th11;
      then
A51:  Se c= dom App CFe = doms CFe = doms CFIs=dom App CFIs
      by A43,A45,A46,A44,Th107,Def9,FINSUB_1:def 5;
      then reconsider SIs = Se as Element of Fin dom App CFIs;
      reconsider SIs = sIs,RIs=rIs
      as Element of Fin dom App CFIs by A50,A51,FINSUB_1:def 5;
      reconsider Ss=ss,Rs=rs as Element of Fin dom App CFs
      by A50,FINSUB_1:def 5;
A52:  C.n1 in dom App CFIs by A19,A51,A4;
      reconsider Cn1I = Cn1 as Element of dom App CFIs by A51,A4;
      reconsider Cn1S = Cn1 as Element of dom App CFs by A50,A4;
      let SIsE,RIsE be Element of Fin dom App CFIs,
      SsE,RsE be Element of Fin dom App CFs such that
A53:  SIsE=sIsE & RIsE =rIsE & SsE=ssE & RsE = rsE;
      set k = card (Cn1"{L2});
      consider p be Permutation of dom Cn1,F be FinSequence such that
A54:  Cn1*p = F^(k|->L2) & not L2 in rng F by Th134;
      CFIs = SignGenOp(f^<*I.d1*>^<*d2*>,A, swap(F1,1+m,2+m) ) * Es by A44,A43;
      then
A55:  len Cn1I = len CFIs = len Es by Th47,CARD_1:def 7;
      then
A56:  dom Cn1 = dom Es by FINSEQ_3:30;
      then reconsider Esp=Es*p as Enumeration of swap(F1,L1,L2) by Th109;
A57:  len Es = card swap(F1,L1,L2) = len Esp by CARD_1:def 7;
      Cn1I in doms CFIs;
      then
A58:  Cn1*p in doms (SignGenOp(fIDD,A,swap(F1,L1,L2))*Esp)by A44,A43,A56,Th110;
      Cn1S in doms CFs;
      then
A59:  Cn1*p in doms (SignGenOp(fDD,A,swap(F1,L1,L2))*Esp)
      by A44,A56,Th110,A43;
A60:  rng (F^(k|->L2))=rng F \/ rng (k|->L2) by FINSEQ_1:31;
A61:  dom p  = dom Cn1 = rng p by FUNCT_2:52,def 3;
      rng (Cn1*p) c= {L1,L2};
      then rng F c= {L1,L2} by A60,A54,XBOOLE_1:11;
      then rng F c= {L1}\/{L2} by ENUMSET1:1;
      then
A62:  rng F c= {L1} by A54,ZFMISC_1:135;
A63:  F = len F |-> L1
      proof
        per cases;
        suppose F={};
          hence thesis;
        end;
        suppose F<>{};
          then F = dom F --> L1 by A62,FUNCOP_1:9,ZFMISC_1:33;
          hence thesis by FINSEQ_1:def 3;
        end;
      end;
A64:  len Cn1 = len (F^(k|->L2)) = len F + len (k|->L2)
      by A54,A61,FINSEQ_1:22,FINSEQ_3:29,RELAT_1:27;
A65:  not len F is even
      proof
        assume
A66:    len F is even;
        not Cn1*p is with_evenly_repeated_values by A42,Th44;
        then consider y such that
A67:    not card ((Cn1*p)"{y}) is even;
A68:    card ((Cn1*p)"{y})=card (F"{y})+card ((k|->L2)"{y}) by A54,FINSEQ_3:57;
A69:    L1<>L2;
        (Cn1*p)"{y}<>{} by A67;
        then y in rng (Cn1*p) by FUNCT_1:72;
        then per cases by TARSKI:def 2;
        suppose y =L1;
          then card (F"{y}) = card Seg len F
          & not L2 in {y} by A69,A63,FUNCOP_1:15,TARSKI:def 1;
          then card (F"{y}) = len F & (k|->L2)"{y} = {} by FUNCOP_1:16;
          hence thesis by A68,A67,A66;
        end;
        suppose y=L2;
          then card ((k|->L2)"{y}) = card Seg k & not L1 in {y}
          by A69,FUNCOP_1:15,TARSKI:def 1;
          then card ((k|->L2)"{y}) = k & F"{y}={} by A63,FUNCOP_1:16;
          hence thesis by A2,A64,A66,A67,A68,CARD_1:def 7;
        end;
      end;
      set esp1=Esp|len F;
A70:  len esp1 = len F by A55,A57,A64,FINSEQ_1:59,NAT_1:11;
      consider esp2 be FinSequence such that
A71:  Esp = esp1 ^ esp2 by FINSEQ_1:80;
      set R1 = rng esp1, R2= rng esp2;
A72:  len Esp = len esp1+len esp2 by A71,FINSEQ_1:22;
A73:  esp1 is one-to-one &esp2 is one-to-one& R1 misses R2 by A71,FINSEQ_3:91;
      then reconsider Esp1=esp1 as Enumeration of R1 by RLAFFIN3:def 1;
      reconsider Esp2=esp2 as Enumeration of R2 by A73,RLAFFIN3:def 1;
      set CFs1 = SignGenOp(fDD,A,R1) * Esp1, CFs2 = SignGenOp(fDD,A,R2) * Esp2;
      set CFIs1 = SignGenOp(fIDD,A,R1) * Esp1,
        CFIs2 = SignGenOp(fIDD,A,R2) * Esp2;
      rng CFs1 c= D* & rng CFs2 c= D* & rng CFIs1 c= D* & rng CFIs2 c= D*;
      then reconsider CFs1,CFs2,CFIs1,CFIs2 as FinSequence of D*
        by FINSEQ_1:def 4;
A74:  len CFs1 = len Esp1 = len CFIs1 by CARD_1:def 7;
      R1 \/ R2 = rng Esp =swap(F1,L1,L2) by A71,FINSEQ_1:31,RLAFFIN3:def 1;
      then
A75:  SignGenOp(fDD,A,swap(F1,L1,L2)) * Esp = CFs1^CFs2 &
      SignGenOp(fIDD,A,swap(F1,L1,L2)) * Esp = CFIs1^CFIs2 by A71,Th81;
      then
A76:  F in doms CFs1 & (k|->L2) in doms CFs2 &
      F in doms CFIs1 & (k|->L2) in doms CFIs2 by A70,A58,A59,A74,A54,Th50;
      then
A77:  (App (SignGenOp(fDD,A,swap(F1,L1,L2)) * Esp)).(Cn1*p) =
      ((App CFs1).F)^((App CFs2).(k|->L2)) &
      (App (SignGenOp(fIDD,A,swap(F1,L1,L2)) * Esp)).(Cn1*p) =
      ((App CFIs1).F)^((App CFIs2).(k|->L2)) by A54,A75,Th61;
A78:  Cn1*p in dom App (SignGenOp(fIDD,A,swap(F1,L1,L2))*Esp) by A58,Def9;
A79:  Cn1*p in dom App (SignGenOp(fDD,A,swap(F1,L1,L2))*Esp) by A59,Def9;
A80:  M"**"((App CFIs1).F) = I.(M"**"((App CFs1).F))
      proof
        F in dom (App CFIs1) & F in dom (App CFs1) by A76,Def9;
        then
A81:    M"**"((App CFIs1).F) = (M"**"(App CFIs1)).F &
        M"**"((App CFs1).F) = (M"**"(App CFs1)).F by Def10;
        defpred P1[object] means L1 in Esp1.$1;
        consider D1 be set such that
A82:    x in D1 iff x in dom Esp1 & P1[x] from XBOOLE_0:sch 1;
        D1 c= dom Esp1 by A82;
        then reconsider D1 as Subset of dom Esp1;
A83:    for i holds i in D1 iff L1 in Esp1.i
        proof
          let i;
          thus i in D1 implies L1 in Esp1.i by A82;
          assume
A84:      L1 in Esp1.i;
          then i in dom Esp1 by FUNCT_1:def 2;
          hence thesis by A84,A82;
        end;
A85:    fIDD/.L1 = fIDD.L1 by A47,PARTFUN1:def 6
        .= (f^<*I.d1*>).L1 by A47,FINSEQ_1:def 7
        .= I.d1 by A43;
A86:    fDD/.L1 = fDD.L1 by A47,PARTFUN1:def 6
        .= (f^<*d1*>).L1 by A47,FINSEQ_1:def 7
        .= d1 by A43;
        per cases;
        suppose
A87:      card D1 is even;
          (M"**"(App CFIs1)).F
          = M"**"( (len F) |-> fIDD/.L1) by A87,A47,A83,Th135,A1,A70,A63
          .= I.( M"**"( (len F) |-> d1)) by Th4,A1,A65,A85
          .= I. ( (M"**"(App CFs1)).F  ) by A63,A86,A87,A47,A83,Th135,A1,A70;
          hence thesis by A81;
        end;
        suppose
A88:      not card D1 is even;
          (M"**"(App CFIs1)).F
          = I.(M"**"( (len F) |-> fIDD/.L1)) by A88,A47,A83,Th135,A1,A70,A63
          .= I.(I.( M"**"( (len F) |-> d1))) by Th4,A1,A65,A85
          .= I. ( (M"**"(App CFs1)).F  ) by A63,A86,A88,A47,A83,Th135,A1,A70;
          hence thesis by A81;
        end;
      end;
A89:  M"**"((App CFIs2).(k|->L2)) = M"**"((App CFs2).(k|->L2))
      proof
        k|->L2 in dom (App CFIs2) & k|->L2 in dom (App CFs2) by A76,Def9;
        then
A90:    M"**"((App CFIs2).(k|->L2)) = (M"**"(App CFIs2)).(k|->L2) &
        M"**"((App CFs2).(k|->L2)) = (M"**"(App CFs2)).(k|->L2) by Def10;
        defpred P2[object] means L2 in Esp2.$1;
        consider D2 be set such that
A91:    x in D2 iff x in dom Esp2 & P2[x] from XBOOLE_0:sch 1;
        D2 c= dom Esp2 by A91;
        then reconsider D2 as Subset of dom Esp2;
A92:    for i holds i in D2 iff L2 in Esp2.i
        proof
          let i;
          thus i in D2 implies L2 in Esp2.i by A91;
          assume
A93:      L2 in Esp2.i;
          then i in dom Esp2 by FUNCT_1:def 2;
          hence thesis by A93,A91;
        end;
A94:    fIDD/.L2 = fIDD.L2 by A47,PARTFUN1:def 6
        .= d2 by A46,A43;
A95:    fDD/.L2 = fDD.L2 by A47,PARTFUN1:def 6
        .= d2 by A45,A43;
        per cases;
        suppose
A96:      card D2 is even;
          then (M"**"(App CFIs2)).(k|->L2) = M"**"(k |-> fIDD/.L2)
          by A72,A70,A55,A57,A64,A47,A92,Th135,A1
          .= (M"**"(App CFs2)).(k|->L2)
          by A94,A95,A96,A72,A70,A55,A57,A64,A92,Th135,A1,A47;
          hence thesis by A90;
        end;
        suppose
A97:      not card D2 is even;
          then (M"**"(App CFIs2)).(k|->L2) = I.(M"**"(k |-> fIDD/.L2))
          by A72,A70,A55,A57,A64,A47,A92,Th135,A1
          .= (M"**"(App CFs2)).(k|->L2)
          by A94,A95,A97,A72,A70,A55,A57,A64,A92,Th135,A1,A47;
          hence thesis by A90;
        end;
      end;
A98: (M"**"App CFIs).Cn1S =
      (M "**"App (SignGenOp(fIDD,A,swap(F1,L1,L2))*Esp)).(Cn1S*p)
      by A56,Th112,A1,A52,A44,A43
      .= M"**" (((App CFIs1).F)^((App CFIs2).(k|->L2))) by A77,A78,Def10
      .= M.(M"**" ((App CFIs1).F), M"**"((App CFIs2).(k|->L2)))
      by A1,FINSOP_1:5
      .= I.(M.(M"**"((App CFs1).F), M"**"((App CFs2).(k|->L2))))
      by A80,A89,A1,FINSEQOP:67
      .= I.(M"**" (((App CFs1).F)^((App CFs2).(k|->L2)))) by A1,FINSOP_1:5
      .= I.((M "**"App (SignGenOp(fDD,A,swap(F1,L1,L2))*Esp)).(Cn1S*p))
      by A79,Def10,A77
      .= I.((M"**"App CFs).Cn1S) by A56,Th112,A44,A1,A43;
A99: (M"**"App CFIs).Cn1I = M"**" ((App CFIs).Cn1I) by Def10;
A100: (M"**"App CFs).Cn1S = M"**" ((App CFs).Cn1S) by Def10;
A101: A$$(RIsE,M"**"App CFIs)= A.(A$$(RIs,M"**"App CFIs),(M"**"App CFIs).Cn1I)
      by A20,A23,A1,A53,SETWOP_2:2;
A102: A$$(RsE,M"**"App CFs)= A.(A$$(Rs,M"**"App CFs),(M"**"App CFs).Cn1S)
      by A20,A23,A1,A53,SETWOP_2:2;
      A. ( A$$(SIs,M"**"App CFIs), A$$(Ss,M"**"App CFs))=
      A. ( A$$(RIs,M"**"App CFIs), A$$(Rs,M"**"App CFs)) by A24,A44,A43;
      hence A. ( A$$(SIsE,M"**"App CFIs), A$$(SsE,M"**"App CFs))
      = A.( A$$(RIs,M"**"App CFIs),A.(the_unity_wrt A,A$$(Rs,M"**"App CFs)))
      by A1,A53,SETWISEO:15
      .= A.( A$$(RIs,M"**"App CFIs),
      A.( A.( (M"**"App CFIs).Cn1S,(M"**"App CFs).Cn1),A$$(Rs,M"**"App CFs)))
      by A98,A1,FINSEQOP:59
      .= A.( A$$(RIs,M"**"App CFIs),
      A.( (M"**"App CFIs).Cn1,A.((M"**"App CFs).Cn1,A$$(Rs,M"**"App CFs))))
      by A99,A100,A1,BINOP_1:def 3
      .= A.( A$$(RIs,M"**"App CFIs),
      A.((M"**"App CFIs).Cn1,A$$(RsE,M"**"App CFs))) by A102,A1,BINOP_1:def 2
      .= A. (A$$(RIsE,M"**"App CFIs),A$$(RsE,M"**"App CFs))
      by A101,A1,BINOP_1:def 3;
    end;
  end;
  P[n] from NAT_1:sch 2(A9,A13);
  then consider SIs1,RIs1,Ss1,Rs1 be Subset of doms(m+2,card F1) such that
A104:  SIs1 c= rng (C|len C) & RIs1 = rng (C|len C) = Rs1 &
  Ss1 c= rng (C|len C) and
A105:   SIs1 is with_evenly_repeated_values-member &
  Ss1 is with_evenly_repeated_values-member  and
A106: for CFs,CFIs be non-empty non empty FinSequence of D*,f,d1,d2 st
  len f=m&CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es &
  CFIs = SignGenOp(f^<*I.d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es
  for SIs,RIs be Element of Fin dom App CFIs,
  Ss,Rs be Element of Fin dom App CFs st SIs1=SIs & RIs1 =RIs &
  Ss1=Ss & Rs1 = Rs holds
  A.( A$$(SIs,M"**"App CFIs), A$$(Ss,M"**"App CFs))=
  A.( A$$(RIs,M"**"App CFIs), A$$(Rs,M"**"App CFs));
  take SIs1,Ss1;
  thus SIs1 c= (len E1)-tuples_on {1+m,2+m} &
  Ss1 c= (len E1)-tuples_on {1+m,2+m} &
  SIs1 is with_evenly_repeated_values-member &
  Ss1 is with_evenly_repeated_values-member by A104,A105,FUNCT_2:def 3;
  let CFe,CFs be non-empty non empty FinSequence of D*,f,d1,d2 such that
A107:  len f=m &
  CFe = SignGenOp(f^<*d1*>^<*d2*>,A, Ext(F1,1+len f,2+len f) ) * Ee &
  CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(F1,1+len f,2+len f) ) * Es;
  let Se be Element of Fin dom App CFe,Ss be Element of Fin dom App CFs
  such that
A108:  Se =SIs1 & Ss  = Ss1;
  set CFIs = SignGenOp(f^<*I.d1*>^<*d2*>,A,swap(F1,L1,L2))*Es;
A109: Ext(F1,1+m,2+m) is non empty by A107;
A110: for x st x in dom CFIs holds CFIs.x is non empty
  proof
    let x;
    assume x in dom CFIs;
    then CFIs.x = SignGen(f^<*I.d1*>^<*d2*>,A,Es.x) by Th80;
    hence thesis;
  end;
  rng CFIs c= D*;
  then reconsider CFIs as non-empty non empty FinSequence of D*
  by A109,A10,A110,FINSEQ_1:def 4,FUNCT_1:def 9;
A111: len (f^<*I.d1*>^<*d2*>) = len (f^<*I.d1*>)+1 & len (f^<*I.d1*>) = m+1
  by A107,FINSEQ_2:16;
A112: len (f^<*d1*>^<*d2*>) = len (f^<*d1*>)+1 & len (f^<*d1*>) = m+1
  by A107,FINSEQ_2:16;
A113: doms(m+2,card F1) = dom App CFIs by A10,A12,A111,Lm3;
A114: len Ee = card F1 by A12;
A115: doms(m+2,card F1) = dom App CFs by A10,A12,A112,Lm3,A107;
  reconsider Fe = Se,RIs = se as Element of Fin dom App CFIs
  by A113,A108,FINSUB_1:def 5;
A116: doms(m+2,card F1) = dom App CFe by A114,A112,Lm3,A107;
  reconsider Rs =ss as Element of Fin dom App CFs by A115,FINSUB_1:def 5;
  reconsider Te = se as Element of Fin dom App CFe by A116,FINSUB_1:def 5;
A117: Rs1 = ss by A8,A104,A6;
A118:  A. ( A$$(Fe, M"**"App CFIs), A$$(Ss,M"**"App CFs))=
  A. ( A$$(RIs,M"**"App CFIs), A$$(Rs,M"**"App CFs))
  by A8,A4,A104,A117,A106,A107,A108;
  thus A. ((M "**" App (SignGenOp(f^<*A . (d1,d2)*>,A,F1) * E1)).
  (len E1|-> (1+ len f)),
  (M "**" App (SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,F1) *
  E1)).(len E1|-> (1+ len f)))= A.(A$$(Te,M"**"App CFe),
  (M "**" App (SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,F1) *
  E1)).(len E1|-> (1+ len f)) ) by A5,A107
  .= A.(A$$(Te,M"**"App CFe), A$$(Rs,M"**"App CFs)) by A107,A7
  .= A.(A$$(RIs,M"**"App CFIs), A$$(Rs,M"**"App CFs)) by A1,A2,A3,Th128,A107
  .=A.( A$$(Fe,M"**"App CFIs), A$$(Ss,M"**"App CFs)) by A118
  .=A.( A$$(Se,M"**"App CFe), A$$(Ss,M"**"App CFs)) by A1,A2,A3,Th128,A107;
end;

theorem Th138:
  A is commutative associative having_a_unity having_an_inverseOp &
  M is associative commutative having_a_unity &
  M is_distributive_wrt A
implies
  for E be Enumeration of F st union F c= Seg (1+m)
  for Ee be Enumeration of Ext(F,1+m,2+m),
      Es be Enumeration of swap(F,1+m,2+m) st
      Ee = Ext(E,1+m,2+m) & Es = Swap(E,1+m,2+m)
  for Ees be Enumeration of
      Ext(F,1+m,2+m)\/swap(F,1+m,2+m) st Ees=Ee^Es
  for s1,s2 be FinSequence st s1 in doms(m+1,card F) & s2 in doms(m+1,card F) &
    s1 is with_evenly_repeated_values & s2 is with_evenly_repeated_values &
    card (s1"{1+m}) < card (s2"{1+m})
  ex D1,D2 be Subset of doms(m+2,card F+card F) st
    D1 is with_evenly_repeated_values-member &
    D2 is with_evenly_repeated_values-member &
    for CE1,CE2 be FinSequence of D*,f,d1,d2 st
      len f = m &
      CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
      CE2 = SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,F) * E
     for CFes be non-empty non empty FinSequence of D* st
       CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
             Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees
     for S1,S2 be Element of Fin dom App CFes st
       S1=D1 & S2=D2 holds
     S1 misses S2 &
     A.(M.((M"**"App CE1).s1,(M"**"App CE2).s2),
        M.((M"**"App CE1).s2,(M"**"App CE2).s1))= A$$(S1\/S2,M"**"App CFes) &
     (for h be FinSequence,i st h in S1 & i in dom (s1^s2) holds
       ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
       ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i)) &
     (for h be FinSequence,i st h in S2 & i in dom (s2^s1) holds
       ((s2^s1).i = 1+len f implies h.i in {1+len f,2+len f}) &
       ((s2^s1).i <> 1+len f implies h.i =(s2^s1).i))
proof
  assume
A1: A is commutative associative having_a_unity having_an_inverseOp &
  M is associative commutative having_a_unity &
  M is_distributive_wrt A;
  set I=the_inverseOp_wrt A;
  let E be Enumeration of F such that
A2: union F c= Seg (1+m);
  set EF=Ext(F,1+m,2+m),SF = swap(F,1+m,2+m);
  let Ee be Enumeration of EF,Es be Enumeration of SF such that
A3: Ee = Ext(E,1+m,2+m) & Es = Swap(E,1+m,2+m);
  let Ees be Enumeration of
  Ext(F,1+m,2+m)\/swap(F,1+m,2+m) such that
A4: Ees=Ee^Es;
  let s1,s2 be FinSequence such that
A5: s1 in doms(m+1,card F) & s2 in doms(m+1,card F) &
  s1 is with_evenly_repeated_values & s2 is with_evenly_repeated_values &
  card (s1"{1+m}) < card (s2"{1+m});
A6: card F=len E & len s1 = card F = len s2 by A5,CARD_1:def 7;
  card (s1"{1+m}) is even by A5;
  then consider n1 be Nat such that
A7: card (s1"{1+m}) = 2*n1 by ABIAN:def 2;
  card (s2"{1+m}) is even by A5;
  then consider n2 be Nat such that
A8: card (s2"{1+m}) = 2*n2 by ABIAN:def 2;
  reconsider N=(2*n2)-(2*n1) as even Nat by A5,A7,A8,NAT_1:21;
A9: N<>0 by A5,A7,A8;
  set N1 = N|->(1+m);
  card dom s2 = card Seg len s2 by FINSEQ_1:def 3
  .= len s2;
  then
A10: 2*n2 <= len s2 by A8,NAT_1:43,RELAT_1:132;
  N <= N+(2*n1) by NAT_1:11;
  then reconsider L = len s2 - N as Nat by A10,NAT_1:21,XXREAL_0:2;
A11: F<>{} by A5;
  ex p2 be Permutation of dom s2,s3 be FinSequence st
  s2*p2 = s3^N1
  proof
    s2"{1+m} is non empty by A5;
    then consider x such that
A12:  x in s2"{1+m};
    x in dom s2 & s2.x in {1+m} by A12,FUNCT_1:def 7;
    then 1+m = s2.x in rng s2 by FUNCT_1:def 3,TARSKI:def 1;
    then reconsider L={1+m} as Subset of rng s2 by ZFMISC_1:31;
    L``=L;
    then consider p be Permutation of dom s2 such that
A13: (s2-L)^(s2-L`) = s2*p by FINSEQ_3:115;
    L` = (rng s2) \L by SUBSET_1:def 4;
    then
    s2"(L`) = s2"(rng s2) \ s2"(L) by FUNCT_1:69;
    then s2"(L`) = (dom s2) \ s2"(L) by RELAT_1:134;
    then card (s2"(L`)) = card (dom s2)-card  (s2"(L))
      by CARD_2:44,RELAT_1:132;
    then card (s2"(L`)) = card (Seg len s2)-card  (s2"(L)) by FINSEQ_1:def 3;
    then
A14: len (s2-L`) = len s2 - (len s2 - (2*n2)) by A8,FINSEQ_3:59;
    rng (s2-L`) = rng s2 \ L` by FINSEQ_3:65
    .= rng s2 \ (rng s2 \L) by SUBSET_1:def 4
    .= rng s2 /\L by XBOOLE_1:48
    .= L by XBOOLE_1:28;
    then s2-L` = dom (s2-L`) --> 1+m by FUNCOP_1:9;
    then s2-L` = 2*n2 |-> (1+m) by A14,FINSEQ_1:def 3;
    then s2-L` = ((2*n1) |-> (1+m))^N1 by FINSEQ_2:123;
    then s2*p = ((s2-L)^((2*n1) |-> (1+m)))^N1 by A13,FINSEQ_1:32;
    hence thesis;
  end;
  then consider p2 be Permutation of dom s2,s3 be FinSequence such that
A15: s2*p2 = s3^N1;
A16: dom s2 = dom E by A6,FINSEQ_3:29;
  then reconsider Ep=E*p2 as Enumeration of F by Th109;
A17: dom p2 = dom s2 = rng p2 by FUNCT_2:52,def 3;
  then
A18: dom Ep = dom s2 by A16,RELAT_1:27;
  then
A19: len Ep=len s2 by FINSEQ_3:29;
  set ep1 = Ep|L;
  L <= L+N by NAT_1:11;
  then
A20:len ep1 = L by A19,FINSEQ_1:59;
  consider ep2 be FinSequence such that
A21: Ep = ep1 ^ ep2 by FINSEQ_1:80;
  set R1 = rng ep1, R2= rng ep2;
A22:len Ep = len ep1+len ep2 by A21,FINSEQ_1:22;
A23: ep1 is one-to-one & ep2 is one-to-one & R1 misses R2 by A21,FINSEQ_3:91;
  then reconsider Ep1=ep1 as Enumeration of R1 by RLAFFIN3:def 1;
  reconsider Ep2=ep2 as Enumeration of R2 by A23,RLAFFIN3:def 1;
  reconsider s2p2=s2*p2 as FinSequence;
  s2*p2 is with_evenly_repeated_values by A5,Th44;
  then
A24: s3 is with_evenly_repeated_values by A15,Th105;
A25: dom s2p2 = dom s2 by A17,RELAT_1:27;
  N1"{1+m} = Seg N by FUNCOP_1:15;
  then
A26: card (N1"{1+m}) = N;
  s2p2,s2 are_fiberwise_equipotent by A25,CLASSES1:80;
  then card (s2p2"{1+m}) = card (s2"{1+m}) by CLASSES1:78;
  then
A27: 2*n2 = card (s3"{1+m}) + N by A26,A15,A8,FINSEQ_3:57;
A28: R1 \/ R2 = rng Ep =F by A21,FINSEQ_1:31,RLAFFIN3:def 1;
  union R1 c= union F & union R2 c= union F  by A28,XBOOLE_1:7,ZFMISC_1:77;
  then
A29: union R1 c= Seg (1+m) & union R2 c= Seg (1+m) by A2;
  set Rs1 = swap(R1,1+m,2+m), Rs2 = swap(R2,1+m,2+m),
  Es1 = Swap(Ep1,1+m,2+m),Es2 = Swap(Ep2,1+m,2+m);
  1+m < 1+m+1 by NAT_1:13;
  then
A30: not 2+m in union R1 & not 2+m in union R2 &
  not 2+m in union F  by A2,A29,FINSEQ_1:1;
  then reconsider Es1 as Enumeration of Rs1 by Th27;
  reconsider Es2 as Enumeration of Rs2 by A30,Th27;
A31: 1+m<>2+m;
  then reconsider Ees1 = Ee^Es1 as Enumeration of EF\/Rs1 by Th79,A30,Th22;
A32:len Ees1= len Ee + len Es1 by FINSEQ_1:22;
A33:len Ee = len E = card F by A3,CARD_1:def 7;
  set ER1 = Ext(R1,1+m,2+m),ER2 = Ext(R2,1+m,2+m),
  Ee1 = Ext(Ep1,1+m,2+m),
  Ee2 = Ext(Ep2,1+m,2+m);
  reconsider Ee1 as Enumeration of ER1 by A30,Th28;
  reconsider Ee2 as Enumeration of ER2 by A30,Th28;
  reconsider Ees2 = Ee1^Es as Enumeration of ER1\/SF  by A31,A30,Th22,Th79;
A34:  len N1 = N;
A35: len Ep1 = card R1 & len Ep2 = card R2 by CARD_1:def 7;
A36: s3^N1 in doms(m+1,card R1+card R2) by A35,A22,A19,A6,A15,A5,Th124,A16;
A37: s3 in doms(m+1,card R1) & N1 in doms(m+1,card R2)
  by A22,A20,A19,A36,A34,A35,Th120;
A38: card F = card R1+card R2 by A6,A22,A35,A18,FINSEQ_3:29;
  consider S1 be Subset of doms(m+2,card F+card R1) such that
card (s1"{1+m})=0 implies s1^s3 in S1 and
A40:S1 is with_evenly_repeated_values-member and
A41: for CE1,CE2 be FinSequence of D*, f,d1,d2 st
  len f = m &
  CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
  CE2 = SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,R1) * Ep1
  for CFes be non-empty non empty FinSequence of D* st
  CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
  Ext(F,1+len f,2+len f)\/swap(R1,1+len f,2+len f) ) * Ees1
  for Sd be Element of Fin dom App CFes st S1 = Sd
  holds M.((M "**" App CE1).s1,(M "**" App CE2).s3)=
  A$$(Sd,M"**"App CFes) &
  for h be FinSequence,i st h in Sd & i in dom h holds
  ((s1^s3).i = 1+len f implies h.i in {1+len f,2+len f}) &
   ((s1^s3).i <> 1+len f implies h.i =(s1^s3).i)
  by Th126,A1,A2,A3,A27,A7,A29,A24,A5,Th40,A37;
  consider S2 be Subset of doms(m+2,card R1+card F) such that
   card (s3"{1+m})=0 implies s3^s1 in S2 and
A43: S2 is with_evenly_repeated_values-member and
A44: for CE1,CE2 be FinSequence of D*, f,d1,d2 st
  len f = m & CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,R1) * Ep1 &
  CE2 = SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,F) * E
  for CFes be non-empty non empty FinSequence of D* st
  CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
  Ext(R1,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees2
  for Sd be Element of Fin dom App CFes st S2 = Sd
  holds
  M.((M "**" App CE1).s3,(M "**" App CE2).s1)= A$$(Sd,M"**"App CFes) &
  for h be FinSequence,i st h in Sd & i in dom h holds
  ((s3^s1).i = 1+len f implies h.i in {1+len f,2+len f}) &
  ((s3^s1).i <> 1+len f implies h.i =(s3^s1).i)
  by Th126,A24,A5,Th40,A1,A2,A3,A27,A7,A29,A37;
  consider G,H be Subset of doms(m+2,card R2) such that
A45:   G c= (len Ep2)-tuples_on {1+m,2+m} &
  H c= (len Ep2)-tuples_on {1+m,2+m}&G is with_evenly_repeated_values-member &
  H is with_evenly_repeated_values-member and
A46: for CFe,CFs be non-empty non empty FinSequence of D*,f,d1,d2 st
  len f=m &
  CFe = SignGenOp(f^<*d1*>^<*d2*>,A, Ext(R2,1+len f,2+len f) ) * Ee2 &
  CFs = SignGenOp(f^<*d1*>^<*d2*>,A, swap(R2,1+len f,2+len f) ) * Es2
  for Se be Element of Fin dom App CFe,
  Ss be Element of Fin dom App CFs st Se =G & Ss  =H holds
  A. ((M "**" App (SignGenOp(f^<*A.(d1,d2)*>,A,R2) * Ep2)).
  (len Ep2|-> (1+ len f)),
  (M "**" App (SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,R2)
  * Ep2)).(len Ep2|-> (1+ len f))) =
  A. ( A$$(Se,M"**"App CFe), A$$(Ss,M"**"App CFs))
    by A1,Th137,A22,A20,A19,A29;
A47:len Ees2= len Ee1 + len Es by FINSEQ_1:22;
A48:len Es = len E = card F by A3,CARD_1:def 7;
  ER2 \/  ER1 = EF by A28,Th16;
  then
A49: ER2 \/ (ER1\/SF) = EF\/SF by XBOOLE_1:4;
A50: ER2 misses ER1 by A30,A23,Th33;
  ER2 misses SF by A31,A30,Th22;
  then reconsider Ee2es2 = Ee2^Ees2 as Enumeration of EF\/SF
  by A49,Th79,A50,XBOOLE_1:70;
A51: len Ee2es2 = len Ee2+len Ees2 by FINSEQ_1:22;
  defpred P[object,object] means
  ($1 in Seg (L+N) implies for i st i=p2".$1 holds
  (i <= L implies $2=i+N) & (i > L implies $2=i-L)) &
  (not $1 in Seg (L+N) implies $2=$1);
A52: dom (p2") = rng p2 & rng (p2") = dom p2 by FUNCT_1:33;
A53: len Ees = len Ee + len Es by A4,FINSEQ_1:22;
A54: len Ees = len s1+len s2 =len (s2^s1)
  by A3,A6,A4,CARD_1:def 7,FINSEQ_1:22;
  then
A55: dom Ees = dom (s2^s1) by FINSEQ_3:29;
A56:len Ee = L+N by A6,A3,CARD_1:def 7;
A57: dom s2 = dom Ee = Seg (L+N) by A6,A33,FINSEQ_1:def 3,FINSEQ_3:29;
A58: dom s2 = dom Ee = Seg (L+N) by A6,A33,FINSEQ_1:def 3,FINSEQ_3:29;
A59: dom Ee c= dom Ees by A4,FINSEQ_1:26;
A60: for x st x in dom Ees ex y st y in dom Ees & P[x,y]
  proof
    let y such that
A61: y in dom Ees;
    reconsider x=y as Nat by A61;
    per cases;
    suppose
A62:  x in dom Ee;
      then
A63:  p2".x in Seg (L+N) by A57,A52,A17,FUNCT_1:def 3;
      reconsider j = (p2".x) as Nat;
A64:  1<=j <= L+N by A63,FINSEQ_1:1;
      per cases;
      suppose
A65:    j <=L;
        then 1+0 <=j+N <= L+N by A64,XREAL_1:7;
        then
A66:    j+N in dom Ee by A57;
        take jN=j+N;
        thus thesis by A62,A56,A65,A66,A59,FINSEQ_1:def 3;
      end;
      suppose
A67:    j > L;
        then reconsider jL=j-L as Nat by NAT_1:21;
        take jL;
        0<>jL <= j-0 by A67,XREAL_1:6;
        then 1<=jL <= L+N by A64,NAT_1:14,XXREAL_0:2;
        then jL in dom Ee by A57;
        hence thesis by A62,A56,A67,A59,FINSEQ_1:def 3;
      end;
    end;
    suppose
A69:  not x in dom Ee;
      take x;
      thus thesis by A56,A61,A69,FINSEQ_1:def 3;
    end;
  end;
  consider perm1 be Function of dom Ees,dom Ees such that
A70:    for x st x in dom Ees holds P[x,perm1.x] from FUNCT_2:sch 1(A60);
A71:dom perm1 = dom Ees by FUNCT_2:52;
A72:dom Ees c= rng perm1
  proof
    let x;
    assume
A73:  x in dom Ees;
    then reconsider x as Nat;
    per cases;
    suppose x in dom Ee;
      then
A74:  1<=x<=L+N by A57,FINSEQ_1:1;
      per cases;
      suppose  x <=N;
        then 1+0<=x+L<=N+L by A74,XREAL_1:7;
        then x+L in rng (p2") by A57,A17,A52;
        then consider y such that
A75:    y in dom (p2") & (p2").y = x+L by FUNCT_1:def 3;
        reconsider y as Nat by A75;
A76:    y in dom Ees by A59,A75,A57;
A77:    P[y,perm1.y] by A70,A59,A75,A57;
        x+L >= 1+L > L by A74,NAT_1:13,XREAL_1:6;
        then x+L >L by XXREAL_0:2;
        then perm1.y = x+L-L by A75,A57,A77;
        hence thesis by A71,A76,FUNCT_1:def 3;
      end;
      suppose
A78:    x >N;
        then reconsider xN=x-N as Nat by NAT_1:21;
A79:    0<>xN <= L+N-N & L<=L+N by A74,A78,NAT_1:11,XREAL_1:9;
        then 1<= xN <=L & xN <=L+N by NAT_1:14,XXREAL_0:2;
        then xN in rng (p2") by A57,A17,A52;
        then consider y such that
A80:    y in dom (p2") & (p2").y = xN by FUNCT_1:def 3;
A81:    y in dom Ees by A59,A80,A57;
        perm1.y = xN+N by A80,A57,A81,A70,A79;
        hence thesis by A71,A81,FUNCT_1:def 3;
      end;
    end;
    suppose not x in dom Ee;
      then perm1.x =x by A73,A70,A57;
      hence thesis by A73,A71,FUNCT_1:def 3;
    end;
  end;
  then dom Ees = rng perm1;
  then
A82: perm1 is onto by FUNCT_2:def 3;
  card dom Ees = card dom Ees;
  then perm1 is one-to-one by A82,FINSEQ_4:63;
  then reconsider perm1 as Permutation of dom Ees by A82;
  set p1I=perm1;
A83: len Ee1 = len Ep1 & len Ee2 = len Ep2 by CARD_1:def 7;
A84:dom Ees = dom Ee2es2 by A33,A6,A53,A51,A47,A22,A19,A83,FINSEQ_3:29;
  then
A85: dom (Ee2es2 * perm1) = dom perm1 by A72,RELAT_1:27;
  then dom (Ee2es2 * perm1) = Seg len Ees by A71,FINSEQ_1:def 3;
  then reconsider Eperm=Ee2es2 * perm1 as FinSequence by FINSEQ_1:def 2;
  for i st 1<=i <=len Ees holds Ees.i = (Eperm).i
  proof
    let i such that A86: 1<=i <=len Ees;
A87: i in dom Ees by A86,FINSEQ_3:25;
    then
A88: (Ee2es2 * perm1).i = Ee2es2.(perm1.i) & perm1.i in dom Ee2es2
    by A85,A71,FUNCT_1:11,12;
A89: P[i, perm1.i] by A87,A70;
    per cases;
    suppose
A90:  i in Seg (L+N);
      reconsider j=p2".i as Nat;
A91:  Ees.i = Ee.i by A4,A90,A57,FINSEQ_1:def 7;
A92:  p2.j = i & j in dom p2 by A90,A57,A17,FUNCT_1:32;
A93:  1<= j <= L+N by A92,FINSEQ_3:25;
      per cases;
        suppose
A94:      j <= L;
          then
A95:      perm1.i = j+N by A87,A70,A90;
A96:      j in dom Ee1 c= dom Ees2 by A93,A94,A83,A20,FINSEQ_1:26,FINSEQ_3:25;
          then
A97:      (Ee2es2 * perm1).i
          = Ees2.j by A95,A88,A83,A22,A20,A19,FINSEQ_1:def 7
          .= Ee1.j by A96,FINSEQ_1:def 7;
          Ee1 = Ext(Ep,1+m,2+m) | (Seg L) by Th26;
          then Ee1 = (Ee*p2) | (Seg L) by A3,Th25;
          then j in dom (Ee*p2) & Ee1.j = (Ee*p2).j
          by A96,FUNCT_1:47,RELAT_1:57;
          hence thesis by A91,A97,A92,FUNCT_1:12;
        end;
        suppose
A98:      j>L;
          then reconsider jL=j-L as Nat by NAT_1:21;
A99:      perm1.i = jL by A98,A87,A70,A90;
          jL<>0 by A98;
          then 1<= jL <= L+N-L by A93,NAT_1:14,XREAL_1:6;
          then
A100:     jL in dom Ee2 by A83,A22,A20,A19,FINSEQ_3:25;
          dom E=dom Ext(E,1+m,2+m) by Def5;
          then
A101:     j in dom (Ext(E,1+m,2+m)*p2) by A90,A16,A57,A92,FUNCT_1:11;
          (Ee2es2 * perm1).i = Ee2.jL by A88,A99,A100,FINSEQ_1:def 7
          .=(Ee1^Ee2).(jL+L) by A100,A83,A20,FINSEQ_1:def 7
          .= Ext(Ep,1+m,2+m).j by A21,Th19
          .= (Ext(E,1+m,2+m)*p2).j by Th25
          .= Ext(E,1+m,2+m).(p2.j) by A101,FUNCT_1:12
          .= Ext(E,1+m,2+m).i by A90,A57,A17,FUNCT_1:32
          .= Ee.i by A3;
          hence thesis by A4,A90,A57,FINSEQ_1:def 7;
        end;
      end;
      suppose
A102:   not i in Seg (L+N); then
A103:   N <= L+N < i by A86,NAT_1:11;
        then N<i by XXREAL_0:2;
        then not i in dom Ee2 by A83,A22,A20,A19,FINSEQ_3:25;
        then consider n such that
A104:   n in dom Ees2 & i=len Ee2 + n by A89,A102,A88,FINSEQ_1:25;
        L < n by A104,A103,A83,A22,A20,A19,XREAL_1:6;
        then not n in dom Ee1 by A83,A20,FINSEQ_3:25;
        then consider m such that
A105:   m in dom Es & n=len Ee1 + m by A104,FINSEQ_1:25;
        thus Eperm.i = Ee2es2.i by A88,A87,A70,A102
        .= Ees2.n by A104,FINSEQ_1:def 7
        .= Es.m by A105,FINSEQ_1:def 7
        .=(Ee^Es).(len Ee+m) by A105,FINSEQ_1:def 7
        .=(Ee^Es).i by A104,A105,A83,A6,A33,A22,A19
        .= Ees.i by A4;
      end;
    end;
    then
A106: Ees = Eperm by A85,FINSEQ_3:29,FUNCT_2:52;
    Rs1 \/ Rs2 = SF by A28,Th13;
    then
A107: (EF\/Rs1)\/Rs2 = EF\/SF by XBOOLE_1:4;
A108: Rs2 misses Rs1 by A31,A30,A23,Th34;
    Rs2 misses EF by A31,A30,Th22;
    then Rs2 misses EF \/Rs1 by A108,XBOOLE_1:70;
    then reconsider Ees1s2 = Ees1^Es2 as Enumeration of EF\/SF by A107,Th79;
A109: len Ees1s2 = len Ees1+len Es2 by FINSEQ_1:22;
    defpred Q[object,object] means
    ($1 in dom s1 implies $2=$1) &
    (not $1 in dom s1 implies for i,j st j=$1 & i=p2".(j-len s1)
    holds $2 = i+len s1);
A110: len Ees =len (s1^s2) by A48,A33,A6,A53,FINSEQ_1:22;
    then
A111: dom Ees = dom (s1^s2) by FINSEQ_3:29;
A112: len Es = L+N by A6,A3,CARD_1:def 7;
A113: dom s1 = dom Es = Seg (L+N) by A48,A6,FINSEQ_1:def 3,FINSEQ_3:29;
A114: dom s2 = dom Ee = Seg (L+N) by A6,A33,FINSEQ_1:def 3,FINSEQ_3:29;
A115: len Es1 = len Ep1 & len Es2 = len Ep2 by CARD_1:def 7;
A116: dom Ees = dom Ees1s2  by A32,A109,A53,A48,A6,A22,A19,A115,FINSEQ_3:29;
A117: Swap(Ep,1+m,2+m) = Swap(E,1+m,2+m)*p2 by Th23;
A118: Ees1s2 = Ee^(Es1^Es2) by FINSEQ_1:32;
A119: Es1^Es2 = Swap(Ep1^Ep2,1+m,2+m) by Th18
    .= Swap(Ep,1+m,2+m) by A21;
A120: for x st x in dom Ees ex y st y in dom Ees & Q[x,y]
    proof
      let y such that
A121: y in dom Ees;
      reconsider x=y as Nat by A121;
      per cases;
      suppose x in dom Ee;
        hence thesis by A121,A114,A113;
      end;
      suppose
A122:   not x in dom Ee;
        then consider n such that
A123:   n in dom Es & x=len Ee + n by A121,A4,FINSEQ_1:25;
        reconsider j = (p2".n) as Nat;
        take J=j+len s1;
        n in Seg(L+N) by A112,A123,FINSEQ_1:def 3;
        then j in Seg (L+N) by A52,A17,A58,FUNCT_1:def 3;
        hence thesis by A113,A122,A123,A4,A56,A6,FINSEQ_1:28,def 3;
      end;
    end;
    consider perm2 be Function of dom Ees,dom Ees such that
A124: for x st x in dom Ees holds Q[x,perm2.x] from FUNCT_2:sch 1(A120);
A125: dom perm2 = dom Ees by FUNCT_2:52;
A126: dom Ees c= rng perm2
    proof
      let y such that
A127:   y in dom Ees;
      reconsider x=y as Nat by A127;
A128: Q[x,perm2.x] by A127,A124;
      per cases;
      suppose x in dom Ee;
        hence thesis
        by A128,A3,A6,A127,A125,CARD_1:def 7,FINSEQ_3:29,FUNCT_1:def 3;
      end;
      suppose not x in dom Ee;
        then consider n such that
A129:   n in dom Es & x=len Ee + n by A127,A4,FINSEQ_1:25;
        reconsider j = p2.n as Nat;
        n in Seg(L+N) by A112,A129,FINSEQ_1:def 3;
        then
A130:   j in Seg (L+N) by A17,A58,FUNCT_1:def 3;
        then j in dom Es by A112,FINSEQ_1:def 3;
        then
A131:   len s1+j in dom (Ees) by A4,A56,A6,FINSEQ_1:28;
        then
A132:   Q[len s1+j,perm2.(len s1+j)] by A124;
A133:   p2".( len s1+j-len s1) =n by A129,A17,A58,A113,FUNCT_1:32;
        j>0 by A130,FINSEQ_1:1;
        then len s1+j > len s1+0 by XREAL_1:6;
        then perm2.(len s1+j) = x by A129,A56,A6,A133,A132,FINSEQ_3:25;
        hence thesis by A131,A125,FUNCT_1:def 3;
      end;
    end;
    then dom Ees = rng perm2;
    then
A134: perm2 is onto by FUNCT_2:def 3;
    card dom Ees = card dom Ees;
    then perm2 is one-to-one by A134,FINSEQ_4:63;
    then reconsider perm2 as Permutation of dom Ees by A134;
A135: dom s2 = Seg (N+L) by FINSEQ_1:def 3;
A136: dom (Ees1s2 * perm2) = dom perm2 by A126,A116,RELAT_1:27;
    dom (Ees1s2 * perm2) = Seg len Ees by A136,A125,FINSEQ_1:def 3;
    then reconsider Eperm2=Ees1s2 * perm2 as FinSequence by FINSEQ_1:def 2;
    for i st 1<=i <=len Ees holds Ees.i = (Eperm2).i
    proof
      let i such that
A137: 1<=i <=len Ees;
      i in dom Ees by A137,FINSEQ_3:25;
      then
A138: (Ees1s2 * perm2).i = Ees1s2.(perm2.i) & perm2.i in dom Ees1s2
      by A136,A125,FUNCT_1:11,12;
A139: i in dom perm2 by A137,A125,FINSEQ_3:25;
A140: len s1 = len E =len Ee by A6,A3,CARD_1:def 7;
A141: dom s1=dom Ee by A6,A3,CARD_1:def 7,FINSEQ_3:29;
      len (Es1^Es2) = len Es1 + len Es2 by FINSEQ_1:22;
      then
A142: dom (Es1^Es2)= dom s2 by A22,A18,CARD_1:def 7,FINSEQ_3:29;
      per cases;
      suppose
A143:   i in dom s1;
        Ees1s2.i = Ee.i = Ees.i by A118,A4,A143,A141,FINSEQ_1:def 7;
        hence thesis by A143,A139,A124,A138;
      end;
      suppose
A144:   not i in dom s1;
        then consider m such that
A145:   m in dom s2 & i=len s1 + m by A137,A111,FINSEQ_1:25,FINSEQ_3:25;
        reconsider j=p2".m as Nat;
        m = i-len s1 by A145;
        then
A146:   perm2.i = j+len s1 by A144,A139,A124;
A147:   p2.j = m & j in dom p2 by A145,A17,FUNCT_1:32;
A148:   j in dom (Es1^Es2) by A142,A145,A17,FUNCT_1:32;
A149:   dom Es = dom s2 by A6,A3,CARD_1:def 7,FINSEQ_3:29;
        (Ees1s2 * perm2).i =( Ee^(Es1^Es2)).(j+len s1) by A146,A138,FINSEQ_1:32
        .= (Es1^Es2).j by A148,A140,FINSEQ_1:def 7
        .= Es.m by A142,A147,A3,A117,A119,FUNCT_1:12
        .= (Ee^Es).i by A145,A149,A6,A33,FINSEQ_1:def 7;
        hence thesis by A4;
      end;
    end;
    then
A150: Ees = Eperm2 by A136,FINSEQ_3:29,FUNCT_2:52;
    doms(m+2,card F+card R1)^doms(m+2,card R2) =
    doms(m+2,card F+card R1+card R2) by Th123;
    then doms(m+2,card F+card R1)^doms(m+2,card R2) = doms(m+2,card F+card F)
    by A38;
    then reconsider s1h=S1^H  as Subset of doms(m+2,card F+card F)
    by POLNOT_1:16;
A151: len Ees = card (EF\/SF) by CARD_1:def 7;
    then
A152: card (EF\/SF) = len s1 +len s2 by A110,FINSEQ_1:22;
    then card F+card F = card (EF\/SF) by A6;
    then reconsider Pgs1={s*perm2 where s is FinSequence of NAT: s in s1h}
    as Subset of doms(m+2,card F+card F) by Th119;
    doms(m+2,card R2)^doms(m+2,card F+card R1) =
    doms(m+2,card R2+(card F+card R1)) by Th123;
    then reconsider gs2 = G^S2  as Subset of doms(m+2,card F+card F)
    by A38,POLNOT_1:16;
    reconsider Pgs2={s*perm1 where s is FinSequence of NAT: s in gs2}
    as Subset of doms(m+2,card F+card F) by A152,A6,Th119;
    take Pgs1,Pgs2;
    for x be Element of s1h st x in s1h holds dom x = dom Ees
    proof
      let x be Element of s1h such that
A153: x in s1h;
      reconsider x as FinSequence;
      len x = card F+card F by A153,CARD_1:def 7;
      hence thesis by A151,A152,A6,FINSEQ_3:29;
    end;
    hence Pgs1 is with_evenly_repeated_values-member by A40,A45,Lm1;
    for x be Element of gs2 st x in gs2 holds dom x = dom Ees
    proof
      let x be Element of gs2 such that
A154: x in gs2;
      reconsider x as FinSequence;
      len x = card F+card F by A154,CARD_1:def 7;
      hence thesis by A151,A152,A6,FINSEQ_3:29;
    end;
    hence Pgs2 is with_evenly_repeated_values-member by A43,A45,Lm1;
    let CE1,CE2 be FinSequence of D*,f,d1,d2 such that
A155: len f =m and
A156: CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
    CE2 = SignGenOp(f^<*A.(I.d1,d2)*>,A,F) * E;
    set fID = f^<*A.(I.d1,d2)*>, fD = f^<*A.(d1,d2)*>, fDD=f^<*d1*>^<*d2*>;
    let CFes be non-empty non empty FinSequence of D* such that
A157: CFes = SignGenOp(fDD,A,Ext(F,1+len f,2+len f)\/
    swap(F,1+len f,2+len f) ) * Ees;
A158: len fID = len f+1 =len fD by FINSEQ_2:16;
A159:   s1 in doms CE1 & s2 in doms CE2 by A5,A156,Th106,A158,A155;
A160: len s1 = len CE1 = len E =len CE2 = len s2 by A6,A156,CARD_1:def 7;
    set CEp1 = SignGenOp(fID,A,R1) * Ep1;
    set CEp2 = SignGenOp(fID,A,R2) * Ep2;
    rng CEp1 c= D* & rng CEp2 c= D*;
    then reconsider CEp1,CEp2 as FinSequence of D* by FINSEQ_1:def 4;
A161:len CEp1 = len Ep1 & len CEp2 = len Ep2 & len N1 = N by CARD_1:def 7;
A162: s3^N1 in doms (SignGenOp(fID,A,F) * Ep) by A159,A15,A156,Th110,A16;
A163: SignGenOp(fID,A,F) * Ep = CEp1^CEp2 by A21,Th81,A28;
    then
A164: s3 in doms CEp1 & N1 in doms CEp2 by A22,A20,A19,A161,A162,Th50;
A165: s2p2 in dom App (SignGenOp(fID,A,F) * Ep) by A15,A162,Def9;
A166: (M "**" App (SignGenOp(fID,A,F) * E)).s2 =
    (M "**" App (SignGenOp(fID,A,F) * Ep)).s2p2 by A159,A1,A156,Th112,A16
    .= M "**" ((App (SignGenOp(fID,A,F) * Ep)).s2p2) by A165,Def10
    .= M "**" ( ((App CEp1).s3) ^ ((App CEp2).N1)) by A15,A164,A163,Th61
    .= M.( M "**" ((App CEp1).s3),M "**" ((App CEp2).N1)) by A1,FINSOP_1:5;
    set CFes1 = SignGenOp(fDD,A,EF\/Rs1 ) * Ees1;
    set DFs2 = SignGenOp(fDD,A,Rs2 ) * Es2;
A167: len CFes1 = len Ees1 by CARD_1:def 7;
A168: for x st x in dom CFes1 holds CFes1.x is non empty
    proof
      let x;
      assume x in dom CFes1;
      then CFes1.x = SignGen(fDD,A,Ees1.x) by Th80;
      hence thesis;
    end;
    rng CFes1 c= D*;
    then reconsider CFes1 as non-empty non empty FinSequence of D*
    by A11,A168,FINSEQ_1:def 4,FUNCT_1:def 9;
A169: len DFs2 = len Es2 by CARD_1:def 7;
A170: for x st x in dom DFs2 holds DFs2.x is non empty
    proof
      let x;
      assume x in dom DFs2;
      then DFs2.x = SignGen(fDD,A,Es2.x) by Th80;
      hence thesis;
    end;
    rng DFs2 c= D*;
    then reconsider DFs2 as non-empty non empty FinSequence of D*
    by A9,A22,A20,A19,A170,FINSEQ_1:def 4,FUNCT_1:def 9;
    set CFes2 = SignGenOp(fDD,A,ER1\/SF ) * Ees2;
    set GFe2 = SignGenOp(fDD,A,ER2 ) * Ee2;
A171: len CFes2 = len Ees2 by CARD_1:def 7;
A172: for x st x in dom CFes2 holds CFes2.x is non empty
    proof
      let x;
      assume x in dom CFes2;
      then CFes2.x = SignGen(fDD,A,Ees2.x) by Th80;
      hence thesis;
    end;
    rng CFes2 c= D*;
    then reconsider CFes2 as non-empty non empty FinSequence of D*
    by A11,A172,FINSEQ_1:def 4,FUNCT_1:def 9;
A173: len GFe2 = len Ee2 by CARD_1:def 7;
A174: for x st x in dom GFe2 holds GFe2.x is non empty
    proof
      let x;
      assume x in dom GFe2;
      then GFe2.x = SignGen(fDD,A,Ee2.x) by Th80;
      hence thesis;
    end;
    rng GFe2 c= D*;
    then reconsider GFe2 as non-empty non empty FinSequence of D*
    by A9,A22,A20,A19,A174,FINSEQ_1:def 4,FUNCT_1:def 9;
    set CGS1 = SignGenOp(fDD,A,EF\/SF) * Ees1s2;
    set DEp1 = SignGenOp(fD,A,R1) * Ep1, DEp2 = SignGenOp(fD,A,R2) * Ep2;
    rng DEp1 c= D* & rng DEp2 c= D*;
    then reconsider DEp1,DEp2  as FinSequence of D*  by FINSEQ_1:def 4;
A175: doms (SignGenOp(fID,A,F) * E) = doms (SignGenOp(fD,A,F) * E)
    by A158,Th107;
    then s1 in dom App (SignGenOp(fID,A,F) * E) by A159,A156,Def9;
    then (M "**" App (SignGenOp(fID,A,F) * E)).s1 =
    M "**" ((App (SignGenOp(fID,A,F) * E)).s1) by Def10;
    then reconsider m1 = (M "**" App (SignGenOp(fID,A,F) * E)).s1
      as Element of D;
    doms (SignGenOp(fD,A,R1) * Ep1) = doms (SignGenOp(fID,A,R1) * Ep1)
    by A158,Th107;
    then
A176: s3 in dom App (SignGenOp(fD,A,R1) * Ep1) by A164,Def9;
    then (M "**" App(SignGenOp(fD,A,R1) * Ep1)).s3 =
    M "**" ((App (SignGenOp(fD,A,R1) * Ep1)).s3) by Def10;
    then reconsider md3 = (M "**" App (SignGenOp(fD,A,R1) * Ep1)).s3
    as Element of D;
A177:len DEp1 = len Ep1 & len DEp2 = len Ep2 & len N1 = N by CARD_1:def 7;
    doms (SignGenOp(fID,A,F) * Ep) = doms (SignGenOp(fD,A,F) * Ep)
    by A158,Th107;
    then
A178: s3^N1 in doms (SignGenOp(fD,A,F) * Ep) by A159,A15,A156,Th110,A16;
A179: SignGenOp(fD,A,F) * Ep = DEp1^DEp2 by A21,A28,Th81;
    then
A180: s3 in doms DEp1 & N1 in doms DEp2 by A178,A177,Th50,A22,A20,A19;
A181: s2p2 in dom App (SignGenOp(fD,A,F) * Ep) by A178,A15,Def9;
A182: (M "**" App (SignGenOp(fD,A,F) * E)).s2 =
    (M "**" App (SignGenOp(fD,A,F) * Ep)).s2p2 by A159,A1,Th112,A16,A175,A156
    .= M "**" ((App (SignGenOp(fD,A,F) * Ep)).s2p2) by A181,Def10
    .= M "**" ( ((App DEp1).s3) ^ ((App DEp2).N1)) by A15,A179,A180,Th61
    .= M.( M "**" ((App DEp1).s3),M "**" ((App DEp2).N1)) by A1,FINSOP_1:5;
    s1 in dom App CE2 by A175,A156,A159,Def9;
    then M "**" ((App CE2).s1) = (M "**" (App CE2)).s1 by Def10;
    then reconsider CE2s1 = (M "**" (App CE2)).s1 as Element of D;
    s1 in dom App CE1 by A159,Def9;
    then M "**" ((App CE1).s1) = (M "**" (App CE1)).s1 by Def10;
    then reconsider CE1s1 = (M "**" (App CE1)).s1 as Element of D;
A183: s3 in dom App CEp1 by A164,Def9;
    then (M "**" App(CEp1)).s3 = M "**" ((App (CEp1)).s3) by Def10;
    then reconsider mc3 = (M "**" App (CEp1)).s3 as Element of D;
A184: len fDD=len (f^<*d1*>)+1 & len (f^<*d1*>) = m+1 by A155,FINSEQ_2:16;
    then dom App CFes1 = doms(m+2,card F + card R1) by Lm3,A32,A33,A115,A35;
    then reconsider dS1=S1 as Element of Fin dom App CFes1 by FINSUB_1:def 5;
    dom App CFes2 = doms(m+2, card R1+card F) by Lm3,A184,A35,A47,A48,A83;
    then reconsider dS2=S2 as Element of Fin dom App CFes2 by FINSUB_1:def 5;
A185: DEp1 = SignGenOp(f^<*A . (d1,d2)*>,A,R1) * Ep1;
A186:  M.((M "**" App DEp1).s3,(M "**" App CE2).s1)=
    A$$(dS2,M"**"App CFes2) &
    for h be FinSequence,i st h in dS2 & i in dom h holds
    ((s3^s1).i = 1+len f implies h.i in {1+len f,2+len f}) &
    ((s3^s1).i <> 1+len f implies h.i =(s3^s1).i)
    by A156,A155,A44,A185;
    CEp1 = SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,R1) * Ep1;
    then
A187: M.((M "**" App CE1).s1,(M "**" App CEp1).s3)=
    A$$(dS1,M"**"App CFes1) &
    for h be FinSequence,i st h in dS1 & i in dom h holds
    ((s1^s3).i = 1+len f implies h.i in {1+len f,2+len f}) &
    ((s1^s3).i <> 1+len f implies h.i =(s1^s3).i) by A155,A41,A156;
A188:  A$$(dS1,M"**"App CFes1) =
    M.((M "**" App CE1).s1,(M "**" App CEp1).s3) by A155,A41,A156
    .= M.((M "**" App (SignGenOp(fD,A,F) * E)).s1,
    (M "**" App (SignGenOp(fID,A,R1) * Ep1)).s3) by A156
    .= M.((M "**" App (SignGenOp(fID,A,F) * E)).s1,
    (M "**" App (SignGenOp(fD,A,R1) * Ep1)).s3)
    by A155,A159,A156,A7,A27,A164,A1,Th136
    .= M.(md3, m1 ) by A1,BINOP_1:def 2
    .=M.((M "**" App DEp1).s3,(M "**" App CE2).s1) by A156
    .= A$$(dS2,M"**"App CFes2) by A156,A155,A44;
A189:  A$$(dS1,M"**"App CFes1) =
    M.((M "**" App CE1).s1,(M "**" App CEp1).s3) by A187
    .= M.((M "**" App (SignGenOp(fD,A,F) * E)).s1,
    (M "**" App (SignGenOp(fID,A,R1) * Ep1)).s3) by A156
    .= M.((M "**" App (SignGenOp(fID,A,F) * E)).s1,
    (M "**" App (SignGenOp(fD,A,R1) * Ep1)).s3)
    by A155,A156,A159,A7,A27,A164,A1,Th136
    .= M.(md3, m1 ) by A1,BINOP_1:def 2
    .=M.((M "**" App DEp1).s3,(M "**" App CE2).s1) by A156
    .= A$$(dS2,M"**"App CFes2) by A156,A155,A44;
A190: M.((M "**" App CE1).s2,(M "**" App CE2).s1) =
    M.((M "**" App (SignGenOp(fD,A,F) * E)).s2,
    (M "**" App (SignGenOp(fID,A,F) * E)).s1) by A156
    .= M.((M "**" App (SignGenOp(fD,A,F) * E)).s2,CE2s1) by A156
    .= M. (M.( M "**" ((App DEp1).s3), M "**" ((App DEp2).N1)),CE2s1)
    by A182
    .= M. (M.(M "**" ((App DEp2).N1), M "**" ((App DEp1).s3)),CE2s1)
    by A1,BINOP_1:def 2
    .= M. ( M "**" ((App DEp2).N1), M.( M "**" ((App DEp1).s3),CE2s1))
    by A1,BINOP_1:def 3
    .= M. ( M "**" ((App DEp2).N1), A$$(dS2,M"**"App CFes2))
    by Def10,A176,A186;
A191: M.((M "**" App CE1).s1,(M "**" App CE2).s2) =
    M.((M "**" App (SignGenOp(fD,A,F) * E)).s1,
    (M "**" App (SignGenOp(fID,A,F) * E)).s2) by A156
    .= M.(CE1s1, (M "**" App (SignGenOp(fID,A,F) * E)).s2) by A156
    .= M. ((M "**" App (SignGenOp(fID,A,F) * E)).s2, CE1s1)
    by A1,A166,BINOP_1:def 2
    .= M. (M.( M "**" ((App CEp1).s3), M "**" ((App CEp2).N1)),CE1s1)
    by A166
    .= M. (M.( M "**" ((App CEp2).N1), M "**" ((App CEp1).s3) ), CE1s1)
    by A1,BINOP_1:def 2
    .= M. (M "**" ((App CEp2).N1), M.(M "**" ((App CEp1).s3), CE1s1))
    by A1,BINOP_1:def 3
    .= M. (M "**" ((App CEp2).N1), M.( CE1s1, M "**" ((App CEp1).s3) ))
    by A1,BINOP_1:def 2
    .= M. (M "**" ((App CEp2).N1), A$$(dS1,M"**"App CFes1)) by A187,A183,Def10;
    N1 in dom App CEp2 & N1 in dom App DEp2 by A164,A180,Def9;
    then
A192: M "**" ((App CEp2).N1) = (M"**" (App CEp2)).N1 &
    M "**" ((App DEp2).N1) = (M"**" (App DEp2)).N1 by Def10;
    dom App GFe2 = doms(m+2,card R2) by A83,A35,A184,Lm3;
    then reconsider dG=G as Element of Fin dom App GFe2 by FINSUB_1:def 5;
    dom App DFs2 = doms(m+2,card R2) by A115,A35,A184,Lm3;
    then reconsider dH=H as Element of Fin dom App DFs2 by FINSUB_1:def 5;
A193:   CFes = SignGenOp(fDD,A,Ext(F,1+m,2+m)\/swap(F,1+m,2+m) ) * Ees
    by A157,A155;
    then
A194: len CFes = len Ees by CARD_1:def 7;
    doms(m+2,card F+card F) = dom App CFes by A193,A184,Lm3,A33,A48,A53;
    then reconsider dPgs1 = Pgs1, dPgs2 = Pgs2
    as Element of Fin dom App CFes by FINSUB_1:def 5;
A195: A. ( M.((M "**" App CE1).s1,(M "**" App CE2).s2),
    M.((M "**" App CE1).s2,(M "**" App CE2).s1))
    = A. ( M. ( M "**" ((App CEp2).N1), A$$(dS2,M"**"App CFes2)),
    M. ( M "**" ((App DEp2).N1), A$$(dS2,M"**"App CFes2)))
    by A189,A190,A191
    .= M. (A. (M "**" ((App CEp2).N1), M "**" ((App DEp2).N1)),
    A$$(dS2,M"**"App CFes2)) by A1,BINOP_1:13
    .= M. (A. (M "**" ((App DEp2).N1), M "**" ((App CEp2).N1)),
    A$$(dS2,M"**"App CFes2)) by A1,BINOP_1:def 2
    .= M. ( A. ( A$$(dG,M"**"App GFe2), A$$(dH,M"**"App DFs2)),
    A$$(dS2,M"**"App CFes2)) by A192,A155,A46,A22,A20,A19
    .= A. (M. ( A$$(dG,M"**"App GFe2),A$$(dS2,M"**"App CFes2)),
    M.(A$$(dH,M"**"App DFs2), A$$(dS2,M"**"App CFes2))) by A1,BINOP_1:13;
    set CGS2 = SignGenOp(fDD,A,EF\/SF) * Ee2es2;
A196: for x st x in dom CGS2 holds CGS2.x is non empty
    proof
      let x;
      assume x in dom CGS2;
      then CGS2.x = SignGen(fDD,A,Ee2es2.x) by Th80;
      hence thesis;
    end;
    rng CGS2 c= D*;
    then reconsider CGS2 as non-empty non empty FinSequence of D*
    by A11,A196,FINSEQ_1:def 4,FUNCT_1:def 9;
    doms(m+2,card F+card F) = dom App CGS2
    by A184,Lm3,A38,A35,A48,A51,A47,A83;
    then reconsider dgs2=gs2 as Element of Fin dom App CGS2 by FINSUB_1:def 5;
A197: GFe2^CFes2 = CGS2 by A49,Th81;
    dG c= dom App GFe2 & dS2 c= dom App CFes2 by FINSUB_1:def 5;
    then
A198: dG c= doms GFe2 & dS2 c= doms CFes2 by Def9;
A199: dPgs2 c= dom App CFes = doms CFes by Def9,FINSUB_1:def 5;
A200: len s3 = L by A20,A177,A180,Th47;
A201: for h be FinSequence,i st h in Pgs2 & i in dom (s2^s1) holds
    ((s2^s1).i = 1+len f implies h.i in {1+len f,2+len f}) &
    ((s2^s1).i <> 1+len f implies h.i =(s2^s1).i)
    proof
      let h be FinSequence,i such that
A202: h in Pgs2 & i in dom (s2^s1);
      consider s be FinSequence of NAT such that
A203: h = s*perm1 & s in gs2 by A202;
      len h = len (s2^s1) by Th47,A194,A54,A199,A202;
      then dom h =dom (s2^s1) by FINSEQ_3:29;
      then
A204: h.i = s.(perm1.i) & i in dom perm1 by A203,A202,FUNCT_1:11,12;
      consider g1,g2 be FinSequence such that
A205: s = g1^g2 & g1 in G & g2 in S2 by A203,POLNOT_1:def 2;
A206: len g1 = len Ee2 = N & len g2 = len Ee1 + len E
      by Th47,A198,A205,A48,A47,A171,A173,A22,A20,A19,CARD_1:def 7;
      then len s = len g1+len g2 = len E+len E by A205,A6,A83,A20,FINSEQ_1:22;
      then
A207: dom s = dom Ees by A3,A4,CARD_1:def 7,FINSEQ_3:29;
A208: P[i,perm1.i] by A55,A202,A70;
      per cases;
      suppose
A209:   i in dom s2;
        then
A210:   (s2^s1).i = s2.i by FINSEQ_1:def 7;
        consider j be object such that
A211:   j in dom p2 & i = p2.j by A209,A17,FUNCT_1:def 3;
        reconsider j as Nat by A211;
A212:   j in dom (s2*p2) by A211,A17,RELAT_1:27;
A213:   (s3^N1).j = s2.i by A25,A15,A211,FUNCT_1:12;
A214:   (p2").i = j by A211,FUNCT_1:32;
        per cases;
        suppose
A215:     j in dom s3;
          then
A216:     1<=j <=L by A200,FINSEQ_3:25;
          s2.i = s3.j by A213,A215,FINSEQ_1:def 7;
          then
A217:     (s2^s1).i = (s3^s1).j by A210,A215,FINSEQ_1:def 7;
A218:     dom s3 c= dom g2 by A83,A20,A200,A206,FINSEQ_3:30,NAT_1:11;
A219:     s.(j+N) = g2.j by A218,A215,A206,A205,FINSEQ_1:def 7;
          h.i = s.(j+N) by A204,A214,A208,A216,A209,FINSEQ_1:def 3;
          hence thesis by A219,A217,A218,A215,A186,A205;
        end;
        suppose
A221:     not j in dom s3;
          then consider n such that
A222:     n in dom N1 & j=len s3 + n by A212,A15,FINSEQ_1:25;
          j>=1 by A211,FINSEQ_3:25;
          then
A223:     j > L by A200,A221,FINSEQ_3:25;
A224:     perm1.i = j - L by A223,A214,A208,A209,FINSEQ_1:def 3;
A225:     s2.i = N1.n by A213,A222,FINSEQ_1:def 7;
          thus (s2^s1).i = 1+len f implies h.i in {1+len f,2+len f}
          proof
            assume (s2^s1).i = 1+len f;
            len g1 = len N1 by A206;
            then
A226:       dom g1 = dom N1 by FINSEQ_3:29;
            then
A227:       h.i = g1.n by A224,A200,A204,A205,A222,FINSEQ_1:def 7;
            g1 is Element of (len Ep2)-tuples_on {1+len f,2+len f}
            by A155,A205,A45;
            then
A228:       rng g1 c= {1+len f,2+len f} by FINSEQ_1:def 4;
            g1.n in rng g1 by A226,A222,FUNCT_1:def 3;
            hence thesis by A227,A228;
          end;
          thus thesis by A155,A225,A210,A222,FUNCOP_1:7;
        end;
      end;
      suppose
A229:   not i in dom s2;
        then consider n such that
A230:   n in dom s1 & i=len s2 + n by A202,FINSEQ_1:25;
        (s2^s1).i = s1.n by A230,FINSEQ_1:def 7;
        then
A231:   (s2^s1).i = (s3^s1).(L+n) by A200,A230,FINSEQ_1:def 7;
A232:   dom s2 = Seg (L+N) by FINSEQ_1:def 3;
        1<= i by A202,FINSEQ_3:25;
        then N <= L+N < i by A232,A229,NAT_1:11;
        then N <i by XXREAL_0:2;
        then
A233:   not i in dom g1 by A206,FINSEQ_3:25;
        consider m such that
A234:   m in dom g2 & i=len g1 + m by A207,A55,A202,A205,A233,FINSEQ_1:25;
        h.i = g2.m by A204,A229,A208,A205,A234,FINSEQ_1:def 3,def 7;
        hence thesis by A231,A234,A206,A230,A205,A186;
      end;
    end;
A235: for x st x in dom CGS1 holds CGS1.x is non empty
    proof
      let x;
      assume x in dom CGS1;
      then CGS1.x = SignGen(fDD,A,Ees1s2.x) by Th80;
      hence thesis;
    end;
    rng CGS1 c= D*;
    then reconsider CGS1 as non-empty non empty FinSequence of D*
    by A11,A235,FINSEQ_1:def 4,FUNCT_1:def 9;
    doms(m+2,card F+card F) = dom App CGS1
    by A38,A184,Lm3,A115,A35,A32,A33,A109;
    then reconsider ds1h=s1h as Element of Fin dom App CGS1 by FINSUB_1:def 5;
A236: CFes1^DFs2 = CGS1 by A107,Th81;
    dH c= dom App DFs2 & dS1 c= dom App CFes1 by FINSUB_1:def 5;
    then
A237:dH c= doms DFs2 & dS1 c= doms CFes1 by Def9;
A238:dPgs1 c= dom App CFes by FINSUB_1:def 5;
A239:for h be FinSequence,i st h in Pgs1 & i in dom (s1^s2) holds
    ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
    ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i)
    proof
      let h be FinSequence,i such that
A240: h in Pgs1 & i in dom (s1^s2);
      consider s be FinSequence of NAT such that
A241: h = s*perm2 & s in s1h by A240;
      len h = len (s1^s2) by Th47,A194,A110,A238,A199,A240;
      then
A242: dom h =dom (s1^s2) by FINSEQ_3:29;
      then
A243: h.i = s.(perm2.i) & i in dom perm2 by A241,A240,FUNCT_1:11,12;
      consider g1,g2 be FinSequence such that
A244: s = g1^g2 & g1 in S1 & g2 in H by A241,POLNOT_1:def 2;
A245: len g2 = len DFs2 & len g1 = len CFes1  by Th47,A237,A244;
A246: len g2 = len Es2 & len g1 = len Es1 + len E
      by A169,A33,A32,A167,Th47,A237,A244;
A247: dom g1 = dom Ees1 by A245,CARD_1:def 7,FINSEQ_3:29;
A248: dom s1=dom Ee c= dom Ees1
      by A3,A6,CARD_1:def 7,FINSEQ_1:26,FINSEQ_3:29;
      per cases;
      suppose
A249:   i in dom s1;
        then
A250:   perm2.i = i by A124,A111,A240;
A251:   s.i = g1.i by A247,A248,A249,A244,FINSEQ_1:def 7;
        (s1^s3).i = s1.i = (s1^s2).i by A249,FINSEQ_1:def 7;
        hence thesis by A243,A250,A251,A187,A247,A248,A249,A244;
      end;
      suppose
A252:   not  i in dom s1;
        then consider n such that
A253:   n in dom s2 & i=len s1 + n by A240,FINSEQ_1:25;
        reconsider j=p2".n as Nat;
        n = i-len s1 by A253;
        then
A254:   perm2.i = j+len s1 by A124,A111,A240,A252;
A255:   p2.j = n & j in dom p2 by A253,A17,FUNCT_1:32;
        then
A256:   s2.n = (s3^N1).j by A15,A253,FUNCT_1:11,12;
A257:   1<=j <=L+N by A135,A255,FINSEQ_1:1;
A258:   (s1^s2).i = s2.n by A253,FINSEQ_1:def 7;
        per cases;
        suppose
A259:     j <= L;
          then 1+0 <= j+len E <= len g1
          by A257,A245,A33,A32,A167,A115,A20,XREAL_1:7;
          then
A260:     j+len E in dom g1 by FINSEQ_3:25;
          then
A261:     h.i = g1.(j+len E) by A254,A243,A244,A6,FINSEQ_1:def 7;
A262:     j in dom s3 by A200,A257,A259,FINSEQ_3:25;
          then
A263:     (s1^s3).(j+len E) = s3.j by A6,FINSEQ_1:def 7;
          thus (s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}
          proof
            assume (s1^s2).i = 1+len f;
            then (s1^s3).(j+len E) = 1+len f
            by A256,A258,A263,A262,FINSEQ_1:def 7;
            hence thesis by A261,A244,A260,A187;
          end;
          assume (s1^s2).i <> 1+len f;
          then (s1^s3).(j+len E) <> 1+len f
          by A256,A258,A263,A262,FINSEQ_1:def 7;
          then g1.(j+len E) = (s1^s3).(j+len E) by A244,A260,A187;
          hence h.i =(s1^s2).i by A261,A258,A262,A263,A256,FINSEQ_1:def 7;
        end;
        suppose
A264:     j > L;
          then reconsider jL=j-L as Nat by NAT_1:21;
          jL<>0 by A264;
          then
A265:     1<= jL <= L+N-L by A257,NAT_1:14,XREAL_1:6;
          then
A266:     jL in dom N1;
          then
A267:     (s3^N1).(L+jL) = N1.jL by A200,FINSEQ_1:def 7;
A268:     jL in dom g2 by A115,A22,A20,A19,A246,A265,FINSEQ_3:25;
          L+len s1 = len g1 by A20,A245,A6,A3,A167,CARD_1:def 7;
          then
A269:     h.i = s.(jL+(L+len s1)) = g2.jL
          by A244,A254,A242,A241,A240,A268,FINSEQ_1:def 7,FUNCT_1:12;
          g2 is Element of (len Ep2)-tuples_on {1+len f,2+len f}
          by A155,A45,A244;
          then
A270:     rng g2 c= {1+len f,2+len f} by FINSEQ_1:def 4;
          g2.jL in rng g2 by A268,FUNCT_1:def 3;
          hence thesis by A155,A269,A270,A267,A258,A256,A266,FUNCOP_1:7;
        end;
      end;
    end;
A271: Pgs2 misses Pgs1
    proof
      assume Pgs2 meets Pgs1;
      then consider x such that
A272: x in Pgs2 & x in Pgs1 by XBOOLE_0:3;
      reconsider x as FinSequence by A272;
A273: dom s1=dom s2 by A6,FINSEQ_3:29;
      s1<>s2 by A5;
      then consider i be object such that
A274: i in dom s1 & s1.i <>s2.i by A6,FINSEQ_3:29;
      reconsider i as Nat by A274;
A275: (s1^s2).i = s1.i & (s2^s1).i = s2.i by A274,A273,FINSEQ_1:def 7;
A276: dom s1 c= dom (s1^s2) & dom s2 c= dom (s2^s1) by FINSEQ_1:26;
      dom s1=dom CE1 & dom s2 = dom CE2 by A160,FINSEQ_3:29;
      then
A277: CE1.i = SignGen(fD,A,E.i) & CE2.i = SignGen(fID,A,E.i)
      by A156,Th80,A274,A273;
      per cases;
      suppose
A278:   s1.i = 1+len f;
        then x.i in {1+len f,2+len f} by A275,A276,A239,A272,A274;
        then
A279:   x.i = 1+len f or x.i = 2+len f by TARSKI:def 2;
        s2.i in dom (CE2.i) by A159,Th47,A274,A273;
        then
A280:   s2.i in dom fID by A277,Def11;
        x.i = s2.i by A278,A201,A275,A276,A274,A273,A272;
        then 1+len f+1 <= len fID by A280,A279,A278,A274,FINSEQ_3:25;
        hence thesis by A158,NAT_1:13;
      end;
      suppose
A281:   s2.i = 1+len f;
        then x.i in {1+len f,2+len f} by A275,A276,A274,A273,A272,A201;
        then
A282:   x.i = 1+len f or x.i = 2+len f by TARSKI:def 2;
        s1.i in dom (CE1.i) by A159,Th47,A274;
        then
A283:   s1.i in dom fD by A277,Def11;
        x.i = s1.i by A239,A276,A272,A281,A275,A274;
        then 1+len f+1 <= len fD by A283,A282,A281,A274,FINSEQ_3:25;
        hence thesis by A158,NAT_1:13;
      end;
      suppose s1.i <> 1+len f & s2.i <> 1+len f;
        then x.i = s1.i & x.i = s2.i by A201,A239,A275,A276,A274,A273,A272;
        hence thesis by A274;
      end;
    end;
    let D1,D2 be Element of Fin dom App CFes such that
A284: D1 = Pgs1 & D2=Pgs2;
    thus D1 misses D2 by A271,A284;
    thus A.( M.((M "**" App CE1).s1,(M "**" App CE2).s2),
    M.((M "**" App CE1).s2,(M "**" App CE2).s1))=
    A. (M. ( A$$(dG,M"**"App GFe2),A$$(dS2,M"**"App CFes2)),
    M.(A$$(dH,M"**"App DFs2), A$$(dS2,M"**"App CFes2))) by A195
    .= A. (A $$ (dgs2,M "**" App CGS2), M.(A$$(dH,M"**"App DFs2),
    A$$(dS2,M"**"App CFes2))) by A197,A1,Th93
    .= A. (A$$ (dPgs2,M "**" App CFes), M.(A$$(dH,M"**"App DFs2),
    A$$(dS2,M"**"App CFes2))) by A193,A1,A84,A106,Th115
    .= A. (A$$ (dPgs2,M "**" App CFes), M.(A$$(dH,M"**"App DFs2),
    A$$(dS1,M"**"App CFes1))) by A188
    .= A. (A$$ (dPgs2,M "**" App CFes),
    M.( A$$(dS1,M"**"App CFes1), A$$(dH,M"**"App DFs2)))
    by A1,BINOP_1:def 2
    .= A. (A$$ (dPgs2,M "**" App CFes), A $$ (ds1h,M "**" App CGS1))
    by A1,Th93,A236
    .=A. (A$$ (dPgs2,M "**" App CFes),A$$ (dPgs1,M "**" App CFes)) by A1,A116
,A150,Th115,A193
    .=A$$ (D1\/D2,M "**" App CFes) by A284,A271,A1,SETWOP_2:4;
    thus for h be FinSequence,i st h in D1 & i in dom (s1^s2) holds
    ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
    ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i) by A239,A284;
    thus thesis by A201,A284;
end;

theorem Th139:
  A is commutative associative having_a_unity having_an_inverseOp &
  M is associative commutative having_a_unity &
  M is_distributive_wrt A
implies
  for E be Enumeration of F st union F c= Seg (1+m)
  for Ee be Enumeration of Ext(F,1+m,2+m),
      Es be Enumeration of swap(F,1+m,2+m) st
      Ee = Ext(E,1+m,2+m) & Es = Swap(E,1+m,2+m)
  for Ees be Enumeration of
      Ext(F,1+m,2+m)\/swap(F,1+m,2+m) st Ees=Ee^Es
  for s1,s2 be FinSequence st s1 in doms(m+1,card F) & s2 in doms(m+1,card F) &
    s1 is with_evenly_repeated_values & s2 is with_evenly_repeated_values &
    s1<>s2
  ex D1,D2 be Subset of doms(m+2,card F+card F) st
    D1 is with_evenly_repeated_values-member &
    D2 is with_evenly_repeated_values-member &
    for CE1,CE2 be FinSequence of D*,f,d1,d2 st
      len f = m &
      CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
      CE2 = SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,F) * E
     for CFes be non-empty non empty FinSequence of D* st
       CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
             Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees
     for S1,S2 be Element of Fin dom App CFes st
       S1=D1 & S2=D2 holds
     S1 misses S2 &
     A.(M.((M"**"App CE1).s1,(M"**"App CE2).s2),
        M.((M"**"App CE1).s2,(M"**"App CE2).s1))= A$$(S1\/S2,M"**"App CFes) &
     (for h be FinSequence,i st h in S1 & i in dom (s1^s2) holds
       ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
       ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i)) &
     (for h be FinSequence,i st h in S2 & i in dom (s2^s1) holds
       ((s2^s1).i = 1+len f implies h.i in {1+len f,2+len f}) &
       ((s2^s1).i <> 1+len f implies h.i =(s2^s1).i))
proof
  assume
A1: A is commutative associative having_a_unity having_an_inverseOp &
  M is associative commutative having_a_unity &
  M is_distributive_wrt A;
  let E be Enumeration of F such that
A2: union F c= Seg (1+m);
  let Ee be Enumeration of Ext(F,1+m,2+m),
      Es be Enumeration of swap(F,1+m,2+m) such that
A3: Ee = Ext(E,1+m,2+m) & Es = Swap(E,1+m,2+m);
  let Ees be Enumeration of
      Ext(F,1+m,2+m)\/swap(F,1+m,2+m) such that
A4:Ees=Ee^Es;
  let s1,s2 be FinSequence such that
A5:s1 in doms(m+1,card F) & s2 in doms(m+1,card F) &
  s1 is with_evenly_repeated_values &
  s2 is with_evenly_repeated_values & s1<>s2;
  set I=the_inverseOp_wrt A;
  per cases by XXREAL_0:1;
  suppose
A6: card (s1"{1+m}) = card (s2"{1+m});
    then consider D1 be Subset of doms(m+2,card F+card F) such that
    card (s1"{1+m}) = 0 implies  s1^s2 in D1 and
A7: D1 is with_evenly_repeated_values-member &
    for CE1,CE2 be FinSequence of D*, f,d1,d2 st len f = m &
    CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
    CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F) * E
    for CFes be non-empty non empty FinSequence of D* st
    CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
    Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees
    for Sd be Element of Fin dom App CFes st Sd = D1 holds
    M.((M "**" App CE1).s1,(M "**" App CE2).s2)= A$$(Sd,M"**"App CFes) &
    for h be FinSequence,i st h in Sd & i in dom h holds
    ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
    ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i) by A1,A2,A3,A4,A5,Th126,Th40;
    consider D2 be Subset of doms(m+2,card F+card F) such that
    card (s2"{1+m}) = 0 implies  s2^s1 in D2 and
A8:  D2 is with_evenly_repeated_values-member &
    for CE1,CE2 be FinSequence of D*, f,d1,d2 st len f = m &
    CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
    CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F) * E
    for CFes be non-empty non empty FinSequence of D* st
    CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
    Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees
    for Sd be Element of Fin dom App CFes st D2 = Sd holds
    M.((M "**" App CE1).s2,(M "**" App CE2).s1)= A$$(Sd,M"**"App CFes) &
    for h be FinSequence,i st h in Sd & i in dom h holds
    ((s2^s1).i = 1+len f implies h.i in {1+len f,2+len f}) &
    ((s2^s1).i <> 1+len f implies h.i =(s2^s1).i)
    by A6,A1,A2,A3,A4,A5,Th126,Th40;
    take D1,D2;
    thus D1 is with_evenly_repeated_values-member &
    D2 is with_evenly_repeated_values-member by A7,A8;
    let CE1,CE2 be FinSequence of D*,f,d1,d2 such that
A9:   len f = m & CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
    CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F) * E;
    let CFes be non-empty non empty FinSequence of D* such that
A10: CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
    Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees;
    let S1,S2 be Element of Fin dom App CFes such that
A11:S1=D1 & S2=D2;
    set fD = f^<*A . (d1,d2)*>,fID=f^<*A.( I.d1,d2)*>;
A12: M.((M "**" App CE1).s1,(M "**" App CE2).s2)= A$$(S1,M"**"App CFes) &
    for h be FinSequence,i st h in S1 & i in dom h holds
         ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
         ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i) by A7,A9,A10,A11;
A13:M.((M "**" App CE1).s2,(M "**" App CE2).s1)= A$$(S2,M"**"App CFes) &
       for h be FinSequence,i st h in S2 & i in dom h holds
         ((s2^s1).i = 1+len f implies h.i in {1+len f,2+len f}) &
         ((s2^s1).i <> 1+len f implies h.i =(s2^s1).i) by A8,A9,A10,A11;
A14: len fID = len f+1 & len fD = len f+1 by FINSEQ_2:16;
A15: card F=len E &
    len s1 = card F = len s2 by A5,CARD_1:def 7;
    CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
    Ext(F,1+m,2+m)\/swap(F,1+m,2+m) ) * Ees by A9,A10;
    then len CFes = len Ees by CARD_1:def 7;
    then
A16: len CFes = len Ee+len Es & len Ee = len E = len Es
    by A4,A3,CARD_1:def 7,FINSEQ_1:22;
A17: dom s1=dom CE1 & dom s2 = dom CE2 by A15,A9,CARD_1:def 7,FINSEQ_3:29;
A18: s1 in doms CE1 & s2 in doms CE2 by A5,A14,A9,Th106;
    thus S1 misses S2
    proof
      assume S1 meets S2;
      then consider x such that
A19:  x in S1 & x in S2 by XBOOLE_0:3;
      reconsider x as FinSequence by A19;
      S1 c= dom App CFes by FINSUB_1:def 5;
      then x in dom App CFes by A19;
      then
A20:  len x = len CFes by Th47;
      len (s1^s2) = len s1 +len s2 = len (s2^s1) by FINSEQ_1:22;
      then
A21:  dom (s1^s2)= dom x = dom (s2^s1) by A20,A16,A15,FINSEQ_3:30;
A22:  dom s1=dom s2 by A15,FINSEQ_3:29;
      consider i be object such that
A23:  i in dom s1 & s1.i <>s2.i by A5,A15,FINSEQ_3:29;
      reconsider i as Nat by A23;
A24:  (s1^s2).i = s1.i & (s2^s1).i = s2.i by A23,A22,FINSEQ_1:def 7;
A25:  dom s1 c= dom (s1^s2) & dom s2 c= dom (s2^s1) by FINSEQ_1:26;
A26:  CE1.i = SignGen(fD,A,E.i) & CE2.i = SignGen(fID,A,E.i)
      by A17,A9,Th80,A23,A22;
      per cases;
      suppose
A27:    s1.i = 1+len f;
        then x.i in {1+len f,2+len f} by A24,A21,A25,A7,A9,A10,A11,A19,A23;
        then
A28:    x.i = 1+len f or x.i = 2+len f by TARSKI:def 2;
        s2.i in dom (CE2.i) by A18,Th47,A23,A22;
        then
A29:    s2.i in dom fID by A26,Def11;
        x.i = s2.i by A27,A21,A8,A9,A10,A11,A24,A25,A23,A19;
        then 1+len f+1 <= len fID by A29,A28,A27,A23,FINSEQ_3:25;
        hence thesis by A14,NAT_1:13;
      end;
      suppose
A30:    s2.i = 1+len f;
        then x.i in {1+len f,2+len f} by A23,A25,A21,A24,A19,A8,A9,A10,A11;
        then
A31:    x.i = 1+len f or x.i = 2+len f by TARSKI:def 2;
        s1.i in dom (CE1.i) by A18,Th47,A23;
        then
A32:    s1.i in dom fD by A26,Def11;
        x.i = s1.i by A23,A25,A21,A7,A9,A10,A11,A19,A30,A24;
        then 1+len f+1 <= len fD by A32,A31,A30,A23,FINSEQ_3:25;
        hence thesis by A14,NAT_1:13;
      end;
      suppose s1.i <> 1+len f & s2.i <> 1+len f;
        then x.i = s1.i & x.i = s2.i
        by A21,A7,A9,A10,A11,A8,A24,A25,A23,A19;
        hence thesis by A23;
      end;
    end;
    hence A.(M.((M"**"App CE1).s1,(M"**"App CE2).s2),
    M.((M"**"App CE1).s2,(M"**"App CE2).s1))= A$$(S1\/S2,M"**"App CFes)
    by A12,A13,A1,SETWOP_2:4;
    thus for h be FinSequence,i st h in S1 & i in dom (s1^s2) holds
    ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
    ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i)
    proof
      let h be FinSequence,i such that
A33:  h in S1 & i in dom (s1^s2);
      S1 c= dom App CFes by FINSUB_1:def 5;
      then h in dom App CFes by A33;
      then
A34:  len h = len CFes by Th47;
      len (s1^s2) = len h by A34,A16,A15,FINSEQ_1:22;
      then dom (s1^s2)= dom h by FINSEQ_3:30;
      hence thesis by A33,A7,A9,A10,A11;
    end;
    let h be FinSequence,i such that
A35: h in S2 & i in dom (s2^s1);
    S2 c= dom App CFes by FINSUB_1:def 5;
    then h in dom App CFes by A35;
    then len h = len CFes by Th47;
    then len h = len (s2^s1) by A16,A15,FINSEQ_1:22;
    then dom h = dom (s2^s1) by FINSEQ_3:30;
    hence thesis by A35,A8,A9,A10,A11;
   end;
   suppose card (s1"{1+m}) < card (s2"{1+m});
     hence thesis by Th138,A1,A2,A3,A4,A5;
   end;
   suppose
A36: card (s1"{1+m}) > card (s2"{1+m});
     consider D1,D2 be Subset of doms(m+2,card F+card F) such that
A37: D1 is with_evenly_repeated_values-member &
     D2 is with_evenly_repeated_values-member &
     for CE1,CE2 be FinSequence of D*,f,d1,d2 st
     len f = m & CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
     CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F) * E
     for CFes be non-empty non empty FinSequence of D* st
     CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
     Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees
     for S1,S2 be Element of Fin dom App CFes st
     S1=D1 & S2=D2 holds S1 misses S2 &
     A.(M.((M"**"App CE1).s2,(M"**"App CE2).s1),
     M.((M"**"App CE1).s1,(M"**"App CE2).s2))= A$$(S1\/S2,M"**"App CFes) &
     (for h be FinSequence,i st h in S1 & i in dom (s2^s1) holds
     ((s2^s1).i = 1+len f implies h.i in {1+len f,2+len f}) &
     ((s2^s1).i <> 1+len f implies h.i =(s2^s1).i)) &
     (for h be FinSequence,i st h in S2 & i in dom (s1^s2) holds
     ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
     ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i))
     by Th138,A1,A2,A3,A4,A5,A36;
     take D2,D1;
     thus D2 is with_evenly_repeated_values-member &
     D1 is with_evenly_repeated_values-member  by A37;
     let CE1,CE2 be FinSequence of D*,f,d1,d2 such that
A38: len f = m & CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
     CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F) * E;
     let CFes be non-empty non empty FinSequence of D* such that
A39: CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
     Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees;
     let S2,S1 be Element of Fin dom App CFes such that
A40:  S2=D2 & S1=D1;
     len (f^<*A.(d1,d2)*>) = m+1 =len (f^<*A.( I.d1,d2)*>) by A38,FINSEQ_2:16;
     then dom App CE1= doms(m+1,card F)= dom App CE2 by A38,Lm3;
     then (M"**"App CE1).s1 = M"**"((App CE1).s1)&
     (M"**"App CE1).s2 = M"**"((App CE1).s2)&
     (M"**"App CE2).s1 = M"**"((App CE2).s1)&
     (M"**"App CE2).s2 = M"**"((App CE2).s2) by A5,Def10;
     then reconsider m11=(M"**"App CE1).s1,m21=(M"**"App CE2).s1,
       m22= (M"**"App CE2).s2,m12= (M"**"App CE1).s2 as Element of D;
     A$$(S1\/S2,M"**"App CFes) = A.(M.(m12,m21),M.(m11,m22)) by A37,A38,A39,A40
     .=A.(M.((M"**"App CE1).s1,(M"**"App CE2).s2),
     M.((M"**"App CE1).s2,(M"**"App CE2).s1)) by A1,BINOP_1:def 2;
     hence thesis by A37,A38,A39,A40;
   end;
end;

theorem Th140:
  M is commutative associative & len f=2
implies
  SignGenOp(f,M,A,{2}) = M.(A.(f.1,f.2), A.(f.1,(the_inverseOp_wrt A).(f.2)))
proof
  assume
A1: M is commutative associative & len f=2;
A2: bool {2} = { {}, {2}} by ZFMISC_1:24;
  set E = (1,2)-->({},{2});
  set I=the_inverseOp_wrt A;
A3: dom E={1,2}=Seg 2 by FINSEQ_1:2,FUNCT_4:62;
  then reconsider E as FinSequence by FINSEQ_1:def 2;
A4: rng E={ {}, {2}} by FUNCT_4:64;
  1 .--> {}= {1} --> {} & 2 .--> {2}= {2} --> {2} by FUNCOP_1:def 9;
  then rng (1 .--> {}) = {{}} & rng (2 .--> {2}) = {{2}} by FUNCOP_1:8;
  then (1 .--> {})+*(2 .--> {2}) is one-to-one by FUNCT_4:92,ZFMISC_1:11;
  then E is one-to-one by FUNCT_4:def 4;
  then reconsider E as Enumeration of bool {2} by A4,A2,RLAFFIN3:def 1;
  set C=SignGenOp(f,A,bool {2});
  card bool {2}= 2 by A2,CARD_2:57;
  then len (C*E)= len E = 2 by CARD_1:def 7;
  then
A5: dom (C * E) = dom E by FINSEQ_3:30;
  then 1 in dom (C * E) & 2 in dom (C * E) by A3;
  then reconsider O=1,T=2 as Element of [#]dom (C * E);
  E.O= {} by FUNCT_4:63;
  then (C * E).O = C.{} & {} in bool {2} by A2,FUNCT_1:12,TARSKI:def 2;
  then (C * E).O = SignGen(f,A,{}) by Def12;
  then (C * E).O = f by Th71;
  then (A "**" (C * E)).O = A "**" f by Def10;
  then
A6: (A "**" (C * E)).O = A.(f.1,f.2) by A1,FINSOP_1:21;
  f is non empty by A1;
  then
A7: f|1 = <*f.1*> by FINSEQ_5:20;
  then dom (f|1) = Seg 1 ={1} by FINSEQ_1:2,38;
  then
A8: SignGen(f|1,A,{2}) = <*f.1*> by A7,Th70,ZFMISC_1:11;
  E.T= {2} by FUNCT_4:63;
  then (C * E).T = C.{2} & {2} in bool {2} by FUNCT_1:12;
  then (C * E).T = SignGen(f,A,{2}) & 1+1 in {2} by Def12,TARSKI:def 1;
  then (C * E).T = <*f.1,I.(f.2)*> by A8,A1,Th73;
  then
A9: len ((C * E).T) = 2 & ((C * E).T).1 = f.1 & ((C * E).T).2 = I.(f.2)
  by FINSEQ_1:44;
  (A "**" (C * E)).T = A "**" ((C * E).T) by Def10;
  then
A10:(A "**" (C * E)).T = A.(f.1, I.(f.2)) by A9,FINSOP_1:21;
  SignGenOp(f,M,A,{2})= M $$ ([#]dom (C * E), A "**" (C * E)) by A1,Def13;
  hence thesis by A6,A10,A1,A5,A3,SETWOP_2:1;
end;


theorem Th141:
  M is commutative associative &
  A is commutative associative having_a_unity having_an_inverseOp &
  M is_distributive_wrt A
implies
  for E be Enumeration of bool {2}
    for CE be non-empty non empty FinSequence of D* st
      CE = SignGenOp(f,A,bool {2}) * E & len f = 2
      ex S be Element of Fin dom App CE st S = { <*1,1*>, <*2,2*>} &
        SignGenOp(f,M,A,{2}) = A $$ (S,M "**" App CE)
proof
  assume that
A1: M is commutative associative and
A2: A is commutative associative having_a_unity having_an_inverseOp and
A3: M is_distributive_wrt A;
  let E be Enumeration of bool {2};
  let CE be non-empty non empty FinSequence of D* such that
A4: CE = SignGenOp(f,A,bool {2}) * E & len f = 2;
  set C = SignGenOp(f,A,bool {2});
  set I=the_inverseOp_wrt A;
  1 in dom f & 2 in dom f by A4,FINSEQ_3:25;
  then f.1 in rng f & f.2 in rng f & rng f c= D by FUNCT_1:def 3;
  then reconsider f1=f.1,f2=f.2 as Element of D;
  M.(f1,A.(f1,I.f2)) = A.(M.(f1,f1),M.(f1,I.f2)) &
  M.(f2,A.(f1,I.f2)) = A.(M.(f2,f1),M.(f2,I.f2)) by A3,BINOP_1:11;
  then
A5: M.(A.(f1,f2),A.(f1,I.f2)) =
  A.(A.(M.(f1,f1),M.(f1,I.f2)),A.(M.(f2,f1),M.(f2,I.f2)))
      by A3,BINOP_1:def 10,def 11
    .= A.(M.(f1,f1),A.(M.(f1,I.f2),A.(M.(f2,f1),M.(f2,I.f2))))
      by A2,BINOP_1:def 3
    .= A.(M.(f1,f1),A.(A.(M.(f1,I.f2),M.(f2,f1)),M.(f2,I.f2)))
      by A2,BINOP_1:def 3
    .= A.(M.(f1,f1),A.(A.(I.(M.(f1,f2)),M.(f2,f1)),M.(f2,I.f2)))
      by A3,A2,FINSEQOP:67
    .= A.(M.(f1,f1),A.( A. (I.(M.(f1,f2)),M.(f1,f2)),M.(f2,I.f2)))
      by A1,BINOP_1:def 2
    .= A.(M.(f1,f1),A.(the_unity_wrt A, M.(f2,I.f2))) by A2,FINSEQOP:59
    .= A.(M.(f1,f1),M.(f2,I.f2)) by A2,SETWISEO:15;
A6:bool {2} = { {}, {2}} by ZFMISC_1:24;
  then card bool {2}= 2 by CARD_2:57;
  then
A7: len (CE)= len E = len f by A4,CARD_1:def 7;
A8: 1 in dom CE & 1 in dom E & 2 in dom CE & 2 in dom E by A7,A4,FINSEQ_3:25;
  then
A9: CE.1 = C.(E.1) & E.1 in rng E & CE.2 = C.(E.2) & E.2 in rng E
    by A4,FUNCT_1:12,def 3;
  then
A10: CE.1 = SignGen(f,A,E.1) & CE.2 = SignGen(f,A,E.2) by Def12;
  then
A11: len (CE.1) = len f & len (CE.2) = len f by CARD_1:def 7;
A12: { <*1,1*>, <*2,2*>} c= doms CE
  proof
    let x be object;
    assume
A13: x in { <*1,1*>, <*2,2*>};
    then
A14: x = <*1,1*> or x= <*2,2*> by TARSKI:def 2;
    reconsider x as FinSequence by A13;
A15: len x = 2 by A14,FINSEQ_1:44;
    for i st i in dom x holds x.i in dom (CE.i)
    proof
      let i such that
A16:    i in dom x;
A17:    1<=i <=2  by A16,A15,FINSEQ_3:25;
      then i<2 or i=2 by XXREAL_0:1;
      then
A18:    i=1 or i=2 by A17,NAT_1:23;
      then x.i = 1 or x.i=2 by A14;
      hence thesis by A18,A11,A4,FINSEQ_3:25;
    end;
    hence thesis by A15,A4,A7,Th47;
  end;
  then { <*1,1*>, <*2,2*>} c= dom App CE by Def9;
  then reconsider S = { <*1,1*>, <*2,2*>} as Element of Fin dom App CE
    by FINSUB_1:def 5;
  take S;
  thus S = { <*1,1*>, <*2,2*>};
A19: SignGenOp(f,M,A,{2}) = A.(M.(f1,f1), M.(f2,I.f2)) by A5,A4,A1,Th140;
  <*1,1*> in { <*1,1*>, <*2,2*>} & <*2,2*> in { <*1,1*>, <*2,2*>}
     by TARSKI:def 2;
  then reconsider s1=<*1,1*>,s2= <*2,2*> as Element of dom App CE by A12,Def9;
  s1.1=1 & s2.1=2;
  then
A20: s1 <>s2;
A21: A $$ (S,M "**" App CE)
    = A.((M "**" App CE).s1,(M "**" App CE).s2) by A20,A2,SETWOP_2:1
    .= A.(M "**" ((App CE).s1),(M "**" App CE).s2) by Def10
    .= A.(M "**" ((App CE).s1),M "**" ((App CE).s2)) by Def10;
A22: len ((App CE).s1) = len s1 =2 by Def9,CARD_1:def 7;
A23: len ((App CE).s2) = len s2 =2 by Def9,CARD_1:def 7;
A26: E.1 <> E.2 by A8,FUNCT_1:def 4;
  per cases by A6,A9,TARSKI:def 2;
  suppose
A27:  E.1={};
    then
A28:  E.2 ={2} by A26,A6,A9,TARSKI:def 2;
    for k st 1 <= k <= 2 holds ((App CE).s1).k = <* f1,f1*>.k
    proof
      let k such that
A29:    1 <= k <= 2;
A30:    k in dom s1 by A29,A22,FINSEQ_3:25;
      then
A31:    ((App CE).s1).k = CE.k.(s1.k) by Def9;
      k<2 or k=2 by A29,XXREAL_0:1;
      then per cases by A29,NAT_1:23;
      suppose
A32:      k=1;
        then CE.k.(s1.k) = f1 by A27,A10,Th71;
        hence thesis by A30,Def9,A32;
      end;
      suppose
A33:      k=2;
        len SignGen(f,A,{2}) = len f by CARD_1:def 7;
        then 1 in dom SignGen(f,A,{2}) & not 1 in {2}
          by A4,FINSEQ_3:25,TARSKI:def 1;
        then SignGen(f,A,{2}).1 = f.1 by Def11;
        hence thesis by A31,A28,A10,A33;
      end;
    end;
    then (App CE).s1 = <* f1,f1*> by A22,CARD_1:def 7;
    then A34: M "**" ((App CE).s1) = M.(f1,f1) by FINSOP_1:12;
    for k st 1 <= k <= 2 holds ((App CE).s2).k = <* f2,I.f2*>.k
    proof
      let k such that
A35:    1 <= k <= 2;
      k in dom s2 by A35,A23,FINSEQ_3:25;
      then
A36:    ((App CE).s2).k = CE.k.(s2.k) by Def9;
      k<2 or k=2 by A35,XXREAL_0:1;
      then per cases by A35,NAT_1:23;
      suppose k=1;
        hence thesis by A36,Th71,A27,A10;
      end;
      suppose
A37:      k=2;
        len SignGen(f,A,{2}) = len f by CARD_1:def 7;
        then 2 in dom SignGen(f,A,{2}) & 2 in {2}
          by A4,FINSEQ_3:25,TARSKI:def 1;
        then SignGen(f,A,{2}).2 = I.f2 by Def11;
        hence thesis by A36,A28,A10,A37;
      end;
    end;
    then (App CE).s2 = <* f2,I.f2*> by A23,CARD_1:def 7;
     hence thesis by A19,A21,A34,FINSOP_1:12;
  end;
  suppose
A38:  E.1={2};
    then
A39:  E.2 ={} by A26,A6,A9,TARSKI:def 2;
    for k st 1 <= k <= 2 holds ((App CE).s1).k = <* f1,f1*>.k
    proof
      let k such that
A40:    1 <= k <= 2;
      k in dom s1 by A40,A22,FINSEQ_3:25;
      then
A41:    ((App CE).s1).k = CE.k.(s1.k) by Def9;
      k<2 or k=2 by A40,XXREAL_0:1;
      then per cases by A40,NAT_1:23;
      suppose
A42:      k=2;
        then CE.k.(s1.k) = f1 by A39,A10,Th71;
        hence thesis by A41,A42;
      end;
      suppose
A43:      k=1;
        len SignGen(f,A,{2}) = len f by CARD_1:def 7;
        then 1 in dom SignGen(f,A,{2}) & not 1 in {2}
          by A4,FINSEQ_3:25,TARSKI:def 1;
        hence thesis by A41,A38,A10,A43,Def11;
      end;
    end;
    then (App CE).s1 = <* f1,f1*> by A22,CARD_1:def 7;
    then
A44: M "**" ((App CE).s1) = M.(f1,f1) by FINSOP_1:12;
    for k st 1 <= k <= 2 holds ((App CE).s2).k = <* I.f2,f2*>.k
    proof
      let k such that
A45:    1 <= k <= 2;
      k in dom s2 by A45,A23,FINSEQ_3:25;
      then
A46:    ((App CE).s2).k = CE.k.(s2.k) by Def9;
      k<2 or k=2 by A45,XXREAL_0:1;
      then per cases by A45,NAT_1:23;
      suppose
A47:      k=2;
        then CE.k = SignGen(f,A,{}) by A38,A26,A6,A9,A10,TARSKI:def 2;
        then CE.k.(s2.k) = f2 by Th71,A47;
        hence thesis by A46,A47;
      end;
      suppose
A48:      k=1;
        len SignGen(f,A,{2}) = len f by CARD_1:def 7;
        then 2 in dom SignGen(f,A,{2}) & 2 in {2}
          by A4,FINSEQ_3:25,TARSKI:def 1;
        hence thesis by A46,A38,A10,A48,Def11;
      end;
    end;
    then
A49: (App CE).s2 = <* I.f2,f2*> by A23,CARD_1:def 7;
    A $$ (S,M "**" App CE)
      = A.(M.(f1,f1),M.(I.f2,f2)) by A21,A44,A49,FINSOP_1:12
      .= A.(M.(f1,f1),M.(f2,I.f2)) by A1,BINOP_1:def 2;
    hence thesis by A5,A4,A1,Th140;
  end;
end;

theorem
   M is commutative associative &
   A is commutative associative having_a_unity having_an_inverseOp &
   M is_distributive_wrt A
implies
  for E be Enumeration of bool {2}
    for CE be non-empty non empty FinSequence of D* st
        CE = SignGenOp(f,A,bool {2}) * E & len f = 2
     ex S be Element of Fin dom App CE st
        S is with_evenly_repeated_values-member &
       SignGenOp(f,M,A,{2}) = A $$ (S,M "**" App CE)
proof
  assume
A1: M is commutative associative &
    A is commutative associative having_a_unity having_an_inverseOp &
    M is_distributive_wrt A;
  let E be Enumeration of bool {2};
  let CE be non-empty non empty FinSequence of D* such that
A2: CE = SignGenOp(f,A,bool {2}) * E & len f = 2;
  consider S be Element of Fin dom App CE such that
A3: S = { <*1,1*>, <*2,2*>} and
A4: SignGenOp(f,M,A,{2}) = A $$ (S,M "**" App CE) by A2,A1,Th141;
  take S;
  thus S is with_evenly_repeated_values-member by A3;
  thus SignGenOp(f,M,A,{2}) = A $$ (S,M "**" App CE) by A4;
end;

::$N Main Theorem

theorem
  A is commutative associative having_a_unity having_an_inverseOp &
  M is associative commutative having_a_unity &
  M is_distributive_wrt A & m > 1 &
  (for d holds M.(the_unity_wrt A,d) = the_unity_wrt A)
implies
     ex E be Enumeration of bool(Seg m\{1}),
        S be Subset of doms(m,card bool(Seg m\{1})) st
       S is with_evenly_repeated_values-member &
       card bool(Seg m\{1}) |-> 1 in S &
       for CE be non-empty non empty FinSequence of D*,f st
          CE = SignGenOp(f,A,bool(Seg m\{1})) * E & len f = m
          for Sce be Element of Fin dom App CE st Sce=S holds
             SignGenOp(f,M,A,Seg m\{1}) = A $$ (Sce,M "**" App CE)
proof
  set I=the_inverseOp_wrt A;
  assume that
A1: A is commutative associative having_a_unity having_an_inverseOp &
  M is associative commutative having_a_unity &
  M is_distributive_wrt A and
A2: m > 1 and
A3: for d holds M.(the_unity_wrt A,d) = the_unity_wrt A;
  defpred P[Nat] means
  ex E be Enumeration of bool(Seg $1\{1}),
     S be Subset of doms($1,card bool(Seg $1\{1})) st
       S is with_evenly_repeated_values-member &
       card bool(Seg $1\{1}) |-> 1 in S &
       for CE be non-empty non empty FinSequence of D*,f st
          CE = SignGenOp(f,A,bool(Seg $1\{1})) * E & len f = $1
          for Sce be Element of Fin dom App CE st Sce=S holds
             SignGenOp(f,M,A,Seg $1\{1}) = A $$ (Sce,M "**" App CE);
A4:P[2]
  proof
    set B=bool(Seg 2\{1});
A5: Seg 2\{1} = {2} by FINSEQ_1:2,ZFMISC_1:17;
    then B = { {}, {2} } by ZFMISC_1:24;
    then
A6:card B=2 by CARD_2:57;
    set S = { <*1,1*>, <*2,2*>};
    S c= doms(2,card B)
    proof
      1 in Seg 2 & 2 in Seg 2;
      then
      reconsider O=1,T=2 as Element of Seg 2;
      let x;
      assume x in S;
      then
A7: x=<*O,O*> or x= <*T,T*> by TARSKI:def 2;
      then reconsider x as FinSequence of Seg 2;
      len x =2 by A7,CARD_1:def 7;
      then x is Element of (card B)-tuples_on Seg 2 by A6,FINSEQ_2:92;
      hence thesis;
    end;
    then reconsider S = { <*1,1*>, <*2,2*>} as Subset of doms(2,card B);
    take E = the Enumeration of bool(Seg 2\{1});
    take S;
    thus S is with_evenly_repeated_values-member;
    A8: card bool(Seg 2\{1}) = card bool(Seg (1+1) \{1})
    .= 2 * card bool(Seg 1 \{1}) by Th9;
    Seg (1+0)\{1} = {} by FINSEQ_1:2;
    then card bool (Seg (1+0)\{1}) = 1 by CARD_1:30,ZFMISC_1:1;
    then card bool(Seg 2\{1}) |-> 1 = <*1,1*> by A8,FINSEQ_2:61;
    hence card bool(Seg 2\{1}) |-> 1 in S by TARSKI:def 2;
    let CE be non-empty non empty FinSequence of D*,f such that
A9:   CE = SignGenOp(f,A,B) * E & len f = 2;
    let Sce be Element of Fin dom App CE such that
A10: Sce=S;
    consider Sd be Element of Fin dom App CE such that
A11:   Sd = { <*1,1*>, <*2,2*>} &
    SignGenOp(f,M,A,{2}) = A $$ (Sd,M "**" App CE) by A1,A5,A9,Th141;
    thus SignGenOp(f,M,A,Seg 2\{1}) = A $$ (Sce,M "**" App CE)
      by A10,A11,FINSEQ_1:2,ZFMISC_1:17;
  end;
A12: for j being Nat st 2 <= j holds P[j] implies P[j+1]
  proof
    let j be Nat;
    assume
A13:2 <= j;
    set F=bool(Seg j\{1}),Dj=doms(j,card F);
    set ccc = card F |-> 1;
    assume P[j];
    then consider E be Enumeration of F,S be Subset of doms(j,card F) such that
A14: S is with_evenly_repeated_values-member and
A15: ccc in S and
A16:for CE be non-empty non empty FinSequence of D*,f st
      CE = SignGenOp(f,A,bool(Seg j\{1})) * E & len f = j
      for Sce be Element of Fin dom App CE st Sce=S holds
      SignGenOp(f,M,A,Seg j\{1}) = A $$ (Sce,M "**" App CE);
    reconsider m=j-1 as Nat by A13;
    reconsider Dj as non empty finite set by A13;
    set EF=Ext(F,1+m,2+m),SF=swap(F,1+m,2+m);
A17:union F= Seg j\{1}=Seg (m+1)\{1} by ZFMISC_1:81;
    then
A18: union F c= Seg (1+m) by XBOOLE_1:36;
A19: 1+m+1 > 1+m by NAT_1:13;
    then
A20: not m+2 in union F by A18,FINSEQ_1:1;
    then reconsider Ee = Ext(E,1+m,2+m) as Enumeration of EF by Th28;
    reconsider Es = Swap(E,1+m,2+m) as Enumeration of SF by A20,Th27;
    reconsider Ees=Ee^Es as Enumeration of EF\/SF by Th79,A20,A19,Th22;
    defpred P[object,object] means
    for f,g be object st f in Dj & g in Dj & $1= [f,g] holds $2={f,g};
A21: for x st x in [:Dj,Dj:] ex y st P[x,y]
    proof
      let x such that
A22:x in [:Dj,Dj:];
      consider x1,x2 be object such that
A23:x1 in Dj & x2 in Dj & [x1,x2] =x by A22,ZFMISC_1:def 2;
      take X={x1,x2};
      let f,g be object such that
A24: f in Dj & g in Dj & x = [f,g];
      f=x1 & g = x2 by A23,A24,XTUPLE_0:1;
      hence thesis;
    end;
    consider h be Function such that
A25: dom h = [:Dj,Dj:] &
    for x st x in [:Dj,Dj:] holds P[x,h.x] from CLASSES1:sch 1(A21);
    set H=h|[:S,S:];
A26: [:S,S:] c= [:Dj,Dj:] by ZFMISC_1:96;
A27: dom H = [:S,S:] by A25,RELAT_1:62,ZFMISC_1:96;
    reconsider R=rng H as finite set;
    set C = canFS R;
A28:rng C = R by FUNCT_2:def 3;
    defpred I[Nat] means $1 <= len C implies
    for EC be Element of Fin [:Dj,Dj:] st EC = H"rng (C|$1) holds
    ex D12 be Subset of doms(m+2,card F+card F) st
    ([ccc,ccc] in EC implies ccc^ccc in D12) &
    D12 is with_evenly_repeated_values-member &
    for CE1,CE2 be FinSequence of D*,f,d1,d2 st
    len f = m &
    CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
    CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F) * E
    for M1 be Function of Dj,D, M2 be Function of Dj,D st
    M1=M"**"App CE1 & M2=M"**"App CE2
    for CFes be non-empty non empty FinSequence of D* st
    CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
    Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees
    for S12 be Element of Fin dom App CFes st S12=D12
    holds
    A $$ (EC,M*( M1, M2)) =
    A$$(S12,M"**"App CFes) &
    for h be FinSequence st h in S12
    ex s1,s2 be FinSequence st s1 in Dj & s2 in Dj & [s1,s2] in EC &
    for i st i in dom (s1^s2) holds
    ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
    ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i);
A29: for i st I[i] holds I[i+1]
    proof
      let i;
      assume
A30: I[i];
      set i1=i+1;
      assume
A31: i1 <= len C;
      let HC be Element of Fin [:Dj,Dj:] such that
A32: HC = H"rng (C|i1);
A33: i1 in dom C by A31,FINSEQ_3:25,NAT_1:11;
      then C|i1 = (C|i)^<*C.i1*> by FINSEQ_5:10;
      then rng (C|i1) = rng (C|i)\/ rng <*C.i1*> by FINSEQ_1:31;
      then
A34: rng (C|i1) = rng (C|i)\/ { C.i1 } by FINSEQ_1:39;
A35: C.i1 in rng C by A33,FUNCT_1:def 3;
A36: H"rng (C|i1) = H"rng (C|i) \/ H"{C.i1} by A34,RELAT_1:140;
      then H"rng (C|i) c= HC c= [:Dj,Dj:] by A32,FINSUB_1:def 5,XBOOLE_1:7;
      then H"rng (C|i) c= [:Dj,Dj:];
      then reconsider HC1 = H"rng (C|i) as Element of Fin [:Dj,Dj:]
        by FINSUB_1:def 5;
      consider D12 be Subset of doms(m+2,card F+card F) such that
A37:   ([ccc,ccc] in HC1 implies ccc^ccc in D12) and
A38:   D12 is with_evenly_repeated_values-member and
A39:   for CE1,CE2 be FinSequence of D*,f,d1,d2 st
      len f = m &
      CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
      CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F) * E
      for M1 be Function of Dj,D, M2 be Function of Dj,D st
      M1=M"**"App CE1 & M2=M"**"App CE2
      for CFes be non-empty non empty FinSequence of D* st
      CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
      Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees
      for S12 be Element of Fin dom App CFes st S12=D12
      holds
        A $$ (HC1,M*( M1, M2)) = A$$(S12,M"**"App CFes) &
        for h be FinSequence st h in S12
        ex s1,s2 be FinSequence st s1 in Dj & s2 in Dj & [s1,s2] in HC1 &
        for i st i in dom (s1^s2) holds
        ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
        ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i) by A30,A31,NAT_1:13;
      H"{C.i1}<>{} by A35,FUNCT_1:72;
      then consider s12 be object such that
A40:  s12 in H"{C.i1} by XBOOLE_0:def 1;
A41:  s12 in dom H & H.s12 in {C.i1} by A40,FUNCT_1:def 7;
      then consider s1,s2 be object such that
A42:  s1 in S & s2 in S & s12=[s1,s2] by ZFMISC_1:def 2;
      reconsider s1,s2 as Element of (card F)-tuples_on Seg j by A42;
      s12 in dom h & h.s12 = H.s12 by A41,FUNCT_1:47,RELAT_1:57;
      then
A43:  C.i1 = H.s12 = {s1,s2} by A42,A41,A25,TARSKI:def 1;
      reconsider s12 as Element of [:Dj,Dj:] by A41,A25,RELAT_1:57;
A44:  not C.i1 in rng (C|i)
      proof
        assume C.i1 in rng(C|i);
        then consider x such that
A45:    x in dom (C|i) & C.i1 = (C|i).x by FUNCT_1:def 3;
A46:    x in dom C & x in Seg i & (C|i).x = C.x by A45,FUNCT_1:47,RELAT_1:57;
        then x=i1 by A45,A33,FUNCT_1:def 4;
        then i1 <=i by A46,FINSEQ_1:1;
        hence thesis by NAT_1:13;
      end;
      per cases;
      suppose
A47:    s1=s2;
        H"{C.i1} c= {[s1,s2]}
        proof
          let y;
          assume y in H"{C.i1};
          then
A48:      y in dom H & H.y in {C.i1} by FUNCT_1:def 7;
          consider t1,t2 be object such that
A49:      t1 in S & t2 in S & y=[t1,t2] by A48,ZFMISC_1:def 2;
          y in dom h & h.y = H.y by A48,FUNCT_1:47,RELAT_1:57;
          then C.i1 = H.y = {t1,t2} by A25,A48,A49,TARSKI:def 1;
          then {s1}={s1,s1}={t1,t2} by A43,A47,ENUMSET1:29;
          then t2=s1=t1 by ZFMISC_1:4;
          hence thesis by A47,A49,TARSKI:def 1;
        end;
        then
A50: H"{C.i1} = {s12} by A42,A40,ZFMISC_1:33;
        consider D1 be Subset of doms(m+2,card F+card F) such that
A51:     card (s1"{1+m})=0 implies s1^s2 in D1 and
A52:    D1 is with_evenly_repeated_values-member and
A53:    for CE1,CE2 be FinSequence of D*, f,d1,d2 st len f = m &
        CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
        CE2 = SignGenOp(f^<*A.( (the_inverseOp_wrt A).d1,d2)*>,A,F) * E
        for CFes be non-empty non empty FinSequence of D* st
        CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
        Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees
        for Sd be Element of Fin dom App CFes st D1 = Sd holds
        M.((M "**" App CE1).s1,(M "**" App CE2).s2)= A$$(Sd,M"**"App CFes) &
        for h be FinSequence,i st h in Sd & i in dom h holds
        ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
        ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i)
        by A47,A1,A18,Th126,A42,A14,Th40;
        reconsider DD=D12\/D1 as Subset of doms(m+2,card F+card F);
        take DD;
        thus [ccc,ccc] in HC implies ccc^ccc in DD
        proof
          assume [ccc,ccc] in HC;
          then per cases by A50,A36,A32,XBOOLE_0:def 3;
          suppose [ccc,ccc] in HC1;
            hence thesis by A37,XBOOLE_0:def 3;
          end;
          suppose [ccc,ccc] in {s12};
            then [ccc,ccc] =s12 by TARSKI:def 1;
            then
A54:          ccc = s1 & ccc = s2 by A42,XTUPLE_0:1;
            1+0<>1+m by A13;
            then not 1 in {1+m} by TARSKI:def 1;
            then ccc"{1+m} = {} by FUNCOP_1:16;
            hence thesis by A54,A51,XBOOLE_0:def 3;
          end;
        end;
        thus DD is with_evenly_repeated_values-member by A38,A52;
        let CE1,CE2 be FinSequence of D*,f,d1,d2 such that
A55:    len f = m and
A56:    CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
        CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F) * E;
        let M1 be Function of Dj,D, M2 be Function of Dj,D such that
A57: M1=M"**"App CE1 & M2=M"**"App CE2;
        let CFes be non-empty non empty FinSequence of D* such that
A58:     CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
        Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees;
        let SS be Element of Fin dom App CFes such that
A59:    SS=DD;
        D1 c= DD & D12 c= DD & DD c= dom App CFes
        by A59,FINSUB_1:def 5,XBOOLE_1:7;
        then D1 c= dom App CFes & D12 c= dom App CFes;
        then reconsider S1=D1,S12=D12 as Element of Fin dom App CFes
          by FINSUB_1:def 5;
A60:    A $$ (HC1,M*( M1, M2)) = A$$(S12,M"**"App CFes) &
          for h be FinSequence st h in S12
          ex s1,s2 be FinSequence st s1 in Dj & s2 in Dj & [s1,s2] in HC1 &
          for i st i in dom (s1^s2) holds
          ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
          ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i) by A39,A55,A56,A57,A58;
A61:    M.((M "**" App CE1).s1,(M "**" App CE2).s2)
          = A$$(S1,M"**"App CFes) &
        for h be FinSequence,i st h in S1 & i in dom h holds
          ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
          ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i) by A53,A55,A56,A58;
        not s12 in HC1 by A44,A43,FUNCT_1:def 7;
        then
A62:    HC1 misses {.s12.} by ZFMISC_1:50;
A63:    HC = HC1\/{.s12.} by A50,A34,A32,RELAT_1:140;
A64:    A $$ (HC,M*( M1, M2)) =
        A.(A $$ (HC1,M*( M1, M2)),A $$ ({.s12.},M*( M1, M2)))
        by A1,A62,A50,A36,A32,SETWOP_2:4;
        (M*( M1, M2)).(s1,s2) = (M*( M1, M2)).s12 by A42,BINOP_1:def 1;
        then M.(M1.s1,M2.s2) = (M*( M1, M2)).s12 by FINSEQOP:81;
        then
A65:    A$$(S1,M"**"App CFes) =
        A $$ ({.s12.},M*( M1, M2)) by A57,A61,A1,SETWISEO:17;
        CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
        Ext(F,1+m,2+m)\/swap(F,1+m,2+m) ) * Ees by A58,A55;
        then len CFes = len Ees by CARD_1:def 7;
        then
A66:     len CFes = len Ee+len Es & len Ee = len E = len Es
        by CARD_1:def 7,FINSEQ_1:22;
A67:    len s1 = card F = len s2 by A13,CARD_1:def 7;
A68:    S12 misses S1
        proof
          assume S12 meets S1;
          then consider x such that
A69:      x in S12 & x in S1 by XBOOLE_0:3;
          reconsider x as FinSequence by A69;
          consider d1,d2 be FinSequence such that
A70:      d1 in Dj & d2 in Dj & [d1,d2] in HC1 and
A71:      for i st i in dom (d1^d2) holds
          ((d1^d2).i = 1+len f implies x.i in {1+len f,2+len f}) &
          ((d1^d2).i <> 1+len f implies x.i =(d1^d2).i)
          by A69,A39,A55,A56,A57,A58;
          reconsider d1,d2 as Element of (card F)-tuples_on Seg j by A70;
A72:      len d1 = card F =len d2 & card F = len E by A13,CARD_1:def 7;
          S1 c= dom App CFes by FINSUB_1:def 5;
          then x in dom App CFes by A69;
          then
A73:      len x = len CFes by Th47;
          len (s1^s2) = len x = len (s2^s1) by A72,A73,A66,CARD_1:def 7;
          then
A74:      dom (s1^s2)= dom x = dom (s2^s1) by FINSEQ_3:30;
A75:      for i st 1<=i & i <= card F holds s1.i=d1.i
          proof
            let i such that
A76:        1<=i & i <= card F;
A77:        i in dom s1 c= dom (s1^s2) by A76,A67,FINSEQ_1:26,FINSEQ_3:25;
            then
A78:        (s1^s2).i in rng (s1^s2) by FUNCT_1:def 3;
A79:        (s1^s2).i=s1.i by A77,FINSEQ_1:def 7;
A80:        i in dom d1 c= dom (d1^d2) by A76,A72,FINSEQ_1:26,FINSEQ_3:25;
            then
A81:        (d1^d2).i in rng (d1^d2) by FUNCT_1:def 3;
A82:        (d1^d2).i=d1.i by A80,FINSEQ_1:def 7;
A83:        ((s1^s2).i = 1+len f implies x.i in {1+len f,2+len f}) &
            ((s1^s2).i <> 1+len f implies x.i =(s1^s2).i)
            by A74,A69,A77,A53,A55,A56,A58;
            per cases;
            suppose
A84:          (d1^d2).i = 1+len f;
              then
A85:          x.i in {1+len f,2+len f} by A80,A71;
              reconsider d=(s1^s2).i as Nat;
              rng (s1^s2) c= Seg j by RELAT_1:def 19;
              then d <=m+1 by A78,FINSEQ_1:1;
              then
A86:          d <m+1+1 by NAT_1:13;
              (s1^s2).i = 1+len f by A83,A85,A86,A55,TARSKI:def 2;
              hence thesis by A84,A79,A80,FINSEQ_1:def 7;
            end;
            suppose
A87:          (d1^d2).i <> 1+len f;
              then
A88:          (d1^d2).i = x.i by A80,A71;
              reconsider d=(d1^d2).i as Nat;
              rng (d1^d2) c= Seg j by RELAT_1:def 19;
              then d<=j by A81,FINSEQ_1:1;
              then d <m+1+1 by NAT_1:13;
              then not d in {1+len f,2+len f} by A55,A87,TARSKI:def 2;
              hence thesis by A88,A79,A82,A74,A69,A77,A53,A55,A56,A58;
            end;
          end;
          for k st 1<=k & k <= card F holds s2.k=d2.k
          proof
            let k such that
A89:        1<=k & k <= card F;
            set i = k+card F;
A90:        k in dom s2 by A89,A67,FINSEQ_3:25;
            then
A91:        i in dom (s1^s2) by A67,FINSEQ_1:28;
            then
A92:        (s1^s2).i in rng (s1^s2) by FUNCT_1:def 3;
A93:        (s1^s2).i=s2.k by A90,A67,FINSEQ_1:def 7;
A94:         k in dom d2 by A89,A72,FINSEQ_3:25;
            then
A95:        i in dom (d1^d2) by A72,FINSEQ_1:28;
            then
A96:        (d1^d2).i in rng (d1^d2) by FUNCT_1:def 3;
A97:        (d1^d2).i=d2.k by A94,A72,FINSEQ_1:def 7;
A98:        ((s1^s2).i = 1+len f implies x.i in {1+len f,2+len f}) &
            ((s1^s2).i <> 1+len f implies x.i =(s1^s2).i)
            by A74,A69,A91,A53,A55,A56,A58;
            per cases;
            suppose
A99:          (d1^d2).i = 1+len f;
              then
A100:         x.i in {1+len f,2+len f} by A95,A71;
              reconsider d=(s1^s2).i as Nat;
              rng (s1^s2) c= Seg j by RELAT_1:def 19;
              then d<=j by A92,FINSEQ_1:1;
              then d <m+1+1 by NAT_1:13;
              hence thesis by A99,A93,A97,A98,A100,A55,TARSKI:def 2;
            end;
            suppose
A101:         (d1^d2).i <> 1+len f;
              then
A102:         (d1^d2).i = x.i by A95,A71;
              reconsider d=(d1^d2).i as Nat;
              rng (d1^d2) c= Seg j by RELAT_1:def 19;
              then d<=j by A96,FINSEQ_1:1;
              then d <m+1+1 by NAT_1:13;
              then not d in {1+len f,2+len f} by A55,A101,TARSKI:def 2;
              hence thesis by A102,A93,A97,A74,A69,A91,A53,A55,A56,A58;
            end;
          end;
          then
          d1=s1 & d2=s2 by A75,A13,A72,CARD_1:def 7;
          hence thesis by A42,A44,A43,A70,FUNCT_1:def 7;
        end;
        thus A $$ (HC,M*( M1, M2)) =
        A$$(SS,M"**"App CFes) by A59,A64,A65,A60,A1,A68,SETWOP_2:4;
        let h be FinSequence such that
A103:   h in SS;
        per cases by A103,A59,XBOOLE_0:def 3;
        suppose h in S12;
          then consider s1,s2 be FinSequence such that
A104:     s1 in Dj & s2 in Dj & [s1,s2] in HC1 &
          for i st i in dom (s1^s2) holds
          ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
          ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i) by A39,A55,A56,A57,A58;
          take s1,s2;
          thus thesis by A104,A63,XBOOLE_0:def 3;
        end;
        suppose
A105:     h in S1;
          take s1,s2;
          S1 c= dom App CFes by FINSUB_1:def 5;
          then h in dom App CFes by A105;
          then
A106:     len h = len CFes by Th47;
          len (s1^s2) = len s1 +len s2 & len E=card F
          by CARD_1:def 7,FINSEQ_1:22;
          then
A107:     dom (s1^s2)= dom h  by A67,A106,A66,FINSEQ_3:30;
          s12 in {.s12.} by TARSKI:def 1;
          hence thesis by A107,A42,A105,A53,A55,A56,A58,A63,XBOOLE_0:def 3;
        end;
      end;
      suppose
A108:   s1<>s2;
A109:   [s2,s1] in dom H by A27,A42,ZFMISC_1:def 2;
        then [s2,s1] in dom h & h.[s2,s1] = H.[s2,s1] by FUNCT_1:47,RELAT_1:57;
        then
A110:   H.[s2,s1] = {s2,s1} by A25;
        then
A111:   [s2,s1] in H"{C.i1} by A41,A43,A109,FUNCT_1:def 7;
        reconsider s21=[s2,s1] as Element of [:Dj,Dj:] by ZFMISC_1:def 2;
A112:   [s1,s2]<>[s2,s1] by A108,XTUPLE_0:1;
        then
A113:   not [s1,s2] in {[s2,s1]} & not [s2,s1] in {[s1,s2]} by TARSKI:def 1;
        H"{C.i1} c= {[s1,s2],[s2,s1]}
        proof
          let y;
          assume y in H"{C.i1};
          then
A115:     y in dom H & H.y in {C.i1} by FUNCT_1:def 7;
          then consider t1,t2 be object such that
A116:     t1 in S & t2 in S & y=[t1,t2] by ZFMISC_1:def 2;
          y in dom h & h.y = H.y by A115,FUNCT_1:47,RELAT_1:57;
          then
A117:     C.i1 = H.y = {t1,t2} by A25,A115,A116,TARSKI:def 1;
A118:     t1<>t2
          proof
            assume t1=t2;
            then {t1}={t1,t2} by ENUMSET1:29;
            then s1=t1=s2 by A117,A43,ZFMISC_1:4;
            hence thesis by A108;
          end;
          t1 in {s1,s2} & t2 in {s1,s2} by A43,A117,TARSKI:def 2;
          then (t1=s1 or t1=s2) & (t2=s1 or t2=s2) by TARSKI:def 2;
          hence thesis by A118,A116,TARSKI:def 2;
        end;
        then
A119:   H"{C.i1} = {[s1,s2],[s2,s1]} by A42,A40,A111,A113,ZFMISC_1:36;
        consider D1,D2 be Subset of doms(m+2,card F+card F) such that
A120:   D1 is with_evenly_repeated_values-member &
          D2 is with_evenly_repeated_values-member and
A121:   for CE1,CE2 be FinSequence of D*,f,d1,d2 st
          len f = m &
          CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
          CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F) * E
          for CFes be non-empty non empty FinSequence of D* st
          CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
          Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees
          for S1,S2 be Element of Fin dom App CFes st
          S1=D1 & S2=D2 holds
          S1 misses S2 &
          A.(M.((M"**"App CE1).s1,(M"**"App CE2).s2),
          M.((M"**"App CE1).s2,(M"**"App CE2).s1))= A$$(S1\/S2,M"**"App CFes) &
          (for h be FinSequence,i st h in S1 & i in dom (s1^s2) holds
          ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
          ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i)) &
          (for h be FinSequence,i st h in S2 & i in dom (s2^s1) holds
          ((s2^s1).i = 1+len f implies h.i in {1+len f,2+len f}) &
          ((s2^s1).i <> 1+len f implies h.i =(s2^s1).i))
          by Th139,A108,A1,A17,A42,A14,XBOOLE_1:36;
        reconsider DD=D12\/(D1\/D2) as Subset of doms(m+2,card F+card F);
        take DD;
        thus [ccc,ccc] in HC implies ccc^ccc in DD
        proof
          assume [ccc,ccc] in HC;
          then [ccc,ccc] in HC1 \/ H"{C.i1} by A34,A32,RELAT_1:140;
          then per cases by A119,XBOOLE_0:def 3;
          suppose [ccc,ccc] in HC1;
            hence thesis by A37,XBOOLE_0:def 3;
          end;
          suppose [ccc,ccc] in {[s1,s2],[s2,s1]};
            then [ccc,ccc] =[s1,s2] or [ccc,ccc] =[s2,s1] by TARSKI:def 2;
            then ccc = s1 & ccc = s2 by XTUPLE_0:1;
            hence thesis by A108;
          end;
        end;
        thus DD is with_evenly_repeated_values-member by A38,A120;
        let CE1,CE2 be FinSequence of D*,f,d1,d2 such that
A122:   len f = m and
A123:   CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
        CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F) * E;
        let M1 be Function of Dj,D, M2 be Function of Dj,D such that
A124:   M1=M"**"App CE1 & M2=M"**"App CE2;
        let CFes be non-empty non empty FinSequence of D* such that
A125:   CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
        Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees;
        let SS be Element of Fin dom App CFes such that
A126:   SS=DD;
        D1\/(D2\/D12) = DD =D2\/(D1\/D12) by XBOOLE_1:4;
        then D1 c= DD & D2 c= DD & D12 c= DD & DD c= dom App CFes
        by A126,FINSUB_1:def 5,XBOOLE_1:7;
        then D1 c= dom App CFes & D2 c= dom App CFes & D12 c= dom App CFes;
        then reconsider S1=D1,S2=D2,S12=D12 as Element of Fin dom App CFes
        by FINSUB_1:def 5;
A127:   A $$ (HC1,M*( M1, M2)) = A$$(S12,M"**"App CFes) &
        for h be FinSequence st h in S12
        ex s1,s2 be FinSequence st s1 in Dj & s2 in Dj & [s1,s2] in HC1 &
        for i st i in dom (s1^s2) holds
        ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
        ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i)
        by A39,A122,A123,A124,A125;
A128:   S1=D1 & S2=D2;
        then
A129:   S1 misses S2 &
        A.(M.((M"**"App CE1).s1,(M"**"App CE2).s2),
        M.((M"**"App CE1).s2,(M"**"App CE2).s1))= A$$(S1\/S2,M"**"App CFes) &
        (for h be FinSequence,i st h in S1 & i in dom (s1^s2) holds
        ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
        ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i)) &
        (for h be FinSequence,i st h in S2 & i in dom (s2^s1) holds
        ((s2^s1).i = 1+len f implies h.i in {1+len f,2+len f}) &
        ((s2^s1).i <> 1+len f implies h.i =(s2^s1).i)) by A121,A122,A123,A125;
A130:   not s12 in HC1 by A44,A43,FUNCT_1:def 7;
A131:   not s21 in HC1 by A44,A43,A110,FUNCT_1:def 7;
A132:   HC1 misses {.s12,s21.} by A131,A130,ZFMISC_1:51;
A133:   HC = HC1\/{.s12,s21.} by A34,A32,A119,A42,RELAT_1:140;
A134:   A $$ (HC,M*( M1, M2)) =
        A.(A $$ (HC1,M*( M1, M2)),A $$ ({.s12,s21.},M*( M1 , M2)))
        by A1,A132,A36,A32,A119,A42,SETWOP_2:4;
        (M*( M1 , M2)).(s1,s2) = (M*( M1, M2)).s12 &
        (M*( M1 , M2)).(s2,s1) = (M*( M1, M2)).s21 by A42,BINOP_1:def 1;
        then
A135:   M.(M1.s1,M2.s2) = (M*( M1, M2)).s12 &
        M.(M1.s2,M2.s1) = (M*( M1, M2)).s21 by FINSEQOP:81;
A136:   A$$(S1\/S2,M"**"App CFes) = A $$ ({.s12,s21.},M*( M1,M2))
        by A129,A135,A124,A1,A112,A42,SETWOP_2:1;
A137:   S12 misses S1
        proof
          assume S12 meets S1;
          then consider x such that
A138:     x in S12 & x in S1 by XBOOLE_0:3;
          reconsider x as FinSequence by A138;
          consider d1,d2 be FinSequence such that
A139:     d1 in Dj & d2 in Dj & [d1,d2] in HC1 and
A140:     for i st i in dom (d1^d2) holds
          ((d1^d2).i = 1+len f implies x.i in {1+len f,2+len f}) &
          ((d1^d2).i <> 1+len f implies x.i =(d1^d2).i)
          by A138,A39,A122,A123,A124,A125;
          reconsider d1,d2 as Element of (card F)-tuples_on Seg j by A139;
A141:     len s1 = card F = len s2 by A13,CARD_1:def 7;
A142:     len d1 = card F =len d2 by A13,CARD_1:def 7;
          for i st 1<=i & i <= card F holds s1.i=d1.i
          proof
            let i such that
A143:       1<=i & i <= card F;
A144:       i in dom s1 c= dom (s1^s2)
            by A143,A141,FINSEQ_1:26,FINSEQ_3:25;
            then
A145:       (s1^s2).i in rng (s1^s2) by FUNCT_1:def 3;
A146:       (s1^s2).i=s1.i by A144,FINSEQ_1:def 7;
A147:       i in dom d1 c= dom (d1^d2)
            by A143,A142,FINSEQ_1:26,FINSEQ_3:25;
A148:       (d1^d2).i in rng (d1^d2) by A147,FUNCT_1:def 3;
A149:       (d1^d2).i=d1.i by A147,FINSEQ_1:def 7;
A150:       ((s1^s2).i = 1+len f implies x.i in {1+len f,2+len f}) &
            ((s1^s2).i <> 1+len f implies x.i =(s1^s2).i)
            by A138,A144,A121,A122,A123,A125,A128;
            per cases;
            suppose
A151:         (d1^d2).i = 1+len f;
              then
A152:         x.i in {1+len f,2+len f} by A147,A140;
              reconsider d=(s1^s2).i as Nat;
              rng (s1^s2) c= Seg j by RELAT_1:def 19;
              then d<=j by A145,FINSEQ_1:1;
              then d <m+1+1 by NAT_1:13;
              hence thesis by A151,A146,A149,A150,A152,A122,TARSKI:def 2;
            end;
            suppose
A153:         (d1^d2).i <> 1+len f;
              then
A154:         (d1^d2).i = x.i by A147,A140;
              reconsider d=(d1^d2).i as Nat;
              rng (d1^d2) c= Seg j by RELAT_1:def 19;
              then d<=j by A148,FINSEQ_1:1;
              then d <m+1+1 by NAT_1:13;
              then not x.i in {1+len f,2+len f} by A122,A154,A153,TARSKI:def 2;
              hence thesis by A154,A146,A149,A138,A144,A129;
            end;
          end;
          then
A155:     s1=d1 by A141,A13,CARD_1:def 7;
          for k st 1<=k & k <= card F holds s2.k=d2.k
          proof
            let k such that
A156:       1<=k & k <= card F;
            set i = k+card F;
A157:       k in dom s2 by A156,A141,FINSEQ_3:25;
            then
A158:       i in dom (s1^s2) by A141,FINSEQ_1:28;
            then
A159:       (s1^s2).i in rng (s1^s2) by FUNCT_1:def 3;
A160:       (s1^s2).i=s2.k by A157,A141,FINSEQ_1:def 7;
A161:       k in dom d2 by A156,A142,FINSEQ_3:25;
            then
A162:       i in dom (d1^d2) by A142,FINSEQ_1:28;
            then
A163:       (d1^d2).i in rng (d1^d2) by FUNCT_1:def 3;
A164:       (d1^d2).i=d2.k by A161,A142,FINSEQ_1:def 7;
A165:       ((s1^s2).i = 1+len f implies x.i in {1+len f,2+len f}) &
            ((s1^s2).i <> 1+len f implies x.i =(s1^s2).i)
            by A138,A158,A121,A122,A123,A125,A128;
            per cases;
            suppose
A166:         (d1^d2).i = 1+len f;
              then
A167:         x.i in {1+len f,2+len f} by A162,A140;
              reconsider d=(s1^s2).i as Nat;
              rng (s1^s2) c= Seg j by RELAT_1:def 19;
              then d<=j by A159,FINSEQ_1:1;
              then d <m+1+1 by NAT_1:13;
              hence thesis by A166,A160,A164,A122,A165,A167,TARSKI:def 2;
            end;
            suppose
A168:         (d1^d2).i <> 1+len f;
              then
A169:         (d1^d2).i = x.i by A162,A140;
              reconsider d=(d1^d2).i as Nat;
              rng (d1^d2) c= Seg j by RELAT_1:def 19;
              then d<=j by A163,FINSEQ_1:1;
              then d <m+1+1 by NAT_1:13;
              then not d in {1+len f,2+len f} by A122,A168,TARSKI:def 2;
              hence thesis by A169,A160,A164,A158,A138,A129;
            end;
          end;
          then s2=d2 by A141,A13,CARD_1:def 7;
          hence thesis by A44,A43,A139,A155,A42,FUNCT_1:def 7;
        end;
        S12 misses S2
        proof
          assume S12 meets S2;
          then consider x such that
A170:     x in S12 & x in S2 by XBOOLE_0:3;
          reconsider x as FinSequence by A170;
          consider d1,d2 be FinSequence such that
A171:     d1 in Dj & d2 in Dj & [d1,d2] in HC1 and
A172:     for i st i in dom (d1^d2) holds
          ((d1^d2).i = 1+len f implies x.i in {1+len f,2+len f}) &
          ((d1^d2).i <> 1+len f implies x.i =(d1^d2).i)
          by A170,A39,A122,A123,A124,A125;
          reconsider d1,d2 as Element of (card F)-tuples_on Seg j by A171;
A173:     len s1 = card F = len s2 by A13,CARD_1:def 7;
A174:     len d1 = card F =len d2 by A13,CARD_1:def 7;
          for i st 1<=i & i <= card F holds s2.i=d1.i
          proof
            let i such that
A175:       1<=i & i <= card F;
A176:       i in dom s2 c= dom (s2^s1) by A175,A173,FINSEQ_1:26,FINSEQ_3:25;
            then
A177:       (s2^s1).i in rng (s2^s1) by FUNCT_1:def 3;
A178:       (s2^s1).i=s2.i by A176,FINSEQ_1:def 7;
A179:       i in dom d1 c= dom (d1^d2) by A175,A174,FINSEQ_1:26,FINSEQ_3:25;
            then
A180:       (d1^d2).i in rng (d1^d2) by FUNCT_1:def 3;
A181:       (d1^d2).i=d1.i by A179,FINSEQ_1:def 7;
A182:       ((s2^s1).i = 1+len f implies x.i in {1+len f,2+len f}) &
            ((s2^s1).i <> 1+len f implies x.i =(s2^s1).i)
            by A170,A176,A128,A121,A122,A123,A125;
            per cases;
            suppose
A183:         (d1^d2).i = 1+len f;
              then
A184:         x.i in {1+len f,2+len f} by A179,A172;
              reconsider d=(s2^s1).i as Nat;
              rng (s2^s1) c= Seg j by RELAT_1:def 19;
              then d<=j by A177,FINSEQ_1:1;
              then d <m+1+1 by NAT_1:13;
              hence thesis by A183,A178,A181,A182,A184,A122,TARSKI:def 2;
            end;
            suppose
A185:         (d1^d2).i <> 1+len f;
              then
A186:         (d1^d2).i = x.i by A179,A172;
              reconsider d=(d1^d2).i as Nat;
              rng (d1^d2) c= Seg j by RELAT_1:def 19;
              then d<=j by A180,FINSEQ_1:1;
              then d <m+1+1 by NAT_1:13;
              then not d in {1+len f,2+len f} by A122,A185,TARSKI:def 2;
              hence thesis by A186,A178,A181,A170,A176,A129;
            end;
          end;
          then
A187:     s2=d1 by A173,A13,CARD_1:def 7;
          for k st 1<=k & k <= card F holds s1.k=d2.k
          proof
            let k such that
A188:       1<=k & k <= card F;
            set i = k+card F;
A189:       k in dom s1 by A188,A173,FINSEQ_3:25;
            then
A190:       i in dom (s2^s1) by A173,FINSEQ_1:28;
            then
A191:       (s2^s1).i in rng (s2^s1) by FUNCT_1:def 3;
A192:       (s2^s1).i=s1.k by A189,A173,FINSEQ_1:def 7;
A193:       k in dom d2 by A188,A174,FINSEQ_3:25;
            then
A194:       i in dom (d1^d2) by A174,FINSEQ_1:28;
            then
A195:       (d1^d2).i in rng (d1^d2) by FUNCT_1:def 3;
A196:       (d1^d2).i=d2.k by A193,A174,FINSEQ_1:def 7;
A197:       ((s2^s1).i = 1+len f implies x.i in {1+len f,2+len f}) &
            ((s2^s1).i <> 1+len f implies x.i =(s2^s1).i)
            by A170,A190,A128,A121,A122,A123,A125;
            per cases;
            suppose
A198:         (d1^d2).i = 1+len f;
              then
A199:         x.i in {1+len f,2+len f} by A194,A172;
              reconsider d=(s2^s1).i as Nat;
              rng (s2^s1) c= Seg j by RELAT_1:def 19;
              then d<=j by A191,FINSEQ_1:1;
              then d <m+1+1 by NAT_1:13;
              hence thesis by A198,A192,A196,A122,A197,A199,TARSKI:def 2;
            end;
            suppose
A200:         (d1^d2).i <> 1+len f;
              then
A201:         (d1^d2).i = x.i by A194,A172;
              reconsider d=(d1^d2).i as Nat;
              rng (d1^d2) c= Seg j by RELAT_1:def 19;
              then d<=j by A195,FINSEQ_1:1;
              then d <m+1+1 by NAT_1:13;
              then not d in {1+len f,2+len f} by A122,A200,TARSKI:def 2;
              hence thesis by A201,A192,A196,A170,A190,A129;
            end;
          end;
          then s1=d2 by A173,A13,CARD_1:def 7;
          hence thesis by A44,A43,A110,A171,A187,FUNCT_1:def 7;
        end;
        then S12 misses (S1\/S2) by A137,XBOOLE_1:70;
        hence A $$ (HC,M*( M1, M2))
        = A$$(SS,M"**"App CFes) by A134,A136,A126,A127,A1,SETWOP_2:4;
        let h be FinSequence such that
A202:   h in SS;
        per cases by A202,A126,XBOOLE_0:def 3;
        suppose h in S12;
          then consider s1,s2 be FinSequence such that
A203:     s1 in Dj & s2 in Dj & [s1,s2] in HC1 &
          for i st i in dom (s1^s2) holds
          ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
          ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i)
          by A39,A122,A123,A124,A125;
          take s1,s2;
          thus thesis by A203,A133,XBOOLE_0:def 3;
        end;
        suppose h in S1\/S2;
          then per cases by XBOOLE_0:def 3;
          suppose
A204:       h in S1;
            take s1,s2;
            s12 in {.s12,s21.} by TARSKI:def 2;
            hence thesis
            by A42,A204,A128,A121,A122,A123,A125,A133,XBOOLE_0:def 3;
          end;
          suppose
A205:       h in S2;
            take s2,s1;
            s21 in {.s12,s21.} by TARSKI:def 2;
            hence thesis by A205,A128,A121,A122,A123,A125,A133,XBOOLE_0:def 3;
          end;
        end;
      end;
    end;
A206: I[0]
    proof
      assume 0 <= len C;
      let EC be Element of Fin [:Dj,Dj:] such that
A207: EC = H"rng (C|0);
      reconsider D12 = {} as Subset of doms(m+2,card F+card F) by XBOOLE_1:2;
      take D12;
      thus [ccc,ccc] in EC implies ccc^ccc in D12 by A207;
      thus  D12 is with_evenly_repeated_values-member;
      let CE1,CE2 be FinSequence of D*,f,d1,d2 such that
      len f = m &
      CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
      CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F) * E;
      let M1 be Function of Dj,D, M2 be Function of Dj,D such that
      M1=M"**"App CE1 & M2=M"**"App CE2;
      let CFes be non-empty non empty FinSequence of D* such that
      CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
      Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees;
      let S12 be Element of Fin dom App CFes such that
A208: S12=D12;
A209: EC={}.[:Dj,Dj:] by A207;
      S12 = {}.(dom App CFes) by A208;then
      A$$(S12,M"**"App CFes) = the_unity_wrt A =A $$ (EC,M*( M1, M2))
      by A209,A1,SETWISEO:31;
      hence thesis by A208;
    end;
A210: for i holds I[i] from NAT_1:sch 2(A206,A29);
    reconsider ss = [:S,S:] as Element of Fin [:Dj,Dj:]
    by A26,FINSUB_1:def 5;
    reconsider s = S as Element of Fin Dj by FINSUB_1:def 5;
    H"rng (C|len C) = dom H by A28,RELAT_1:134;
    then
A211: H"rng (C|len C) = [:S,S:] by A25,RELAT_1:62,ZFMISC_1:96;
    consider D12 be Subset of doms(m+2,card F+card F) such that
A212: ([ccc,ccc] in [:S,S:] implies ccc^ccc in D12) and
A213: D12 is with_evenly_repeated_values-member and
A214: for CE1,CE2 be FinSequence of D*,f,d1,d2 st
    len f = m & CE1 = SignGenOp(f^<*A . (d1,d2)*>,A,F) * E &
    CE2 = SignGenOp(f^<*A.( I.d1,d2)*>,A,F) * E
    for M1 be Function of Dj,D, M2 be Function of Dj,D st
    M1=M"**"App CE1 & M2=M"**"App CE2
    for CFes be non-empty non empty FinSequence of D* st
    CFes = SignGenOp(f^<*d1*>^<*d2*>,A,
    Ext(F,1+len f,2+len f)\/swap(F,1+len f,2+len f) ) * Ees
    for S12 be Element of Fin dom App CFes st S12=D12
    holds A $$ (ss,M*( M1, M2)) = A$$(S12,M"**"App CFes) &
    for h be FinSequence st h in S12
    ex s1,s2 be FinSequence st s1 in Dj & s2 in Dj & [s1,s2] in ss &
    for i st i in dom (s1^s2) holds
    ((s1^s2).i = 1+len f implies h.i in {1+len f,2+len f}) &
    ((s1^s2).i <> 1+len f implies h.i =(s1^s2).i) by A211,A210;
A215: m<>0 by A13;
    then
A216: EF\/SF = bool(Seg (j+1)\{1}) by Th39;
    reconsider EES = Ees as Enumeration of bool(Seg (j+1)\{1}) by Th39,A215;
    take EES;
A217: 2 * card F = card bool (Seg (1+j)\{1}) by A13,Th9;
    then reconsider T12=D12 as Subset of doms(j+1,card bool(Seg (j+1)\{1}));
    take T12;
    thus T12 is with_evenly_repeated_values-member by A213;
    [ccc,ccc] in [:S,S:] by A15,ZFMISC_1:def 2;
    hence card bool (Seg (j+1)\{1}) |-> 1 in T12
      by A217,A212,FINSEQ_2:123;
    let CE be non-empty non empty FinSequence of D*,f such that
A218: CE = SignGenOp(f,A,bool(Seg (j+1)\{1})) * EES & len f = j+1;
    let Tce be Element of Fin dom App CE such that
A219: Tce=T12;
    set g=f|m, d1 = f/.(m+1),d2 = f/.(j+1);
A220: m < m+1 =j < j+1 by NAT_1:13;
    1<= m+1 by NAT_1:11;
    then m+1 in dom f by A218,A220,FINSEQ_3:25;
    then
A221: f.(m+1) = d1 by PARTFUN1:def 6;
    m < len f by A220,A218,XXREAL_0:2;
    then
A222: f| (m+1) = g ^ <* d1*> by A221,FINSEQ_5:83;
    1<= j+1 by NAT_1:11;
    then j+1 in dom f by A218,FINSEQ_3:25;
    then
A223: f.(j+1) = f/.(j+1) by PARTFUN1:def 6;
    then
A224: f = g^<*d1*>^<*d2*> by A222,A218,FINSEQ_3:55;
A225: len g = m by A220,A218,FINSEQ_1:59,XXREAL_0:2;
    then
A226: len (g^<*A.(d1,d2)*>) = j = len (g^<*A.(I.d1,d2)*>) by FINSEQ_2:16;
    set CE1 = SignGenOp(g^<*A . (d1,d2)*>,A,F) * E,
    CE2 = SignGenOp(g^<*A.( I.d1,d2)*>,A,F) * E;
A227: dom App CE2 = Dj = dom App CE1 by A226,Lm3;
A228: for x st x in dom CE1 holds CE1.x is non empty
    proof
      let x;
      assume x in dom CE1;
      then CE1.x = SignGen(g^<*A.(d1,d2)*>,A,E.x) by Th80;
      hence thesis;
    end;
    reconsider CE1 as non-empty non empty FinSequence of D*
    by A228,FUNCT_1:def 9;
    for x st x in dom CE2 holds CE2.x is non empty
    proof
      let x;
      assume x in dom CE2;
      then CE2.x = SignGen(g^<*A . (I.d1,d2)*>,A,E.x) by Th80;
      hence thesis;
    end;
    then reconsider CE2 as non-empty non empty FinSequence of D*
    by FUNCT_1:def 9;
    reconsider s1=S as Element of Fin dom App CE1 by A227,FINSUB_1:def 5;
    reconsider s2=S as Element of Fin dom App CE2 by A227,FINSUB_1:def 5;
    set M1=M"**"App CE1,M2=M"**"App CE2;
    reconsider M1,M2 as Function of Dj,D by A227;
A230: CE = SignGenOp(g^<*d1*>^<*d2*>,A,
    Ext(F,1+len g,2+len g)\/swap(F,1+len g,2+len g) ) * Ees
    by A225,A223,A222,A216,A218,FINSEQ_3:55;
    M1=M"**"App CE1 & M2=M"**"App CE2
    implies for CE be non-empty non empty FinSequence of D* st
    CE = SignGenOp(g^<*d1*>^<*d2*>,A,
    Ext(F,1+len g,2+len g)\/swap(F,1+len g,2+len g) ) * Ees
    for S12 be Element of Fin dom App CE st S12=D12
    holds A $$ (ss,M*( M1, M2)) = A$$(S12,M"**"App CE) &
    for h be FinSequence st h in S12
    ex s1,s2 be FinSequence st s1 in Dj & s2 in Dj & [s1,s2] in ss &
    for i st i in dom (s1^s2) holds
    ((s1^s2).i = 1+len g implies h.i in {1+len g,2+len g}) &
    ((s1^s2).i <> 1+len g implies h.i =(s1^s2).i) by A225,A214;
    then
A231: A $$ (ss,M*( M1, M2)) = A$$(Tce,M"**"App CE) &
    for h be FinSequence st h in Tce
    ex s1,s2 be FinSequence st s1 in Dj & s2 in Dj & [s1,s2] in ss &
    for i st i in dom (s1^s2) holds
    ((s1^s2).i = 1+len g implies h.i in {1+len g,2+len g}) &
    ((s1^s2).i <> 1+len g implies h.i =(s1^s2).i) by A219,A230;
A232:  SignGenOp(g^<*A.(d1,d2)*>,M,A,Seg j\{1}) = A $$ (s1,M "**" App CE1)
    by A226,A16;
A233: SignGenOp(g^<*A.(I.d1,d2)*>,M,A,Seg j\{1}) = A $$ (s2,M "**" App CE2)
    by A226,A16;
    len g <>0 by A225,A13;
    then SignGenOp(g^<*d1*>^<*d2*>,M,A,Seg (2+len g)\{1}) =
       M. (SignGenOp(g^<*A.(d1,d2)*>,M,A,Seg (1+len g)\{1}),
           SignGenOp(g^<*A.(I.d1,d2)*>,M,A,Seg (1+len g)\{1}))
     by A1,Th130;
     hence SignGenOp(f,M,A,Seg (j+1)\{1})
     = A$$(Tce,M"**"App CE) by A224,A232,A233,A225,A227,A1,Th3,A3,A231;
   end;
A234: for i being Nat st 2 <= i holds P[i] from NAT_1:sch 8(A4,A12);
   m>=1+1 by A2,NAT_1:13;
   hence thesis by A234;
 end;