aofa_l00.miz



    begin

    reserve X,Y for set,

x,y,z for object,

i,j,n for natural number;

    registration

      let f be non empty-yielding Function;

      cluster ( Union f) -> non empty;

      coherence

      proof

        ( rng f) c/= { {} } by RELAT_1:def 15;

        then

        consider x such that

         A1: x in ( rng f) & x nin { {} };

        reconsider x as set by TARSKI: 1;

        x <> {} & x c= ( Union f) by A1, TARSKI:def 1, ZFMISC_1: 74;

        hence thesis;

      end;

    end

    definition

      let I be set;

      let f be ManySortedSet of I;

      let i be set;

      let x;

      :: original: +*

      redefine

      func f +* (i,x) -> ManySortedSet of I ;

      coherence

      proof

        ( dom (f +* (i,x))) = ( dom f) = I by FUNCT_7: 30, PARTFUN1:def 2;

        hence thesis by PARTFUN1:def 2, RELAT_1:def 18;

      end;

    end

    registration

      let I be set;

      let f be non-empty ManySortedSet of I;

      let i be set;

      let x be non empty set;

      cluster (f +* (i,x)) -> non-empty;

      coherence ;

    end

    registration

      let S be non empty non void ManySortedSign;

      cluster non-empty for strict VarMSAlgebra over S;

      existence

      proof

        set X = the non-empty ManySortedSet of the carrier of S;

        set O = the ManySortedFunction of ((X # ) * the Arity of S), (X * the ResultSort of S);

        set f = the ManySortedMSSet of X, X;

        take VarMSAlgebra (# X, O, f #);

        thus thesis;

      end;

    end

    definition

      let f,g be Function;

      :: AOFA_L00:def1

      attr g is f -tolerating means f tolerates g;

    end

    theorem :: AOFA_L00:1

    

     Th1: for f,g be Function holds g is f -tolerating iff for x st x in ( dom f) & x in ( dom g) holds (f . x) = (g . x)

    proof

      let f,g be Function;

      thus g is f -tolerating implies for x st x in ( dom f) & x in ( dom g) holds (f . x) = (g . x)

      proof

        assume

         A1: for x be object st x in (( dom f) /\ ( dom g)) holds (f . x) = (g . x);

        let x;

        assume x in ( dom f) & x in ( dom g);

        then x in (( dom f) /\ ( dom g)) by XBOOLE_0:def 4;

        hence thesis by A1;

      end;

      assume

       A2: for x st x in ( dom f) & x in ( dom g) holds (f . x) = (g . x);

      let x;

      assume x in (( dom f) /\ ( dom g));

      then x in ( dom f) & x in ( dom g) by XBOOLE_0:def 4;

      hence thesis by A2;

    end;

    theorem :: AOFA_L00:2

    

     Th2: for I,J be set holds for f be ManySortedSet of I holds for g be ManySortedSet of J holds g is f -tolerating iff for x st x in I & x in J holds (f . x) = (g . x)

    proof

      let I,J be set;

      let f be ManySortedSet of I;

      let g be ManySortedSet of J;

      ( dom f) = I & ( dom g) = J by PARTFUN1:def 2;

      hence thesis by Th1;

    end;

    theorem :: AOFA_L00:3

    

     Th3: for f,g be Function holds f tolerates (g +* f)

    proof

      let f,g be Function;

      let x;

      assume x in (( dom f) /\ ( dom (g +* f)));

      then x in (( dom f) /\ (( dom g) \/ ( dom f))) = ( dom f) by FUNCT_4:def 1, XBOOLE_1: 21;

      hence ((g +* f) . x) = (f . x) by FUNCT_4: 13;

    end;

    registration

      let X,Y be Function;

      cluster (Y +* X) -> X -tolerating;

      coherence by Th3;

    end

    registration

      let X be Function;

      let J be set;

      let Y be ManySortedSet of J;

      cluster (Y +* (X | J)) -> X -tolerating;

      coherence

      proof

        let x;

        assume

         A1: x in (( dom X) /\ ( dom (Y +* (X | J))));

        then

         A2: x in ( dom X) & x in ( dom (Y +* (X | J))) = (( dom Y) \/ ( dom (X | J))) by XBOOLE_0:def 4, FUNCT_4:def 1;

        

        thus ((Y +* (X | J)) . x) = ((X | J) . x) by A2, RELAT_1: 57, FUNCT_4: 13

        .= (X . x) by A1, FUNCT_1: 49;

      end;

    end

    registration

      let J be set;

      let X be Function;

      cluster X -tolerating for ManySortedSet of J;

      existence

      proof

        set Y = the ManySortedSet of J;

        set Z = (Y +* (X | J));

        reconsider Z as ManySortedSet of J;

        take Z;

        thus thesis;

      end;

    end

    registration

      let J be set;

      let X be non-empty Function;

      cluster X -tolerating for non-empty ManySortedSet of J;

      existence

      proof

        set Y = the non-empty ManySortedSet of J;

        set Z = (Y +* (X | J));

        reconsider Z as ManySortedSet of J;

        now

          let x;

          assume

           A1: x in J;

          per cases ;

            suppose

             A2: x in ( dom X);

            then x in ( dom (X | J)) by A1, RELAT_1: 57;

            

            then (Z . x) = ((X | J) . x) by FUNCT_4: 13

            .= (X . x) by A1, FUNCT_1: 49;

            hence (Z . x) is non empty by A2, FUNCT_1:def 9;

          end;

            suppose x nin ( dom X);

            then x nin ( dom (X | J)) by RELAT_1: 57;

            then (Z . x) = (Y . x) by FUNCT_4: 11;

            hence (Z . x) is non empty by A1;

          end;

        end;

        then

        reconsider Z as non-empty ManySortedSet of J by PBOOLE:def 13;

        take Z;

        thus thesis;

      end;

    end

    registration

      let I be non empty set;

      let X be non empty-yielding ManySortedSet of I;

      cluster ( Union X) -> non empty;

      coherence ;

    end

    theorem :: AOFA_L00:4

    

     Th4: for S be non empty non void ManySortedSign holds for o be OperSymbol of S, r be SortSymbol of S, T be MSAlgebra over S holds o is_of_type ( {} ,r) implies {} in ( Args (o,T))

    proof

      let S be non empty non void ManySortedSign;

      let o be OperSymbol of S;

      let r be SortSymbol of S;

      let T be MSAlgebra over S;

      assume

       A1: (the Arity of S . o) = {} & (the ResultSort of S . o) = r;

      ( Args (o,T)) = ( product (the Sorts of T * ( the_arity_of o))) by PRALG_2: 3

      .= { {} } by A1, CARD_3: 10;

      hence {} in ( Args (o,T)) by TARSKI:def 1;

    end;

    theorem :: AOFA_L00:5

    

     Th5: for S be non empty non void ManySortedSign holds for o be OperSymbol of S, s,r be SortSymbol of S, T be MSAlgebra over S holds o is_of_type ( <*s*>,r) & x in (the Sorts of T . s) implies <*x*> in ( Args (o,T))

    proof

      let S be non empty non void ManySortedSign;

      let o be OperSymbol of S;

      let s,r be SortSymbol of S;

      let T be MSAlgebra over S;

      assume

       A1: (the Arity of S . o) = <*s*> & (the ResultSort of S . o) = r;

      assume

       A2: x in (the Sorts of T . s);

      

       A3: ( dom the Sorts of T) = the carrier of S by PARTFUN1:def 2;

      ( Args (o,T)) = ( product (the Sorts of T * ( the_arity_of o))) by PRALG_2: 3

      .= ( product <*(the Sorts of T . s)*>) by A1, A3, FINSEQ_2: 34;

      hence <*x*> in ( Args (o,T)) by A2, FINSEQ_3: 123;

    end;

     Lm1:

    now

      let I be set;

      let A be ManySortedSet of I;

      

       A1: ( dom A) = I by PARTFUN1:def 2;

      ( rng A) c= ( bool ( Union A))

      proof

        let x;

        reconsider X = x as set by TARSKI: 1;

        assume x in ( rng A);

        then X c= ( union ( rng A)) = ( Union A) by ZFMISC_1: 74;

        hence thesis;

      end;

      hence A is Function of I, ( bool ( Union A)) by A1, FUNCT_2: 2;

    end;

    theorem :: AOFA_L00:6

    

     Th6: for S be non empty non void ManySortedSign holds for o be OperSymbol of S, s1,s2,r be SortSymbol of S, T be MSAlgebra over S holds o is_of_type ( <*s1, s2*>,r) & x in (the Sorts of T . s1) & y in (the Sorts of T . s2) implies <*x, y*> in ( Args (o,T))

    proof

      let S be non empty non void ManySortedSign;

      let o be OperSymbol of S;

      let s1,s2,r be SortSymbol of S;

      let A be MSAlgebra over S;

      assume

       A1: (the Arity of S . o) = <*s1, s2*> & (the ResultSort of S . o) = r;

      assume

       A2: x in (the Sorts of A . s1) & y in (the Sorts of A . s2);

      then

      reconsider x as Element of (the Sorts of A . s1);

      reconsider y as Element of (the Sorts of A . s2) by A2;

      

       A3: the Sorts of A is Function of the carrier of S, ( bool ( Union the Sorts of A)) by Lm1;

      ( Args (o,A)) = ( product (the Sorts of A * ( the_arity_of o))) by PRALG_2: 3

      .= ( product <*(the Sorts of A . s1), (the Sorts of A . s2)*>) by A1, A3, FINSEQ_2: 36;

      hence thesis by A2, FINSEQ_3: 124;

    end;

    theorem :: AOFA_L00:7

    for S be non empty non void ManySortedSign holds for o be OperSymbol of S, s1,s2,s3,r be SortSymbol of S, T be MSAlgebra over S holds o is_of_type ( <*s1, s2, s3*>,r) & x in (the Sorts of T . s1) & y in (the Sorts of T . s2) & z in (the Sorts of T . s3) implies <*x, y, z*> in ( Args (o,T))

    proof

      let S be non empty non void ManySortedSign;

      let o be OperSymbol of S;

      let s1,s2,s3,r be SortSymbol of S;

      let A be MSAlgebra over S;

      assume

       A1: (the Arity of S . o) = <*s1, s2, s3*> & (the ResultSort of S . o) = r;

      assume

       A2: x in (the Sorts of A . s1) & y in (the Sorts of A . s2) & z in (the Sorts of A . s3);

      

       A3: the Sorts of A is Function of the carrier of S, ( bool ( Union the Sorts of A)) by Lm1;

      ( Args (o,A)) = ( product (the Sorts of A * ( the_arity_of o))) by PRALG_2: 3

      .= ( product <*(the Sorts of A . s1), (the Sorts of A . s2), (the Sorts of A . s3)*>) by A1, A3, FINSEQ_2: 37;

      hence <*x, y, z*> in ( Args (o,A)) by A2, FINSEQ_3: 125;

    end;

    definition

      let S,E be Signature;

      :: AOFA_L00:def2

      attr E is S -extension means

      : Def2: S is Subsignature of E;

    end

    registration

      let S be Signature;

      cluster -> S -extension for Extension of S;

      coherence by ALGSPEC1:def 5;

    end

    theorem :: AOFA_L00:8

    

     Th8: for S,E be non empty Signature st E is S -extension holds for a be SortSymbol of S holds a is SortSymbol of E

    proof

      let S,E be non empty Signature;

      assume S is Subsignature of E;

      then the carrier of S c= the carrier of E by INSTALG1: 10;

      hence thesis;

    end;

    theorem :: AOFA_L00:9

    

     Th9: for S,E be non void Signature st E is S -extension holds for o be OperSymbol of S holds for a be set holds for r be Element of S holds for r1 be Element of E st r = r1 & o is_of_type (a,r) holds o is_of_type (a,r1)

    proof

      let S,E be non void Signature;

      assume S is Subsignature of E;

      then

       A1: the carrier of S c= the carrier of E & the carrier' of S c= the carrier' of E & the ResultSort of S c= the ResultSort of E & the Arity of S c= the Arity of E by INSTALG1: 10, INSTALG1: 11;

      let o be OperSymbol of S;

      let a be set;

      let r be Element of S;

      let r1 be Element of E;

      assume

       A2: r = r1;

      assume

       A3: (the Arity of S . o) = a & (the ResultSort of S . o) = r;

      ( dom the Arity of S) = the carrier' of S & o in the carrier' of S & ( dom the ResultSort of S) = the carrier' of S by FUNCT_2:def 1;

      hence (the Arity of E . o) = a & (the ResultSort of E . o) = r1 by A1, A2, A3, GRFUNC_1: 2;

    end;

    definition

      let X be Function;

      let J,Y be set;

      :: AOFA_L00:def3

      func X extended_by (Y,J) -> ManySortedSet of J equals ((J --> Y) +* (X | J));

      coherence ;

    end

    registration

      let X be Function;

      let J,Y be set;

      cluster (X extended_by (Y,J)) -> X -tolerating;

      coherence ;

    end

    definition

      struct ( ConnectivesSignature) PCLangSignature (# the carrier -> set,

the carrier' -> set,

the Arity -> Function of the carrier', ( the carrier * ),

the ResultSort -> Function of the carrier', the carrier,

the formula-sort -> Element of the carrier,

the connectives -> FinSequence of the carrier' #)

       attr strict strict;

    end

    definition

      let X be set;

      struct ( PCLangSignature) QCLangSignature over X (# the carrier -> set,

the carrier' -> set,

the Arity -> Function of the carrier', ( the carrier * ),

the ResultSort -> Function of the carrier', the carrier,

the formula-sort -> Element of the carrier,

the connectives -> FinSequence of the carrier',

the quant-sort -> set,

the quantifiers -> Function of [: the quant-sort, X:], the carrier' #)

       attr strict strict;

    end

    definition

      let X be set;

      struct ( QCLangSignature over X) AlgLangSignature over X (# the carrier -> set,

the carrier' -> set,

the Arity -> Function of the carrier', ( the carrier * ),

the ResultSort -> Function of the carrier', the carrier,

the formula-sort, program-sort -> Element of the carrier,

the connectives -> FinSequence of the carrier',

the quant-sort -> set,

the quantifiers -> Function of [: the quant-sort, X:], the carrier' #)

       attr strict strict;

    end

    definition

      let n be Nat;

      let L be PCLangSignature;

      :: AOFA_L00:def4

      attr L is n PC-correct means

      : Def4: ( len the connectives of L) >= (n + 5) & (the connectives of L | {n, (n + 1), (n + 2), (n + 3), (n + 4), (n + 5)}) is one-to-one & (the connectives of L . n) is_of_type ( <*the formula-sort of L*>,the formula-sort of L) & (the connectives of L . (n + 5)) is_of_type ( {} ,the formula-sort of L) & ((the connectives of L . (n + 1)) is_of_type ( <*the formula-sort of L, the formula-sort of L*>,the formula-sort of L) & ... & (the connectives of L . (n + 4)) is_of_type ( <*the formula-sort of L, the formula-sort of L*>,the formula-sort of L));

    end

    definition

      let X;

      let L be QCLangSignature over X;

      :: AOFA_L00:def5

      attr L is QC-correct means

      : Def5: the quant-sort of L = {1, 2} & the quantifiers of L is one-to-one & ( rng the quantifiers of L) misses ( rng the connectives of L) & for q,x be object st q in the quant-sort of L & x in X holds (the quantifiers of L . (q,x)) is_of_type ( <*the formula-sort of L*>,the formula-sort of L);

    end

    definition

      let n be Nat;

      let X be set;

      let L be AlgLangSignature over X;

      :: AOFA_L00:def6

      attr L is n AL-correct means

      : Def6: the program-sort of L <> the formula-sort of L & ( len the connectives of L) >= (n + 8) & ((the connectives of L . (n + 6)) is_of_type ( <*the program-sort of L, the formula-sort of L*>,the formula-sort of L) & ... & (the connectives of L . (n + 8)) is_of_type ( <*the program-sort of L, the formula-sort of L*>,the formula-sort of L));

    end

    registration

      let n;

      cluster n PC-correct -> non void for PCLangSignature;

      coherence ;

    end

    definition

      let X,Y be set;

      :: AOFA_L00:def7

      func incl (Y,X) -> Function of Y, X equals

      : Def7: ( id Y);

      coherence

      proof

        ( dom ( id Y)) = Y & ( rng ( id Y)) = Y;

        hence thesis by A1, FUNCT_2: 2;

      end;

    end

    registration

      let n be non empty natural number;

      let X be set;

      cluster non void non emptyn PC-correct QC-correct for QCLangSignature over X;

      existence

      proof

        set O = ( { 0 , 1, 2, 3, 4, 5} \/ [: {1, 2}, X:]);

        set a = ((( {1, 2, 3, 4} --> <* 0 , 0 *>) \/ (( { 0 } \/ [: {1, 2}, X:]) --> <* 0 *>)) \/ ( {5} --> {} ));

        set r = (O --> 0 );

        

         A1: ( dom ( {1, 2, 3, 4} --> <* 0 , 0 *>)) = {1, 2, 3, 4} & ( dom ( {5} --> {} )) = {5} & ( dom (( { 0 } \/ [: {1, 2}, X:]) --> <* 0 *>)) = ( { 0 } \/ [: {1, 2}, X:]);

        

         B1: [: {1, 2}, X:] misses { 0 , 1, 2, 3, 4, 5}

        proof

          assume [: {1, 2}, X:] meets { 0 , 1, 2, 3, 4, 5};

          then

          consider x such that

           A2: x in { 0 , 1, 2, 3, 4, 5} & x in [: {1, 2}, X:] by XBOOLE_0: 3;

          thus contradiction by A2, ENUMSET1:def 4;

        end;

         {1, 2, 3, 4} misses ( { 0 } \/ [: {1, 2}, X:])

        proof

          assume {1, 2, 3, 4} meets ( { 0 } \/ [: {1, 2}, X:]);

          then

          consider x such that

           A2: x in {1, 2, 3, 4} & x in ( { 0 } \/ [: {1, 2}, X:]) by XBOOLE_0: 3;

          x in { 0 } or x in [: {1, 2}, X:] by A2, XBOOLE_0:def 3;

          then

          consider y, z such that

           A3: y in {1, 2} & z in X & x = [y, z] by A2, ENUMSET1:def 2;

          thus contradiction by A2, A3, ENUMSET1:def 2;

        end;

        then

        reconsider aa = (( {1, 2, 3, 4} --> <* 0 , 0 *>) \/ (( { 0 } \/ [: {1, 2}, X:]) --> <* 0 *>)) as Function by A1, GRFUNC_1: 13;

        

         A4: ( dom aa) = ( {1, 2, 3, 4} \/ ( { 0 } \/ [: {1, 2}, X:])) by A1, XTUPLE_0: 23

        .= (( { 0 } \/ {1, 2, 3, 4}) \/ [: {1, 2}, X:]) by XBOOLE_1: 4

        .= ( { 0 , 1, 2, 3, 4} \/ [: {1, 2}, X:]) by ENUMSET1: 7;

        ( { 0 , 1, 2, 3, 4} \/ [: {1, 2}, X:]) misses {5}

        proof

          assume ( { 0 , 1, 2, 3, 4} \/ [: {1, 2}, X:]) meets {5};

          then

          consider x such that

           A5: x in ( { 0 , 1, 2, 3, 4} \/ [: {1, 2}, X:]) & x in {5} by XBOOLE_0: 3;

          x = 5 by A5, TARSKI:def 1;

          then 5 in { 0 , 1, 2, 3, 4} or 5 in [: {1, 2}, X:] by A5, XBOOLE_0:def 3;

          hence contradiction by ENUMSET1:def 3;

        end;

        then

        reconsider a as Function by A1, A4, GRFUNC_1: 13;

        

         A6: ( dom a) = (( { 0 , 1, 2, 3, 4} \/ [: {1, 2}, X:]) \/ {5}) by A1, A4, XTUPLE_0: 23

        .= (( {5} \/ { 0 , 1, 2, 3, 4}) \/ [: {1, 2}, X:]) by XBOOLE_1: 4

        .= O by ENUMSET1: 15;

        reconsider 00 = 0 as Element of { 0 } by TARSKI:def 1;

         <*00*> in ( { 0 } * ) & <*00, 00*> in ( { 0 } * ) by FINSEQ_1:def 11;

        then ( rng ( {1, 2, 3, 4} --> <* 0 , 0 *>)) c= ( { 0 } * ) & ( rng (( { 0 } \/ [: {1, 2}, X:]) --> <* 0 *>)) c= ( { 0 } * ) by ZFMISC_1: 31;

        then (( rng ( {1, 2, 3, 4} --> <* 0 , 0 *>)) \/ ( rng (( { 0 } \/ [: {1, 2}, X:]) --> <* 0 *>))) c= ( { 0 } * ) & ( <*> { 0 }) in ( { 0 } * ) by FINSEQ_1:def 11, XBOOLE_1: 8;

        then ( rng aa) c= ( { 0 } * ) & ( rng ( {5} --> {} )) c= ( { 0 } * ) by RELAT_1: 12;

        then (( rng aa) \/ ( rng ( {5} --> {} ))) c= ( { 0 } * ) by XBOOLE_1: 8;

        then ( rng a) c= ( { 0 } * ) by RELAT_1: 12;

        then

        reconsider a as Function of O, ( { 0 } * ) by A6, FUNCT_2: 2;

        reconsider r as Function of O, { 0 };

         0 in { 0 , 1, 2, 3, 4, 5} & 1 in { 0 , 1, 2, 3, 4, 5} & 2 in { 0 , 1, 2, 3, 4, 5} & 3 in { 0 , 1, 2, 3, 4, 5} & 4 in { 0 , 1, 2, 3, 4, 5} & 5 in { 0 , 1, 2, 3, 4, 5} by ENUMSET1:def 4;

        then

        reconsider o0 = 0 , o1 = 1, o2 = 2, o3 = 3, o4 = 4, o5 = 5 as Element of O by XBOOLE_0:def 3;

        set p = the (n -' 1) qua Nat -element FinSequence of { 0 , 1, 2, 3, 4, 5};

        

         B2: ( rng p) c= { 0 , 1, 2, 3, 4, 5} c= O by XBOOLE_1: 7;

        then

        reconsider p as FinSequence of O by XBOOLE_1: 1, FINSEQ_1:def 4;

        set c6 = <*o0, o1, o2, o3, o4, o5*>;

        reconsider c = (p ^ c6) as FinSequence of O;

        ( rng c6) = { 0 , 1, 2, 3, 4, 5} by AOFA_A00: 21;

        then

         B3: ( rng c) = (( rng p) \/ ( rng c6)) c= ( { 0 , 1, 2, 3, 4, 5} \/ { 0 , 1, 2, 3, 4, 5}) = { 0 , 1, 2, 3, 4, 5} by B2, XBOOLE_1: 13, FINSEQ_1: 31;

        n > 0 ;

        then

         A7: n >= ( 0 + 1) by NAT_1: 13;

        

         A8: (i = 0 or ... or i = 5) implies (c . (n + i)) = i

        proof

          assume i = 0 or ... or i = 5;

          then i = 0 & (c . (n + 0 )) = (c6 . ( 0 + 1)) or ... or i = 5 & (c . (n + 5)) = (c6 . (5 + 1));

          hence thesis by AOFA_A00: 20;

        end;

        take L = QCLangSignature (# { 0 }, O, a, r, ( In ( 0 , { 0 })), c, {1, 2}, ( incl ( [: {1, 2}, X:],O)) #);

        thus the carrier' of L is non empty;

        thus the carrier of L is non empty;

        ( len c6) = (5 + 1) & ( len p) = (n -' 1) by CARD_1:def 7;

        then (( len p) + ( len c6)) = ((n -' 1) + (1 + 5)) = (((n -' 1) + 1) + 5) & n is Real & 1 is Real;

        then (( len p) + ( len c6)) = (n + 5) by A7, XREAL_1: 235;

        hence ( len the connectives of L) >= (n + 5) by FINSEQ_1: 22;

        set N = {n, (n + 1), (n + 2), (n + 3), (n + 4), (n + 5)};

        thus (the connectives of L | N) is one-to-one

        proof

          let x, y;

          assume

           A9: x in ( dom (the connectives of L | N)) & y in ( dom (the connectives of L | N)) & ((the connectives of L | N) . x) = ((the connectives of L | N) . y);

          then

           A10: x in N & y in N by RELAT_1: 57;

          then

           A11: (c . x) = ((c | N) . x) = (c . y) by A9, FUNCT_1: 49;

          

           A12: (x = (n + 0 ) or ... or x = (n + 5)) & (y = (n + 0 ) or ... or y = (n + 5)) by A10, ENUMSET1:def 4;

          then

          consider i be Nat such that

           A13: 0 <= i <= 5 & x = (n + i);

          consider j be Nat such that

           A14: 0 <= j <= 5 & y = (n + j) by A12;

          (i = 0 or ... or i = 5) & (j = 0 or ... or j = 5) by A13, A14;

          then (c . x) = i & (c . y) = j by A8, A13, A14;

          hence thesis by A11, A13, A14;

        end;

        thus (the connectives of L . n) is_of_type ( <*the formula-sort of L*>,the formula-sort of L)

        proof

           0 = 0 or ... or 0 = 5;

          then

           A15: (c . (n + 0 )) = 0 by A8;

          00 in ( { 0 } \/ [: {1, 2}, X:]) & <* 0 *> in { <* 0 *>} by XBOOLE_0:def 3, TARSKI:def 1;

          then [ 0 , <* 0 *>] in (( { 0 } \/ [: {1, 2}, X:]) --> <* 0 *>) by ZFMISC_1: 106;

          then [ 0 , <* 0 *>] in aa by XBOOLE_0:def 3;

          then [ 0 , <* 0 *>] in a by XBOOLE_0:def 3;

          

          hence (the Arity of L . (the connectives of L . n)) = <*00*> by A15, FUNCT_1: 1

          .= <*the formula-sort of L*>;

          

          thus (the ResultSort of L . (the connectives of L . n)) = 00

          .= the formula-sort of L;

        end;

        thus (the connectives of L . (n + 5)) is_of_type ( {} ,the formula-sort of L)

        proof

           0 = 5 or ... or 5 = 5;

          then

           A16: (c . (n + 5)) = 5 by A8;

          5 in {5} & {} in { {} } by TARSKI:def 1;

          then [5, {} ] in ( {5} --> {} ) by ZFMISC_1: 106;

          then [5, {} ] in a by XBOOLE_0:def 3;

          hence (the Arity of L . (the connectives of L . (n + 5))) = {} by A16, FUNCT_1: 1;

          

          thus (the ResultSort of L . (the connectives of L . (n + 5))) = 00

          .= the formula-sort of L;

        end;

        thus (the connectives of L . (n + 1)) is_of_type ( <*the formula-sort of L, the formula-sort of L*>,the formula-sort of L) & ... & (the connectives of L . (n + 4)) is_of_type ( <*the formula-sort of L, the formula-sort of L*>,the formula-sort of L)

        proof

          let i;

          assume 1 <= i <= 4;

          then

           A17: i = 1 or ... or i = 4;

          i = 1 & (c . (n + 1)) = 1 or ... or i = 4 & (c . (n + 4)) = 4 by A17;

          then (c . (n + i)) in {1, 2, 3, 4} & <* 0 , 0 *> in { <* 0 , 0 *>} by TARSKI:def 1, ENUMSET1:def 2;

          then [(c . (n + i)), <* 0 , 0 *>] in ( {1, 2, 3, 4} --> <* 0 , 0 *>) by ZFMISC_1: 106;

          then [(c . (n + i)), <* 0 , 0 *>] in aa by XBOOLE_0:def 3;

          then [(c . (n + i)), <* 0 , 0 *>] in a by XBOOLE_0:def 3;

          

          hence (the Arity of L . (the connectives of L . (n + i))) = <*00, 0 *> by FUNCT_1: 1

          .= <*the formula-sort of L, 00*>

          .= <*the formula-sort of L, the formula-sort of L*>;

          

          thus (the ResultSort of L . (the connectives of L . (n + i))) = 00

          .= the formula-sort of L;

        end;

        thus the quant-sort of L = {1, 2};

        

         A18: the quantifiers of L = ( id [: {1, 2}, X:]) by Def7, XBOOLE_1: 7;

        hence the quantifiers of L is one-to-one;

        ( rng the quantifiers of L) c= [: {1, 2}, X:] by A18;

        hence ( rng the quantifiers of L) misses ( rng the connectives of L) by B1, B3, XBOOLE_1: 64;

        hereby

          let q,x be object;

          assume

           A19: q in the quant-sort of L & x in X;

          then

           A20: [q, x] in [:the quant-sort of L, X:] by ZFMISC_1: 87;

          (the quantifiers of L . (q,x)) = [q, x] & <* 0 *> in { <* 0 *>} by A19, A18, FUNCT_1: 18, TARSKI:def 1, ZFMISC_1: 87;

          then (the quantifiers of L . (q,x)) in ( { 0 } \/ [: {1, 2}, X:]) & <* 0 *> in { <* 0 *>} by A20, XBOOLE_0:def 3;

          then [(the quantifiers of L . (q,x)), <* 0 *>] in (( { 0 } \/ [: {1, 2}, X:]) --> <* 0 *>) by ZFMISC_1: 106;

          then [(the quantifiers of L . (q,x)), <* 0 *>] in aa by XBOOLE_0:def 3;

          then

           A21: [(the quantifiers of L . (q,x)), <* 0 *>] in a by XBOOLE_0:def 3;

          thus (the quantifiers of L . (q,x)) is_of_type ( <*the formula-sort of L*>,the formula-sort of L)

          proof

            

            thus (the Arity of L . (the quantifiers of L . (q,x))) = <*00*> by A21, FUNCT_1: 1

            .= <*the formula-sort of L*>;

            

            thus (the ResultSort of L . (the quantifiers of L . (q,x))) = 00

            .= the formula-sort of L;

          end;

        end;

      end;

    end

    registration

      let n be non empty natural number;

      cluster non void non emptyn PC-correct for PCLangSignature;

      existence

      proof

        set X = the set;

        set S = the non void non emptyn PC-correct QC-correct QCLangSignature over X;

        take S;

        thus thesis;

      end;

    end

    registration

      let X be set;

      cluster non void non empty for strict AlgLangSignature over X;

      existence

      proof

        set C = the non empty set;

        set O = the non empty set;

        set ay = the Function of O, (C * );

        set rs = the Function of O, C;

        set f = the Element of C;

        set p = the Element of C;

        set c = the FinSequence of O;

        set qs = {1, 2};

        set q = the Function of [:qs, X:], O;

        take L = AlgLangSignature (# C, O, ay, rs, f, p, c, qs, q #);

        thus the carrier' of L is non empty;

        thus the carrier of L is non empty;

      end;

    end

    registration

      cluster ordinal -> non pair for set;

      coherence

      proof

        let A be set;

        assume

         A1: A is ordinal pair;

        then

        consider x, y such that

         A2: A = [x, y] by XTUPLE_0:def 1;

         {} in A by A1, ORDINAL3: 8;

        hence thesis by A2, TARSKI:def 2;

      end;

    end

    theorem :: AOFA_L00:10

    for a be ordinal number holds for n1,n2 be natural number st n1 <> n2 holds (a +^ n1) <> (a +^ n2) by ORDINAL3: 21;

    registration

      let R be non empty Relation;

      cluster -> pair for Element of R;

      coherence ;

    end

    theorem :: AOFA_L00:11

    

     Th11: for n be non empty natural number holds for X be non empty set holds for J be Signature holds ex S be strict non void non empty AlgLangSignature over X st S is n PC-correct QC-correctn AL-correctJ -extension & (for i st i = 0 or ... or i = 8 holds (the connectives of S . (n + i)) = (( sup the carrier' of J) +^ i)) & (for x be Element of X holds (the quantifiers of S . (1,x)) = [the carrier' of J, 1, x] & (the quantifiers of S . (2,x)) = [the carrier' of J, 2, x]) & the formula-sort of S = ( sup the carrier of J) & the program-sort of S = (( sup the carrier of J) +^ 1) & the carrier of S = (the carrier of J \/ {the formula-sort of S, the program-sort of S}) & for w be Ordinal st w = ( sup the carrier' of J) holds the carrier' of S = ((the carrier' of J \/ {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)}) \/ [: {the carrier' of J}, {1, 2}, X:])

    proof

      let n be non empty natural number;

      let X be non empty set;

      let J be Signature;

      set w = ( sup the carrier' of J);

      set u = ( sup the carrier of J);

      set O1 = ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} \/ [: {the carrier' of J}, {1, 2}, X:]);

      set O = (the carrier' of J \/ O1);

      set a = (((( {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} --> <*(u +^ 0 ), (u +^ 0 )*>) \/ (( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:]) --> <*(u +^ 0 )*>)) \/ ( {(w +^ 5)} --> {} )) \/ ( {(w +^ 6), (w +^ 7), (w +^ 8)} --> <*(u +^ 1), (u +^ 0 )*>));

      set ay = (the Arity of J \/ a);

      set r = (O1 --> (u +^ 0 ));

      set rs = (the ResultSort of J +* r);

      

       A1: ( dom ( {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} --> <*(u +^ 0 ), (u +^ 0 )*>)) = {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} & ( dom ( {(w +^ 6), (w +^ 7), (w +^ 8)} --> <*(u +^ 1), (u +^ 0 )*>)) = {(w +^ 6), (w +^ 7), (w +^ 8)} & ( dom ( {(w +^ 5)} --> {} )) = {(w +^ 5)} & ( dom (( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:]) --> <*(u +^ 0 )*>)) = ( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:]);

      

       B1: {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} misses [: {the carrier' of J}, {1, 2}, X:]

      proof

        assume {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} meets [: {the carrier' of J}, {1, 2}, X:];

        then

        consider x such that

         A2: x in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} & x in [: {the carrier' of J}, {1, 2}, X:] by XBOOLE_0: 3;

        

         A3: x = (w +^ 0 ) or x = (w +^ 1) or x = (w +^ 2) or x = (w +^ 3) or x = (w +^ 4) or x = (w +^ 5) or x = (w +^ 6) or x = (w +^ 7) or x = (w +^ 8) by A2, ENUMSET1:def 7;

        consider j be object, y, z such that

         A5: j in {the carrier' of J} & y in {1, 2} & z in X & x = [j, y, z] by A2, MCART_1: 68;

        thus contradiction by A3, A5;

      end;

       {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} misses ( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:])

      proof

        assume {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} meets ( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:]);

        then

        consider x such that

         A2: x in {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} & x in ( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:]) by XBOOLE_0: 3;

        

         A3: x = (w +^ 1) or x = (w +^ 2) or x = (w +^ 3) or x = (w +^ 4) by A2, ENUMSET1:def 2;

        

         A4: (w +^ 0 ) <> (w +^ 1) & (w +^ 0 ) <> (w +^ 2) & (w +^ 0 ) <> (w +^ 3) & (w +^ 0 ) <> (w +^ 4) by ORDINAL3: 21;

        x in {(w +^ 0 )} or x in [: {the carrier' of J}, {1, 2}, X:] by A2, XBOOLE_0:def 3;

        then

        consider j be object, y, z such that

         A5: j in {the carrier' of J} & y in {1, 2} & z in X & x = [j, y, z] by A3, A4, MCART_1: 68, TARSKI:def 1;

        thus contradiction by A2, A5, ENUMSET1:def 2;

      end;

      then

      reconsider aa = (( {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} --> <*(u +^ 0 ), (u +^ 0 )*>) \/ (( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:]) --> <*(u +^ 0 )*>)) as Function by A1, GRFUNC_1: 13;

      

       A6: ( dom aa) = ( {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} \/ ( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:])) by A1, XTUPLE_0: 23

      .= (( {(w +^ 0 )} \/ {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)}) \/ [: {the carrier' of J}, {1, 2}, X:]) by XBOOLE_1: 4

      .= ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} \/ [: {the carrier' of J}, {1, 2}, X:]) by ENUMSET1: 7;

      ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} \/ [: {the carrier' of J}, {1, 2}, X:]) misses {(w +^ 5)}

      proof

        assume ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} \/ [: {the carrier' of J}, {1, 2}, X:]) meets {(w +^ 5)};

        then

        consider x such that

         A7: x in ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} \/ [: {the carrier' of J}, {1, 2}, X:]) & x in {(w +^ 5)} by XBOOLE_0: 3;

        

         A8: (w +^ 5) <> (w +^ 0 ) & (w +^ 5) <> (w +^ 1) & (w +^ 5) <> (w +^ 2) & (w +^ 5) <> (w +^ 3) & (w +^ 5) <> (w +^ 4) by ORDINAL3: 21;

        x = (w +^ 5) by A7, TARSKI:def 1;

        then (w +^ 5) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} or (w +^ 5) in [: {the carrier' of J}, {1, 2}, X:] by A7, XBOOLE_0:def 3;

        then ex j be object, y, z st j in {the carrier' of J} & y in {1, 2} & z in X & (w +^ 5) = [j, y, z] by A8, ENUMSET1:def 3, MCART_1: 68;

        hence contradiction;

      end;

      then

      reconsider ab = (aa \/ ( {(w +^ 5)} --> {} )) as Function by A1, A6, GRFUNC_1: 13;

      

       A9: ( dom ab) = (( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} \/ [: {the carrier' of J}, {1, 2}, X:]) \/ {(w +^ 5)}) by A1, A6, XTUPLE_0: 23

      .= (( {(w +^ 5)} \/ {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)}) \/ [: {the carrier' of J}, {1, 2}, X:]) by XBOOLE_1: 4

      .= ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5)} \/ [: {the carrier' of J}, {1, 2}, X:]) by ENUMSET1: 15;

      ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5)} \/ [: {the carrier' of J}, {1, 2}, X:]) misses {(w +^ 6), (w +^ 7), (w +^ 8)}

      proof

        assume ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5)} \/ [: {the carrier' of J}, {1, 2}, X:]) meets {(w +^ 6), (w +^ 7), (w +^ 8)};

        then

        consider x such that

         A10: x in ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5)} \/ [: {the carrier' of J}, {1, 2}, X:]) & x in {(w +^ 6), (w +^ 7), (w +^ 8)} by XBOOLE_0: 3;

        

         A11: (w +^ 6) <> (w +^ 0 ) & (w +^ 6) <> (w +^ 1) & (w +^ 6) <> (w +^ 2) & (w +^ 6) <> (w +^ 3) & (w +^ 6) <> (w +^ 4) & (w +^ 6) <> (w +^ 5) by ORDINAL3: 21;

        

         A12: (w +^ 7) <> (w +^ 0 ) & (w +^ 7) <> (w +^ 1) & (w +^ 7) <> (w +^ 2) & (w +^ 7) <> (w +^ 3) & (w +^ 7) <> (w +^ 4) & (w +^ 7) <> (w +^ 5) by ORDINAL3: 21;

        

         A13: (w +^ 8) <> (w +^ 0 ) & (w +^ 8) <> (w +^ 1) & (w +^ 8) <> (w +^ 2) & (w +^ 8) <> (w +^ 3) & (w +^ 8) <> (w +^ 4) & (w +^ 8) <> (w +^ 5) by ORDINAL3: 21;

        x = (w +^ 6) or x = (w +^ 7) or x = (w +^ 8) by A10, ENUMSET1:def 1;

        then (w +^ 6) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5)} or (w +^ 6) in [: {the carrier' of J}, {1, 2}, X:] or (w +^ 7) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5)} or (w +^ 7) in [: {the carrier' of J}, {1, 2}, X:] or (w +^ 8) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5)} or (w +^ 8) in [: {the carrier' of J}, {1, 2}, X:] by A10, XBOOLE_0:def 3;

        then (w +^ 6) in [: {the carrier' of J}, {1, 2}, X:] or (w +^ 7) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5)} or (w +^ 7) in [: {the carrier' of J}, {1, 2}, X:] or (w +^ 8) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5)} or (w +^ 8) in [: {the carrier' of J}, {1, 2}, X:] by A11, ENUMSET1:def 4;

        then (w +^ 6) in [: {the carrier' of J}, {1, 2}, X:] or (w +^ 7) in [: {the carrier' of J}, {1, 2}, X:] or (w +^ 8) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5)} or (w +^ 8) in [: {the carrier' of J}, {1, 2}, X:] by A12, ENUMSET1:def 4;

        then (ex j be object, y, z st j in {the carrier' of J} & y in {1, 2} & z in X & (w +^ 6) = [j, y, z]) or (ex j be object, y, z st j in {the carrier' of J} & y in {1, 2} & z in X & (w +^ 7) = [j, y, z]) or (ex j be object, y, z st j in {the carrier' of J} & y in {1, 2} & z in X & (w +^ 8) = [j, y, z]) by A13, ENUMSET1:def 4, MCART_1: 68;

        hence contradiction;

      end;

      then

      reconsider a as Function by A1, A9, GRFUNC_1: 13;

      

       A14: ( dom a) = (( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5)} \/ [: {the carrier' of J}, {1, 2}, X:]) \/ {(w +^ 6), (w +^ 7), (w +^ 8)}) by A1, A9, XTUPLE_0: 23

      .= (( {(w +^ 6), (w +^ 7), (w +^ 8)} \/ {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5)}) \/ [: {the carrier' of J}, {1, 2}, X:]) by XBOOLE_1: 4

      .= O1 by ENUMSET1: 82;

      then

       A15: ( dom ay) = (( dom the Arity of J) \/ ( dom a)) = O by XTUPLE_0: 23, FUNCT_2:def 1;

      

       A16: ( dom the Arity of J) = the carrier' of J by FUNCT_2:def 1;

      

       A17: O1 misses the carrier' of J

      proof

        assume O1 meets the carrier' of J;

        then

        consider x such that

         A18: x in O1 & x in the carrier' of J by XBOOLE_0: 3;

        x in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} or x in [: {the carrier' of J}, {1, 2}, X:] by A18, XBOOLE_0:def 3;

        then (x = (w +^ 0 ) or ... or x = (w +^ 8)) or x in [: {the carrier' of J}, {1, 2}, X:] by ENUMSET1:def 7;

        then ((w +^ 0 ) in w or ... or (w +^ 8) in w) & w = (w +^ 0 ) or x in [: {the carrier' of J}, {1, 2}, X:] by A18, ORDINAL2: 19, ORDINAL2: 27;

        then

        consider j,i,y be object such that

         A19: j in {the carrier' of J} & i in {1, 2} & y in X & x = [j, i, y] by MCART_1: 68, ORDINAL3: 22;

        reconsider jiy = [j, i, y] as set;

        the carrier' of J = j & j in {j} & {j} in { {j, i}, {j}} in { [j, i]} in jiy by A19, TARSKI:def 1, TARSKI:def 2;

        hence thesis by A18, A19, XREGULAR: 9;

      end;

      then

      reconsider ay = (the Arity of J \/ a) as Function by A14, A16, GRFUNC_1: 13;

      set C = (the carrier of J \/ {(u +^ 0 ), (u +^ 1)});

      (u +^ 0 ) in {(u +^ 0 ), (u +^ 1)} & (u +^ 1) in {(u +^ 0 ), (u +^ 1)} by TARSKI:def 2;

      then

      reconsider 00 = (u +^ 0 ), 01 = (u +^ 1) as Element of C by XBOOLE_0:def 3;

       <*00*> in (C * ) & <*00, 00*> in (C * ) by FINSEQ_1:def 11;

      then ( rng ( {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} --> <*00, 00*>)) c= (C * ) & ( rng (( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:]) --> <*00*>)) c= (C * ) by ZFMISC_1: 31;

      then (( rng ( {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} --> <*00, 00*>)) \/ ( rng (( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:]) --> <*00*>))) c= (C * ) & ( <*> C) in (C * ) by FINSEQ_1:def 11, XBOOLE_1: 8;

      then ( rng aa) c= (C * ) & ( rng ( {(w +^ 5)} --> {} )) c= (C * ) by RELAT_1: 12;

      then (( rng aa) \/ ( rng ( {(w +^ 5)} --> {} ))) c= (C * ) & <*01, 00*> in (C * ) by FINSEQ_1:def 11, XBOOLE_1: 8;

      then ( rng ab) c= (C * ) & ( rng ( {(w +^ 6), (w +^ 7), (w +^ 8)} --> <*01, 00*>)) c= (C * ) by ZFMISC_1: 31, RELAT_1: 12;

      then (( rng ab) \/ ( rng ( {(w +^ 6), (w +^ 7), (w +^ 8)} --> <*01, 00*>))) c= (C * ) by XBOOLE_1: 8;

      then

       A20: ( rng a) c= (C * ) by RELAT_1: 12;

      ( rng the Arity of J) c= (the carrier of J * ) c= (C * ) by XBOOLE_1: 7, FINSEQ_1: 62;

      then ( rng the Arity of J) c= (C * );

      then ( rng ay) = (( rng the Arity of J) \/ ( rng a)) c= (C * ) by A20, XBOOLE_1: 8, RELAT_1: 12;

      then

      reconsider ay as Function of O, (C * ) by A15, FUNCT_2: 2;

      the carrier' of J <> {} implies the carrier of J <> {} by INSTALG1:def 1;

      then

       A21: ( dom r) = O1 & ( rng r) = {00} & {00} c= C & ( dom the ResultSort of J) = the carrier' of J & ( rng the ResultSort of J) c= the carrier of J c= C by XBOOLE_1: 7, ZFMISC_1: 31, FUNCT_2:def 1;

      then ( rng the ResultSort of J) c= C;

      then ( dom rs) = O & ( rng rs) c= ( {00} \/ ( rng the ResultSort of J)) c= C by A21, XBOOLE_1: 8, FUNCT_4:def 1, FUNCT_4: 17;

      then ( dom rs) = O & ( rng rs) c= C;

      then

      reconsider rs as Function of O, C by FUNCT_2: 2;

      (w +^ 0 ) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} & ... & (w +^ 8) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} by ENUMSET1:def 7;

      then (w +^ 0 ) in O1 & ... & (w +^ 8) in O1 by XBOOLE_0:def 3;

      then

      reconsider o0 = (w +^ 0 ), o1 = (w +^ 1), o2 = (w +^ 2), o3 = (w +^ 3), o4 = (w +^ 4), o5 = (w +^ 5), o6 = (w +^ 6), o7 = (w +^ 7), o8 = (w +^ 8) as Element of O by XBOOLE_0:def 3;

      set p = the (n -' 1) qua Nat -element FinSequence of {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)};

      

       B2: ( rng p) c= {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} c= O1 c= O by XBOOLE_1: 7;

      then ( rng p) c= {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} c= O;

      then

      reconsider p as FinSequence of O by XBOOLE_1: 1, FINSEQ_1:def 4;

      set c9 = ( <*o0, o1, o2, o3, o4, o5, o6, o7*> ^ <*o8*>);

      n > 0 ;

      then

       A22: n >= ( 0 + 1) by NAT_1: 13;

      reconsider c = (p ^ c9) as FinSequence of O;

      ( rng c9) = {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} by AOFA_A00: 26;

      then

       B3: ( rng c) = (( rng p) \/ ( rng c9)) c= ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} \/ {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)}) by B2, XBOOLE_1: 13, FINSEQ_1: 31;

      

       A23: i = 0 or ... or i = 8 implies (c . (n + i)) = (w +^ i)

      proof

        assume i = 0 or ... or i = 8;

        then

         A24: i = 0 & (c . (n + 0 )) = (c9 . ( 0 + 1)) or ... or i = 8 & (c . (n + 8)) = (c9 . (8 + 1));

        thus thesis by A24, AOFA_A00: 29;

      end;

      deffunc Q( object) = [the carrier' of J, ($1 `1 ), ($1 `2 )];

      consider q be Function such that

       A25: ( dom q) = [: {1, 2}, X:] & for x st x in [: {1, 2}, X:] holds (q . x) = Q(x) from FUNCT_1:sch 3;

      ( rng q) c= O

      proof

        let x;

        assume x in ( rng q);

        then

        consider y such that

         A26: y in ( dom q) & x = (q . y) by FUNCT_1:def 3;

        consider i,z be object such that

         A27: i in {1, 2} & z in X & y = [i, z] by A25, A26, ZFMISC_1:def 2;

        x = [the carrier' of J, (y `1 ), (y `2 )] & (y `1 ) = i & (y `2 ) = z & the carrier' of J in {the carrier' of J} by A25, A26, A27, TARSKI:def 1;

        then x in [: {the carrier' of J}, {1, 2}, X:] by A27, MCART_1: 69;

        then x in O1 by XBOOLE_0:def 3;

        hence x in O by XBOOLE_0:def 3;

      end;

      then

      reconsider q as Function of [: {1, 2}, X:], O by A25, FUNCT_2: 2;

      set L = AlgLangSignature (# C, O, ay, rs, 00, 01, c, {1, 2}, q #);

      reconsider L as non empty non void strict AlgLangSignature over X;

      take L;

      ( len c9) = (8 + 1) & ( len p) = (n -' 1) & n is Real & 1 is Real by CARD_1:def 7;

      then

       A28: (( len p) + ( len c9)) = (((n -' 1) + 1) + 8) = (n + 8) by A22, XREAL_1: 235;

      then ( len the connectives of L) = (n + 8) = ((n + 5) + 3) by FINSEQ_1: 22;

      hence ( len the connectives of L) >= (n + 5) by NAT_1: 12;

      set N = {n, (n + 1), (n + 2), (n + 3), (n + 4), (n + 5)};

      thus (the connectives of L | N) is one-to-one

      proof

        let x, y;

        assume

         A29: x in ( dom (the connectives of L | N)) & y in ( dom (the connectives of L | N)) & ((the connectives of L | N) . x) = ((the connectives of L | N) . y);

        then

         A30: x in N & y in N by RELAT_1: 57;

        then

         A31: (c . x) = ((c | N) . x) = (c . y) by A29, FUNCT_1: 49;

        

         A32: (x = (n + 0 ) or ... or x = (n + 5)) & (y = (n + 0 ) or ... or y = (n + 5)) by A30, ENUMSET1:def 4;

        then

        consider i be Nat such that

         A33: 0 <= i <= 5 & x = (n + i);

        consider j be Nat such that

         A34: 0 <= j <= 5 & y = (n + j) by A32;

        i <= 8 & j <= 8 by A33, A34, XXREAL_0: 2;

        then (i = 0 or ... or i = 8) & (j = 0 or ... or j = 8);

        then (c . x) = (w +^ i) & (c . y) = (w +^ j) by A23, A33, A34;

        hence thesis by A31, A33, A34, ORDINAL3: 21;

      end;

      thus (the connectives of L . n) is_of_type ( <*the formula-sort of L*>,the formula-sort of L)

      proof

         0 = 0 or ... or 0 = 8;

        then

         A35: (c . (n + 0 )) = (w +^ 0 ) by A23;

        

         A36: (w +^ 0 ) in {(w +^ 0 )} & 00 in {00} by TARSKI:def 1;

        then (w +^ 0 ) in ( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:]) & <*00*> in { <*00*>} by XBOOLE_0:def 3, TARSKI:def 1;

        then [(w +^ 0 ), <*00*>] in (( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:]) --> <*00*>) by ZFMISC_1: 106;

        then [(w +^ 0 ), <*00*>] in aa by XBOOLE_0:def 3;

        then [(w +^ 0 ), <*00*>] in ab by XBOOLE_0:def 3;

        then [(w +^ 0 ), <*00*>] in a by XBOOLE_0:def 3;

        then [(w +^ 0 ), <*00*>] in ay by XBOOLE_0:def 3;

        hence (the Arity of L . (the connectives of L . n)) = <*the formula-sort of L*> by A35, FUNCT_1: 1;

        (w +^ 0 ) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} by ENUMSET1:def 7;

        then

         A37: (w +^ 0 ) in ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} \/ [: {the carrier' of J}, {1, 2}, X:]) by XBOOLE_0:def 3;

        then [(w +^ 0 ), 00] in r by A36, ZFMISC_1: 87;

        then (r . (c . n)) = 00 by A35, FUNCT_1: 1;

        hence (the ResultSort of L . (the connectives of L . n)) = the formula-sort of L by A35, A37, A21, FUNCT_4: 13;

      end;

      thus (the connectives of L . (n + 5)) is_of_type ( {} ,the formula-sort of L)

      proof

        5 = 0 or ... or 5 = 8;

        then

         A38: (c . (n + 5)) = (w +^ 5) by A23;

        (w +^ 5) in {(w +^ 5)} & {} in { {} } by TARSKI:def 1;

        then [(w +^ 5), {} ] in ( {(w +^ 5)} --> {} ) by ZFMISC_1: 106;

        then [(w +^ 5), {} ] in ab by XBOOLE_0:def 3;

        then [(w +^ 5), {} ] in a by XBOOLE_0:def 3;

        then [(w +^ 5), {} ] in ay by XBOOLE_0:def 3;

        hence (the Arity of L . (the connectives of L . (n + 5))) = {} by A38, FUNCT_1: 1;

        (w +^ 5) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} by ENUMSET1:def 7;

        then

         A39: (w +^ 5) in ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} \/ [: {the carrier' of J}, {1, 2}, X:]) & 00 in {00} by TARSKI:def 1, XBOOLE_0:def 3;

        then [(w +^ 5), 00] in r by ZFMISC_1: 87;

        then (r . (w +^ 5)) = 00 by FUNCT_1: 1;

        hence (the ResultSort of L . (the connectives of L . (n + 5))) = the formula-sort of L by A39, A38, A21, FUNCT_4: 13;

      end;

      thus (the connectives of L . (n + 1)) is_of_type ( <*the formula-sort of L, the formula-sort of L*>,the formula-sort of L) & ... & (the connectives of L . (n + 4)) is_of_type ( <*the formula-sort of L, the formula-sort of L*>,the formula-sort of L)

      proof

        let i;

        assume

         A40: 1 <= i <= 4;

        then 0 <= i <= 8 by XXREAL_0: 2;

        then

         A41: i = 0 or ... or i = 8;

        then

         A42: (c . (n + i)) = (w +^ i) by A23;

        i = 1 or ... or i = 4 by A40;

        then (c . (n + i)) in {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} & <*00, 00*> in { <*00, 00*>} by A42, TARSKI:def 1, ENUMSET1:def 2;

        then [(c . (n + i)), <*00, 00*>] in ( {(w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4)} --> <*00, 00*>) by ZFMISC_1: 106;

        then [(c . (n + i)), <*00, 00*>] in aa by XBOOLE_0:def 3;

        then [(c . (n + i)), <*00, 00*>] in ab by XBOOLE_0:def 3;

        then [(c . (n + i)), <*00, 00*>] in a by XBOOLE_0:def 3;

        then [(c . (n + i)), <*00, 00*>] in ay by XBOOLE_0:def 3;

        hence (the Arity of L . (the connectives of L . (n + i))) = <*the formula-sort of L, the formula-sort of L*> by FUNCT_1: 1;

        (c . (n + i)) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} by A42, A41, ENUMSET1:def 7;

        then

         A43: (c . (n + i)) in O1 & 00 in {00} by TARSKI:def 1, XBOOLE_0:def 3;

        then [(c . (n + i)), 00] in r by ZFMISC_1: 106;

        then (r . (c . (n + i))) = 00 by FUNCT_1: 1;

        hence (the ResultSort of L . (the connectives of L . (n + i))) = the formula-sort of L by A43, A21, FUNCT_4: 13;

      end;

      thus the quant-sort of L = {1, 2};

      thus the quantifiers of L is one-to-one

      proof

        let x, y;

        assume

         A44: x in ( dom the quantifiers of L) & y in ( dom the quantifiers of L);

        then

        reconsider a = x, b = y as Element of [: {1, 2}, X:];

        assume (the quantifiers of L . x) = (the quantifiers of L . y);

        

        then [the carrier' of J, (x `1 ), (x `2 )] = (the quantifiers of L . y) by A44, A25

        .= [the carrier' of J, (y `1 ), (y `2 )] by A44, A25;

        then (x `1 ) = (y `1 ) & (x `2 ) = (y `2 ) by XTUPLE_0: 3;

        then x = [(a `1 ), (a `2 )] = [(b `1 ), (b `2 )] = y;

        hence x = y;

      end;

      ( rng the quantifiers of L) c= [: {the carrier' of J}, {1, 2}, X:]

      proof

        let a be object;

        assume a in ( rng the quantifiers of L);

        then

        consider b be object such that

         C1: b in ( dom the quantifiers of L) & a = (the quantifiers of L . b) by FUNCT_1:def 3;

        reconsider b as Element of [: {1, 2}, X:] by C1;

        a = [the carrier' of J, (b `1 ), (b `2 )] & (b `1 ) in {1, 2} & (b `2 ) in X & the carrier' of J in {the carrier' of J} by C1, A25, TARSKI:def 1, MCART_1: 10;

        hence thesis by MCART_1: 69;

      end;

      hence ( rng the quantifiers of L) misses ( rng the connectives of L) by B1, B3, XBOOLE_1: 64;

      hereby

        let q,x be object;

        assume

         A45: q in the quant-sort of L & x in X;

        

         A46: (the quantifiers of L . (q,x)) = [the carrier' of J, ( [q, x] `1 ), ( [q, x] `2 )] & <*00*> in { <*00*>} & ( [q, x] `1 ) = q & ( [q, x] `2 ) = x & the carrier' of J in {the carrier' of J} by A25, A45, TARSKI:def 1, ZFMISC_1: 87;

        then (the quantifiers of L . (q,x)) in [: {the carrier' of J}, the quant-sort of L, X:] by A45, MCART_1: 69;

        then (the quantifiers of L . (q,x)) in ( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:]) & <*00*> in { <*00*>} by XBOOLE_0:def 3, TARSKI:def 1;

        then [(the quantifiers of L . (q,x)), <*00*>] in (( {(w +^ 0 )} \/ [: {the carrier' of J}, {1, 2}, X:]) --> <*00*>) by ZFMISC_1: 106;

        then [(the quantifiers of L . (q,x)), <*00*>] in aa by XBOOLE_0:def 3;

        then [(the quantifiers of L . (q,x)), <*00*>] in ab by XBOOLE_0:def 3;

        then [(the quantifiers of L . (q,x)), <*00*>] in a by XBOOLE_0:def 3;

        then

         A47: [(the quantifiers of L . (q,x)), <*00*>] in ay by XBOOLE_0:def 3;

        thus (the quantifiers of L . (q,x)) is_of_type ( <*the formula-sort of L*>,the formula-sort of L)

        proof

          thus (the Arity of L . (the quantifiers of L . (q,x))) = <*the formula-sort of L*> by A47, FUNCT_1: 1;

           [the carrier' of J, q, x] in [: {the carrier' of J}, {1, 2}, X:] by A46, A45, MCART_1: 69;

          then

           A48: [the carrier' of J, q, x] in O1 by XBOOLE_0:def 3;

          then (r . [the carrier' of J, q, x]) = 00 & [the carrier' of J, q, x] in O by XBOOLE_0:def 3, FUNCOP_1: 7;

          hence (the ResultSort of L . (the quantifiers of L . (q,x))) = the formula-sort of L by A21, A46, A48, FUNCT_4: 13;

        end;

      end;

      thus the program-sort of L <> the formula-sort of L by ORDINAL3: 21;

      thus ( len the connectives of L) >= (n + 8) by A28, FINSEQ_1: 22;

      thus (the connectives of L . (n + 6)) is_of_type ( <*the program-sort of L, the formula-sort of L*>,the formula-sort of L) & ... & (the connectives of L . (n + 8)) is_of_type ( <*the program-sort of L, the formula-sort of L*>,the formula-sort of L)

      proof

        let i;

        assume

         A49: 6 <= i <= 8;

        

         A50: i = 0 or ... or i = 8 by A49;

        then

         A51: (c . (n + i)) = (w +^ i) by A23;

        i = 6 or ... or i = 8 by A49;

        then (w +^ i) in {(w +^ 6), (w +^ 7), (w +^ 8)} & <*01, 00*> in { <*01, 00*>} by TARSKI:def 1, ENUMSET1:def 1;

        then [(w +^ i), <*01, 00*>] in ( {(w +^ 6), (w +^ 7), (w +^ 8)} --> <*01, 00*>) by ZFMISC_1: 106;

        then [(w +^ i), <*01, 00*>] in a by XBOOLE_0:def 3;

        then [(w +^ i), <*01, 00*>] in ay by XBOOLE_0:def 3;

        hence (the Arity of L . (the connectives of L . (n + i))) = <*the program-sort of L, the formula-sort of L*> by A51, FUNCT_1: 1;

        (w +^ i) in {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} by A50, ENUMSET1:def 7;

        then

         A52: (w +^ i) in ( {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)} \/ [: {the carrier' of J}, {1, 2}, X:]) by XBOOLE_0:def 3;

        then [(w +^ i), 00] in r by ZFMISC_1: 106;

        then (r . (w +^ i)) = 00 by FUNCT_1: 1;

        hence (the ResultSort of L . (the connectives of L . (n + i))) = the formula-sort of L by A21, A52, A51, FUNCT_4: 13;

      end;

      thus L is J -extension

      proof

        set f1 = ( id the carrier of J);

        set g1 = ( id the carrier' of J);

        thus ( dom f1) = the carrier of J & ( dom g1) = the carrier' of J;

        thus ( rng f1) c= the carrier of L & ( rng g1) c= the carrier' of L by XBOOLE_1: 7;

        the carrier' of J <> {} implies the carrier of J <> {} by INSTALG1:def 1;

        then

         A53: ( dom the ResultSort of J) = the carrier' of J & ( dom the Arity of J) = the carrier' of J by FUNCT_2:def 1;

        ( rng the ResultSort of J) c= the carrier of J;

        

        hence (f1 * the ResultSort of J) = the ResultSort of J by RELAT_1: 53

        .= (the ResultSort of L | the carrier' of J) by A17, A21, FUNCT_4: 33

        .= (the ResultSort of L * g1) by RELAT_1: 65;

        let o be set, p be Function;

        assume

         A54: o in the carrier' of J;

        then

        reconsider x = o as Element of the carrier' of J;

        assume

         A55: p = (the Arity of J . o);

        ( dom the Arity of J) = the carrier' of J by FUNCT_2:def 1;

        then

        reconsider q = p as Element of (the carrier of J * ) by A55, A54, FUNCT_1: 102;

        ( rng q) c= the carrier of J;

        then (f1 * p) = p & (g1 . x) = x by RELAT_1: 53;

        hence (f1 * p) = (the Arity of L . (g1 . o)) by A53, A55, A54, GRFUNC_1: 15;

      end;

      thus (i = 0 or ... or i = 8) implies (the connectives of L . (n + i)) = (( sup the carrier' of J) +^ i) by A23;

      hereby

        let x be Element of X;

        1 in {1, 2} by TARSKI:def 2;

        then [1, x] in [: {1, 2}, X:] by ZFMISC_1:def 2;

        

        hence (the quantifiers of L . (1,x)) = [the carrier' of J, ( [1, x] `1 ), ( [1, x] `2 )] by A25

        .= [the carrier' of J, 1, x];

        2 in {1, 2} by TARSKI:def 2;

        then [2, x] in [: {1, 2}, X:] by ZFMISC_1:def 2;

        

        hence (the quantifiers of L . (2,x)) = [the carrier' of J, ( [2, x] `1 ), ( [2, x] `2 )] by A25

        .= [the carrier' of J, 2, x];

      end;

      thus the formula-sort of L = ( sup the carrier of J) & the program-sort of L = (( sup the carrier of J) +^ 1) by ORDINAL2: 27;

      thus the carrier of L = (the carrier of J \/ {the formula-sort of L, the program-sort of L});

      let w be Ordinal;

      assume w = ( sup the carrier' of J);

      hence the carrier' of L = ((the carrier' of J \/ {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)}) \/ [: {the carrier' of J}, {1, 2}, X:]) by XBOOLE_1: 4;

    end;

    registration

      let n be non empty natural number;

      let X be non empty set;

      let J be Signature;

      cluster J -extensionn PC-correct QC-correctn AL-correct for non void non empty strict AlgLangSignature over X;

      existence

      proof

        consider S be strict non void non empty AlgLangSignature over X such that

         A1: S is n PC-correct QC-correctn AL-correctJ -extension and (for i st i = 0 or ... or i = 8 holds (the connectives of S . (n + i)) = (( sup the carrier' of J) +^ i)) & (for x be Element of X holds (the quantifiers of S . (1,x)) = [the carrier' of J, 1, x] & (the quantifiers of S . (2,x)) = [the carrier' of J, 2, x]) & the formula-sort of S = ( sup the carrier of J) & the program-sort of S = (( sup the carrier of J) +^ 1) & the carrier of S = (the carrier of J \/ {the formula-sort of S, the program-sort of S}) & for w be Ordinal st w = ( sup the carrier' of J) holds the carrier' of S = ((the carrier' of J \/ {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)}) \/ [: {the carrier' of J}, {1, 2}, X:]) by Th11;

        take S;

        thus thesis by A1;

      end;

    end

    registration

      let X be non empty set;

      let n be non empty natural number;

      cluster n PC-correct QC-correctn AL-correct for non void non empty strict AlgLangSignature over X;

      existence

      proof

        set J = the non empty non void Signature;

        set S = the J -extensionn PC-correct QC-correctn AL-correct non void non empty strict AlgLangSignature over X;

        take S;

        thus thesis;

      end;

    end

    begin

    definition

      let J be non empty non void Signature;

      let T be MSAlgebra over J;

      :: AOFA_L00:def8

      mode VariableSet of T -> set means

      : Def8: ex G be GeneratorSet of T st it = ( Union G);

      existence

      proof

        set G = the GeneratorSet of T;

        take X = ( Union G), G;

        thus thesis;

      end;

    end

    definition

      let J be non empty non void Signature;

      let T be MSAlgebra over J;

      let X be GeneratorSet of T;

      :: original: Union

      redefine

      func Union X -> VariableSet of T ;

      coherence by Def8;

    end

    theorem :: AOFA_L00:12

    for J be non empty non void Signature holds for T be MSAlgebra over J holds for X be VariableSet of T holds X c= ( Union the Sorts of T)

    proof

      let J be non empty non void Signature;

      let T be MSAlgebra over J;

      let X be VariableSet of T;

      consider G be GeneratorSet of T such that

       A1: X = ( Union G) by Def8;

      let x;

      assume x in X;

      then

      consider y be object such that

       A2: y in ( dom G) & x in (G . y) by A1, CARD_5: 2;

      y in the carrier of J by A2;

      then

       A3: y in ( dom the Sorts of T) by PARTFUN1:def 2;

      G c= the Sorts of T by PBOOLE:def 18;

      then (G . y) c= (the Sorts of T . y) by A2;

      hence thesis by A2, A3, CARD_5: 2;

    end;

    definition

      let S be non empty non void Signature;

      let X be ManySortedSet of the carrier of S;

      let T be VarMSAlgebra over S;

      :: AOFA_L00:def9

      attr T is X -vf-yielding means the free-vars of T is ManySortedMSSet of the Sorts of T, X;

    end

    definition

      let J be non empty set;

      let Q be ManySortedSet of J;

      let Y be set;

      let f be Function of [:( Union Q), Y:], ( Union Q);

      :: AOFA_L00:def10

      attr f is sort-preserving means

      : Def10: for j be Element of J holds (f .: [:(Q . j), Y:]) c= (Q . j);

    end

    registration

      let J be non empty set;

      let Q be ManySortedSet of J;

      let Y be set;

      cluster sort-preserving for Function of [:( Union Q), Y:], ( Union Q);

      existence

      proof

        deffunc F( object, object) = (( id ( Union Q)) . $1) qua set;

        

         A1: for j,y be object st j in ( Union Q) & y in Y holds F(j,y) in ( Union Q) by FUNCT_1: 17;

        consider F be Function of [:( Union Q), Y:], ( Union Q) such that

         A2: for j,y be object st j in ( Union Q) & y in Y holds (F . (j,y)) = F(j,y) from BINOP_1:sch 2( A1);

        take F;

        let j be Element of J;

        let x;

        assume x in (F .: [:(Q . j), Y:]);

        then

        consider y such that

         A3: y in ( dom F) & y in [:(Q . j), Y:] & x = (F . y) by FUNCT_1:def 6;

        consider a,b be object such that

         A4: a in (Q . j) & b in Y & y = [a, b] by A3, ZFMISC_1:def 2;

        ( dom Q) = J by PARTFUN1:def 2;

        then x = (F . (a,b)) = F(a,b) = a by A2, A3, A4, FUNCT_1: 17, CARD_5: 2;

        hence x in (Q . j) by A4;

      end;

    end

    definition

      let J be non empty non void Signature;

      let X be ManySortedSet of the carrier of J;

      struct ( MSAlgebra over J) SubstMSAlgebra over J,X (# the Sorts -> ManySortedSet of the carrier of J,

the Charact -> ManySortedFunction of (( the Sorts # ) * the Arity of J), ( the Sorts * the ResultSort of J),

the subst-op -> sort-preserving Function of [:( Union the Sorts), ( Union [|X, the Sorts|]):], ( Union the Sorts) #)

       attr strict strict;

    end

    theorem :: AOFA_L00:13

    

     Th13: for I be set holds for X be ManySortedSet of I holds for S be ManySortedSubset of X holds for x holds (S . x) is Subset of (X . x)

    proof

      let I be set;

      let X be ManySortedSet of I;

      let S be ManySortedSubset of X;

      let x;

      

       A1: S c= X by PBOOLE:def 18;

      x in ( dom S) & ( dom S) = I or x nin ( dom S) by PARTFUN1:def 2;

      then (S . x) c= (X . x) or (S . x) = {} by A1, FUNCT_1:def 2;

      hence thesis by XBOOLE_1: 2;

    end;

    definition

      let J be non empty non void Signature;

      let X be non empty-yielding ManySortedSet of the carrier of J;

      let Q be SubstMSAlgebra over J, X;

      let x be Element of ( Union X);

      

       A2: x in ( Union X) c= ( Union the Sorts of Q) by A1, PBOOLE:def 18, MSAFREE4: 1;

      :: AOFA_L00:def11

      func @ (x,Q) -> Element of ( Union the Sorts of Q) equals x;

      coherence by A2;

    end

    definition

      let J be non empty non void Signature;

      let X be non empty-yielding ManySortedSet of the carrier of J;

      let Q be SubstMSAlgebra over J, X;

      let j be SortSymbol of J;

      let A be Element of Q, j;

      let x be Element of ( Union X);

      let y be Element of ( Union X);

      given a be SortSymbol of J such that

       A3: x in (X . a) & y in (X . a);

      :: AOFA_L00:def12

      func A / (x,y) -> Element of Q, j equals

      : Def12: (the subst-op of Q . [A, [x, y]]);

      coherence

      proof

        (X . a) is Subset of (the Sorts of Q . a) by A1, Th13;

        then

         A4: [x, y] in [:(X . a), (the Sorts of Q . a):] by A3, ZFMISC_1: 87;

        

         A5: ( [|X, the Sorts of Q|] . a) = [:(X . a), (the Sorts of Q . a):] by PBOOLE:def 16;

        ( dom [|X, the Sorts of Q|]) = the carrier of J by PARTFUN1:def 2;

        then

         A6: [x, y] in ( Union [|X, the Sorts of Q|]) by A4, A5, CARD_5: 2;

        then

         A7: (the Sorts of Q . j) is non empty & [A, [x, y]] in [:(the Sorts of Q . j), ( Union [|X, the Sorts of Q|]):] by A2, ZFMISC_1: 87;

        ( dom the Sorts of Q) = the carrier of J by PARTFUN1:def 2;

        then

         A8: A in ( Union the Sorts of Q) by A2, CARD_5: 2;

        then [A, [x, y]] in [:( Union the Sorts of Q), ( Union [|X, the Sorts of Q|]):] by A6, ZFMISC_1: 87;

        then [A, [x, y]] in ( dom the subst-op of Q) by A8, FUNCT_2:def 1;

        then (the subst-op of Q . [A, [x, y]]) in (the subst-op of Q .: [:(the Sorts of Q . j), ( Union [|X, the Sorts of Q|]):]) c= (the Sorts of Q . j) by Def10, A7, FUNCT_1:def 6;

        hence thesis;

      end;

    end

    definition

      let J be non empty non void Signature;

      let X be non empty-yielding ManySortedSet of the carrier of J;

      let Q be SubstMSAlgebra over J, X;

      let j be SortSymbol of J;

      let A be Element of Q, j;

      let x be Element of ( Union X);

      let t be Element of ( Union the Sorts of Q);

      given a be SortSymbol of J such that

       A2: x in (X . a) & t in (the Sorts of Q . a);

      :: AOFA_L00:def13

      func A / (x,t) -> Element of Q, j equals

      : Def13: (the subst-op of Q . [A, [x, t]]);

      coherence

      proof

        

         A3: [x, t] in [:(X . a), (the Sorts of Q . a):] by A2, ZFMISC_1: 87;

        

         A4: ( [|X, the Sorts of Q|] . a) = [:(X . a), (the Sorts of Q . a):] by PBOOLE:def 16;

        ( dom [|X, the Sorts of Q|]) = the carrier of J by PARTFUN1:def 2;

        then

         A5: [x, t] in ( Union [|X, the Sorts of Q|]) by A3, A4, CARD_5: 2;

        then

         A6: (the Sorts of Q . j) is non empty & [A, [x, t]] in [:(the Sorts of Q . j), ( Union [|X, the Sorts of Q|]):] by A1, ZFMISC_1: 87;

        ( dom the Sorts of Q) = the carrier of J by PARTFUN1:def 2;

        then

         A7: A in ( Union the Sorts of Q) by A1, CARD_5: 2;

        then [A, [x, t]] in [:( Union the Sorts of Q), ( Union [|X, the Sorts of Q|]):] by A5, ZFMISC_1: 87;

        then [A, [x, t]] in ( dom the subst-op of Q) by A7, FUNCT_2:def 1;

        then (the subst-op of Q . [A, [x, t]]) in (the subst-op of Q .: [:(the Sorts of Q . j), ( Union [|X, the Sorts of Q|]):]) c= (the Sorts of Q . j) by Def10, A6, FUNCT_1:def 6;

        hence thesis;

      end;

    end

    registration

      let J be non empty non void ManySortedSign;

      let X be ManySortedSet of the carrier of J;

      cluster non-empty for SubstMSAlgebra over J, X;

      existence

      proof

        set Q = the non-empty MSAlgebra over J;

        set s = the sort-preserving Function of [:( Union the Sorts of Q), ( Union [|X, the Sorts of Q|]):], ( Union the Sorts of Q);

        take K = SubstMSAlgebra (# the Sorts of Q, the Charact of Q, s #);

        thus the Sorts of K is non-empty;

      end;

    end

    definition

      let J be non empty non void Signature;

      let X be non empty-yielding ManySortedSet of the carrier of J;

      let Q be non-empty SubstMSAlgebra over J, X;

      let o be OperSymbol of J;

      let p be Element of ( Args (o,Q));

      let x be Element of ( Union X);

      let y be Element of ( Union the Sorts of Q);

      :: AOFA_L00:def14

      func p / (x,y) -> Element of ( Args (o,Q)) means

      : Def14: for i be Nat st i in ( dom ( the_arity_of o)) holds ex j be SortSymbol of J st j = (( the_arity_of o) . i) & ex A be Element of Q, j st A = (p . i) & (it . i) = (A / (x,y));

      existence

      proof

        deffunc F( object) = (( In ((p . $1),(the Sorts of Q . (( the_arity_of o) /. $1)))) / (x,y));

        consider q be Function such that

         A1: ( dom q) = ( dom ( the_arity_of o)) & for x st x in ( dom ( the_arity_of o)) holds (q . x) = F(x) from FUNCT_1:sch 3;

        ( dom q) = ( Seg ( len ( the_arity_of o))) by A1, FINSEQ_1:def 3;

        then

        reconsider q as FinSequence by FINSEQ_1:def 2;

        

         A2: ( len q) = ( len ( the_arity_of o)) by A1, FINSEQ_3: 29;

        now

          let k be Nat;

          assume

           A3: k in ( dom q);

          (q . k) = F(k) by A1, A3;

          hence (q . k) in (the Sorts of Q . (( the_arity_of o) /. k));

        end;

        then

        reconsider q as Element of ( Args (o,Q)) by A2, MSAFREE2: 5;

        take q;

        let i be Nat;

        assume

         A4: i in ( dom ( the_arity_of o));

        take j = (( the_arity_of o) /. i);

        thus j = (( the_arity_of o) . i) by A4, PARTFUN1:def 6;

        take A = ( In ((p . i),(the Sorts of Q . j)));

        thus A = (p . i) by A4, MSUALG_6: 2, SUBSET_1:def 8;

        thus (q . i) = (A / (x,y)) by A4, A1;

      end;

      uniqueness

      proof

        let q1,q2 be Element of ( Args (o,Q)) such that

         A5: for i be Nat st i in ( dom ( the_arity_of o)) holds ex j be SortSymbol of J st j = (( the_arity_of o) . i) & ex A be Element of Q, j st A = (p . i) & (q1 . i) = (A / (x,y)) and

         A6: for i be Nat st i in ( dom ( the_arity_of o)) holds ex j be SortSymbol of J st j = (( the_arity_of o) . i) & ex A be Element of Q, j st A = (p . i) & (q2 . i) = (A / (x,y));

        

         A7: ( dom q1) = ( dom ( the_arity_of o)) & ( dom q2) = ( dom ( the_arity_of o)) by MSUALG_6: 2;

        hence ( dom q1) = ( dom q2);

        let z be object;

        assume

         A8: z in ( dom q1);

        then

        reconsider i = z as Nat;

        consider j1 be SortSymbol of J such that

         A9: j1 = (( the_arity_of o) . i) & ex A be Element of Q, j1 st A = (p . i) & (q1 . i) = (A / (x,y)) by A5, A7, A8;

        consider j2 be SortSymbol of J such that

         A10: j2 = (( the_arity_of o) . i) & ex A be Element of Q, j2 st A = (p . i) & (q2 . i) = (A / (x,y)) by A6, A7, A8;

        thus (q1 . z) = (q2 . z) by A9, A10;

      end;

    end

    definition

      let I be non empty set;

      let X be non-empty ManySortedSet of I;

      let S be non-empty ManySortedSubset of X;

      let x be Element of I;

      let z be Element of (S . x);

      :: AOFA_L00:def15

      func @ z -> Element of (X . x) equals z;

      coherence

      proof

        S c= X by PBOOLE:def 18;

        then z in (S . x) & (S . x) c= (X . x) & (S . x) is non empty;

        hence thesis;

      end;

    end

    definition

      let J be non empty non void Signature;

      let X be non empty-yielding ManySortedSet of the carrier of J;

      let Q be non-empty SubstMSAlgebra over J, X;

      :: AOFA_L00:def16

      attr Q is subst-correct means for x be Element of ( Union X) holds for a be SortSymbol of J st x in (X . a) holds (for j be SortSymbol of J holds for A be Element of Q, j holds (A / (x,x)) = A) & for y be Element of ( Union the Sorts of Q) st y in (the Sorts of Q . a) holds for o be OperSymbol of J holds for p be Element of ( Args (o,Q)) holds for A be Element of Q, ( the_result_sort_of o) st A = (( Den (o,Q)) . p) holds not (ex S be QCLangSignature over ( Union X) st J = S & ex z be Element of ( Union X), q be Element of {1, 2} st o = (the quantifiers of S . (q,z))) implies (A / (x,y)) = (( Den (o,Q)) . (p / (x,y)));

      :: AOFA_L00:def17

      attr Q is subst-correct2 means for j be SortSymbol of J holds for q be Element of Q, j, t be Element of Q, j holds for x be Element of ( Union X) st t = x in (X . j) holds (t / (x,q)) = q;

    end

    theorem :: AOFA_L00:14

    

     Th14: for J be non empty non void Signature holds for X be non empty-yielding ManySortedSet of the carrier of J holds for Q be SubstMSAlgebra over J, X st X is ManySortedSubset of the Sorts of Q holds for a be SortSymbol of J st (the Sorts of Q . a) <> {} holds for A be Element of Q, a holds for x,y be Element of ( Union X) holds for t be Element of ( Union the Sorts of Q) st y = t holds for j be SortSymbol of J st x in (X . j) & y in (X . j) holds (A / (x,y)) = (A / (x,t))

    proof

      let J be non empty non void Signature;

      let X be non empty-yielding ManySortedSet of the carrier of J;

      let Q be SubstMSAlgebra over J, X;

      assume

       A1: X is ManySortedSubset of the Sorts of Q;

      let a be SortSymbol of J;

      assume

       A2: (the Sorts of Q . a) <> {} ;

      let A be Element of Q, a;

      let x,y be Element of ( Union X);

      let t be Element of ( Union the Sorts of Q);

      assume

       A3: y = t;

      let j be SortSymbol of J;

      assume

       A4: x in (X . j);

      assume

       A5: y in (X . j);

      

       A6: (X . j) is Subset of (the Sorts of Q . j) by A1, Th13;

      

      thus (A / (x,y)) = (the subst-op of Q . [A, [x, y]]) by A1, A2, A4, A5, Def12

      .= (A / (x,t)) by A6, A5, A3, A4, A2, Def13;

    end;

    registration

      let J be non void Signature;

      cluster J -extension -> non void non empty for Signature;

      coherence

      proof

        let S be Signature;

        assume J is Subsignature of S;

        then the carrier of J c= the carrier of S & the carrier' of J c= the carrier' of S by INSTALG1: 10;

        hence the carrier' of S is non empty & the carrier of S is non empty;

      end;

    end

    registration

      let J be Signature;

      cluster J -extension for non empty non void Signature;

      existence

      proof

        set n = the non empty natural number;

        set X = the non empty set;

        set S = the J -extensionn PC-correct QC-correctn AL-correct non void non empty strict AlgLangSignature over X;

        take S;

        thus thesis;

      end;

      let X be non empty set;

      cluster J -extension for non empty non void QCLangSignature over X;

      existence

      proof

        set n = the non empty natural number;

        set S = the J -extensionn PC-correct QC-correctn AL-correct non void non empty strict AlgLangSignature over X;

        take S;

        thus thesis;

      end;

      let n be non empty natural number;

      cluster J -extension for non empty non voidn PC-correct QC-correct QCLangSignature over X;

      existence

      proof

        set S = the J -extensionn PC-correct QC-correctn AL-correct non void non empty strict AlgLangSignature over X;

        take S;

        thus thesis;

      end;

    end

    definition

      let J be Signature;

      let X be non empty set;

      let n be non empty Nat;

      let S be J -extensionn PC-correct feasible AlgLangSignature over X;

      :: AOFA_L00:def18

      attr S is essential means

      : Def16: (the connectives of S .: ((n + 9) \ n)) misses the carrier' of J & ( rng the quantifiers of S) misses the carrier' of J & {the formula-sort of S, the program-sort of S} misses the carrier of J;

    end

    registration

      let n be non empty natural number;

      let X be non empty set;

      let J be Signature;

      cluster essential for J -extensionn PC-correct QC-correctn AL-correct non void non empty strict AlgLangSignature over X;

      existence

      proof

        set w = ( sup the carrier' of J);

        deffunc c( ConnectivesSignature) = the connectives of $1;

        defpred P[ Nat, ConnectivesSignature] means ( c($2) . (n + $1)) = (w +^ $1);

        consider S be strict non void non empty AlgLangSignature over X such that

         A1: S is n PC-correct QC-correctn AL-correctJ -extension and

         A2: (for i st i = 0 or ... or i = 8 holds (the connectives of S . (n + i)) = (( sup the carrier' of J) +^ i)) and

         A3: (for x be Element of X holds (the quantifiers of S . (1,x)) = [the carrier' of J, 1, x] & (the quantifiers of S . (2,x)) = [the carrier' of J, 2, x]) & the formula-sort of S = ( sup the carrier of J) & the program-sort of S = (( sup the carrier of J) +^ 1) and the carrier of S = (the carrier of J \/ {the formula-sort of S, the program-sort of S}) & for w be Ordinal st w = ( sup the carrier' of J) holds the carrier' of S = ((the carrier' of J \/ {(w +^ 0 ), (w +^ 1), (w +^ 2), (w +^ 3), (w +^ 4), (w +^ 5), (w +^ 6), (w +^ 7), (w +^ 8)}) \/ [: {the carrier' of J}, {1, 2}, X:]) by Th11;

        reconsider S as J -extensionn PC-correct QC-correctn AL-correct non void non empty strict AlgLangSignature over X by A1;

        take S;

        set c = the connectives of S;

        thus (the connectives of S .: ((n + 9) \ n)) misses the carrier' of J

        proof

          assume (the connectives of S .: ((n + 9) \ n)) meets the carrier' of J;

          then

          consider x such that

           A4: x in (c .: ((n + 9) \ n)) & x in the carrier' of J by XBOOLE_0: 3;

          consider k be object such that

           A5: k in ( dom c) & k in ((n + 9) \ n) & x = (c . k) by A4, FUNCT_1:def 6;

          reconsider k as Nat by A5;

          set k1 = (k -' n);

          

           A6: k in ( Segm (n + 9)) & k nin n by A5, XBOOLE_0:def 5;

          then ( Segm n) c= ( Segm k) by ORDINAL1: 16;

          then n <= k < ((n + 8) + 1) by A6, NAT_1: 44;

          then n <= k <= (n + 8) by NAT_1: 13;

          then

           A7: (n + 0 ) <= (n + k1) <= (n + 8) & k = (n + k1) by XREAL_1: 235;

          then 0 <= k1 <= 8 by XREAL_1: 6;

          then 0 = k1 or ... or 8 = k1;

          then (c . k) = (w +^ k1) by A2, A7;

          then (w +^ k1) in w = (w +^ 0 ) by A4, A5, ORDINAL2: 19, ORDINAL2: 27;

          hence thesis by ORDINAL3: 22;

        end;

        thus ( rng the quantifiers of S) misses the carrier' of J

        proof

          assume ( rng the quantifiers of S) meets the carrier' of J;

          then

          consider x such that

           A8: x in ( rng the quantifiers of S) & x in the carrier' of J by XBOOLE_0: 3;

          consider y such that

           A9: y in ( dom the quantifiers of S) & x = (the quantifiers of S . y) by A8, FUNCT_1:def 3;

          ( dom the quantifiers of S) = [:the quant-sort of S, X:] by FUNCT_2:def 1

          .= [: {1, 2}, X:] by Def5;

          then

          consider i,z be object such that

           A10: i in {1, 2} & z in X & y = [i, z] by A9, ZFMISC_1:def 2;

          i = 1 or i = 2 by A10, TARSKI:def 2;

          then x = (the quantifiers of S . (i,z)) = [the carrier' of J, i, z] by A9, A10, A3;

          then the carrier' of J in {the carrier' of J} in { {the carrier' of J, i}, {the carrier' of J}} in { [the carrier' of J, i]} in (the quantifiers of S . (i,z)) = x in the carrier' of J by A8, TARSKI:def 1, TARSKI:def 2;

          hence thesis by XREGULAR: 9;

        end;

        assume {the formula-sort of S, the program-sort of S} meets the carrier of J;

        then

        consider x such that

         A11: x in {the formula-sort of S, the program-sort of S} & x in the carrier of J by XBOOLE_0: 3;

        x = the formula-sort of S or x = the program-sort of S by A11, TARSKI:def 2;

        then ( sup the carrier of J) in ( sup the carrier of J) or (( sup the carrier of J) +^ 1) in ( sup the carrier of J) by A3, A11, ORDINAL2: 19;

        then (( sup the carrier of J) +^ 1) in (( sup the carrier of J) +^ 0 ) by ORDINAL2: 27;

        hence thesis by ORDINAL3: 22;

      end;

    end

    registration

      let J be non empty Signature;

      let S be J -extension non empty Signature;

      let X be non empty-yielding ManySortedSet of the carrier of J;

      cluster X -tolerating for non empty-yielding ManySortedSet of the carrier of S;

      existence

      proof

        set Y = (X extended_by ( {} ,the carrier of S));

        consider x such that

         A1: x in the carrier of J & (X . x) is non empty by PBOOLE:def 12;

        Y is non empty-yielding

        proof

          take x;

          J is Subsignature of S by Def2;

          then

           A2: the carrier of J c= the carrier of S by INSTALG1: 10;

          hence x in the carrier of S by A1;

          x in ( dom X) by A1, PARTFUN1:def 2;

          then x in ( dom (X | the carrier of S)) by A2, RELAT_1: 57;

          

          then (Y . x) = ((X | the carrier of S) . x) by FUNCT_4: 13

          .= (X . x) by A1, A2, FUNCT_1: 49;

          hence (Y . x) is non empty by A1;

        end;

        hence thesis;

      end;

    end

    definition

      let J be non empty Signature;

      let S be non empty Signature;

      let T be MSAlgebra over J;

      let Q be MSAlgebra over S;

      :: AOFA_L00:def19

      attr Q is T -extension means

      : Def17: (Q | J) = the MSAlgebra of T;

    end

    theorem :: AOFA_L00:15

    

     Th15: for J be non empty non void Signature holds for S be J -extension Signature holds for T be MSAlgebra over J holds for Q1,Q2 be MSAlgebra over S st the MSAlgebra of Q1 = the MSAlgebra of Q2 holds Q1 is T -extension implies Q2 is T -extension

    proof

      let J be non empty non void Signature;

      let S be J -extension Signature;

      

       A1: J is Subsignature of S by Def2;

      let T be MSAlgebra over J;

      let Q1,Q2 be MSAlgebra over S;

      assume

       A2: the MSAlgebra of Q1 = the MSAlgebra of Q2;

      assume

       A3: (Q1 | J) = the MSAlgebra of T;

      (Q1 | J) = (Q1 | (J,( id the carrier of J),( id the carrier' of J))) & (Q2 | J) = (Q2 | (J,( id the carrier of J),( id the carrier' of J))) by INSTALG1:def 4;

      hence (Q2 | J) = the MSAlgebra of T by A3, A1, A2, INSTALG1:def 2, INSTALG1: 21;

    end;

    theorem :: AOFA_L00:16

    

     Th16: for J be non empty non void Signature holds for S be J -extension Signature holds for T be MSAlgebra over J holds for Q be MSAlgebra over S st Q is T -extension holds for x st x in the carrier of J holds (the Sorts of T . x) = (the Sorts of Q . x)

    proof

      let J be non empty non void Signature;

      let S be J -extension Signature;

      J is Subsignature of S by Def2;

      then

       A1: (( id the carrier of J),( id the carrier' of J)) form_morphism_between (J,S) by INSTALG1:def 2;

      let T be MSAlgebra over J;

      let Q be MSAlgebra over S;

      assume

       A2: (Q | J) = the MSAlgebra of T;

      (Q | J) = (Q | (J,( id the carrier of J),( id the carrier' of J))) by INSTALG1:def 4;

      then

       A3: the Sorts of T = (the Sorts of Q * ( id the carrier of J)) & ( dom ( id the carrier of J)) = the carrier of J by A1, A2, INSTALG1:def 3;

      let x;

      assume

       A4: x in the carrier of J;

      

      hence (the Sorts of T . x) = (the Sorts of Q . (( id the carrier of J) . x)) by A3, FUNCT_1: 13

      .= (the Sorts of Q . x) by A4, FUNCT_1: 17;

    end;

    theorem :: AOFA_L00:17

    

     Th17: for J be non empty non void Signature holds for S be J -extension Signature holds for T be MSAlgebra over J holds for I be set st I c= (the carrier of S \ the carrier of J) holds for X be ManySortedSet of I holds ex Q be MSAlgebra over S st Q is T -extension & (the Sorts of Q | I) = X

    proof

      let J be non empty non void Signature;

      let S be J -extension Signature;

      let T be MSAlgebra over J;

      let I be set;

      assume

       A1: I c= (the carrier of S \ the carrier of J);

      let X be ManySortedSet of I;

      set U = (( the ManySortedSet of the carrier of S +* the Sorts of T) +* X);

      

       A2: J is Subsignature of S by Def2;

      ( dom U) = (( dom ( the ManySortedSet of the carrier of S +* the Sorts of T)) \/ ( dom X)) by FUNCT_4:def 1

      .= ((( dom the ManySortedSet of the carrier of S) \/ ( dom the Sorts of T)) \/ ( dom X)) by FUNCT_4:def 1

      .= ((( dom the ManySortedSet of the carrier of S) \/ ( dom the Sorts of T)) \/ I) by PARTFUN1:def 2

      .= ((( dom the ManySortedSet of the carrier of S) \/ the carrier of J) \/ I) by PARTFUN1:def 2

      .= ((the carrier of S \/ the carrier of J) \/ I) by PARTFUN1:def 2

      .= (the carrier of S \/ I) by A2, INSTALG1: 10, XBOOLE_1: 12

      .= the carrier of S by A1, XBOOLE_1: 1, XBOOLE_1: 12;

      then

      reconsider U as ManySortedSet of the carrier of S by RELAT_1:def 18, PARTFUN1:def 2;

      set C = ( the ManySortedFunction of ((U # ) * the Arity of S), (U * the ResultSort of S) +* the Charact of T);

      ( dom C) = (( dom the ManySortedFunction of ((U # ) * the Arity of S), (U * the ResultSort of S)) \/ ( dom the Charact of T)) by FUNCT_4:def 1

      .= (the carrier' of S \/ ( dom the Charact of T)) by PARTFUN1:def 2

      .= (the carrier' of S \/ the carrier' of J) by PARTFUN1:def 2

      .= the carrier' of S by A2, INSTALG1: 10, XBOOLE_1: 12;

      then

      reconsider C as ManySortedSet of the carrier' of S by RELAT_1:def 18, PARTFUN1:def 2;

      

       A3: ( dom X) = I misses the carrier of J by A1, XBOOLE_1: 63, XBOOLE_1: 79, PARTFUN1:def 2;

      C is ManySortedFunction of ((U # ) * the Arity of S), (U * the ResultSort of S)

      proof

        let o be object;

        assume

         A4: o in the carrier' of S;

        then

        reconsider w = o as OperSymbol of S;

        per cases ;

          suppose

           A5: o in the carrier' of J;

          then

          reconsider u = o as OperSymbol of J;

          o in ( dom the Charact of T) by A5, PARTFUN1:def 2;

          then

           A6: (C . o) = (the Charact of T . o) by FUNCT_4: 13;

          the Arity of J = (the Arity of S | the carrier' of J) & the ResultSort of J = (the ResultSort of S | the carrier' of J) by A2, INSTALG1: 12;

          then

           A7: (the Arity of J . o) = (the Arity of S . o) & (the ResultSort of J . o) = (the ResultSort of S . o) by A5, FUNCT_1: 49;

          

           A8: ((the Sorts of T # ) . ( the_arity_of u)) = ( product (the Sorts of T * ( the_arity_of u))) & ((U # ) . ( the_arity_of w)) = ( product (U * ( the_arity_of w))) by FINSEQ_2:def 5;

          

           A9: ( dom the Sorts of T) = the carrier of J & ( rng ( the_arity_of u)) c= the carrier of J by PARTFUN1:def 2;

          (U * ( the_arity_of w)) = (( the ManySortedSet of the carrier of S +* the Sorts of T) * ( the_arity_of w)) by A3, A7, A9, XBOOLE_1: 63, FUNCT_7: 11

          .= (the Sorts of T * ( the_arity_of u)) by A9, A7, AOFA_I00: 3;

          then

           A10: ((the Sorts of T # ) . ( the_arity_of u)) = ((U # ) . ( the_arity_of w)) by A8;

          

           A11: ( rng the ResultSort of S) c= the carrier of S & ( rng the ResultSort of J) c= the carrier of J & the carrier of J = ( dom the Sorts of T) by PARTFUN1:def 2;

          ( rng the ResultSort of J) misses ( dom X) by A3, XBOOLE_1: 63;

          

          then

           A12: (U * the ResultSort of J) = (( the ManySortedSet of the carrier of S +* the Sorts of T) * the ResultSort of J) by FUNCT_7: 11

          .= (the Sorts of T * the ResultSort of J) by A11, AOFA_I00: 3;

          (((the Sorts of T # ) * the Arity of J) . o) = ((the Sorts of T # ) . ( the_arity_of u)) & (((U # ) * the Arity of S) . o) = ((U # ) . ( the_arity_of w)) & ((the Sorts of T * the ResultSort of S) . o) = (the Sorts of T . (the ResultSort of S . o)) & ((the Sorts of T * the ResultSort of J) . o) = (the Sorts of T . (the ResultSort of J . o)) & ((U * the ResultSort of S) . o) = (U . (the ResultSort of S . o)) & ((U * the ResultSort of J) . o) = (U . (the ResultSort of J . o)) by A4, A5, FUNCT_2: 15;

          hence thesis by A6, A7, A10, A12;

        end;

          suppose o nin the carrier' of J;

          then o nin ( dom the Charact of T);

          then (C . o) = ( the ManySortedFunction of ((U # ) * the Arity of S), (U * the ResultSort of S) . o) by FUNCT_4: 11;

          hence thesis;

        end;

      end;

      then

      reconsider C as ManySortedFunction of ((U # ) * the Arity of S), (U * the ResultSort of S);

      take Q = MSAlgebra (# U, C #);

      thus Q is T -extension

      proof

        

         A13: (Q | J) = (Q | (J,( id the carrier of J),( id the carrier' of J))) by INSTALG1:def 4;

        (( id the carrier of J),( id the carrier' of J)) form_morphism_between (J,S) by A2, INSTALG1:def 2;

        then the Sorts of (Q | J) = (the Sorts of Q * ( id the carrier of J)) & the Charact of (Q | J) = (the Charact of Q * ( id the carrier' of J)) by A13, INSTALG1:def 3;

        then

         A14: the Sorts of (Q | J) = (the Sorts of Q | the carrier of J) & the Charact of (Q | J) = (the Charact of Q | the carrier' of J) by RELAT_1: 65;

        

         A15: ( dom the Sorts of T) = the carrier of J & ( dom the Charact of T) = the carrier' of J by PARTFUN1:def 2;

        the Sorts of (Q | J) = (( the ManySortedSet of the carrier of S +* the Sorts of T) | the carrier of J) by A3, A14, FUNCT_4: 72

        .= the Sorts of T by A15;

        hence (Q | J) = the MSAlgebra of T by A14, A15;

      end;

      ( dom X) = I by PARTFUN1:def 2;

      hence (the Sorts of Q | I) = X;

    end;

    theorem :: AOFA_L00:18

    

     Th18: for J be non empty non void Signature holds for S be J -extension Signature holds for T be non-empty MSAlgebra over J holds for I be set st I c= (the carrier of S \ the carrier of J) holds for X be non-empty ManySortedSet of I holds ex Q be non-empty MSAlgebra over S st Q is T -extension & (the Sorts of Q | I) = X

    proof

      let J be non empty non void Signature;

      let S be J -extension Signature;

      let T be non-empty MSAlgebra over J;

      set K = (the carrier of S \ the carrier of J);

      let I be set;

      assume

       A1: I c= K;

      let X be non-empty ManySortedSet of I;

      set Y = ( the non-empty ManySortedSet of K +* X);

      ( dom Y) = (( dom the non-empty ManySortedSet of K) \/ ( dom X)) by FUNCT_4:def 1

      .= (K \/ ( dom X)) by PARTFUN1:def 2

      .= (K \/ I) by PARTFUN1:def 2

      .= K by A1, XBOOLE_1: 12;

      then

      reconsider Y as non-empty ManySortedSet of K by RELAT_1:def 18, PARTFUN1:def 2;

      consider Q be MSAlgebra over S such that

       A2: Q is T -extension & (the Sorts of Q | K) = Y by Th17;

      now

        let x be object;

        assume x in the carrier of S;

        per cases by XBOOLE_0:def 5;

          suppose

           A3: x in the carrier of J;

          then (the Sorts of Q . x) = (the Sorts of T . x) by A2, Th16;

          hence (the Sorts of Q . x) is non empty by A3;

        end;

          suppose

           A4: x in K;

          then (the Sorts of Q . x) = (Y . x) by A2, FUNCT_1: 49;

          hence (the Sorts of Q . x) is non empty by A4;

        end;

      end;

      then the Sorts of Q is non-empty;

      then

      reconsider Q as non-empty MSAlgebra over S by MSUALG_1:def 3;

      take Q;

      thus Q is T -extension by A2;

      

       A5: ( dom X) = I by PARTFUN1:def 2;

      

      thus (the Sorts of Q | I) = ((the Sorts of Q | K) | I) by A1, RELAT_1: 74

      .= X by A2, A5;

    end;

    registration

      let J be non empty non void Signature;

      let S be J -extension Signature;

      let T be MSAlgebra over J;

      cluster T -extension for MSAlgebra over S;

      existence

      proof

        set Z = the ManySortedSet of {} ;

         {} c= (the carrier of S \ the carrier of J);

        then

        consider Q be MSAlgebra over S such that

         A1: Q is T -extension & (the Sorts of Q | {} ) = Z by Th17;

        take Q;

        thus thesis by A1;

      end;

    end

    registration

      let J be non empty non void Signature;

      let S be J -extension Signature;

      let T be non-empty MSAlgebra over J;

      cluster T -extension for non-empty MSAlgebra over S;

      existence

      proof

        set I = (the carrier of S \ the carrier of J);

        set Z = the non-empty ManySortedSet of I;

        consider Q be MSAlgebra over S such that

         A1: Q is T -extension & (the Sorts of Q | I) = Z by Th17;

        now

          let s be object;

          assume s in the carrier of S;

          per cases by XBOOLE_0:def 5;

            suppose

             A2: s in the carrier of J;

            then (the Sorts of Q . s) = (the Sorts of T . s) by A1, Th16;

            hence (the Sorts of Q . s) is non empty by A2;

          end;

            suppose

             A3: s in I;

            then (the Sorts of Q . s) = (Z . s) by A1, FUNCT_1: 49;

            hence (the Sorts of Q . s) is non empty by A3;

          end;

        end;

        then the Sorts of Q is non-empty;

        then

        reconsider Q as non-empty MSAlgebra over S by MSUALG_1:def 3;

        take Q;

        thus thesis by A1;

      end;

    end

    theorem :: AOFA_L00:19

    

     Th19: for I be set, a be object holds ( pr1 (I, {a})) is one-to-one

    proof

      let I be set;

      let a be object;

      set f = ( pr1 (I, {a}));

      let x,y be object;

      assume

       A1: x in ( dom f) & y in ( dom f);

      then

      consider i1,a1 be object such that

       A2: i1 in I & a1 in {a} & x = [i1, a1] by ZFMISC_1:def 2;

      consider i2,a2 be object such that

       A3: i2 in I & a2 in {a} & y = [i2, a2] by A1, ZFMISC_1:def 2;

      assume (f . x) = (f . y);

      then (f . (i1,a1)) = (f . (i2,a2)) by A2, A3;

      then

       A4: i1 = (f . (i2,a2)) = i2 by A2, A3, FUNCT_3:def 4;

      a1 = a = a2 by A2, A3, TARSKI:def 1;

      hence x = y by A2, A3, A4;

    end;

    theorem :: AOFA_L00:20

    

     Th20: for S1,S2,E1,E2 be Signature st the ManySortedSign of S1 = the ManySortedSign of S2 & the ManySortedSign of E1 = the ManySortedSign of E2 & E1 is Extension of S1 holds E2 is Extension of S2

    proof

      let S1,S2,E1,E2 be Signature;

      assume

       A1: the ManySortedSign of S1 = the ManySortedSign of S2;

      assume

       A2: the ManySortedSign of E1 = the ManySortedSign of E2;

      set f = ( id the carrier of S1), g = ( id the carrier' of S1);

      assume

       A3: ( dom f) = the carrier of S1 & ( dom g) = the carrier' of S1 & ( rng f) c= the carrier of E1 & ( rng g) c= the carrier' of E1 & (f * the ResultSort of S1) = (the ResultSort of E1 * g) & for o be set, p be Function st o in the carrier' of S1 & p = (the Arity of S1 . o) holds (f * p) = (the Arity of E1 . (g . o));

      thus ( dom ( id the carrier of S2)) = the carrier of S2;

      thus thesis by A1, A2, A3;

    end;

    registration

      let I be set;

      let a be object;

      cluster ( pr1 (I, {a})) -> one-to-one;

      coherence by Th19;

    end

    definition

      let a,b,c be non empty set;

      let g be Function of a, b;

      let f be Function of b, c;

      :: original: *

      redefine

      func f * g -> Function of a, c ;

      coherence

      proof

        ( dom (f * g)) = a & ( rng (f * g)) c= c by FUNCT_2:def 1;

        hence thesis;

      end;

    end

    theorem :: AOFA_L00:21

    

     Lem6: for f be one-to-one Function st X misses Y holds (f .: X) misses (f .: Y)

    proof

      let f be one-to-one Function;

      assume

       Z2: X misses Y;

      assume (f .: X) meets (f .: Y);

      then

      consider x such that

       A1: x in (f .: X) & x in (f .: Y) by XBOOLE_0: 3;

      consider y such that

       A2: y in ( dom f) & y in X & x = (f . y) by A1, FUNCT_1:def 6;

      consider z be object such that

       A3: z in ( dom f) & z in Y & x = (f . z) by A1, FUNCT_1:def 6;

      y <> z by Z2, A2, A3, XBOOLE_0: 3;

      hence contradiction by A3, A2, FUNCT_1:def 4;

    end;

    theorem :: AOFA_L00:22

    

     Th21: for n be non empty natural number, X be set holds for J be non empty Signature holds ex Q be non empty non voidn PC-correct QC-correct QCLangSignature over X st the carrier of Q misses the carrier of J & the carrier' of Q misses the carrier' of J

    proof

      let n be non empty natural number, X be set;

      let J be non empty Signature;

      set Q = the non empty non voidn PC-correct QC-correct QCLangSignature over X;

      reconsider A = [:the carrier of Q, {the carrier of J}:] as non empty set;

      reconsider B = [:the carrier' of Q, {the carrier' of J}:] as non empty set;

      reconsider f = ( pr1 (the carrier of Q, {the carrier of J})) as Function of A, the carrier of Q;

      reconsider g = ( pr1 (the carrier' of Q, {the carrier' of J})) as Function of B, the carrier' of Q;

      f is one-to-one & ( rng f) = the carrier of Q by FUNCT_3: 44;

      then

      reconsider f1 = (f " ) as Function of the carrier of Q, A by FUNCT_2: 25;

      

       A1: g is one-to-one & ( rng g) = the carrier' of Q by FUNCT_3: 44;

      then

      reconsider g1 = (g " ) as Function of the carrier' of Q, B by FUNCT_2: 25;

      deffunc F( object) = (f1 * ( In ($1,(the carrier of Q * ))));

      consider ff be Function such that

       A2: ( dom ff) = (the carrier of Q * ) & for p be object st p in (the carrier of Q * ) holds (ff . p) = F(p) from FUNCT_1:sch 3;

      ( rng ff) c= (A * )

      proof

        let a be object;

        assume a in ( rng ff);

        then

        consider b be object such that

         A3: b in ( dom ff) & a = (ff . b) by FUNCT_1:def 3;

        

         A4: a = F(b) by A2, A3;

         F(b) is FinSequence & ( rng F(b)) c= A;

        then F(b) is FinSequence of A by FINSEQ_1:def 4;

        hence thesis by A4, FINSEQ_1:def 11;

      end;

      then

      reconsider ff as Function of (the carrier of Q * ), (A * ) by A2, FUNCT_2: 2;

      reconsider Ar = ((ff * the Arity of Q) * g) as Function of B, (A * );

      reconsider re = ((f1 * the ResultSort of Q) * g) as Function of B, A;

      

       A5: the formula-sort of Q in the carrier of Q = ( dom f1) by FUNCT_2:def 1;

      then

      reconsider fs = (f1 . the formula-sort of Q) as Element of A by FUNCT_1: 102;

      ( rng (g1 * the connectives of Q)) c= B;

      then

      reconsider co = (g1 * the connectives of Q) as FinSequence of B by FINSEQ_1:def 4;

      reconsider qu = (g1 * the quantifiers of Q) as Function of [:the quant-sort of Q, X:], B;

      set QQ = QCLangSignature (# A qua non empty set, B qua non empty set, Ar, re, fs, co, the quant-sort of Q qua set, qu #);

      

       A6: QQ is n PC-correct

      proof

        ( rng the connectives of Q) c= the carrier' of Q = ( dom g1) by FUNCT_2:def 1;

        then

         A7: ( dom the connectives of QQ) = ( dom the connectives of Q) = ( Seg ( len the connectives of Q)) by RELAT_1: 27, FINSEQ_1:def 3;

        then ( len the connectives of QQ) = ( len the connectives of Q) by FINSEQ_1:def 3;

        hence ( len the connectives of QQ) >= (n + 5) by Def4;

        (the connectives of QQ | {n, (n + 1), (n + 2), (n + 3), (n + 4), (n + 5)}) = (g1 * (the connectives of Q | {n, (n + 1), (n + 2), (n + 3), (n + 4), (n + 5)})) & g1 is one-to-one & (the connectives of Q | {n, (n + 1), (n + 2), (n + 3), (n + 4), (n + 5)}) is one-to-one by Def4, RELAT_1: 83;

        hence (the connectives of QQ | {n, (n + 1), (n + 2), (n + 3), (n + 4), (n + 5)}) is one-to-one;

         0 < n <= (n + 5) <= ( len the connectives of Q) by Def4, NAT_1: 12;

        then ( 0 + 1) <= n <= ( len the connectives of Q) by NAT_1: 13, XXREAL_0: 2;

        then

         A8: (g1 . (the connectives of Q . n)) = (the connectives of QQ . n) in B = ( dom g) & (the connectives of Q . n) in the carrier' of Q by A7, FUNCT_1: 13, FUNCT_1: 102, FUNCT_2:def 1, FINSEQ_3: 25;

        1 <= ((n + 4) + 1) = (n + 5) <= ( len the connectives of Q) by Def4, NAT_1: 12;

        then

         A9: (g1 . (the connectives of Q . (n + 5))) = (the connectives of QQ . (n + 5)) in B = ( dom g) & (the connectives of Q . (n + 5)) in the carrier' of Q by A7, FUNCT_1: 13, FUNCT_1: 102, FUNCT_2:def 1, FINSEQ_3: 25;

        

         A10: <*the formula-sort of Q*> in (the carrier of Q * ) by FINSEQ_1:def 11;

        

         A11: ( <*> the carrier of Q) in (the carrier of Q * ) by FINSEQ_1:def 11;

        

         A12: (the connectives of Q . n) is_of_type ( <*the formula-sort of Q*>,the formula-sort of Q) by Def4;

        

         A13: (the connectives of Q . (n + 5)) is_of_type ( {} ,the formula-sort of Q) by Def4;

        

        thus (the Arity of QQ . (the connectives of QQ . n)) = ((ff * the Arity of Q) . (g . (the connectives of QQ . n))) by A8, FUNCT_1: 13

        .= (ff . (the Arity of Q . (g . (the connectives of QQ . n)))) by A8, FUNCT_1: 102, FUNCT_2: 15

        .= (ff . <*the formula-sort of Q*>) by A12, A1, A8, FUNCT_1: 35

        .= (f1 * ( In ( <*the formula-sort of Q*>,(the carrier of Q * )))) by A2, A10

        .= (f1 * <*the formula-sort of Q*>) by A10, SUBSET_1:def 8

        .= <*the formula-sort of QQ*> by A5, FINSEQ_2: 34;

        

        thus (the ResultSort of QQ . (the connectives of QQ . n)) = ((f1 * the ResultSort of Q) . (g . (the connectives of QQ . n))) by A8, FUNCT_1: 13

        .= (f1 . (the ResultSort of Q . (g . (the connectives of QQ . n)))) by A8, FUNCT_1: 102, FUNCT_2: 15

        .= the formula-sort of QQ by A12, A1, A8, FUNCT_1: 35;

        

        thus (the Arity of QQ . (the connectives of QQ . (n + 5))) = ((ff * the Arity of Q) . (g . (the connectives of QQ . (n + 5)))) by A9, FUNCT_1: 13

        .= (ff . (the Arity of Q . (g . (the connectives of QQ . (n + 5))))) by A9, FUNCT_1: 102, FUNCT_2: 15

        .= (ff . {} ) by A13, A1, A9, FUNCT_1: 35

        .= (f1 * ( In ( {} ,(the carrier of Q * )))) by A2, A11

        .= (f1 * {} ) by A11, SUBSET_1:def 8

        .= {} ;

        

        thus (the ResultSort of QQ . (the connectives of QQ . (n + 5))) = ((f1 * the ResultSort of Q) . (g . (the connectives of QQ . (n + 5)))) by A9, FUNCT_1: 13

        .= (f1 . (the ResultSort of Q . (g . (the connectives of QQ . (n + 5))))) by A9, FUNCT_1: 102, FUNCT_2: 15

        .= the formula-sort of QQ by A13, A1, A9, FUNCT_1: 35;

        ((the connectives of Q . (n + 1)) is_of_type ( <*the formula-sort of Q, the formula-sort of Q*>,the formula-sort of Q) & ... & (the connectives of Q . (n + 4)) is_of_type ( <*the formula-sort of Q, the formula-sort of Q*>,the formula-sort of Q)) by Def4;

        then

         A14: ((the Arity of Q . (the connectives of Q . (n + 1))) = <*the formula-sort of Q, the formula-sort of Q*> & (the ResultSort of Q . (the connectives of Q . (n + 1))) = the formula-sort of Q) & ... & ((the Arity of Q . (the connectives of Q . (n + 4))) = <*the formula-sort of Q, the formula-sort of Q*> & (the ResultSort of Q . (the connectives of Q . (n + 4))) = the formula-sort of Q) by AOFA_A00:def 9;

        let i;

        assume

         A15: 1 <= i <= 4;

        then i <= (n + i) <= (n + 4) <= ((n + 4) + 1) = (n + 5) <= ( len the connectives of Q) by Def4, XREAL_1: 6, NAT_1: 12;

        then 1 <= (n + i) <= (n + 5) <= ( len the connectives of Q) by A15, XXREAL_0: 2;

        then 1 <= (n + i) <= ( len the connectives of Q) by XXREAL_0: 2;

        then

         A16: (g1 . (the connectives of Q . (n + i))) = (the connectives of QQ . (n + i)) in B = ( dom g) & (the connectives of Q . (n + i)) in the carrier' of Q by A7, FUNCT_1: 13, FUNCT_1: 102, FUNCT_2:def 1, FINSEQ_3: 25;

        

         A17: <*the formula-sort of Q, the formula-sort of Q*> in (the carrier of Q * ) by FINSEQ_1:def 11;

        

        thus (the Arity of QQ . (the connectives of QQ . (n + i))) = ((ff * the Arity of Q) . (g . (the connectives of QQ . (n + i)))) by A16, FUNCT_1: 13

        .= (ff . (the Arity of Q . (g . (the connectives of QQ . (n + i))))) by A16, FUNCT_1: 102, FUNCT_2: 15

        .= (ff . (the Arity of Q . (the connectives of Q . (n + i)))) by A1, A16, FUNCT_1: 35

        .= (ff . <*the formula-sort of Q, the formula-sort of Q*>) by A15, A14

        .= (f1 * ( In ( <*the formula-sort of Q, the formula-sort of Q*>,(the carrier of Q * )))) by A2, A17

        .= (f1 * <*the formula-sort of Q, the formula-sort of Q*>) by A17, SUBSET_1:def 8

        .= <*the formula-sort of QQ, the formula-sort of QQ*> by FINSEQ_2: 36;

        

        thus (the ResultSort of QQ . (the connectives of QQ . (n + i))) = ((f1 * the ResultSort of Q) . (g . (the connectives of QQ . (n + i)))) by A16, FUNCT_1: 13

        .= (f1 . (the ResultSort of Q . (g . (the connectives of QQ . (n + i))))) by A16, FUNCT_1: 102, FUNCT_2: 15

        .= (f1 . (the ResultSort of Q . (the connectives of Q . (n + i)))) by A1, A16, FUNCT_1: 35

        .= the formula-sort of QQ by A15, A14;

      end;

      QQ is QC-correct

      proof

        thus the quant-sort of QQ = {1, 2} by Def5;

        the quantifiers of Q is one-to-one by Def5;

        hence the quantifiers of QQ is one-to-one;

        ( rng co) = (g1 .: ( rng the connectives of Q)) & ( dom g1) = the carrier' of Q & ( rng qu) = (g1 .: ( rng the quantifiers of Q)) & ( rng the quantifiers of Q) misses ( rng the connectives of Q) by Def5, RELSET_2: 52, FUNCT_2:def 1;

        hence ( rng the quantifiers of QQ) misses ( rng the connectives of QQ) by Lem6;

        let q,x be object;

        assume

         A18: q in the quant-sort of QQ & x in X;

        then [q, x] in [:the quant-sort of QQ, X:] by ZFMISC_1: 87;

        then

         A19: (the quantifiers of Q . (q,x)) in the carrier' of Q = ( dom g1) & (the quantifiers of QQ . (q,x)) in B = ( dom g) by FUNCT_2:def 1, FUNCT_2: 5;

        

         A20: <*the formula-sort of Q*> in (the carrier of Q * ) by FINSEQ_1:def 11;

        

         A21: (the quantifiers of Q . (q,x)) is_of_type ( <*the formula-sort of Q*>,the formula-sort of Q) by A18, Def5;

        

        thus (the Arity of QQ . (the quantifiers of QQ . (q,x))) = ((ff * the Arity of Q) . (g . (the quantifiers of QQ . (q,x)))) by A19, FUNCT_1: 13

        .= (ff . (the Arity of Q . (g . (the quantifiers of QQ . (q,x))))) by A19, FUNCT_1: 102, FUNCT_2: 15

        .= (ff . (the Arity of Q . (g . (g1 . (the quantifiers of Q . [q, x]))))) by A18, ZFMISC_1: 87, FUNCT_2: 15

        .= (ff . <*the formula-sort of Q*>) by A21, A1, A19, FUNCT_1: 35

        .= (f1 * ( In ( <*the formula-sort of Q*>,(the carrier of Q * )))) by A2, A20

        .= (f1 * <*the formula-sort of Q*>) by A20, SUBSET_1:def 8

        .= <*the formula-sort of QQ*> by FINSEQ_2: 35;

        

        thus (the ResultSort of QQ . (the quantifiers of QQ . (q,x))) = ((f1 * the ResultSort of Q) . (g . (the quantifiers of QQ . (q,x)))) by A19, FUNCT_1: 13

        .= (f1 . (the ResultSort of Q . (g . (the quantifiers of QQ . (q,x))))) by A19, FUNCT_1: 102, FUNCT_2: 15

        .= (f1 . (the ResultSort of Q . (g . (g1 . (the quantifiers of Q . [q, x]))))) by A18, ZFMISC_1: 87, FUNCT_2: 15

        .= the formula-sort of QQ by A21, A1, A19, FUNCT_1: 35;

      end;

      then

      reconsider QQ as non empty non voidn PC-correct QC-correct QCLangSignature over X by A6;

      take QQ;

      thus the carrier of QQ misses the carrier of J

      proof

        assume the carrier of QQ meets the carrier of J;

        then

        consider a be object such that

         A22: a in the carrier of QQ & a in the carrier of J by XBOOLE_0: 3;

        consider b,c be object such that

         A23: b in the carrier of Q & c in {the carrier of J} & a = [b, c] by A22, ZFMISC_1:def 2;

        reconsider c as set by TARSKI: 1;

        c in {b, c} in { {b, c}, {b}} in c by A22, A23, TARSKI:def 1, TARSKI:def 2;

        hence contradiction by XREGULAR: 7;

      end;

      thus the carrier' of QQ misses the carrier' of J

      proof

        assume the carrier' of QQ meets the carrier' of J;

        then

        consider a be object such that

         A24: a in the carrier' of QQ & a in the carrier' of J by XBOOLE_0: 3;

        consider b,c be object such that

         A25: b in the carrier' of Q & c in {the carrier' of J} & a = [b, c] by A24, ZFMISC_1:def 2;

        reconsider c as set by TARSKI: 1;

        c in {b, c} in { {b, c}, {b}} in c by A24, A25, TARSKI:def 1, TARSKI:def 2;

        hence contradiction by XREGULAR: 7;

      end;

    end;

    registration

      let J be non empty Signature;

      cluster J -extension for non empty non void Signature;

      existence

      proof

        reconsider E = ( the non empty non void Signature +* J) as non empty non void Signature;

        take E;

        E is Extension of J by ALGSPEC1: 48;

        hence J is Subsignature of E by ALGSPEC1:def 5;

      end;

      let X be set;

      cluster J -extension for non empty non void QCLangSignature over X;

      existence

      proof

        set Q = the non empty non void QCLangSignature over X;

        set C = (the carrier of Q \/ the carrier of J);

        set C9 = (the carrier' of Q \/ the carrier' of J);

        

         A1: the carrier' of Q c= C9 & the carrier' of J c= C9 by XBOOLE_1: 7;

        (the carrier of Q * ) c= (C * ) & (the carrier of J * ) c= (C * ) by XBOOLE_1: 7, FINSEQ_1: 62;

        then

         A2: ((the carrier of Q * ) \/ (the carrier of J * )) c= ((C * ) \/ (C * )) = (C * ) by XBOOLE_1: 13;

        set A = (the Arity of Q +* the Arity of J);

        (( rng the Arity of Q) \/ ( rng the Arity of J)) c= ((the carrier of Q * ) \/ (the carrier of J * )) by XBOOLE_1: 13;

        then ( rng A) c= (( rng the Arity of Q) \/ ( rng the Arity of J)) c= (C * ) & ( dom the Arity of Q) = the carrier' of Q & ( dom the Arity of J) = the carrier' of J by A2, FUNCT_4: 17, FUNCT_2:def 1;

        then ( dom A) = C9 & ( rng A) c= (C * ) by FUNCT_4:def 1;

        then

        reconsider A as Function of C9, (C * ) by FUNCT_2: 2;

        set R = (the ResultSort of Q +* the ResultSort of J);

        ( rng R) c= (( rng the ResultSort of Q) \/ ( rng the ResultSort of J)) c= C & ( dom the ResultSort of Q) = the carrier' of Q & ( dom the ResultSort of J) = the carrier' of J by XBOOLE_1: 13, FUNCT_4: 17, FUNCT_2:def 1;

        then ( dom R) = C9 & ( rng R) c= C by FUNCT_4:def 1;

        then

        reconsider R as Function of C9, C by FUNCT_2: 2;

        reconsider f = the formula-sort of Q as Element of C by XBOOLE_0:def 3;

        ( rng the connectives of Q) c= C9 by A1;

        then

        reconsider c = the connectives of Q as FinSequence of C9 by FINSEQ_1:def 4;

        ( rng the quantifiers of Q) c= C9 by A1;

        then

        reconsider q = the quantifiers of Q as Function of [:the quant-sort of Q, X:], C9 by FUNCT_2: 6;

        reconsider E = QCLangSignature (# C, C9, A, R, f, c, the quant-sort of Q, q #) as non empty non void QCLangSignature over X;

        take E;

        

         A3: (Q +* J) is Extension of J by ALGSPEC1: 48;

        set sE = the ManySortedSign of E;

        sE is non empty & the carrier of sE = (the carrier of Q \/ the carrier of J) & the carrier' of sE = (the carrier' of Q \/ the carrier' of J) & the Arity of sE = (the Arity of Q +* the Arity of J) & the ResultSort of sE = (the ResultSort of Q +* the ResultSort of J);

        then the ManySortedSign of E = (Q +* J) & the ManySortedSign of J = the ManySortedSign of J by CIRCCOMB:def 2;

        then E is Extension of J by A3, Th20;

        hence J is Subsignature of E by ALGSPEC1:def 5;

      end;

      let n be non empty natural number;

      cluster J -extension for non empty non voidn PC-correct QC-correct QCLangSignature over X;

      existence

      proof

        consider Q be non empty non voidn PC-correct QC-correct QCLangSignature over X such that

         A4: the carrier of Q misses the carrier of J & the carrier' of Q misses the carrier' of J by Th21;

        set C = (the carrier of Q \/ the carrier of J);

        set C9 = (the carrier' of Q \/ the carrier' of J);

        

         A5: the carrier' of Q c= C9 & the carrier' of J c= C9 by XBOOLE_1: 7;

        (the carrier of Q * ) c= (C * ) & (the carrier of J * ) c= (C * ) by XBOOLE_1: 7, FINSEQ_1: 62;

        then

         A6: ((the carrier of Q * ) \/ (the carrier of J * )) c= ((C * ) \/ (C * )) = (C * ) by XBOOLE_1: 13;

        set A = (the Arity of Q +* the Arity of J);

        (( rng the Arity of Q) \/ ( rng the Arity of J)) c= ((the carrier of Q * ) \/ (the carrier of J * )) by XBOOLE_1: 13;

        then ( rng A) c= (( rng the Arity of Q) \/ ( rng the Arity of J)) c= (C * ) & ( dom the Arity of Q) = the carrier' of Q & ( dom the Arity of J) = the carrier' of J by A6, FUNCT_4: 17, FUNCT_2:def 1;

        then ( dom A) = C9 & ( rng A) c= (C * ) by FUNCT_4:def 1;

        then

        reconsider A as Function of C9, (C * ) by FUNCT_2: 2;

        set R = (the ResultSort of Q +* the ResultSort of J);

        ( rng R) c= (( rng the ResultSort of Q) \/ ( rng the ResultSort of J)) c= C & ( dom the ResultSort of Q) = the carrier' of Q & ( dom the ResultSort of J) = the carrier' of J by XBOOLE_1: 13, FUNCT_4: 17, FUNCT_2:def 1;

        then ( dom R) = C9 & ( rng R) c= C by FUNCT_4:def 1;

        then

        reconsider R as Function of C9, C by FUNCT_2: 2;

        reconsider f = the formula-sort of Q as Element of C by XBOOLE_0:def 3;

        ( rng the connectives of Q) c= C9 by A5;

        then

        reconsider c = the connectives of Q as FinSequence of C9 by FINSEQ_1:def 4;

        ( rng the quantifiers of Q) c= C9 by A5;

        then

        reconsider q = the quantifiers of Q as Function of [:the quant-sort of Q, X:], C9 by FUNCT_2: 6;

        reconsider E = QCLangSignature (# C, C9, A, R, f, c, the quant-sort of Q, q #) as non empty non void QCLangSignature over X;

        

         A7: (Q +* J) is Extension of J & (J +* Q) is Extension of Q by ALGSPEC1: 48;

        set sE = the ManySortedSign of E;

        ( dom the Arity of J) = the carrier' of J & ( dom the Arity of Q) = the carrier' of Q & ( dom the ResultSort of J) = the carrier' of J & ( dom the ResultSort of Q) = the carrier' of Q by FUNCT_2:def 1;

        then sE is non empty & the carrier of sE = (the carrier of Q \/ the carrier of J) & the carrier' of sE = (the carrier' of Q \/ the carrier' of J) & the Arity of sE = (the Arity of Q +* the Arity of J) = (the Arity of J +* the Arity of Q) & the ResultSort of sE = (the ResultSort of Q +* the ResultSort of J) = (the ResultSort of J +* the ResultSort of Q) by A4, FUNCT_4: 35;

        then the ManySortedSign of E = (Q +* J) & sE = (J +* Q) & the ManySortedSign of Q = the ManySortedSign of Q & the ManySortedSign of J = the ManySortedSign of J by CIRCCOMB:def 2;

        then

         A8: E is Extension of J & E is Extension of Q by A7, Th20;

        

         A9: E is n PC-correct

        proof

          

           A10: ( len the connectives of Q) >= (n + 5) & (the connectives of Q | {n, (n + 1), (n + 2), (n + 3), (n + 4), (n + 5)}) is one-to-one & (the connectives of Q . n) is_of_type ( <*the formula-sort of Q*>,the formula-sort of Q) & (the connectives of Q . (n + 5)) is_of_type ( {} ,the formula-sort of Q) & ((the connectives of Q . (n + 1)) is_of_type ( <*the formula-sort of Q, the formula-sort of Q*>,the formula-sort of Q) & ... & (the connectives of Q . (n + 4)) is_of_type ( <*the formula-sort of Q, the formula-sort of Q*>,the formula-sort of Q)) by Def4;

          thus ( len the connectives of E) >= (n + 5) by Def4;

          thus (the connectives of E | {n, (n + 1), (n + 2), (n + 3), (n + 4), (n + 5)}) is one-to-one by Def4;

           0 < n <= (n + 5) by NAT_1: 12;

          then ( 0 + 1) <= n <= ( len the connectives of Q) by A10, XXREAL_0: 2, NAT_1: 13;

          then n in ( dom the connectives of Q) by FINSEQ_3: 25;

          then (the connectives of E . n) is OperSymbol of Q by FUNCT_1: 102;

          hence (the connectives of E . n) is_of_type ( <*the formula-sort of E*>,the formula-sort of E) by A10, A8, Th9;

          1 <= ((n + 4) + 1) = (n + 5) <= ( len the connectives of Q) by Def4, NAT_1: 12;

          then (n + 5) in ( dom the connectives of Q) by FINSEQ_3: 25;

          then (the connectives of E . (n + 5)) is OperSymbol of Q by FUNCT_1: 102;

          hence (the connectives of E . (n + 5)) is_of_type ( {} ,the formula-sort of E) by A10, A8, Th9;

          (n + 1) <= ((n + 1) + 4) = (n + 5) & ((n + 1) + 1) = (n + 2) <= ((n + 2) + 3) = (n + 5) & ((n + 2) + 1) = (n + 3) <= ((n + 3) + 2) = (n + 5) & ((n + 3) + 1) = (n + 4) <= ((n + 4) + 1) = (n + 5) by NAT_1: 12;

          then 1 <= (n + 1) <= ( len the connectives of Q) & ... & 1 <= (n + 4) <= ( len the connectives of Q) by A10, XXREAL_0: 2, NAT_1: 12;

          then (n + 1) in ( dom the connectives of Q) & ... & (n + 4) in ( dom the connectives of Q) by FINSEQ_3: 25;

          then (the connectives of E . (n + 1)) is OperSymbol of Q & ... & (the connectives of E . (n + 4)) is OperSymbol of Q by FUNCT_1: 102;

          hence ((the connectives of E . (n + 1)) is_of_type ( <*the formula-sort of E, the formula-sort of E*>,the formula-sort of E) & ... & (the connectives of E . (n + 4)) is_of_type ( <*the formula-sort of E, the formula-sort of E*>,the formula-sort of E)) by A10, A8, Th9;

        end;

        E is QC-correct

        proof

          thus the quant-sort of E = {1, 2} & the quantifiers of E is one-to-one by Def5;

          thus ( rng the quantifiers of E) misses ( rng the connectives of E) by Def5;

          let q,x be object such that

           A11: q in the quant-sort of E & x in X;

           [q, x] in [:the quant-sort of Q, X:] by A11, ZFMISC_1: 87;

          then (the quantifiers of E . (q,x)) is OperSymbol of Q & (the quantifiers of Q . (q,x)) is_of_type ( <*the formula-sort of Q*>,the formula-sort of Q) by Def5, A11, FUNCT_2: 5;

          hence (the quantifiers of E . (q,x)) is_of_type ( <*the formula-sort of E*>,the formula-sort of E) by A8, Th9;

        end;

        then

        reconsider E as non empty non voidn PC-correct QC-correct QCLangSignature over X by A9;

        take E;

        thus J is Subsignature of E by A8, ALGSPEC1:def 5;

      end;

    end

    definition

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non void QCLangSignature over ( Union X);

      let Y be X -tolerating ManySortedSet of the carrier of S;

      struct ( VarMSAlgebra over S, SubstMSAlgebra over S, Y) LanguageStr over T,Y,S (# the Sorts -> ManySortedSet of the carrier of S,

the Charact -> ManySortedFunction of (( the Sorts # ) * the Arity of S), ( the Sorts * the ResultSort of S),

the free-vars -> ManySortedMSSet of the Sorts, the Sorts,

the subst-op -> sort-preserving Function of [:( Union the Sorts), ( Union [|Y, the Sorts|]):], ( Union the Sorts),

the equality -> Function of ( Union [|the Sorts of T, the Sorts of T|]), ( the Sorts . the formula-sort of S) #)

       attr strict strict;

    end

    definition

      let S be non empty PCLangSignature;

      let L be MSAlgebra over S;

      :: AOFA_L00:def20

      attr L is language means

      : Def18: not (the Sorts of L . the formula-sort of S) is empty;

    end

    registration

      let S be non empty PCLangSignature;

      cluster non-empty -> language for MSAlgebra over S;

      coherence ;

      cluster language for MSAlgebra over S;

      existence

      proof

        set A = the non-empty MSAlgebra over S;

        take A;

        thus not (the Sorts of A . the formula-sort of S) is empty;

      end;

    end

    theorem :: AOFA_L00:23

    

     Th22: for J be non void Signature holds for S be J -extension non void Signature holds for A1,A2 be MSAlgebra over S st the MSAlgebra of A1 = the MSAlgebra of A2 holds (A1 | J) = (A2 | J)

    proof

      let J be non void Signature;

      let S be J -extension non void Signature;

      let A1,A2 be MSAlgebra over S such that

       A1: the MSAlgebra of A1 = the MSAlgebra of A2;

      

       A2: (A1 | J) = (A1 | (J,( id the carrier of J),( id the carrier' of J))) & (A2 | J) = (A2 | (J,( id the carrier of J),( id the carrier' of J))) by INSTALG1:def 4;

      J is Subsignature of S by Def2;

      then (( id the carrier of J),( id the carrier' of J)) form_morphism_between (J,S) by INSTALG1:def 2;

      then the Sorts of (A1 | J) = (the Sorts of A1 * ( id the carrier of J)) & the Sorts of (A2 | J) = (the Sorts of A2 * ( id the carrier of J)) & the Charact of (A1 | J) = (the Charact of A1 * ( id the carrier' of J)) & the Charact of (A2 | J) = (the Charact of A2 * ( id the carrier' of J)) by A2, INSTALG1:def 3;

      hence (A1 | J) = (A2 | J) by A1;

    end;

    registration

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non void QCLangSignature over ( Union X);

      cluster X -tolerating for non empty-yielding ManySortedSet of the carrier of S;

      existence

      proof

        set Y = the non empty-yielding ManySortedSet of the carrier of S;

        

         A1: J is Subsignature of S by Def2;

        then

         A2: the carrier of J c= the carrier of S by INSTALG1: 10;

        

         A3: ( dom X) = the carrier of J & ( dom Y) = the carrier of S by PARTFUN1:def 2;

        then

         A4: (( dom Y) \/ ( dom X)) = the carrier of S by A1, XBOOLE_1: 12, INSTALG1: 10;

        then ( dom (Y +* X)) = the carrier of S by FUNCT_4:def 1;

        then

        reconsider YX = (Y +* X) as ManySortedSet of the carrier of S by RELAT_1:def 18, PARTFUN1:def 2;

        consider a be object such that

         A5: a in the carrier of J & (X . a) is non empty by PBOOLE:def 12;

        YX is non empty-yielding

        proof

          take a;

          thus a in the carrier of S by A2, A5;

          thus (YX . a) is non empty by A2, A3, A5, A4, FUNCT_4:def 1;

        end;

        hence thesis;

      end;

    end

    registration

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non void QCLangSignature over ( Union X);

      let Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S;

      cluster non-empty languageT -extension for LanguageStr over J, T, X, S, Y;

      existence

      proof

        set A = the T -extension non-empty MSAlgebra over S;

        set f = the ManySortedMSSet of the Sorts of A, the Sorts of A;

        set g = the sort-preserving Function of [:( Union the Sorts of A), ( Union [|Y, the Sorts of A|]):], ( Union the Sorts of A);

        set eq = the Function of ( Union [|the Sorts of T, the Sorts of T|]), (the Sorts of A . the formula-sort of S);

        take L = LanguageStr (# the Sorts of A, the Charact of A, f, g, eq #);

        thus the Sorts of L is non-empty;

        thus not (the Sorts of L . the formula-sort of S) is empty;

         the MSAlgebra of L = the MSAlgebra of A;

        

        hence (L | J) = (A | J) by Th22

        .= the MSAlgebra of T by Def17;

      end;

    end

    definition

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non void QCLangSignature over ( Union X);

      let Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S;

      let L be non-empty LanguageStr over J, T, X, S, Y;

      :: AOFA_L00:def21

      attr L is subst-correct3 means for s,s1 be SortSymbol of S holds for t be Element of L, s holds for t1 be Element of L, s1 holds for y be Element of ( Union Y) st y in (Y . s) holds y nin (( vf t1) . s) & (y nin (( vf t1) . s) implies (t1 / (y,t)) = t1) & (t1 = y in (Y . s1) implies (t1 / (y,t)) = t) & for x be Element of ( Union Y) st x in (Y . s) holds ((t1 / (x,y)) / (y,x)) = t1;

    end

    registration

      let J be non empty Signature;

      let S be J -extension non empty Signature;

      let X be non empty-yielding ManySortedSet of the carrier of J;

      let Y be set;

      cluster (X extended_by (Y,the carrier of S)) -> non empty-yielding;

      coherence

      proof

        consider x such that

         A1: x in the carrier of J & (X . x) is non empty by PBOOLE:def 12;

        take x;

        J is Subsignature of S by Def2;

        then

         A2: the carrier of J c= the carrier of S by INSTALG1: 10;

        hence x in the carrier of S by A1;

        ( dom X) = the carrier of J by PARTFUN1:def 2;

        then x in ( dom (X | the carrier of S)) by A1, A2, RELAT_1: 57;

        

        then ((X extended_by (Y,the carrier of S)) . x) = ((X | the carrier of S) . x) by FUNCT_4: 13

        .= (X . x) by A1, A2, FUNCT_1: 49;

        hence thesis by A1;

      end;

    end

    registration

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non void QCLangSignature over ( Union X);

      cluster (X extended_by ( {} ,the carrier of S)) -vf-yielding non-empty languageT -extension for LanguageStr over J, T, X, S, (X extended_by ( {} ,the carrier of S));

      existence

      proof

        set A = the T -extension non-empty MSAlgebra over S;

        set f = the ManySortedMSSet of the Sorts of A, (X extended_by ( {} ,the carrier of S));

        f is ManySortedMSSet of the Sorts of A, the Sorts of A

        proof

          let i,a be set;

          assume i in the carrier of S & a in (the Sorts of A . i);

          then

          reconsider fia = ((f . i) . a) as ManySortedSubset of (X extended_by ( {} ,the carrier of S)) by AOFA_A00:def 8;

          fia c= the Sorts of A

          proof

            let y be object;

            assume y in the carrier of S;

            then

             A1: (fia . y) c= ((X extended_by ( {} ,the carrier of S)) . y) by PBOOLE:def 2, PBOOLE:def 18;

            

             A2: J is Subsignature of S by Def2;

            then

             A3: ( dom X) = the carrier of J c= the carrier of S by PARTFUN1:def 2, INSTALG1: 10;

            then

             A4: (X extended_by ( {} ,the carrier of S)) = ((the carrier of S --> {} ) +* (X | the carrier of S)) = ((the carrier of S --> {} ) +* X) by RELAT_1: 68;

            (A | (J,( id the carrier of J),( id the carrier' of J))) = (A | J) = the MSAlgebra of T & (( id the carrier of J),( id the carrier' of J)) form_morphism_between (J,S) by A2, Def17, INSTALG1:def 2, INSTALG1:def 4;

            then

             A5: (the Sorts of A * ( id the carrier of J)) = the Sorts of T by INSTALG1:def 3;

            per cases ;

              suppose

               A6: y in the carrier of J;

              ((X extended_by ( {} ,the carrier of S)) . y) = (X . y) c= (the Sorts of T . y) = (the Sorts of A . (( id the carrier of J) . y)) = (the Sorts of A . y) by A6, A3, A4, A5, FUNCT_4: 13, PBOOLE:def 2, PBOOLE:def 18, FUNCT_1: 17, FUNCT_2: 15;

              hence (fia . y) c= (the Sorts of A . y) by A1;

            end;

              suppose y nin the carrier of J;

              

              then ((X extended_by ( {} ,the carrier of S)) . y) = ((the carrier of S --> {} ) . y) by A3, A4, FUNCT_4: 11

              .= {} ;

              hence (fia . y) c= (the Sorts of A . y) by A1;

            end;

          end;

          hence ((f . i) . a) is ManySortedSubset of the Sorts of A by PBOOLE:def 18;

        end;

        then

        reconsider f as ManySortedMSSet of the Sorts of A, the Sorts of A;

        set Y = (X extended_by ( {} ,the carrier of S));

        set g = the sort-preserving Function of [:( Union the Sorts of A), ( Union [|Y, the Sorts of A|]):], ( Union the Sorts of A);

        set eq = the Function of ( Union [|the Sorts of T, the Sorts of T|]), (the Sorts of A . the formula-sort of S);

        take L = LanguageStr (# the Sorts of A, the Charact of A, f, g, eq #);

        thus the free-vars of L is ManySortedMSSet of the Sorts of L, (X extended_by ( {} ,the carrier of S));

        thus the Sorts of L is non-empty;

        thus not (the Sorts of L . the formula-sort of S) is empty;

         the MSAlgebra of L = the MSAlgebra of A;

        

        hence (L | J) = (A | J) by Th22

        .= the MSAlgebra of T by Def17;

      end;

    end

    registration

      let X be set;

      let S be non empty QCLangSignature over X;

      let L be language MSAlgebra over S;

      cluster (the Sorts of L . the formula-sort of S) -> non empty;

      coherence by Def18;

    end

    definition

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non void QCLangSignature over ( Union X);

      let Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S;

      mode Language of Y,S is languageT -extension LanguageStr over J, T, X, S, Y;

    end

    definition

      let S be non empty PCLangSignature;

      let L be language MSAlgebra over S;

      mode Formula of L is Element of (the Sorts of L . the formula-sort of S);

    end

    definition

      let n be non empty natural number;

      let S be non void non emptyn PC-correct PCLangSignature;

      let L be language MSAlgebra over S;

      set f = the formula-sort of S;

      

       A1: (the Sorts of L . f) <> {} by Def18;

      

       A2: (the connectives of S . n) is_of_type ( <*f*>,f) by Def4;

      

       A3: (the connectives of S . (n + 5)) is_of_type ( {} ,f) by Def4;

      

       A4: ( len the connectives of S) >= (n + 5) by Def4;

      (n + 1) <= (n + 5) & ... & (n + 5) <= (n + 5) by XREAL_1: 6;

      then 1 <= (n + 1) <= ( len the connectives of S) & ... & 1 <= (n + 5) <= ( len the connectives of S) by A4, NAT_1: 12, XXREAL_0: 2;

      then

       A5: (n + 1) in ( dom the connectives of S) & ... & (n + 5) in ( dom the connectives of S) by FINSEQ_3: 25;

      

       A6: (the connectives of S . (n + 1)) is_of_type ( <*f, f*>,f) & ... & (the connectives of S . (n + 4)) is_of_type ( <*f, f*>,f) by Def4;

      

       A7: (the connectives of S . (n + 5)) in ( rng the connectives of S) & ( rng the connectives of S) c= the carrier' of S by A5, FUNCT_1:def 3;

      :: AOFA_L00:def22

      func \true_ L -> Formula of L equals (( Den (( In ((the connectives of S . (n + 5)),the carrier' of S)),L)) . {} );

      coherence by A1, A3, A7, AOFA_A00: 31;

      let A be Formula of L;

      :: AOFA_L00:def23

      func \not A -> Formula of L equals (( Den (( In ((the connectives of S . n),the carrier' of S)),L)) . <*A*>);

      coherence by A1, A2, AOFA_A00: 32;

      let B be Formula of L;

      :: AOFA_L00:def24

      func A \and B -> Formula of L equals (( Den (( In ((the connectives of S . (n + 1)),the carrier' of S)),L)) . <*A, B*>);

      coherence by A1, A6, AOFA_A00: 33;

      :: AOFA_L00:def25

      func A \or B -> Formula of L equals (( Den (( In ((the connectives of S . (n + 2)),the carrier' of S)),L)) . <*A, B*>);

      coherence by A1, A6, AOFA_A00: 33;

      :: AOFA_L00:def26

      func A \imp B -> Formula of L equals (( Den (( In ((the connectives of S . (n + 3)),the carrier' of S)),L)) . <*A, B*>);

      coherence by A1, A6, AOFA_A00: 33;

      :: AOFA_L00:def27

      func A \iff B -> Formula of L equals (( Den (( In ((the connectives of S . (n + 4)),the carrier' of S)),L)) . <*A, B*>);

      coherence by A1, A6, AOFA_A00: 33;

    end

    registration

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      cluster non empty for VariableSet of T;

      existence

      proof

        set G = the non-empty GeneratorSet of T;

        reconsider X = ( Union G) as VariableSet of T;

        take X;

        thus thesis;

      end;

    end

    definition

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non void non emptyn PC-correct QC-correct QCLangSignature over ( Union X);

      let Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S;

      let L be Language of Y, S;

      let A be Formula of L;

      let x be Element of ( Union X);

      set f = the formula-sort of S;

      

       A1: the quant-sort of S = {1, 2} by Def5;

      reconsider j = 1 as Element of the quant-sort of S by A1, TARSKI:def 2;

       [j, x] in [:the quant-sort of S, ( Union X):] by A1, ZFMISC_1: 87;

      then

       A2: (the quantifiers of S . (1,x)) = ( In ((the quantifiers of S . (1,x)),the carrier' of S)) & (the quantifiers of S . (1,x)) is_of_type ( <*f*>,f) by A1, Def5, SUBSET_1:def 8, FUNCT_2: 5;

      :: AOFA_L00:def28

      func \for (x,A) -> Formula of L equals (( Den (( In ((the quantifiers of S . (1,x)),the carrier' of S)),L)) . <*A*>);

      coherence by A2, AOFA_A00: 32;

      

       A3: the quant-sort of S = {1, 2} by Def5;

      reconsider j = 2 as Element of the quant-sort of S by A3, TARSKI:def 2;

       [j, x] in [:the quant-sort of S, ( Union X):] by A3, ZFMISC_1: 87;

      then

       A4: (the quantifiers of S . (2,x)) = ( In ((the quantifiers of S . (2,x)),the carrier' of S)) & (the quantifiers of S . (2,x)) is_of_type ( <*f*>,f) by A3, Def5, SUBSET_1:def 8, FUNCT_2: 5;

      :: AOFA_L00:def29

      func \ex (x,A) -> Formula of L equals (( Den (( In ((the quantifiers of S . (2,x)),the carrier' of S)),L)) . <*A*>);

      coherence by A4, AOFA_A00: 32;

    end

    definition

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non void non emptyn PC-correct QC-correct QCLangSignature over ( Union X);

      let Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S;

      let L be Language of Y, S;

      let A be Formula of L;

      let x,y be Element of ( Union X);

      :: AOFA_L00:def30

      func \for (x,y,A) -> Formula of L equals ( \for (x,( \for (y,A))));

      coherence ;

      :: AOFA_L00:def31

      func \ex (x,y,A) -> Formula of L equals ( \ex (x,( \ex (y,A))));

      coherence ;

    end

    definition

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non void non emptyn PC-correct QC-correct QCLangSignature over ( Union X);

      let Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S;

      let L be Language of Y, S;

      let A be Formula of L;

      let x,y,z be Element of ( Union X);

      :: AOFA_L00:def32

      func \for (x,y,z,A) -> Formula of L equals ( \for (x,y,( \for (z,A))));

      coherence ;

      :: AOFA_L00:def33

      func \ex (x,y,z,A) -> Formula of L equals ( \ex (x,y,( \ex (z,A))));

      coherence ;

    end

    definition

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non void non emptyn PC-correct QC-correct QCLangSignature over ( Union X);

      let Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S;

      let L be Language of Y, S;

      let t1,t2 be object;

      given a be SortSymbol of J such that

       A1: t1 in (the Sorts of T . a) & t2 in (the Sorts of T . a);

      :: AOFA_L00:def34

      func t1 '=' (t2,L) -> Formula of L equals (the equality of L . (t1,t2));

      coherence

      proof

        

         A2: [t1, t2] in [:(the Sorts of T . a), (the Sorts of T . a):] = ( [|the Sorts of T, the Sorts of T|] . a) by A1, ZFMISC_1: 87, PBOOLE:def 16;

        ( dom [|the Sorts of T, the Sorts of T|]) = the carrier of J by PARTFUN1:def 2;

        then [t1, t2] in ( Union [|the Sorts of T, the Sorts of T|]) by A2, CARD_5: 2;

        hence thesis by FUNCT_2: 5;

      end;

    end

    definition

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non void non emptyn PC-correct QC-correct QCLangSignature over ( Union X);

      let Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S;

      let L be non-empty Language of Y, S;

      :: AOFA_L00:def35

      attr L is vf-qc-correct means for A,B be Formula of L holds ( vf ( \not A)) = ( vf A) & ( vf (A \and B)) = (( vf A) (\/) ( vf B)) & ( vf (A \or B)) = (( vf A) (\/) ( vf B)) & ( vf (A \imp B)) = (( vf A) (\/) ( vf B)) & ( vf (A \iff B)) = (( vf A) (\/) ( vf B)) & ( vf ( \true_ L)) = ( EmptyMS the carrier of S) & for x be Element of ( Union X) holds for a be SortSymbol of S st x in (X . a) holds ( vf ( \for (x,A))) = (( vf A) (\) (a -singleton x)) & ( vf ( \ex (x,A))) = (( vf A) (\) (a -singleton x));

    end

    definition

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non void non emptyn PC-correct QC-correct QCLangSignature over ( Union X);

      let Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S;

      let L be non-emptyT -extension Language of Y, S;

      :: AOFA_L00:def36

      attr L is vf-finite means for s be SortSymbol of S, t be Element of L, s holds ( vf t) is finite-yielding;

    end

    definition

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non void non emptyn PC-correct QC-correct QCLangSignature over ( Union X);

      let Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S;

      let L be non-emptyT -extension Language of Y, S;

      :: AOFA_L00:def37

      attr L is subst-forex means for A be Formula of L holds for x be Element of ( Union X) holds for s,s1 be SortSymbol of S holds for t be Element of L, s st x in (X . s1) holds for y be Element of ( Union Y) st y in (Y . s) holds (x = y implies (( \for (x,A)) / (y,t)) = ( \for (x,A)) & (( \ex (x,A)) / (y,t)) = ( \ex (x,A))) & (x <> y & x in (( vf t) . s1) implies ex z be Element of ( Union X), x0,z0 be Element of ( Union Y) st x = x0 & z0 = z = the Element of (((X . s1) \ (( vf t) . s1)) \ (( vf A) . s1)) & (( \for (x,A)) / (y,t)) = ( \for (z,((A / (x0,z0)) / (y,t)))) & (( \ex (x,A)) / (y,t)) = ( \ex (z,((A / (x0,z0)) / (y,t))))) & (x <> y & x nin (( vf t) . s) implies (( \for (x,A)) / (y,t)) = ( \for (x,(A / (y,t)))) & (( \ex (x,A)) / (y,t)) = ( \ex (x,(A / (y,t)))));

    end

    theorem :: AOFA_L00:24

    

     Th23: for J be non void Signature holds for T be MSAlgebra over J holds for X be ManySortedSubset of the Sorts of T holds for S be J -extension non void Signature holds for Q be T -extension MSAlgebra over S holds (X extended_by ( {} ,the carrier of S)) is ManySortedSubset of the Sorts of Q

    proof

      let J be non void Signature;

      let T be MSAlgebra over J;

      let X be ManySortedSubset of the Sorts of T;

      let S be J -extension non void Signature;

      let Q be T -extension MSAlgebra over S;

      let x;

      assume

       A1: x in the carrier of S;

      then

      reconsider s = x as SortSymbol of S;

      per cases ;

        suppose

         A2: s in the carrier of J;

        then s in ( dom X) by PARTFUN1:def 2;

        then s in ( dom (X | the carrier of S)) by RELAT_1: 57;

        

        then

         A3: ((X extended_by ( {} ,the carrier of S)) . x) = ((X | the carrier of S) . x) by FUNCT_4: 13

        .= (X . x) by A1, FUNCT_1: 49;

        (X . x) c= (the Sorts of T . x) by A2, PBOOLE:def 18, PBOOLE:def 2;

        hence ((X extended_by ( {} ,the carrier of S)) . x) c= (the Sorts of Q . x) by A2, A3, Th16;

      end;

        suppose

         A4: s nin the carrier of J;

        

         A5: J is Subsignature of S by Def2;

        ( dom (X | the carrier of S)) = (( dom X) /\ the carrier of S) by RELAT_1: 61

        .= (the carrier of J /\ the carrier of S) by PARTFUN1:def 2

        .= the carrier of J by A5, XBOOLE_1: 28, INSTALG1: 10;

        

        then ((X extended_by ( {} ,the carrier of S)) . x) = ((the carrier of S --> {} ) . x) by A4, FUNCT_4: 11

        .= {} ;

        hence ((X extended_by ( {} ,the carrier of S)) . x) c= (the Sorts of Q . x);

      end;

    end;

    theorem :: AOFA_L00:25

    

     Th24: for J be non void Signature holds for T be MSAlgebra over J holds for X be ManySortedSubset of the Sorts of T holds for S be J -extension non void Signature holds ( Union (X extended_by ( {} ,the carrier of S))) = ( Union X)

    proof

      let J be non void Signature;

      let T be MSAlgebra over J;

      let X be ManySortedSubset of the Sorts of T;

      let S be J -extension non void Signature;

      set Y = (X extended_by ( {} ,the carrier of S));

      

       A1: J is Subsignature of S by Def2;

      ( dom X) = the carrier of J by PARTFUN1:def 2;

      then

       A2: (X | the carrier of S) = X by A1, RELAT_1: 68, INSTALG1: 10;

      then ( rng Y) c= (( rng (the carrier of S --> {} )) \/ ( rng X)) by FUNCT_4: 17;

      then ( Union Y) c= ( union ( { {} } \/ ( rng X))) = (( union { {} }) \/ ( Union X)) = ( {} \/ ( Union X)) by ZFMISC_1: 77, ZFMISC_1: 78;

      hence ( Union Y) c= ( Union X);

      X c= Y by A2, FUNCT_4: 25;

      hence ( Union X) c= ( Union Y) by RELAT_1: 11, ZFMISC_1: 77;

    end;

    theorem :: AOFA_L00:26

    

     Th25: for n be non empty natural number holds for X be non empty set holds for S be non empty non voidn PC-correct QC-correct QCLangSignature over X holds for Q be language MSAlgebra over S holds {} in ( Args (( In ((the connectives of S . (n + 5)),the carrier' of S)),Q)) & for A be Formula of Q holds <*A*> in ( Args (( In ((the connectives of S . n),the carrier' of S)),Q)) & for B be Formula of Q holds ( <*A, B*> in ( Args (( In ((the connectives of S . (n + 1)),the carrier' of S)),Q)) & ... & <*A, B*> in ( Args (( In ((the connectives of S . (n + 4)),the carrier' of S)),Q))) & for x be Element of X holds <*A*> in ( Args (( In ((the quantifiers of S . (1,x)),the carrier' of S)),Q)) & <*A*> in ( Args (( In ((the quantifiers of S . (2,x)),the carrier' of S)),Q))

    proof

      let n be non empty natural number;

      let X be non empty set;

      let S be non empty non voidn PC-correct QC-correct QCLangSignature over X;

      let Q be language MSAlgebra over S;

      set f = the formula-sort of S;

      

       A1: ( len the connectives of S) >= (n + 5) by Def4;

      n > 0 ;

      then

       A2: n >= ( 0 + 1) by NAT_1: 13;

      (n + 0 ) <= (n + 5) & ... & (n + 4) <= (n + 5) by XREAL_1: 6;

      then (1 <= (n + 0 ) & ... & 1 <= (n + 5)) & ((n + 0 ) <= ( len the connectives of S) & ... & (n + 5) <= ( len the connectives of S)) by A1, A2, NAT_1: 12, XXREAL_0: 2;

      then

       A3: (n + 0 ) in ( dom the connectives of S) & ... & (n + 5) in ( dom the connectives of S) by FINSEQ_3: 25;

      

       A4: (the connectives of S . (n + 0 )) is_of_type ( <*f*>,f) & ((the connectives of S . (n + 1)) is_of_type ( <*f, f*>,f) & ... & (the connectives of S . (n + 4)) is_of_type ( <*f, f*>,f)) & (the connectives of S . (n + 5)) is_of_type ( {} ,f) by Def4;

      ( In ((the connectives of S . (n + 5)),the carrier' of S)) is_of_type ( {} ,f) by A4, A3, FUNCT_1: 102, SUBSET_1:def 8;

      hence {} in ( Args (( In ((the connectives of S . (n + 5)),the carrier' of S)),Q)) by Th4;

      let A be Formula of Q;

      ( In ((the connectives of S . (n + 0 )),the carrier' of S)) is_of_type ( <*f*>,f) by A4, A3, FUNCT_1: 102, SUBSET_1:def 8;

      hence <*A*> in ( Args (( In ((the connectives of S . n),the carrier' of S)),Q)) by Th5;

      let B be Formula of Q;

      ( In ((the connectives of S . (n + 1)),the carrier' of S)) = (the connectives of S . (n + 1)) & ... & ( In ((the connectives of S . (n + 4)),the carrier' of S)) = (the connectives of S . (n + 4)) by A3, FUNCT_1: 102, SUBSET_1:def 8;

      then ( In ((the connectives of S . (n + 1)),the carrier' of S)) is_of_type ( <*f, f*>,f) & ... & ( In ((the connectives of S . (n + 4)),the carrier' of S)) is_of_type ( <*f, f*>,f) by Def4;

      hence <*A, B*> in ( Args (( In ((the connectives of S . (n + 1)),the carrier' of S)),Q)) & ... & <*A, B*> in ( Args (( In ((the connectives of S . (n + 4)),the carrier' of S)),Q)) by Th6;

      let x be Element of X;

      the quant-sort of S = {1, 2} by Def5;

      then

       A5: 1 in the quant-sort of S & 2 in the quant-sort of S by TARSKI:def 2;

      then [1, x] in [:the quant-sort of S, X:] & ( dom the quantifiers of S) = [:the quant-sort of S, X:] & [2, x] in [:the quant-sort of S, X:] by FUNCT_2:def 1, ZFMISC_1:def 2;

      then ( In ((the quantifiers of S . (1,x)),the carrier' of S)) = (the quantifiers of S . (1,x)) & ( In ((the quantifiers of S . (2,x)),the carrier' of S)) = (the quantifiers of S . (2,x)) by SUBSET_1:def 8, FUNCT_1: 102;

      then ( In ((the quantifiers of S . (1,x)),the carrier' of S)) is_of_type ( <*f*>,f) & ( In ((the quantifiers of S . (2,x)),the carrier' of S)) is_of_type ( <*f*>,f) by A5, Def5;

      hence <*A*> in ( Args (( In ((the quantifiers of S . (1,x)),the carrier' of S)),Q)) & <*A*> in ( Args (( In ((the quantifiers of S . (2,x)),the carrier' of S)),Q)) by Th5;

    end;

    theorem :: AOFA_L00:27

    

     Th26: for n be non empty natural number holds for J be non empty non void Signature holds for T be non-empty MSAlgebra over J holds for X be non empty-yielding GeneratorSet of T holds for S be J -extension non void non emptyn PC-correct QC-correct QCLangSignature over ( Union X) holds for Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S holds for L be non-empty Language of Y, S holds for x be Element of ( Union Y) holds for t be Element of ( Union the Sorts of L) holds for s be SortSymbol of S st x in (Y . s) & t in (the Sorts of L . s) holds (for a be Element of ( Args (( In ((the connectives of S . (n + 5)),the carrier' of S)),L)) st a = {} holds (a / (x,t)) = {} ) & for A be Formula of L holds (for a be Element of ( Args (( In ((the connectives of S . n),the carrier' of S)),L)) st <*A*> = a holds (a / (x,t)) = <*(A / (x,t))*>) & for B be Formula of L holds ((for a be Element of ( Args (( In ((the connectives of S . (n + 1)),the carrier' of S)),L)) st <*A, B*> = a holds (a / (x,t)) = <*(A / (x,t)), (B / (x,t))*>) & ... & (for a be Element of ( Args (( In ((the connectives of S . (n + 4)),the carrier' of S)),L)) st <*A, B*> = a holds (a / (x,t)) = <*(A / (x,t)), (B / (x,t))*>)) & for z be Element of ( Union X) holds (for a be Element of ( Args (( In ((the quantifiers of S . (1,z)),the carrier' of S)),L)) st <*A*> = a holds (a / (x,t)) = <*(A / (x,t))*>) & (for a be Element of ( Args (( In ((the quantifiers of S . (2,z)),the carrier' of S)),L)) st <*A*> = a holds (a / (x,t)) = <*(A / (x,t))*>)

    proof

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non void non emptyn PC-correct QC-correct QCLangSignature over ( Union X);

      let Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S;

      let L be non-empty Language of Y, S;

      let x be Element of ( Union Y);

      let t be Element of ( Union the Sorts of L);

      let s be SortSymbol of S;

      set f = the formula-sort of S;

      assume x in (Y . s) & t in (the Sorts of L . s);

      

       A1: ( len the connectives of S) >= (n + 5) by Def4;

      n > 0 ;

      then

       A2: n >= ( 0 + 1) by NAT_1: 13;

      (n + 0 ) <= (n + 5) & ... & (n + 4) <= (n + 5) by XREAL_1: 6;

      then (1 <= (n + 0 ) & ... & 1 <= (n + 5)) & ((n + 0 ) <= ( len the connectives of S) & ... & (n + 5) <= ( len the connectives of S)) by A1, A2, NAT_1: 12, XXREAL_0: 2;

      then

       A3: (n + 0 ) in ( dom the connectives of S) & ... & (n + 5) in ( dom the connectives of S) by FINSEQ_3: 25;

      

       A4: (the connectives of S . (n + 0 )) is_of_type ( <*f*>,f) & ((the connectives of S . (n + 1)) is_of_type ( <*f, f*>,f) & ... & (the connectives of S . (n + 4)) is_of_type ( <*f, f*>,f)) & (the connectives of S . (n + 5)) is_of_type ( {} ,f) by Def4;

      

       A5: ( In ((the connectives of S . n),the carrier' of S)) is_of_type ( <*f*>,f) & (( In ((the connectives of S . (n + 1)),the carrier' of S)) is_of_type ( <*f, f*>,f) & ... & ( In ((the connectives of S . (n + 4)),the carrier' of S)) is_of_type ( <*f, f*>,f)) & ( In ((the connectives of S . (n + 5)),the carrier' of S)) is_of_type ( {} ,f) by A4, A3, FUNCT_1: 102, SUBSET_1:def 8;

      hereby

        let a be Element of ( Args (( In ((the connectives of S . (n + 5)),the carrier' of S)),L));

        assume a = {} ;

        then ( dom {} ) = ( dom ( the_arity_of ( In ((the connectives of S . (n + 5)),the carrier' of S)))) = ( dom (a / (x,t))) by MSUALG_6: 2;

        hence (a / (x,t)) = {} ;

      end;

      let A be Formula of L;

      hereby

        set o = ( In ((the connectives of S . n),the carrier' of S));

        let a be Element of ( Args (o,L));

        assume a = <*A*>;

        then

         A6: ( dom a) = ( Seg 1) & (a . 1) = A & ( len a) = 1 & ( dom a) = ( dom ( the_arity_of o)) = ( dom (a / (x,t))) by MSUALG_6: 2, FINSEQ_1: 40, FINSEQ_1: 89;

        consider j be SortSymbol of S such that

         A7: j = (( the_arity_of o) . 1) & ex A be Element of L, j st A = (a . 1) & ((a / (x,t)) . 1) = (A / (x,t)) by A6, Def14, FINSEQ_1: 1;

        j = f & ( len (a / (x,t))) = 1 by A5, A6, A7, FINSEQ_1: 40, FINSEQ_3: 29;

        hence (a / (x,t)) = <*(A / (x,t))*> by A7, A6, FINSEQ_1: 40;

      end;

      let B be Formula of L;

      thus (for a be Element of ( Args (( In ((the connectives of S . (n + 1)),the carrier' of S)),L)) st <*A, B*> = a holds (a / (x,t)) = <*(A / (x,t)), (B / (x,t))*>) & ... & (for a be Element of ( Args (( In ((the connectives of S . (n + 4)),the carrier' of S)),L)) st <*A, B*> = a holds (a / (x,t)) = <*(A / (x,t)), (B / (x,t))*>)

      proof

        let i;

        assume

         A8: 1 <= i <= 4;

        set o = ( In ((the connectives of S . (n + i)),the carrier' of S));

        let a be Element of ( Args (o,L));

        assume a = <*A, B*>;

        then

         A9: ( dom a) = ( Seg 2) & (a . 1) = A & (a . 2) = B & ( len a) = 2 & ( dom a) = ( dom ( the_arity_of o)) = ( dom (a / (x,t))) by MSUALG_6: 2, FINSEQ_1: 44, FINSEQ_1: 89;

        consider j1 be SortSymbol of S such that

         A10: j1 = (( the_arity_of o) . 1) & ex A be Element of L, j1 st A = (a . 1) & ((a / (x,t)) . 1) = (A / (x,t)) by A9, Def14, FINSEQ_1: 1;

        consider j2 be SortSymbol of S such that

         A11: j2 = (( the_arity_of o) . 2) & ex A be Element of L, j2 st A = (a . 2) & ((a / (x,t)) . 2) = (A / (x,t)) by A9, Def14, FINSEQ_1: 1;

        o is_of_type ( <*f, f*>,f) by A8, A5;

        then j1 = f & j2 = f by A10, A11, FINSEQ_1: 44;

        hence (a / (x,t)) = <*(A / (x,t)), (B / (x,t))*> by A9, A10, A11, FINSEQ_3: 29, FINSEQ_1: 44;

      end;

      let z be Element of ( Union X);

      hereby

        set o = ( In ((the quantifiers of S . (1,z)),the carrier' of S));

        let a be Element of ( Args (o,L));

        assume a = <*A*>;

        then

         A12: ( dom a) = ( Seg 1) & (a . 1) = A & ( len a) = 1 & ( dom a) = ( dom ( the_arity_of o)) = ( dom (a / (x,t))) by MSUALG_6: 2, FINSEQ_1: 40, FINSEQ_1: 89;

        consider j be SortSymbol of S such that

         A13: j = (( the_arity_of o) . 1) & ex A be Element of L, j st A = (a . 1) & ((a / (x,t)) . 1) = (A / (x,t)) by A12, Def14, FINSEQ_1: 1;

        

         A14: 1 in {1, 2} & the quant-sort of S = {1, 2} & z in ( Union X) by Def5, TARSKI:def 2;

        then [1, z] in [:the quant-sort of S, ( Union X):] by ZFMISC_1: 87;

        then o = (the quantifiers of S . (1,z)) by SUBSET_1:def 8, FUNCT_2: 5;

        then o is_of_type ( <*f*>,f) by A14, Def5;

        then j = f & ( len (a / (x,t))) = 1 by A12, A13, FINSEQ_1: 40, FINSEQ_3: 29;

        hence (a / (x,t)) = <*(A / (x,t))*> by A13, A12, FINSEQ_1: 40;

      end;

      set o = ( In ((the quantifiers of S . (2,z)),the carrier' of S));

      let a be Element of ( Args (o,L));

      assume a = <*A*>;

      then

       A15: ( Seg 1) = ( dom a) & (a . 1) = A & ( len a) = 1 & ( dom a) = ( dom ( the_arity_of o)) = ( dom (a / (x,t))) by MSUALG_6: 2, FINSEQ_1: 40, FINSEQ_1: 89;

      consider j be SortSymbol of S such that

       A16: j = (( the_arity_of o) . 1) & ex A be Element of L, j st A = (a . 1) & ((a / (x,t)) . 1) = (A / (x,t)) by A15, Def14, FINSEQ_1: 1;

      

       A17: 2 in {1, 2} & the quant-sort of S = {1, 2} & z in ( Union X) by Def5, TARSKI:def 2;

      then [2, z] in [:the quant-sort of S, ( Union X):] by ZFMISC_1: 87;

      then o = (the quantifiers of S . (2,z)) by SUBSET_1:def 8, FUNCT_2: 5;

      then o is_of_type ( <*f*>,f) by A17, Def5;

      then j = f & ( len (a / (x,t))) = 1 by A15, A16, FINSEQ_1: 40, FINSEQ_3: 29;

      hence (a / (x,t)) = <*(A / (x,t))*> by A16, A15, FINSEQ_1: 40;

    end;

    theorem :: AOFA_L00:28

    

     Th27: for n be non empty natural number holds for J be non empty non void Signature holds for T be non-empty MSAlgebra over J holds for X be non empty-yielding GeneratorSet of T holds for S be J -extension non empty non voidn PC-correct QC-correct QCLangSignature over ( Union X) holds for Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S holds for L be non-empty Language of Y, S st L is subst-correct & Y is ManySortedSubset of the Sorts of L holds for x,y be Element of ( Union Y) holds for a be SortSymbol of S st x in (Y . a) & y in (Y . a) holds for A be Formula of L holds (( \not A) / (x,y)) = ( \not (A / (x,y))) & for B be Formula of L holds ((A \and B) / (x,y)) = ((A / (x,y)) \and (B / (x,y))) & ((A \or B) / (x,y)) = ((A / (x,y)) \or (B / (x,y))) & ((A \imp B) / (x,y)) = ((A / (x,y)) \imp (B / (x,y))) & ((A \iff B) / (x,y)) = ((A / (x,y)) \iff (B / (x,y))) & (( \true_ L) / (x,y)) = ( \true_ L)

    proof

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non voidn PC-correct QC-correct QCLangSignature over ( Union X);

      let Y be X -tolerating non empty-yielding ManySortedSet of the carrier of S;

      let L be non-empty Language of Y, S such that

       A1: L is subst-correct and

       A2: Y is ManySortedSubset of the Sorts of L;

      let x,y be Element of ( Union Y);

      let a be SortSymbol of S such that

       A3: x in (Y . a) & y in (Y . a);

      Y c= the Sorts of L by A2, PBOOLE:def 18;

      then (Y . a) c= (the Sorts of L . a);

      then

      reconsider t = y as Element of (the Sorts of L . a) by A3;

      let A be Formula of L;

      reconsider aa = <*A*> as Element of ( Args (( In ((the connectives of S . n),the carrier' of S)),L)) by Th25;

      set f = the formula-sort of S;

       B1:

      now

        let i;

        assume i in ( dom the connectives of S);

        then (the connectives of S . i) in ( rng the connectives of S) c= the carrier' of S by FUNCT_1:def 3;

        then

         B7: ( In ((the connectives of S . i),the carrier' of S)) in ( rng the connectives of S) by SUBSET_1:def 8;

        let S1 be QCLangSignature over ( Union Y);

        assume

         B5: S = S1;

        let z be Element of ( Union Y), q be Element of {1, 2};

         [q, z] in [: {1, 2}, ( Union Y):] & the quant-sort of S = {1, 2} by Def5, ZFMISC_1: 87;

        then (the quantifiers of S1 . [q, z]) in ( rng the quantifiers of S) & ( rng the quantifiers of S) misses ( rng the connectives of S) by B5, Def5, FUNCT_2: 4;

        hence ( In ((the connectives of S . i),the carrier' of S)) <> (the quantifiers of S1 . (q,z)) by B7, XBOOLE_0: 3;

      end;

      

       A4: ( len the connectives of S) >= (n + 5) by Def4;

       0 < n <= (n + 5) by NAT_1: 11;

      then ( 0 + 1) <= n <= ( len the connectives of S) by A4, NAT_1: 13, XXREAL_0: 2;

      then

       B2: n in ( dom the connectives of S) by FINSEQ_3: 25;

      then (the connectives of S . n) = ( In ((the connectives of S . n),the carrier' of S)) & (the connectives of S . n) is_of_type ( <*f*>,f) by SUBSET_1:def 8, Def4, FUNCT_1: 102;

      then

       A5: (aa / (x,t)) = <*(A / (x,t))*> & ( the_result_sort_of ( In ((the connectives of S . n),the carrier' of S))) = the formula-sort of S by A3, Th26;

      

       B3: not (ex S1 be QCLangSignature over ( Union Y) st S = S1 & ex z be Element of ( Union Y), q be Element of {1, 2} st ( In ((the connectives of S . n),the carrier' of S)) = (the quantifiers of S1 . (q,z))) by B1, B2;

      

      thus (( \not A) / (x,y)) = (( \not A) / (x,t)) by A3, A2, Th14

      .= ( \not (A / (x,t))) by A5, A1, A3, B3

      .= ( \not (A / (x,y))) by A3, A2, Th14;

      let B be Formula of L;

      

       A6: <*A, B*> in ( Args (( In ((the connectives of S . (n + 1)),the carrier' of S)),L)) & ... & <*A, B*> in ( Args (( In ((the connectives of S . (n + 4)),the carrier' of S)),L)) by Th25;

      

       A7: (for a be Element of ( Args (( In ((the connectives of S . (n + 1)),the carrier' of S)),L)) st <*A, B*> = a holds (a / (x,t)) = <*(A / (x,t)), (B / (x,t))*>) & ... & (for a be Element of ( Args (( In ((the connectives of S . (n + 4)),the carrier' of S)),L)) st <*A, B*> = a holds (a / (x,t)) = <*(A / (x,t)), (B / (x,t))*>) by A3, Th26;

      reconsider a1 = <*A, B*> as Element of ( Args (( In ((the connectives of S . (n + 1)),the carrier' of S)),L)) by A6;

      reconsider a2 = <*A, B*> as Element of ( Args (( In ((the connectives of S . (n + 2)),the carrier' of S)),L)) by A6;

      reconsider a3 = <*A, B*> as Element of ( Args (( In ((the connectives of S . (n + 3)),the carrier' of S)),L)) by A6;

      reconsider a4 = <*A, B*> as Element of ( Args (( In ((the connectives of S . (n + 4)),the carrier' of S)),L)) by A6;

      1 <= (n + 1) <= ((n + 1) + 4) by NAT_1: 11;

      then 1 <= (n + 1) <= ( len the connectives of S) by A4, XXREAL_0: 2;

      then

       B4: (n + 1) in ( dom the connectives of S) by FINSEQ_3: 25;

      then

       A8: (the connectives of S . (n + 1)) = ( In ((the connectives of S . (n + 1)),the carrier' of S)) & ((the connectives of S . (n + 1)) is_of_type ( <*f, f*>,f) & ... & (the connectives of S . (n + 4)) is_of_type ( <*f, f*>,f)) by Def4, SUBSET_1:def 8, FUNCT_1: 102;

      then ( In ((the connectives of S . (n + 1)),the carrier' of S)) is_of_type ( <*f, f*>,f);

      then

       A9: (a1 / (x,t)) = <*(A / (x,t)), (B / (x,t))*> & ( the_result_sort_of ( In ((the connectives of S . (n + 1)),the carrier' of S))) = the formula-sort of S by A7;

      

       B3: not (ex S1 be QCLangSignature over ( Union Y) st S = S1 & ex z be Element of ( Union Y), q be Element of {1, 2} st ( In ((the connectives of S . (n + 1)),the carrier' of S)) = (the quantifiers of S1 . (q,z))) by B1, B4;

      

      thus ((A \and B) / (x,y)) = ((A \and B) / (x,t)) by A3, A2, Th14

      .= ((A / (x,t)) \and (B / (x,t))) by A1, A3, A9, B3

      .= ((A / (x,y)) \and (B / (x,t))) by A3, A2, Th14

      .= ((A / (x,y)) \and (B / (x,y))) by A3, A2, Th14;

      (1 + 1) <= (n + 2) <= ((n + 2) + 3) by NAT_1: 11;

      then 1 <= (n + 2) <= ( len the connectives of S) by A4, XXREAL_0: 2;

      then

       B4: (n + 2) in ( dom the connectives of S) by FINSEQ_3: 25;

      then (the connectives of S . (n + 2)) = ( In ((the connectives of S . (n + 2)),the carrier' of S)) & (the connectives of S . (n + 2)) is_of_type ( <*f, f*>,f) by A8, SUBSET_1:def 8, FUNCT_1: 102;

      then

       A10: (a2 / (x,t)) = <*(A / (x,t)), (B / (x,t))*> & ( the_result_sort_of ( In ((the connectives of S . (n + 2)),the carrier' of S))) = the formula-sort of S by A7;

      

       B3: not (ex S1 be QCLangSignature over ( Union Y) st S = S1 & ex z be Element of ( Union Y), q be Element of {1, 2} st ( In ((the connectives of S . (n + 2)),the carrier' of S)) = (the quantifiers of S1 . (q,z))) by B1, B4;

      

      thus ((A \or B) / (x,y)) = ((A \or B) / (x,t)) by A3, A2, Th14

      .= ((A / (x,t)) \or (B / (x,t))) by A1, A3, A10, B3

      .= ((A / (x,y)) \or (B / (x,t))) by A3, A2, Th14

      .= ((A / (x,y)) \or (B / (x,y))) by A3, A2, Th14;

      1 <= ((n + 2) + 1) <= ((n + 3) + 2) by NAT_1: 11;

      then 1 <= (n + 3) <= ( len the connectives of S) by A4, XXREAL_0: 2;

      then

       B4: (n + 3) in ( dom the connectives of S) by FINSEQ_3: 25;

      then (the connectives of S . (n + 3)) = ( In ((the connectives of S . (n + 3)),the carrier' of S)) & (the connectives of S . (n + 3)) is_of_type ( <*f, f*>,f) by A8, SUBSET_1:def 8, FUNCT_1: 102;

      then

       A11: (a3 / (x,t)) = <*(A / (x,t)), (B / (x,t))*> & ( the_result_sort_of ( In ((the connectives of S . (n + 3)),the carrier' of S))) = the formula-sort of S by A7;

      

       B3: not (ex S1 be QCLangSignature over ( Union Y) st S = S1 & ex z be Element of ( Union Y), q be Element of {1, 2} st ( In ((the connectives of S . (n + 3)),the carrier' of S)) = (the quantifiers of S1 . (q,z))) by B1, B4;

      

      thus ((A \imp B) / (x,y)) = ((A \imp B) / (x,t)) by A3, A2, Th14

      .= ((A / (x,t)) \imp (B / (x,t))) by A1, A3, A11, B3

      .= ((A / (x,y)) \imp (B / (x,t))) by A3, A2, Th14

      .= ((A / (x,y)) \imp (B / (x,y))) by A3, A2, Th14;

      1 <= ((n + 3) + 1) <= ((n + 4) + 1) by NAT_1: 11;

      then 1 <= (n + 4) <= ( len the connectives of S) by A4, XXREAL_0: 2;

      then

       B4: (n + 4) in ( dom the connectives of S) by FINSEQ_3: 25;

      then (the connectives of S . (n + 4)) = ( In ((the connectives of S . (n + 4)),the carrier' of S)) & (the connectives of S . (n + 4)) is_of_type ( <*f, f*>,f) by A8, SUBSET_1:def 8, FUNCT_1: 102;

      then

       A12: (a4 / (x,t)) = <*(A / (x,t)), (B / (x,t))*> & ( the_result_sort_of ( In ((the connectives of S . (n + 4)),the carrier' of S))) = the formula-sort of S by A7;

      

       B3: not (ex S1 be QCLangSignature over ( Union Y) st S = S1 & ex z be Element of ( Union Y), q be Element of {1, 2} st ( In ((the connectives of S . (n + 4)),the carrier' of S)) = (the quantifiers of S1 . (q,z))) by B1, B4;

      

      thus ((A \iff B) / (x,y)) = ((A \iff B) / (x,t)) by A3, A2, Th14

      .= ((A / (x,t)) \iff (B / (x,t))) by A1, A3, A12, B3

      .= ((A / (x,y)) \iff (B / (x,t))) by A3, A2, Th14

      .= ((A / (x,y)) \iff (B / (x,y))) by A3, A2, Th14;

      reconsider ab = {} as Element of ( Args (( In ((the connectives of S . (n + 5)),the carrier' of S)),L)) by Th25;

      1 <= ((n + 4) + 1) <= (n + 5) by NAT_1: 11;

      then

       B4: (n + 5) in ( dom the connectives of S) by A4, FINSEQ_3: 25;

      then (the connectives of S . (n + 5)) = ( In ((the connectives of S . (n + 5)),the carrier' of S)) & (the connectives of S . (n + 5)) is_of_type ( {} ,f) by Def4, SUBSET_1:def 8, FUNCT_1: 102;

      then

       A13: (ab / (x,t)) = ab & ( the_result_sort_of ( In ((the connectives of S . (n + 5)),the carrier' of S))) = the formula-sort of S by A3, Th26;

      

       B3: not (ex S1 be QCLangSignature over ( Union Y) st S = S1 & ex z be Element of ( Union Y), q be Element of {1, 2} st ( In ((the connectives of S . (n + 5)),the carrier' of S)) = (the quantifiers of S1 . (q,z))) by B1, B4;

      

      thus (( \true_ L) / (x,y)) = (( \true_ L) / (x,t)) by A3, A2, Th14

      .= ( \true_ L) by A1, A3, A13, B3;

    end;

    begin

    definition

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non void non empty QCLangSignature over ( Union X);

      let Y be X -tolerating ManySortedSet of the carrier of S;

      struct ( LanguageStr over J, T, X, S, Y, ProgramAlgStr over J, T, X) BialgebraStr over S,Y (# the Sorts -> ManySortedSet of the carrier of S,

the Charact -> ManySortedFunction of (( the Sorts # ) * the Arity of S), ( the Sorts * the ResultSort of S),

the free-vars -> ManySortedMSSet of the Sorts, the Sorts,

the subst-op -> sort-preserving Function of [:( Union the Sorts), ( Union [|Y, the Sorts|]):], ( Union the Sorts),

the equality -> Function of ( Union [|the Sorts of T, the Sorts of T|]), ( the Sorts . the formula-sort of S),

the carrier -> set,

the charact -> PFuncFinSequence of the carrier,

the assignments -> Function of ( Union [|X, the Sorts of T|]), the carrier #)

       attr strict strict;

    end

    registration

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      cluster J -extension for non void non empty AlgLangSignature over ( Union X);

      existence

      proof

        set fs = the Element of the carrier of J;

        set ps = the Element of the carrier of J;

        set co = the FinSequence of the carrier' of J;

        set qs = {1, 2};

        set qq = the Function of [:qs, ( Union X):], the carrier' of J;

        reconsider Q = AlgLangSignature (# the carrier of J, the carrier' of J, the Arity of J, the ResultSort of J, fs, ps, co, qs, qq #) as non void non empty AlgLangSignature over ( Union X);

        take Q;

        thus J is Subsignature of Q by INSTALG1: 13;

      end;

    end

    definition

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non void non empty AlgLangSignature over ( Union X);

      let Y be X -tolerating ManySortedSet of the carrier of S;

      let L be BialgebraStr over J, T, X, S, Y;

      :: AOFA_L00:def38

      attr L is AL-correct means

      : Def34: the carrier of L = (the Sorts of L . the program-sort of S);

    end

    notation

      let S be 1-sorted;

      synonym S is 1s-empty for S is empty;

    end

    notation

      let S be UAStr;

      synonym S is ua-non-empty for S is non-empty;

    end

    registration

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non void non empty AlgLangSignature over ( Union X);

      let Y be X -tolerating ManySortedSet of the carrier of S;

      cluster non 1s-empty for strict BialgebraStr over J, T, X, S, Y;

      existence

      proof

        set U = the non empty UAStr;

        set A = the MSAlgebra over S;

        set f = the ManySortedMSSet of the Sorts of A, the Sorts of A;

        set g = the sort-preserving Function of [:( Union the Sorts of A), ( Union [|Y, the Sorts of A|]):], ( Union the Sorts of A);

        set a = the Function of ( Union [|X, the Sorts of T|]), the carrier of U;

        set eq = the Function of ( Union [|the Sorts of T, the Sorts of T|]), (the Sorts of A . the formula-sort of S);

        take X = BialgebraStr (# the Sorts of A, the Charact of A, f, g, eq, the carrier of U, the charact of U, a #);

        thus the carrier of X is non empty;

      end;

    end

    registration

      let n be non empty Nat;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be essentialJ -extensionn PC-correct non void non empty feasible AlgLangSignature over ( Union X);

      let Y be X -tolerating ManySortedSet of the carrier of S;

      cluster non-empty language AL-correct quasi_total partial ua-non-empty with_empty-instruction with_catenation with_if-instruction with_while-instructionT -extension for non 1s-empty strict BialgebraStr over J, T, X, S, Y;

      existence

      proof

        set W = the IfWhileAlgebra;

        set I = {the program-sort of S};

        set p = the program-sort of S;

        set f = the formula-sort of S;

        p in {f, p} & {f, p} misses the carrier of J by Def16, TARSKI:def 2;

        then p nin the carrier of J by XBOOLE_0: 3;

        then p in (the carrier of S \ the carrier of J) by XBOOLE_0:def 5;

        then

        consider Q be non-empty MSAlgebra over S such that

         A1: Q is T -extension & (the Sorts of Q | I) = (I --> the carrier of W) by Th18, ZFMISC_1: 31;

        set U2 = the Sorts of Q qua non-empty ManySortedSet of the carrier of S;

        set C = the Charact of Q qua ManySortedFunction of ((U2 # ) * the Arity of S), (U2 * the ResultSort of S);

        deffunc Z( object, object, object) = {} ;

        deffunc G( object) = ($1 `1 );

        consider g be Function such that

         A2: ( dom g) = [:( Union U2), ( Union [|Y, U2|]):] and

         A3: for x st x in [:( Union U2), ( Union [|Y, U2|]):] holds (g . x) = G(x) from FUNCT_1:sch 3;

        ( rng g) c= ( Union U2)

        proof

          let x;

          assume x in ( rng g);

          then

          consider y such that

           A4: y in ( dom g) & x = (g . y) by FUNCT_1:def 3;

          consider y1,y2 be object such that

           A5: y1 in ( Union U2) & y2 in ( Union [|Y, U2|]) & y = [y1, y2] by A2, A4, ZFMISC_1:def 2;

          x = ( [y1, y2] `1 ) by A5, A2, A3, A4

          .= y1;

          hence thesis by A5;

        end;

        then

        reconsider g as Function of [:( Union U2), ( Union [|Y, U2|]):], ( Union U2) by A2, FUNCT_2: 2;

        g is sort-preserving

        proof

          let j be SortSymbol of S;

          let x;

          assume x in (g .: [:(U2 . j), ( Union [|Y, U2|]):]);

          then

          consider y such that

           A6: y in ( dom g) & y in [:(U2 . j), ( Union [|Y, U2|]):] & x = (g . y) by FUNCT_1:def 6;

          consider a,b be object such that

           A7: a in (U2 . j) & b in ( Union [|Y, U2|]) & y = [a, b] by A6, ZFMISC_1:def 2;

          x = ( [a, b] `1 ) by A3, A6, A7

          .= a;

          hence x in (U2 . j) by A7;

        end;

        then

        reconsider g as sort-preserving Function of [:( Union U2), ( Union [|Y, U2|]):], ( Union U2);

        set a = the Function of ( Union [|X, the Sorts of T|]), the carrier of W;

        set f = the ManySortedMSSet of U2, U2;

        set eq = the Function of ( Union [|the Sorts of T, the Sorts of T|]), (U2 . the formula-sort of S);

        set A = BialgebraStr (# U2, C, f, g, eq, the carrier of W, the charact of W, a #);

        reconsider A as non 1s-empty strict BialgebraStr over J, T, X, S, Y;

        take A;

        thus the Sorts of A is non-empty;

        thus (the Sorts of A . the formula-sort of S) is non empty;

        

         A8: p in I by TARSKI:def 1;

        

        hence the carrier of A = ((I --> the carrier of W) . p) by FUNCOP_1: 7

        .= (the Sorts of A . the program-sort of S) by A1, A8, FUNCT_1: 49;

        thus the charact of A is quasi_total;

        thus the charact of A is homogeneous;

        thus the charact of A <> {} & the charact of A is non-empty;

        thus 1 in ( dom the charact of A) & (the charact of A . 1) is 0 -ary non empty homogeneous quasi_total PartFunc of (the carrier of A * ), the carrier of A by AOFA_000:def 10;

        thus 2 in ( dom the charact of A) & (the charact of A . 2) is 2 -ary non empty homogeneous quasi_total PartFunc of (the carrier of A * ), the carrier of A by AOFA_000:def 11;

        thus 3 in ( dom the charact of A) & (the charact of A . 3) is 3 -ary non empty homogeneous quasi_total PartFunc of (the carrier of A * ), the carrier of A by AOFA_000:def 12;

        thus 4 in ( dom the charact of A) & (the charact of A . 4) is 2 -ary non empty homogeneous quasi_total PartFunc of (the carrier of A * ), the carrier of A by AOFA_000:def 13;

         the MSAlgebra of A = the MSAlgebra of Q;

        hence A is T -extension by A1, Th15;

      end;

    end

    theorem :: AOFA_L00:29

    for U1,U2 be preIfWhileAlgebra st the UAStr of U1 = the UAStr of U2 holds ( EmptyIns U1) = ( EmptyIns U2) & for I1,J1 be Element of U1 holds for I2,J2 be Element of U2 st I1 = I2 & J1 = J2 holds (I1 \; J1) = (I2 \; J2) & ( while (I1,J1)) = ( while (I2,J2)) & for C1 be Element of U1 holds for C2 be Element of U2 st C1 = C2 holds ( if-then-else (C1,I1,J1)) = ( if-then-else (C2,I2,J2));

    theorem :: AOFA_L00:30

    

     Th29: for U1,U2 be preIfWhileAlgebra st the UAStr of U1 = the UAStr of U2 holds ( ElementaryInstructions U1) = ( ElementaryInstructions U2)

    proof

      let U1,U2 be preIfWhileAlgebra;

      assume

       A1: the UAStr of U1 = the UAStr of U2;

      set Y1 = { (I1 \; I2) where I1,I2 be Algorithm of U1 : I1 <> (I1 \; I2) & I2 <> (I1 \; I2) };

      set Y2 = { (I1 \; I2) where I1,I2 be Algorithm of U2 : I1 <> (I1 \; I2) & I2 <> (I1 \; I2) };

      

       A2: Y1 = Y2

      proof

        thus Y1 c= Y2

        proof

          let x;

          assume x in Y1;

          then

          consider I1,I2 be Algorithm of U1 such that

           A3: x = (I1 \; I2) & I1 <> (I1 \; I2) & I2 <> (I1 \; I2);

          reconsider I1, I2 as Algorithm of U2 by A1;

          x = (I1 \; I2) by A1, A3;

          hence thesis by A3;

        end;

        let x;

        assume x in Y2;

        then

        consider I1,I2 be Algorithm of U2 such that

         A4: x = (I1 \; I2) & I1 <> (I1 \; I2) & I2 <> (I1 \; I2);

        reconsider I1, I2 as Algorithm of U1 by A1;

        x = (I1 \; I2) by A1, A4;

        hence thesis by A4;

      end;

      thus ( ElementaryInstructions U1) = ( ElementaryInstructions U2) by A2, A1;

    end;

    theorem :: AOFA_L00:31

    for U1,U2 be Universal_Algebra st the UAStr of U1 = the UAStr of U2 holds for S1 be Subset of U1, S2 be Subset of U2 st S1 = S2 holds for o1 be operation of U1, o2 be operation of U2 st o1 = o2 holds S1 is_closed_on o1 implies S2 is_closed_on o2;

    theorem :: AOFA_L00:32

    

     Th31: for U1,U2 be Universal_Algebra st the UAStr of U1 = the UAStr of U2 holds for S1 be Subset of U1, S2 be Subset of U2 st S1 = S2 holds S1 is opers_closed implies S2 is opers_closed

    proof

      let U1,U2 be Universal_Algebra;

      assume

       A1: the UAStr of U1 = the UAStr of U2;

      let S1 be Subset of U1;

      let S2 be Subset of U2;

      assume

       A2: S1 = S2;

      assume

       A3: for o be operation of U1 holds S1 is_closed_on o;

      let o be operation of U2;

      reconsider o1 = o as operation of U1 by A1;

      S1 is_closed_on o1 by A3;

      hence thesis by A2;

    end;

    theorem :: AOFA_L00:33

    

     Th32: for U1,U2 be Universal_Algebra st the UAStr of U1 = the UAStr of U2 holds for G be GeneratorSet of U1 holds G is GeneratorSet of U2

    proof

      let U1,U2 be Universal_Algebra;

      assume

       A1: the UAStr of U1 = the UAStr of U2;

      let G be GeneratorSet of U1;

      reconsider G2 = G as Subset of U2 by A1;

      G2 is GeneratorSet of U2

      proof

        let A be Subset of U2;

        reconsider B = A as Subset of U1 by A1;

        assume A is opers_closed;

        hence thesis by A1, Th31, FREEALG:def 4;

      end;

      hence G is GeneratorSet of U2;

    end;

    theorem :: AOFA_L00:34

    

     Th33: for U1,U2 be Universal_Algebra st the UAStr of U1 = the UAStr of U2 holds ( signature U1) = ( signature U2)

    proof

      let U1,U2 be Universal_Algebra;

      assume

       A1: the UAStr of U1 = the UAStr of U2;

      

       A2: ( len ( signature U2)) = ( len the charact of U1) by A1, UNIALG_1:def 4;

      for i st i in ( dom ( signature U2)) holds for h be homogeneous non empty PartFunc of (the carrier of U1 * ), the carrier of U1 st h = (the charact of U1 . i) holds (( signature U2) . i) = ( arity h) by A1, UNIALG_1:def 4;

      hence ( signature U1) = ( signature U2) by A2, UNIALG_1:def 4;

    end;

    registration

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be essentialJ -extension non void non emptyn PC-correct QC-correct AlgLangSignature over ( Union X);

      cluster AL-correct vf-qc-correct vf-correct vf-finite subst-correct subst-forex non degenerated well_founded ECIW-strict for non-empty quasi_total partial ua-non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction language non 1s-emptyT -extension BialgebraStr over J, T, X, S, (X extended_by ( {} ,the carrier of S));

      existence

      proof

        set Y = (X extended_by ( {} ,the carrier of S));

        set W = the IfWhileAlgebra;

        set I = {the program-sort of S};

        set p = the program-sort of S;

        set f = the formula-sort of S;

        p in {f, p} & {f, p} misses the carrier of J by Def16, TARSKI:def 2;

        then p nin the carrier of J by XBOOLE_0: 3;

        then p in (the carrier of S \ the carrier of J) by XBOOLE_0:def 5;

        then

        consider Q be non-empty MSAlgebra over S such that

         A1: Q is T -extension & (the Sorts of Q | I) = (I --> the carrier of W) by Th18, ZFMISC_1: 31;

        set U2 = the Sorts of Q qua non-empty ManySortedSet of the carrier of S;

        set C = the Charact of Q qua ManySortedFunction of ((U2 # ) * the Arity of S), (U2 * the ResultSort of S);

        deffunc Z( object, object, object) = {} ;

        

         A2: for s,r be Element of the carrier of S holds for t be Element of (U2 . s) holds Z(s,r,t) is Subset of (U2 . r) by XBOOLE_1: 2;

        consider f be ManySortedMSSet of U2, U2 such that

         A3: for s,r be Element of the carrier of S holds for t be Element of (U2 . s) holds (((f . s) . t) . r) = Z(s,r,t) from AOFA_A00:sch 1( A2);

        deffunc G( object) = ($1 `1 );

        consider g be Function such that

         A4: ( dom g) = [:( Union U2), ( Union [|Y, U2|]):] and

         A5: for x st x in [:( Union U2), ( Union [|Y, U2|]):] holds (g . x) = G(x) from FUNCT_1:sch 3;

        ( rng g) c= ( Union U2)

        proof

          let x;

          assume x in ( rng g);

          then

          consider y such that

           A6: y in ( dom g) & x = (g . y) by FUNCT_1:def 3;

          consider y1,y2 be object such that

           A7: y1 in ( Union U2) & y2 in ( Union [|Y, U2|]) & y = [y1, y2] by A4, A6, ZFMISC_1:def 2;

          x = ( [y1, y2] `1 ) by A7, A4, A5, A6

          .= y1;

          hence thesis by A7;

        end;

        then

        reconsider g as Function of [:( Union U2), ( Union [|Y, U2|]):], ( Union U2) by A4, FUNCT_2: 2;

        g is sort-preserving

        proof

          let j be SortSymbol of S;

          let x;

          assume x in (g .: [:(U2 . j), ( Union [|Y, U2|]):]);

          then

          consider y such that

           A8: y in ( dom g) & y in [:(U2 . j), ( Union [|Y, U2|]):] & x = (g . y) by FUNCT_1:def 6;

          consider a,b be object such that

           A9: a in (U2 . j) & b in ( Union [|Y, U2|]) & y = [a, b] by A8, ZFMISC_1:def 2;

          x = ( [a, b] `1 ) by A5, A8, A9

          .= a;

          hence x in (U2 . j) by A9;

        end;

        then

        reconsider g as sort-preserving Function of [:( Union U2), ( Union [|Y, U2|]):], ( Union U2);

        set a = the Function of ( Union [|X, the Sorts of T|]), the carrier of W;

        set eq = the Function of ( Union [|the Sorts of T, the Sorts of T|]), (U2 . the formula-sort of S);

        set A = BialgebraStr (# U2, C, f, g, eq, the carrier of W, the charact of W, a #);

        reconsider A as non 1s-empty BialgebraStr over J, T, X, S, Y;

        A is language;

        then

        reconsider A as language non 1s-empty BialgebraStr over J, T, X, S, Y;

         A10:

        now

          let s be SortSymbol of S;

          let B be Element of (the Sorts of A . s);

          let x,y be Element of ( Union Y);

          let a be SortSymbol of S;

          assume

           A11: x in (Y . a) & y in (Y . a);

          

           A12: Y is ManySortedSubset of the Sorts of Q by A1, Th23;

          then (Y . a) is Subset of (the Sorts of A . a) by Th13;

          then

           A13: [x, y] in [:(Y . a), (the Sorts of A . a):] by A11, ZFMISC_1: 87;

          

           A14: ( [|Y, the Sorts of A|] . a) = [:(Y . a), (the Sorts of A . a):] by PBOOLE:def 16;

          ( dom U2) = the carrier of S & ( dom [|Y, the Sorts of A|]) = the carrier of S by PARTFUN1:def 2;

          then

           A15: B in ( Union U2) & [x, y] in ( Union [|Y, the Sorts of A|]) by A13, A14, CARD_5: 2;

          

          thus (B / (x,y)) = (g . [B, [x, y]]) by A12, A11, Def12

          .= ( [B, [x, y]] `1 ) by A5, A15, ZFMISC_1: 87

          .= B;

        end;

         A16:

        now

          let s be SortSymbol of S;

          let B be Element of (the Sorts of A . s);

          let x be Element of ( Union Y);

          let y be Element of ( Union the Sorts of A);

          let a be SortSymbol of S;

          assume

           A17: x in (Y . a) & y in (the Sorts of A . a);

          then

           A18: [x, y] in [:(Y . a), (the Sorts of A . a):] by ZFMISC_1: 87;

          

           A19: ( [|Y, the Sorts of A|] . a) = [:(Y . a), (the Sorts of A . a):] by PBOOLE:def 16;

          ( dom U2) = the carrier of S & ( dom [|Y, the Sorts of A|]) = the carrier of S by PARTFUN1:def 2;

          then

           A20: B in ( Union U2) & [x, y] in ( Union [|Y, the Sorts of A|]) by A18, A19, CARD_5: 2;

          

          thus (B / (x,y)) = (g . [B, [x, y]]) by A17, Def13

          .= ( [B, [x, y]] `1 ) by A5, A20, ZFMISC_1: 87

          .= B;

        end;

        

         A21: the MSAlgebra of A = the MSAlgebra of Q;

        A is non-empty quasi_total partial ua-non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction by AOFA_000:def 10, AOFA_000:def 11, AOFA_000:def 12, AOFA_000:def 13;

        then

        reconsider A as non-empty quasi_total partial ua-non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction language non 1s-emptyT -extension BialgebraStr over J, T, X, S, Y by A21, A1, Th15;

        take A;

        

         A22: p in I by TARSKI:def 1;

        

        hence the carrier of A = ((I --> the carrier of W) . p) by FUNCOP_1: 7

        .= (the Sorts of A . the program-sort of S) by A1, A22, FUNCT_1: 49;

        thus A is vf-qc-correct

        proof

          let C,B be Formula of A;

          

           A23: ( vf C) = ( EmptyMS the carrier of S) & ( vf B) = ( EmptyMS the carrier of S) & ( vf ( \not C)) = ( EmptyMS the carrier of S) & ( vf (C \and B)) = ( EmptyMS the carrier of S) & ( vf (C \or B)) = ( EmptyMS the carrier of S) & ( vf (C \imp B)) = ( EmptyMS the carrier of S) & ( vf (C \iff B)) = ( EmptyMS the carrier of S) by A3;

          thus ( vf ( \not C)) = ( vf C) & ( vf (C \and B)) = (( vf C) (\/) ( vf B)) by A23;

          thus ( vf (C \or B)) = (( vf C) (\/) ( vf B)) & ( vf (C \imp B)) = (( vf C) (\/) ( vf B)) & ( vf (C \iff B)) = (( vf C) (\/) ( vf B)) by A23;

          thus ( vf ( \true_ A)) = ( EmptyMS the carrier of S) by A3;

          let x be Element of ( Union X);

          let a be SortSymbol of S;

          assume x in (X . a);

          ( vf ( \for (x,C))) = ( EmptyMS the carrier of S) & ( vf ( \ex (x,C))) = ( EmptyMS the carrier of S) by A3;

          hence ( vf ( \for (x,C))) = (( vf C) (\) (a -singleton x)) & ( vf ( \ex (x,C))) = (( vf C) (\) (a -singleton x)) by A23, PBOOLE: 60;

        end;

        thus A is vf-correct

        proof

          let o be OperSymbol of S;

          let p be FinSequence;

          assume p in ( Args (o,A));

          let b be Element of A, ( the_result_sort_of o);

          assume b = (( Den (o,A)) . p);

          let s be SortSymbol of S;

          (( vf b) . s) = {} by A3;

          hence thesis;

        end;

        thus A is vf-finite

        proof

          let s be SortSymbol of S, t be Element of A, s;

          let a be object;

          assume a in the carrier of S;

          hence (( vf t) . a) is finite by A3;

        end;

        thus A is subst-correct

        proof

          let x be Element of ( Union Y);

          let a be SortSymbol of S such that

           A24: x in (Y . a);

          thus for j be SortSymbol of S, C be Element of A, j holds (C / (x,x)) = C by A24, A10;

          let y be Element of ( Union the Sorts of A) such that

           A25: y in (the Sorts of A . a);

          let o be OperSymbol of S;

          let p be Element of ( Args (o,A));

          now

            let i be Nat;

            assume

             A26: i in ( dom ( the_arity_of o));

            take j = (( the_arity_of o) /. i);

            thus j = (( the_arity_of o) . i) by A26, PARTFUN1:def 6;

            take B = ( In ((p . i),(the Sorts of A . j)));

            thus B = (p . i) by A26, MSUALG_6: 2, SUBSET_1:def 8;

            hence (p . i) = (B / (x,y)) by A24, A25, A16;

          end;

          then

           A27: (p / (x,y)) = p by Def14;

          let C be Element of A, ( the_result_sort_of o);

          assume

           A28: C = (( Den (o,A)) . p);

          assume not (ex S1 be QCLangSignature over ( Union Y) st S = S1 & ex z be Element of ( Union Y), q be Element of {1, 2} st o = (the quantifiers of S1 . (q,z)));

          thus (C / (x,y)) = (( Den (o,A)) . (p / (x,y))) by A27, A28, A24, A25, A16;

        end;

        thus A is subst-forex

        proof

          let B be Formula of A;

          let x be Element of ( Union X);

          let s,s1 be SortSymbol of S;

          let t be Element of A, s;

          assume x in (X . s1);

          let y be Element of ( Union Y);

          assume

           C2: y in (Y . s);

          thus x = y implies (( \for (x,B)) / (y,t)) = ( \for (x,B)) & (( \ex (x,B)) / (y,t)) = ( \ex (x,B)) by C2, A16;

          thus (x <> y & x in (( vf t) . s1) implies ex z be Element of ( Union X), x0,z0 be Element of ( Union Y) st x = x0 & z0 = z = the Element of (((X . s1) \ (( vf t) . s1)) \ (( vf B) . s1)) & (( \for (x,B)) / (y,t)) = ( \for (z,((B / (x0,z0)) / (y,t)))) & (( \ex (x,B)) / (y,t)) = ( \ex (z,((B / (x0,z0)) / (y,t))))) by A3;

          assume x <> y & x nin (( vf t) . s);

          

          thus (( \for (x,B)) / (y,t)) = ( \for (x,B)) by C2, A16

          .= ( \for (x,(B / (y,t)))) by C2, A16;

          

          thus (( \ex (x,B)) / (y,t)) = ( \ex (x,B)) by C2, A16

          .= ( \ex (x,(B / (y,t)))) by C2, A16;

        end;

        hereby

          let I1,I2 be Element of the carrier of A;

          reconsider J1 = I1, J2 = I2 as Element of W;

          ( EmptyIns A) = ( EmptyIns W) & (I1 \; I2) = (J1 \; J2);

          hence (I1 <> ( EmptyIns A) implies (I1 \; I2) <> I2) & (I2 <> ( EmptyIns A) implies (I1 \; I2) <> I1) & (I1 <> ( EmptyIns A) or I2 <> ( EmptyIns A) implies (I1 \; I2) <> ( EmptyIns A)) by AOFA_000:def 24;

        end;

        hereby

          let C,I1,I2 be Element of the carrier of A;

          reconsider C1 = C, J1 = I1, J2 = I2 as Element of W;

          ( if-then-else (C,I1,I2)) = ( if-then-else (C1,J1,J2)) & ( EmptyIns W) = ( EmptyIns A);

          hence ( if-then-else (C,I1,I2)) <> ( EmptyIns A) by AOFA_000:def 24;

        end;

        hereby

          let C,I be Element of the carrier of A;

          reconsider C1 = C, J = I as Element of W;

          ( EmptyIns A) = ( EmptyIns W) & ( while (C,I)) = ( while (C1,J));

          hence ( while (C,I)) <> ( EmptyIns A) by AOFA_000:def 24;

        end;

        hereby

          let I1,I2,C,J1,J2 be Element of the carrier of A;

          reconsider C1 = C, K1 = I1, K2 = I2, L1 = J1, L2 = J2 as Element of W;

          ( if-then-else (C,J1,J2)) = ( if-then-else (C1,L1,L2)) & (I1 \; I2) = (K1 \; K2) & ( EmptyIns W) = ( EmptyIns A);

          hence I1 = ( EmptyIns A) or I2 = ( EmptyIns A) or (I1 \; I2) <> ( if-then-else (C,J1,J2)) by AOFA_000:def 24;

        end;

        hereby

          let I1,I2,C,J be Element of the carrier of A;

          reconsider C1 = C, K1 = I1, K2 = I2, L = J as Element of W;

          ( EmptyIns W) = ( EmptyIns A) & (I1 \; I2) = (K1 \; K2) & ( while (C,J)) = ( while (C1,L));

          hence I1 <> ( EmptyIns A) & I2 <> ( EmptyIns A) implies (I1 \; I2) <> ( while (C,J)) by AOFA_000:def 24;

        end;

        hereby

          let C1,I1,I2,C2,J be Element of the carrier of A;

          reconsider C3 = C1, K1 = I1, K2 = I2, C4 = C2, L = J as Element of W;

          ( while (C2,J)) = ( while (C4,L)) & ( if-then-else (C1,I1,I2)) = ( if-then-else (C3,K1,K2));

          hence ( if-then-else (C1,I1,I2)) <> ( while (C2,J)) by AOFA_000:def 24;

        end;

        thus A is well_founded

        proof

          

           A29: the UAStr of W = the UAStr of A;

          then ( ElementaryInstructions W) = ( ElementaryInstructions A) & ( ElementaryInstructions W) is GeneratorSet of W by Th29, AOFA_000:def 25;

          hence ( ElementaryInstructions A) is GeneratorSet of A by A29, Th32;

        end;

         the UAStr of A = the UAStr of W;

        then ( signature A) = ( signature W) by Th33;

        hence ( signature A) = ECIW-signature by AOFA_000:def 27;

      end;

    end

    definition

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be essentialJ -extension non empty non voidn PC-correct QC-correctn AL-correct AlgLangSignature over ( Union X);

      mode IfWhileAlgebra of X,S is AL-correct vf-qc-correct vf-correct subst-correct subst-forex non degenerated well_founded ECIW-strict non-empty quasi_total partial ua-non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction language non 1s-emptyT -extension BialgebraStr over J, T, X, S, (X extended_by ( {} ,the carrier of S));

    end

    definition

      let n be non empty Nat;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be essentialJ -extension non empty non voidn PC-correct QC-correctn AL-correct AlgLangSignature over ( Union X);

      let L be IfWhileAlgebra of X, S;

      set f = the formula-sort of S;

      set p = the program-sort of S;

      

       A1: (the connectives of S . (n + 6)) is_of_type ( <*p, f*>,f) & ... & (the connectives of S . (n + 8)) is_of_type ( <*p, f*>,f) by Def6;

      

       A2: (the Sorts of L . p) = the carrier of L by Def34;

      let K be Formula of L;

      let P be Algorithm of L;

      :: AOFA_L00:def39

      func P * K -> Formula of L equals (( Den (( In ((the connectives of S . (n + 6)),the carrier' of S)),L)) . <*P, K*>);

      coherence by A1, A2, AOFA_A00: 33;

      :: AOFA_L00:def40

      func \Cup (P,K) -> Formula of L equals (( Den (( In ((the connectives of S . (n + 7)),the carrier' of S)),L)) . <*P, K*>);

      coherence by A1, A2, AOFA_A00: 33;

      :: AOFA_L00:def41

      func \Cap (P,K) -> Formula of L equals (( Den (( In ((the connectives of S . (n + 8)),the carrier' of S)),L)) . <*P, K*>);

      coherence by A1, A2, AOFA_A00: 33;

    end

    definition

      let n be non empty Nat;

      let S be non empty non voidn PC-correct PCLangSignature;

      let L be language MSAlgebra over S;

      let F be Subset of (the Sorts of L . the formula-sort of S);

      :: AOFA_L00:def42

      attr F is PC-closed means

      : Def38: for A,B,C be Formula of L holds (A \imp (B \imp A)) in F & ((A \imp (B \imp C)) \imp ((A \imp B) \imp (A \imp C))) in F & ((( \not A) \imp ( \not B)) \imp (B \imp A)) in F & (A \imp (A \or B)) in F & (A \imp (B \or A)) in F & ((A \imp C) \imp ((B \imp C) \imp ((A \or B) \imp C))) in F & ((A \and B) \imp A) in F & ((A \and B) \imp B) in F & (A \imp (B \imp (A \and B))) in F & ((A \and ( \not A)) \imp B) in F & ((A \imp B) \imp ((A \imp ( \not B)) \imp ( \not A))) in F & (A \or ( \not A)) in F & ((A \iff B) \imp (A \imp B)) in F & ((A \iff B) \imp (B \imp A)) in F & (((A \imp B) \and (B \imp A)) \imp (A \iff B)) in F & ( \true_ L) in F & ((( \true_ L) \and A) \iff A) in F & ((( \true_ L) \or A) \iff ( \true_ L)) in F & (A in F & (A \imp B) in F implies B in F);

    end

    definition

      let n be non empty Nat;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non voidn PC-correct QC-correct QCLangSignature over ( Union X);

      let L be non-empty Language of (X extended_by ( {} ,the carrier of S)), S;

      let F be Subset of (the Sorts of L . the formula-sort of S);

      :: AOFA_L00:def43

      attr F is QC-closed means

      : Def39: for A,B be Element of (the Sorts of L . the formula-sort of S) holds for x be Element of ( Union X) holds (for a be SortSymbol of J holds (for t be Element of ( Union the Sorts of L) st x in ((X extended_by ( {} ,the carrier of S)) . a) & t in (the Sorts of L . a) holds for y be Element of ( Union (X extended_by ( {} ,the carrier of S))) st x = y holds (( \for (x,A)) \imp (A / (y,t))) in F) & (x in (X . a) & x nin (( vf A) . a) implies (( \for (x,(A \imp B))) \imp (A \imp ( \for (x,B)))) in F)) & (( \not ( \ex (x,A))) \iff ( \for (x,( \not A)))) in F & (( \ex (x,( \not A))) \iff ( \not ( \for (x,A)))) in F & (A in F implies ( \for (x,A)) in F);

    end

    definition

      let n be non empty Nat;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non voidn PC-correct QC-correct QCLangSignature over ( Union X);

      let L be non-emptyT -extension Language of (X extended_by ( {} ,the carrier of S)), S;

      :: AOFA_L00:def44

      attr L is subst-eq-correct means for x0 be Element of ( Union (X extended_by ( {} ,the carrier of S))) holds for s,s1 be SortSymbol of S st x0 in (X . s) holds for t be Element of L, s, t1,t2 be Element of L, s1 holds ((t1 '=' (t2,L)) / (x0,t)) = ((t1 / (x0,t)) '=' ((t2 / (x0,t)),L));

      :: AOFA_L00:def45

      attr L is vf-eq-correct means for s be SortSymbol of S holds (for t1,t2 be Element of L, s holds ( vf (t1 '=' (t2,L))) = (( vf t1) (\/) ( vf t2))) & for s be SortSymbol of S holds for t be Element of L, s st t in (X . s) holds ( vf t) = (s -singleton t);

      let F be Subset of (the Sorts of L . the formula-sort of S);

      :: AOFA_L00:def46

      attr F is with_equality means

      : Def42: (for t be Element of T holds (t '=' (t,L)) in F) & for b be SortSymbol of S holds for t1,t2 be Element of L, b holds for x be Element of ( Union (X extended_by ( {} ,the carrier of S))) st x in (X . b) holds (for c be SortSymbol of S st c in the carrier of J holds for t be Element of L, c holds ((t1 '=' (t2,L)) \imp ((t / (x,t1)) '=' ((t / (x,t2)),L))) in F) & for A be Formula of L holds ((t1 '=' (t2,L)) \imp ((A / (x,t1)) \imp (A / (x,t2)))) in F;

    end

    definition

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty VarMSAlgebra over J;

      let X be non-empty GeneratorSet of T;

      let S be essentialJ -extension non empty non voidn PC-correct QC-correctn AL-correct AlgLangSignature over ( Union X);

      let L be non 1s-empty IfWhileAlgebra of X, S;

      let V be Formula of L;

      let F be Subset of (the Sorts of L . the formula-sort of S);

      :: AOFA_L00:def47

      attr F is V AL-closed means

      : Def43: for A,B be Formula of L holds (for M be Algorithm of L holds ((M * (A \and B)) \iff ((M * A) \and (M * B))) in F & ((M * (A \or B)) \iff ((M * A) \or (M * B))) in F & (( \Cup (M,A)) \iff (A \or ( \Cup (M,(M * A))))) in F & (( \Cap (M,A)) \iff (A \and ( \Cap (M,(M * A))))) in F & ((A \imp B) in F implies (( \Cup (M,A)) \imp ( \Cup (M,B))) in F & (( \Cap (M,A)) \imp ( \Cap (M,B))) in F)) & (for a be SortSymbol of J holds for x be Element of (X . a) holds for x0 be Element of ( Union (X extended_by ( {} ,the carrier of S))) st x = x0 holds for t be Element of (the Sorts of T . a) holds for t1 be Element of ( Union the Sorts of L) st t1 = t holds (((x := (t,L)) * A) \iff (A / (x0,t1))) in F & (for y be Element of (X . a) st y nin (( vf t) . a) holds for y0 be Element of ( Union (X extended_by ( {} ,the carrier of S))) st y = y0 holds (((x := (t,L)) * ( \ex (x,A))) \iff ( \ex (y,((x := (t,L)) * ((y := (( @ x),L)) * (A / (x0,y0))))))) in F) & (((x := (t,L)) * A) \imp ( \ex (x,A))) in F) & for M,M1,M2 be Algorithm of L holds (((M \; M1) * A) \iff (M * (M1 * A))) in F & ((( if-then-else (M,M1,M2)) * A) \iff (((M * V) \and (M * (M1 * A))) \or ((M * ( \not V)) \and (M * (M2 * A))))) in F & ((( while (M,M1)) * A) \iff (((M * ( \not V)) \and A) \or ((M * V) \and (M * (M1 * (( while (M,M1)) * A)))))) in F;

    end

    registration

      let n be non empty Nat;

      let S be non empty non voidn PC-correct PCLangSignature;

      let L be language MSAlgebra over S;

      cluster ( [#] (the Sorts of L . the formula-sort of S)) -> PC-closed;

      coherence

      proof

        let A be Formula of L;

        ( [#] (the Sorts of L . the formula-sort of S)) = (the Sorts of L . the formula-sort of S) & (the Sorts of L . the formula-sort of S) is non empty by Def18, SUBSET_1:def 3;

        hence thesis;

      end;

      cluster PC-closed -> non empty for Subset of (the Sorts of L . the formula-sort of S);

      coherence ;

      cluster PC-closed for Subset of (the Sorts of L . the formula-sort of S);

      existence

      proof

        take ( [#] (the Sorts of L . the formula-sort of S));

        thus thesis;

      end;

    end

    registration

      let n be non empty Nat;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non voidn PC-correct QC-correct QCLangSignature over ( Union X);

      let L be non-empty Language of (X extended_by ( {} ,the carrier of S)), S;

      cluster ( [#] (the Sorts of L . the formula-sort of S)) -> QC-closed;

      coherence

      proof

        let A be Element of (the Sorts of L . the formula-sort of S);

        ( [#] (the Sorts of L . the formula-sort of S)) = (the Sorts of L . the formula-sort of S) by SUBSET_1:def 3;

        hence thesis;

      end;

      cluster QC-closed PC-closed for Subset of (the Sorts of L . the formula-sort of S);

      existence

      proof

        take ( [#] (the Sorts of L . the formula-sort of S));

        thus thesis;

      end;

    end

    registration

      let n be non empty Nat;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non voidn PC-correct QC-correct QCLangSignature over ( Union X);

      let L be non-emptyT -extension Language of (X extended_by ( {} ,the carrier of S)), S;

      cluster ( [#] (the Sorts of L . the formula-sort of S)) -> with_equality;

      coherence

      proof

        ( [#] (the Sorts of L . the formula-sort of S)) = (the Sorts of L . the formula-sort of S) by SUBSET_1:def 3;

        hence thesis;

      end;

      cluster QC-closed PC-closed with_equality for Subset of (the Sorts of L . the formula-sort of S);

      existence

      proof

        take ( [#] (the Sorts of L . the formula-sort of S));

        thus thesis;

      end;

    end

    definition

      let n be non empty Nat;

      let S be non empty non voidn PC-correct PCLangSignature;

      let L be language MSAlgebra over S;

      mode PC-theory of L is PC-closed Subset of (the Sorts of L . the formula-sort of S);

    end

    definition

      let n be non empty Nat;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non voidn PC-correct QC-correct QCLangSignature over ( Union X);

      let L be non-empty Language of (X extended_by ( {} ,the carrier of S)), S;

      mode QC-theory of L is QC-closed PC-closed Subset of (the Sorts of L . the formula-sort of S);

    end

    definition

      let n be non empty Nat;

      let J be non empty non void Signature;

      let T be non-empty MSAlgebra over J;

      let X be non empty-yielding GeneratorSet of T;

      let S be J -extension non empty non voidn PC-correct QC-correct QCLangSignature over ( Union X);

      let L be non-emptyT -extension Language of (X extended_by ( {} ,the carrier of S)), S;

      mode QC-theory_with_equality of L is QC-closed PC-closed with_equality Subset of (the Sorts of L . the formula-sort of S);

    end

    registration

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty VarMSAlgebra over J;

      let X be non-empty GeneratorSet of T;

      let S be essentialJ -extension non empty non voidn PC-correct QC-correctn AL-correct AlgLangSignature over ( Union X);

      let L be non 1s-empty IfWhileAlgebra of X, S;

      let V be Formula of L;

      cluster V AL-closed for PC-closed QC-closed with_equality Subset of (the Sorts of L . the formula-sort of S);

      existence

      proof

        take F = ( [#] (the Sorts of L . the formula-sort of S));

        let A be Formula of L;

        F = (the Sorts of L . the formula-sort of S) by SUBSET_1:def 3;

        hence thesis;

      end;

    end

    definition

      let n be non empty natural number;

      let J be non empty non void Signature;

      let T be non-empty VarMSAlgebra over J;

      let X be non-empty GeneratorSet of T;

      let S be essentialJ -extension non empty non voidn PC-correct QC-correctn AL-correct AlgLangSignature over ( Union X);

      let L be non empty IfWhileAlgebra of X, S;

      let V be Formula of L;

      mode AL-theory of V,L is PC-closed QC-closed with_equalityV AL-closed Subset of (the Sorts of L . the formula-sort of S);

    end

    begin

    reserve n for non empty Nat,

S for non empty non voidn PC-correct PCLangSignature,

L for language MSAlgebra over S,

F for PC-theory of L,

A,B,C,D for Formula of L;

    theorem :: AOFA_L00:35

    

     Th34: (A \imp A) in F

    proof

      

       A1: ((A \imp ((A \imp A) \imp A)) \imp ((A \imp (A \imp A)) \imp (A \imp A))) in F by Def38;

      

       A2: (A \imp ((A \imp A) \imp A)) in F by Def38;

      

       A3: ((A \imp (A \imp A)) \imp (A \imp A)) in F by A1, A2, Def38;

      

       A4: (A \imp (A \imp A)) in F by Def38;

      thus thesis by A3, A4, Def38;

    end;

    theorem :: AOFA_L00:36

    

     Th35: (A \and B) in F iff A in F & B in F

    proof

      ((A \and B) \imp A) in F & ((A \and B) \imp B) in F by Def38;

      hence (A \and B) in F implies A in F & B in F by Def38;

      (A \imp (B \imp (A \and B))) in F by Def38;

      then A in F implies (B \imp (A \and B)) in F by Def38;

      hence thesis by Def38;

    end;

    theorem :: AOFA_L00:37

    

     Th36: ((A \or B) \imp (B \or A)) in F

    proof

      

       A1: ((A \imp (B \or A)) \imp ((B \imp (B \or A)) \imp ((A \or B) \imp (B \or A)))) in F by Def38;

      

       A2: (A \imp (B \or A)) in F & (B \imp (B \or A)) in F by Def38;

      ((B \imp (B \or A)) \imp ((A \or B) \imp (B \or A))) in F by A1, A2, Def38;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:38

    

     Th37: ((B \imp C) \imp ((A \imp B) \imp (A \imp C))) in F

    proof

      

       A1: ((A \imp (B \imp C)) \imp ((A \imp B) \imp (A \imp C))) in F by Def38;

      

       A2: (((B \imp C) \imp ((A \imp (B \imp C)) \imp ((A \imp B) \imp (A \imp C)))) \imp (((B \imp C) \imp (A \imp (B \imp C))) \imp ((B \imp C) \imp ((A \imp B) \imp (A \imp C))))) in F by Def38;

      (((A \imp (B \imp C)) \imp ((A \imp B) \imp (A \imp C))) \imp ((B \imp C) \imp ((A \imp (B \imp C)) \imp ((A \imp B) \imp (A \imp C))))) in F by Def38;

      then ((B \imp C) \imp ((A \imp (B \imp C)) \imp ((A \imp B) \imp (A \imp C)))) in F by A1, Def38;

      then

       A3: (((B \imp C) \imp (A \imp (B \imp C))) \imp ((B \imp C) \imp ((A \imp B) \imp (A \imp C)))) in F by A2, Def38;

      ((B \imp C) \imp (A \imp (B \imp C))) in F by Def38;

      hence thesis by A3, Def38;

    end;

    theorem :: AOFA_L00:39

    

     Th38: (A \imp (B \imp C)) in F implies (B \imp (A \imp C)) in F

    proof

      assume

       A1: (A \imp (B \imp C)) in F;

      

       A2: (((A \imp B) \imp (A \imp C)) \imp ((B \imp (A \imp B)) \imp (B \imp (A \imp C)))) in F by Th37;

      ((A \imp (B \imp C)) \imp ((A \imp B) \imp (A \imp C))) in F by Def38;

      then ((A \imp B) \imp (A \imp C)) in F by A1, Def38;

      then

       A3: ((B \imp (A \imp B)) \imp (B \imp (A \imp C))) in F by A2, Def38;

      (B \imp (A \imp B)) in F by Def38;

      hence thesis by A3, Def38;

    end;

    theorem :: AOFA_L00:40

    

     Th39: ((A \imp B) \imp ((B \imp C) \imp (A \imp C))) in F

    proof

      ((B \imp C) \imp ((A \imp B) \imp (A \imp C))) in F by Th37;

      hence thesis by Th38;

    end;

    theorem :: AOFA_L00:41

    (A \imp (B \imp (A \imp B))) in F

    proof

      ((B \imp (A \imp B)) \imp (A \imp (B \imp (A \imp B)))) in F & (B \imp (A \imp B)) in F by Def38;

      hence thesis by Def38;

    end;

    theorem :: AOFA_L00:42

    

     Th41: ((A \imp (B \imp C)) \imp (B \imp (A \imp C))) in F

    proof

      

       A1: (B \imp (A \imp B)) in F by Def38;

      ((A \imp (B \imp C)) \imp ((A \imp B) \imp (A \imp C))) in F by Def38;

      then

       A2: ((A \imp B) \imp ((A \imp (B \imp C)) \imp (A \imp C))) in F by Th38;

      (((A \imp B) \imp ((A \imp (B \imp C)) \imp (A \imp C))) \imp ((B \imp (A \imp B)) \imp (B \imp ((A \imp (B \imp C)) \imp (A \imp C))))) in F by Th37;

      then ((B \imp (A \imp B)) \imp (B \imp ((A \imp (B \imp C)) \imp (A \imp C)))) in F by A2, Def38;

      then (B \imp ((A \imp (B \imp C)) \imp (A \imp C))) in F by A1, Def38;

      hence thesis by Th38;

    end;

    theorem :: AOFA_L00:43

    (B \imp ((B \imp A) \imp A)) in F

    proof

      

       A1: (((B \imp A) \imp (B \imp A)) \imp (B \imp ((B \imp A) \imp A))) in F by Th41;

      ((B \imp A) \imp (B \imp A)) in F by Th34;

      hence thesis by A1, Def38;

    end;

    theorem :: AOFA_L00:44

    

     Th43: (A \iff B) in F iff (A \imp B) in F & (B \imp A) in F

    proof

      ((A \iff B) \imp (A \imp B)) in F & ((A \iff B) \imp (B \imp A)) in F by Def38;

      hence (A \iff B) in F implies (A \imp B) in F & (B \imp A) in F by Def38;

      assume (A \imp B) in F & (B \imp A) in F;

      then ((A \imp B) \and (B \imp A)) in F & (((A \imp B) \and (B \imp A)) \imp (A \iff B)) in F by Def38, Th35;

      hence thesis by Def38;

    end;

    theorem :: AOFA_L00:45

    

     Th44: B in F implies (A \imp B) in F

    proof

      (B \imp (A \imp B)) in F by Def38;

      hence thesis by Def38;

    end;

    theorem :: AOFA_L00:46

    

     Th45: (A \imp B) in F & (B \imp C) in F implies (A \imp C) in F

    proof

      assume that

       A1: (A \imp B) in F and

       A2: (B \imp C) in F;

      ((A \imp B) \imp ((B \imp C) \imp (A \imp C))) in F by Th39;

      then ((B \imp C) \imp (A \imp C)) in F by A1, Def38;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:47

    

     Th46: (C \imp (B \imp A)) in F & B in F implies (C \imp A) in F

    proof

      assume that

       A1: (C \imp (B \imp A)) in F and

       A2: B in F;

      ((C \imp (B \imp A)) \imp (B \imp (C \imp A))) in F by Th41;

      then (B \imp (C \imp A)) in F by A1, Def38;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:48

    

     Th47: (((A \and B) \imp C) \imp (A \imp (B \imp C))) in F

    proof

      set qp = (B \imp (A \and B));

      set pr = (((A \and B) \imp C) \imp (B \imp C));

      

       A1: ((A \imp (qp \imp pr)) \imp ((A \imp qp) \imp (A \imp pr))) in F by Def38;

      

       A2: (A \imp (B \imp (A \and B))) in F by Def38;

      (A \imp ((B \imp (A \and B)) \imp (((A \and B) \imp C) \imp (B \imp C)))) in F by Th44, Th39;

      then ((A \imp qp) \imp (A \imp pr)) in F by A1, Def38;

      then

       A3: (A \imp (((A \and B) \imp C) \imp (B \imp C))) in F by A2, Def38;

      ((A \imp (((A \and B) \imp C) \imp (B \imp C))) \imp (((A \and B) \imp C) \imp (A \imp (B \imp C)))) in F by Th41;

      hence thesis by A3, Def38;

    end;

    theorem :: AOFA_L00:49

    

     Th48: ((A \imp (B \imp C)) \imp ((A \and B) \imp C)) in F

    proof

      

       A1: (((A \and B) \imp B) \imp ((B \imp C) \imp ((A \and B) \imp C))) in F by Th39;

      ((A \and B) \imp B) in F by Def38;

      then ((B \imp C) \imp ((A \and B) \imp C)) in F by A1, Def38;

      then

       A2: (A \imp ((B \imp C) \imp ((A \and B) \imp C))) in F by Th44;

      

       A3: ((A \imp ((A \and B) \imp C)) \imp ((A \and B) \imp (A \imp C))) in F by Th41;

      ((A \imp ((B \imp C) \imp ((A \and B) \imp C))) \imp ((A \imp (B \imp C)) \imp (A \imp ((A \and B) \imp C)))) in F by Def38;

      then ((A \imp (B \imp C)) \imp (A \imp ((A \and B) \imp C))) in F by A2, Def38;

      then

       A4: ((A \imp (B \imp C)) \imp ((A \and B) \imp (A \imp C))) in F by A3, Th45;

      

       A5: ((A \and B) \imp A) in F by Def38;

      (((A \and B) \imp (A \imp C)) \imp (((A \and B) \imp A) \imp ((A \and B) \imp C))) in F by Def38;

      then (((A \and B) \imp (A \imp C)) \imp ((A \and B) \imp C)) in F by A5, Th46;

      hence thesis by A4, Th45;

    end;

    theorem :: AOFA_L00:50

    

     Th49: ((C \imp A) \imp ((C \imp B) \imp (C \imp (A \and B)))) in F

    proof

      

       A1: ((C \imp (B \imp (A \and B))) \imp ((C \imp B) \imp (C \imp (A \and B)))) in F by Def38;

      (A \imp (B \imp (A \and B))) in F by Def38;

      then

       A2: (C \imp (A \imp (B \imp (A \and B)))) in F by Th44;

      ((C \imp (A \imp (B \imp (A \and B)))) \imp ((C \imp A) \imp (C \imp (B \imp (A \and B))))) in F by Def38;

      then ((C \imp A) \imp (C \imp (B \imp (A \and B)))) in F by A2, Def38;

      hence thesis by A1, Th45;

    end;

    theorem :: AOFA_L00:51

    

     Th50: ((A \and B) \imp (B \and A)) in F

    proof

      set P = (A \and B);

      

       A1: (P \imp B) in F by Def38;

      

       A2: (P \imp A) in F by Def38;

      ((P \imp B) \imp ((P \imp A) \imp (P \imp (B \and A)))) in F by Th49;

      then ((P \imp A) \imp (P \imp (B \and A))) in F by A1, Def38;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:52

    ((A \iff B) \imp (B \iff A)) in F

    proof

      

       A1: (((B \imp A) \and (A \imp B)) \imp (B \iff A)) in F by Def38;

      

       A2: (((A \imp B) \and (B \imp A)) \imp ((B \imp A) \and (A \imp B))) in F by Th50;

      ((((A \imp B) \and (B \imp A)) \imp ((B \imp A) \and (A \imp B))) \imp ((((B \imp A) \and (A \imp B)) \imp (B \iff A)) \imp (((A \imp B) \and (B \imp A)) \imp (B \iff A)))) in F by Th39;

      then ((((B \imp A) \and (A \imp B)) \imp (B \iff A)) \imp (((A \imp B) \and (B \imp A)) \imp (B \iff A))) in F by A2, Def38;

      then

       A3: (((A \imp B) \and (B \imp A)) \imp (B \iff A)) in F by A1, Def38;

      

       A4: (((A \iff B) \imp (A \imp B)) \imp (((A \iff B) \imp (B \imp A)) \imp ((A \iff B) \imp ((A \imp B) \and (B \imp A))))) in F by Th49;

      

       A5: ((A \iff B) \imp (A \imp B)) in F & ((A \iff B) \imp (B \imp A)) in F by Def38;

      then (((A \iff B) \imp (B \imp A)) \imp ((A \iff B) \imp ((A \imp B) \and (B \imp A)))) in F by A4, Def38;

      then

       A6: ((A \iff B) \imp ((A \imp B) \and (B \imp A))) in F by A5, Def38;

      (((A \iff B) \imp ((A \imp B) \and (B \imp A))) \imp ((((A \imp B) \and (B \imp A)) \imp (B \iff A)) \imp ((A \iff B) \imp (B \iff A)))) in F by Th39;

      then ((((A \imp B) \and (B \imp A)) \imp (B \iff A)) \imp ((A \iff B) \imp (B \iff A))) in F by A6, Def38;

      hence thesis by A3, Def38;

    end;

    theorem :: AOFA_L00:53

    

     Th52: ((A \or A) \imp A) in F

    proof

      

       A1: ((A \imp A) \imp ((A \imp A) \imp ((A \or A) \imp A))) in F by Def38;

      

       A2: (A \imp A) in F by Th34;

      then ((A \imp A) \imp ((A \or A) \imp A)) in F by A1, Def38;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:54

    

     Th53: (A \imp (A \and A)) in F

    proof

      

       A1: ((A \imp A) \imp ((A \imp A) \imp (A \imp (A \and A)))) in F by Th49;

      

       A2: (A \imp A) in F by Th34;

      then ((A \imp A) \imp (A \imp (A \and A))) in F by A1, Def38;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:55

    

     Th201: (A \imp B) in F & (A \imp C) in F implies (A \imp (B \and C)) in F

    proof

      assume

       Z0: (A \imp B) in F & (A \imp C) in F;

      ((A \imp B) \imp ((A \imp C) \imp (A \imp (B \and C)))) in F by Th49;

      then ((A \imp C) \imp (A \imp (B \and C))) in F by Z0, Def38;

      hence (A \imp (B \and C)) in F by Z0, Def38;

    end;

    theorem :: AOFA_L00:56

    

     Th54: (((A \and B) \or (A \and C)) \imp (A \and (B \or C))) in F

    proof

      ((A \and B) \imp B) in F & (B \imp (B \or C)) in F by Def38;

      then

       A1: ((A \and B) \imp (B \or C)) in F by Th45;

      ((A \and C) \imp C) in F & (C \imp (B \or C)) in F by Def38;

      then

       A2: ((A \and C) \imp (B \or C)) in F by Th45;

      set AB = (A \and B), AC = (A \and C);

      

       A3: ((AB \imp A) \imp ((AB \imp (B \or C)) \imp (AB \imp (A \and (B \or C))))) in F by Th49;

      (AB \imp A) in F by Def38;

      then ((AB \imp (B \or C)) \imp (AB \imp (A \and (B \or C)))) in F by A3, Def38;

      then

       A4: (AB \imp (A \and (B \or C))) in F by A1, Def38;

      

       A5: ((AC \imp A) \imp ((AC \imp (B \or C)) \imp (AC \imp (A \and (B \or C))))) in F by Th49;

      (AC \imp A) in F by Def38;

      then ((AC \imp (B \or C)) \imp (AC \imp (A \and (B \or C)))) in F by A5, Def38;

      then

       A6: (AC \imp (A \and (B \or C))) in F by A2, Def38;

      ((AB \imp (A \and (B \or C))) \imp ((AC \imp (A \and (B \or C))) \imp ((AB \or AC) \imp (A \and (B \or C))))) in F by Def38;

      then ((AC \imp (A \and (B \or C))) \imp ((AB \or AC) \imp (A \and (B \or C)))) in F by A4, Def38;

      hence thesis by A6, Def38;

    end;

    theorem :: AOFA_L00:57

    ((A \or (B \and C)) \imp ((A \or B) \and (A \or C))) in F

    proof

      set AB = (A \or B), AC = (A \or C), BC = (B \and C);

      set ABC = (A \or BC);

      

       A1: ((ABC \imp AB) \imp ((ABC \imp AC) \imp (ABC \imp (AB \and AC)))) in F by Th49;

      

       A2: ((A \imp AB) \imp ((BC \imp AB) \imp (ABC \imp AB))) in F by Def38;

      

       A3: ((A \imp AC) \imp ((BC \imp AC) \imp (ABC \imp AC))) in F by Def38;

      

       A4: (A \imp AC) in F & (A \imp AB) in F by Def38;

      (BC \imp C) in F & (BC \imp B) in F & (B \imp AB) in F & (C \imp AC) in F by Def38;

      then

       A5: (BC \imp AB) in F & (BC \imp AC) in F by Th45;

      ((BC \imp AB) \imp (ABC \imp AB)) in F & ((BC \imp AC) \imp (ABC \imp AC)) in F by A2, A3, A4, Def38;

      then

       A6: (ABC \imp AB) in F & (ABC \imp AC) in F by A5, Def38;

      then ((ABC \imp AC) \imp (ABC \imp (AB \and AC))) in F by A1, Def38;

      hence thesis by A6, Def38;

    end;

    theorem :: AOFA_L00:58

    

     Th56: (A \imp (( \not A) \imp B)) in F

    proof

      (((A \and ( \not A)) \imp B) \imp (A \imp (( \not A) \imp B))) in F & ((A \and ( \not A)) \imp B) in F by Th47, Def38;

      hence thesis by Def38;

    end;

    theorem :: AOFA_L00:59

    

     Th57: ((A \imp B) \imp (( \not B) \imp ( \not A))) in F

    proof

      ((A \imp B) \imp ((A \imp ( \not B)) \imp ( \not A))) in F by Def38;

      then

       A1: ((A \imp ( \not B)) \imp ((A \imp B) \imp ( \not A))) in F by Th38;

      (( \not B) \imp (A \imp ( \not B))) in F by Def38;

      then (( \not B) \imp ((A \imp B) \imp ( \not A))) in F by A1, Th45;

      hence thesis by Th38;

    end;

    theorem :: AOFA_L00:60

    

     Th58: (A \imp B) in F iff (( \not B) \imp ( \not A)) in F

    proof

      ((( \not B) \imp ( \not A)) \imp (A \imp B)) in F & ((A \imp B) \imp (( \not B) \imp ( \not A))) in F by Def38, Th57;

      hence thesis by Def38;

    end;

    theorem :: AOFA_L00:61

    

     Th59: (A \imp B) in F & (C \imp D) in F implies ((A \or C) \imp (B \or D)) in F

    proof

      assume

       A1: (A \imp B) in F;

      assume

       A2: (C \imp D) in F;

      

       A3: ((A \imp (B \or D)) \imp ((C \imp (B \or D)) \imp ((A \or C) \imp (B \or D)))) in F by Def38;

      (B \imp (B \or D)) in F & (D \imp (B \or D)) in F by Def38;

      then

       A4: (A \imp (B \or D)) in F & (C \imp (B \or D)) in F by A1, A2, Th45;

      then ((C \imp (B \or D)) \imp ((A \or C) \imp (B \or D))) in F by A3, Def38;

      hence ((A \or C) \imp (B \or D)) in F by A4, Def38;

    end;

    theorem :: AOFA_L00:62

    

     Th60: ((A \imp B) \imp ((C \or A) \imp (C \or B))) in F

    proof

      (C \imp (C \or B)) in F & ((C \imp (C \or B)) \imp ((A \imp (C \or B)) \imp ((C \or A) \imp (C \or B)))) in F by Def38;

      then

       A1: ((A \imp (C \or B)) \imp ((C \or A) \imp (C \or B))) in F by Def38;

      ((A \imp B) \imp (A \imp B)) in F & (((A \imp B) \imp (A \imp B)) \imp (((A \imp B) \and A) \imp B)) in F by Th34, Th48;

      then (((A \imp B) \and A) \imp B) in F & (B \imp (C \or B)) in F by Def38;

      then (((A \imp B) \and A) \imp (C \or B)) in F & ((((A \imp B) \and A) \imp (C \or B)) \imp ((A \imp B) \imp (A \imp (C \or B)))) in F by Th45, Th47;

      then ((A \imp B) \imp (A \imp (C \or B))) in F by Def38;

      hence thesis by A1, Th45;

    end;

    theorem :: AOFA_L00:63

    (A \imp B) in F & (C \imp D) in F & (( \not B) \or ( \not D)) in F implies (( \not A) \or ( \not C)) in F

    proof

      assume

       A1: (A \imp B) in F;

      assume

       A2: (C \imp D) in F;

      assume

       A3: (( \not B) \or ( \not D)) in F;

      ((A \imp B) \imp (( \not B) \imp ( \not A))) in F & ((C \imp D) \imp (( \not D) \imp ( \not C))) in F by Th57;

      then (( \not B) \imp ( \not A)) in F & (( \not D) \imp ( \not C)) in F by A1, A2, Def38;

      then ((( \not B) \or ( \not D)) \imp (( \not A) \or ( \not C))) in F by Th59;

      hence (( \not A) \or ( \not C)) in F by A3, Def38;

    end;

    theorem :: AOFA_L00:64

    

     Th62: ((A \or B) \imp (( \not A) \imp B)) in F

    proof

      

       A1: (A \imp (( \not A) \imp B)) in F by Th56;

      

       A2: (B \imp (( \not A) \imp B)) in F by Def38;

      ((A \imp (( \not A) \imp B)) \imp ((B \imp (( \not A) \imp B)) \imp ((A \or B) \imp (( \not A) \imp B)))) in F by Def38;

      then ((B \imp (( \not A) \imp B)) \imp ((A \or B) \imp (( \not A) \imp B))) in F by A1, Def38;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:65

    ((A \or B) \imp (( \not B) \imp A)) in F

    proof

      ((A \or B) \imp (B \or A)) in F & ((B \or A) \imp (( \not B) \imp A)) in F by Th36, Th62;

      hence ((A \or B) \imp (( \not B) \imp A)) in F by Th45;

    end;

    theorem :: AOFA_L00:66

    

     Th64: (A \imp ( \not ( \not A))) in F

    proof

      

       A1: ((A \imp ((( \not A) \imp A) \imp ( \not ( \not A)))) \imp ((A \imp (( \not A) \imp A)) \imp (A \imp ( \not ( \not A))))) in F by Def38;

      

       A2: (((( \not A) \imp A) \imp ((( \not A) \imp ( \not A)) \imp ( \not ( \not A)))) \imp (((( \not A) \imp A) \imp (( \not A) \imp ( \not A))) \imp ((( \not A) \imp A) \imp ( \not ( \not A))))) in F by Def38;

      ((( \not A) \imp A) \imp ((( \not A) \imp ( \not A)) \imp ( \not ( \not A)))) in F by Def38;

      then

       A3: (((( \not A) \imp A) \imp (( \not A) \imp ( \not A))) \imp ((( \not A) \imp A) \imp ( \not ( \not A)))) in F by A2, Def38;

      ((( \not A) \imp A) \imp (( \not A) \imp ( \not A))) in F by Th34, Th44;

      then ((( \not A) \imp A) \imp ( \not ( \not A))) in F by A3, Def38;

      then (A \imp ((( \not A) \imp A) \imp ( \not ( \not A)))) in F by Th44;

      then

       A4: ((A \imp (( \not A) \imp A)) \imp (A \imp ( \not ( \not A)))) in F by A1, Def38;

      (A \imp (( \not A) \imp A)) in F by Def38;

      hence thesis by A4, Def38;

    end;

    theorem :: AOFA_L00:67

    

     Th65: (( \not ( \not A)) \imp A) in F

    proof

      ((( \not A) \imp ( \not ( \not ( \not A)))) \imp (( \not ( \not A)) \imp A)) in F & (( \not A) \imp ( \not ( \not ( \not A)))) in F by Def38, Th64;

      hence thesis by Def38;

    end;

    theorem :: AOFA_L00:68

    

     Th66: (A \iff ( \not ( \not A))) in F

    proof

      

       A1: (((A \imp ( \not ( \not A))) \and (( \not ( \not A)) \imp A)) \imp (A \iff ( \not ( \not A)))) in F by Def38;

      (A \imp ( \not ( \not A))) in F & (( \not ( \not A)) \imp A) in F by Th64, Th65;

      then ((A \imp ( \not ( \not A))) \and (( \not ( \not A)) \imp A)) in F by Th35;

      hence thesis by A1, Def38;

    end;

    theorem :: AOFA_L00:69

    

     Th67: (A \imp ( \not B)) in F iff (B \imp ( \not A)) in F

    proof

      

       A1: (A \imp ( \not B)) in F iff (( \not ( \not B)) \imp ( \not A)) in F by Th58;

      

       A2: (B \imp ( \not A)) in F iff (( \not ( \not A)) \imp ( \not B)) in F by Th58;

      (B \imp ( \not ( \not B))) in F & (A \imp ( \not ( \not A))) in F by Th64;

      hence thesis by A1, A2, Th45;

    end;

    theorem :: AOFA_L00:70

    

     Th68: (( \not A) \imp B) in F iff (( \not B) \imp A) in F

    proof

      

       A1: (( \not A) \imp B) in F iff (( \not B) \imp ( \not ( \not A))) in F by Th58;

      

       A2: (( \not B) \imp A) in F iff (( \not A) \imp ( \not ( \not B))) in F by Th58;

      (( \not ( \not A)) \imp A) in F & (( \not ( \not B)) \imp B) in F by Th65;

      hence thesis by A1, A2, Th45;

    end;

    theorem :: AOFA_L00:71

    

     Th69: (A \imp (B \imp C)) in F & (C \imp D) in F implies (A \imp (B \imp D)) in F

    proof

      assume

       A1: (A \imp (B \imp C)) in F & (C \imp D) in F;

      ((A \imp (B \imp C)) \imp ((A \and B) \imp C)) in F by Th48;

      then ((A \and B) \imp C) in F by A1, Def38;

      then ((A \and B) \imp D) in F & (((A \and B) \imp D) \imp (A \imp (B \imp D))) in F by A1, Th45, Th47;

      hence thesis by Def38;

    end;

    theorem :: AOFA_L00:72

    

     Th70: (( \not (A \and B)) \imp (( \not A) \or ( \not B))) in F

    proof

      (( \not A) \imp (( \not A) \or ( \not B))) in F & (( \not B) \imp (( \not A) \or ( \not B))) in F by Def38;

      then (( \not (( \not A) \or ( \not B))) \imp ( \not ( \not A))) in F & (( \not ( \not A)) \imp A) in F & (( \not (( \not A) \or ( \not B))) \imp ( \not ( \not B))) in F & (( \not ( \not B)) \imp B) in F by Th58, Th65;

      then

       A1: (( \not (( \not A) \or ( \not B))) \imp A) in F & (( \not (( \not A) \or ( \not B))) \imp B) in F by Th45;

      ((( \not (( \not A) \or ( \not B))) \imp A) \imp ((( \not (( \not A) \or ( \not B))) \imp B) \imp (( \not (( \not A) \or ( \not B))) \imp (A \and B)))) in F by Th49;

      then ((( \not (( \not A) \or ( \not B))) \imp B) \imp (( \not (( \not A) \or ( \not B))) \imp (A \and B))) in F by A1, Def38;

      then (( \not (( \not A) \or ( \not B))) \imp (A \and B)) in F by A1, Def38;

      then (( \not (A \and B)) \imp ( \not ( \not (( \not A) \or ( \not B))))) in F & (( \not ( \not (( \not A) \or ( \not B)))) \imp (( \not A) \or ( \not B))) in F by Th58, Th65;

      hence thesis by Th45;

    end;

    theorem :: AOFA_L00:73

    

     Th71: (( \not (A \or B)) \imp (( \not A) \and ( \not B))) in F

    proof

      (A \imp (A \or B)) in F & (B \imp (A \or B)) in F by Def38;

      then

       A1: (( \not (A \or B)) \imp ( \not A)) in F & (( \not (A \or B)) \imp ( \not B)) in F by Th58;

      ((( \not (A \or B)) \imp ( \not A)) \imp ((( \not (A \or B)) \imp ( \not B)) \imp (( \not (A \or B)) \imp (( \not A) \and ( \not B))))) in F by Th49;

      then ((( \not (A \or B)) \imp ( \not B)) \imp (( \not (A \or B)) \imp (( \not A) \and ( \not B)))) in F by A1, Def38;

      hence thesis by A1, Def38;

    end;

    theorem :: AOFA_L00:74

    

     Th72: (A \imp B) in F & (C \imp D) in F implies ((A \and C) \imp (B \and D)) in F

    proof

      assume

       A1: (A \imp B) in F;

      assume

       A2: (C \imp D) in F;

      

       A3: (((A \and C) \imp B) \imp (((A \and C) \imp D) \imp ((A \and C) \imp (B \and D)))) in F by Th49;

      ((A \and C) \imp A) in F & ((A \and C) \imp C) in F by Def38;

      then

       A4: ((A \and C) \imp B) in F & ((A \and C) \imp D) in F by A1, A2, Th45;

      then (((A \and C) \imp D) \imp ((A \and C) \imp (B \and D))) in F by A3, Def38;

      hence ((A \and C) \imp (B \and D)) in F by A4, Def38;

    end;

    theorem :: AOFA_L00:75

    

     Th73: ((( \not A) \or ( \not B)) \imp ( \not (A \and B))) in F

    proof

      ((A \and B) \imp A) in F & ((A \and B) \imp B) in F by Def38;

      then

       A1: (( \not A) \imp ( \not (A \and B))) in F & (( \not B) \imp ( \not (A \and B))) in F by Th58;

      ((( \not A) \imp ( \not (A \and B))) \imp ((( \not B) \imp ( \not (A \and B))) \imp ((( \not A) \or ( \not B)) \imp ( \not (A \and B))))) in F by Def38;

      then ((( \not B) \imp ( \not (A \and B))) \imp ((( \not A) \or ( \not B)) \imp ( \not (A \and B)))) in F by A1, Def38;

      hence ((( \not A) \or ( \not B)) \imp ( \not (A \and B))) in F by A1, Def38;

    end;

    theorem :: AOFA_L00:76

    

     Th74: ((( \not A) \and ( \not B)) \imp ( \not (A \or B))) in F

    proof

      

       A1: ((( \not ( \not A)) \or ( \not ( \not B))) \imp ( \not (( \not A) \and ( \not B)))) in F by Th73;

      (A \imp ( \not ( \not A))) in F & (B \imp ( \not ( \not B))) in F by Th64;

      then ((A \or B) \imp (( \not ( \not A)) \or ( \not ( \not B)))) in F by Th59;

      then ((A \or B) \imp ( \not (( \not A) \and ( \not B)))) in F by A1, Th45;

      then ((( \not A) \and ( \not B)) \imp ( \not ( \not (( \not A) \and ( \not B))))) in F & (( \not ( \not (( \not A) \and ( \not B)))) \imp ( \not (A \or B))) in F by Th64, Th58;

      hence thesis by Th45;

    end;

    theorem :: AOFA_L00:77

    ((A \or (B \or C)) \imp ((A \or B) \or C)) in F

    proof

      

       A1: ((A \imp ((A \or B) \or C)) \imp (((B \or C) \imp ((A \or B) \or C)) \imp ((A \or (B \or C)) \imp ((A \or B) \or C)))) in F by Def38;

      (A \imp (A \or B)) in F & ((A \or B) \imp ((A \or B) \or C)) in F by Def38;

      then (A \imp ((A \or B) \or C)) in F by Th45;

      then

       A2: (((B \or C) \imp ((A \or B) \or C)) \imp ((A \or (B \or C)) \imp ((A \or B) \or C))) in F by A1, Def38;

      (B \imp (A \or B)) in F & (C \imp C) in F by Def38, Th34;

      then ((B \or C) \imp ((A \or B) \or C)) in F by Th59;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:78

    

     Th76: (((A \or B) \or C) \iff (A \or (B \or C))) in F

    proof

      

       A1: (((A \or B) \imp (A \or (B \or C))) \imp ((C \imp (A \or (B \or C))) \imp (((A \or B) \or C) \imp (A \or (B \or C))))) in F by Def38;

      (B \imp (B \or C)) in F & (A \imp A) in F by Def38, Th34;

      then ((A \or B) \imp (A \or (B \or C))) in F by Th59;

      then

       A2: ((C \imp (A \or (B \or C))) \imp (((A \or B) \or C) \imp (A \or (B \or C)))) in F by A1, Def38;

      (C \imp (B \or C)) in F & ((B \or C) \imp (A \or (B \or C))) in F by Def38;

      then (C \imp (A \or (B \or C))) in F by Th45;

      then

       A3: (((A \or B) \or C) \imp (A \or (B \or C))) in F by A2, Def38;

      

       A4: ((A \imp ((A \or B) \or C)) \imp (((B \or C) \imp ((A \or B) \or C)) \imp ((A \or (B \or C)) \imp ((A \or B) \or C)))) in F by Def38;

      (B \imp (A \or B)) in F & (C \imp C) in F by Def38, Th34;

      then ((B \or C) \imp ((A \or B) \or C)) in F by Th59;

      then

       A5: ((A \imp ((A \or B) \or C)) \imp ((A \or (B \or C)) \imp ((A \or B) \or C))) in F by A4, Th46;

      (A \imp (A \or B)) in F & ((A \or B) \imp ((A \or B) \or C)) in F by Def38;

      then (A \imp ((A \or B) \or C)) in F by Th45;

      then ((A \or (B \or C)) \imp ((A \or B) \or C)) in F by A5, Def38;

      hence thesis by A3, Th43;

    end;

    theorem :: AOFA_L00:79

    ((A \and (B \and C)) \imp ((A \and B) \and C)) in F

    proof

      

       A1: (((A \and (B \and C)) \imp (A \and B)) \imp (((A \and (B \and C)) \imp C) \imp ((A \and (B \and C)) \imp ((A \and B) \and C)))) in F by Th49;

      (A \imp A) in F & ((B \and C) \imp B) in F by Def38, Th34;

      then ((A \and (B \and C)) \imp (A \and B)) in F by Th72;

      then

       A2: (((A \and (B \and C)) \imp C) \imp ((A \and (B \and C)) \imp ((A \and B) \and C))) in F by A1, Def38;

      ((A \and (B \and C)) \imp (B \and C)) in F & ((B \and C) \imp C) in F by Def38;

      then ((A \and (B \and C)) \imp C) in F by Th45;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:80

    

     Th78: (((A \and B) \and C) \iff (A \and (B \and C))) in F

    proof

      

       A1: ((((A \and B) \and C) \imp A) \imp ((((A \and B) \and C) \imp (B \and C)) \imp (((A \and B) \and C) \imp (A \and (B \and C))))) in F by Th49;

      ((A \and B) \imp A) in F & (((A \and B) \and C) \imp (A \and B)) in F by Def38;

      then (((A \and B) \and C) \imp A) in F by Th45;

      then

       A2: ((((A \and B) \and C) \imp (B \and C)) \imp (((A \and B) \and C) \imp (A \and (B \and C)))) in F by A1, Def38;

      ((A \and B) \imp B) in F & (C \imp C) in F by Def38, Th34;

      then (((A \and B) \and C) \imp (B \and C)) in F by Th72;

      then

       A3: (((A \and B) \and C) \imp (A \and (B \and C))) in F by A2, Def38;

      

       A4: (((A \and (B \and C)) \imp (A \and B)) \imp (((A \and (B \and C)) \imp C) \imp ((A \and (B \and C)) \imp ((A \and B) \and C)))) in F by Th49;

      ((B \and C) \imp B) in F & (A \imp A) in F by Def38, Th34;

      then ((A \and (B \and C)) \imp (A \and B)) in F by Th72;

      then

       A5: (((A \and (B \and C)) \imp C) \imp ((A \and (B \and C)) \imp ((A \and B) \and C))) in F by A4, Def38;

      ((B \and C) \imp C) in F & ((A \and (B \and C)) \imp (B \and C)) in F by Def38;

      then ((A \and (B \and C)) \imp C) in F by Th45;

      then ((A \and (B \and C)) \imp ((A \and B) \and C)) in F by A5, Def38;

      hence thesis by A3, Th43;

    end;

    theorem :: AOFA_L00:81

    

     Th79: ((C \or (A \imp B)) \imp ((C \or A) \imp (C \or B))) in F

    proof

      

       A1: ((C \imp ((C \or A) \imp (C \or B))) \imp (((A \imp B) \imp ((C \or A) \imp (C \or B))) \imp ((C \or (A \imp B)) \imp ((C \or A) \imp (C \or B))))) in F by Def38;

      (C \imp (C \or B)) in F by Def38;

      then ((C \or A) \imp (C \imp (C \or B))) in F & (((C \or A) \imp (C \imp (C \or B))) \imp (C \imp ((C \or A) \imp (C \or B)))) in F by Th44, Th41;

      then (C \imp ((C \or A) \imp (C \or B))) in F by Def38;

      then

       A2: (((A \imp B) \imp ((C \or A) \imp (C \or B))) \imp ((C \or (A \imp B)) \imp ((C \or A) \imp (C \or B)))) in F by A1, Def38;

      ((A \imp B) \imp ((C \or A) \imp (C \or B))) in F by Th60;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:82

    

     Th80: (((A \or B) \and (A \or C)) \imp (A \or (B \and C))) in F

    proof

      (B \imp (C \imp (B \and C))) in F & (A \imp A) in F by Def38, Th34;

      then ((A \or B) \imp (A \or (C \imp (B \and C)))) in F & ((A \or (C \imp (B \and C))) \imp ((A \or C) \imp (A \or (B \and C)))) in F by Th59, Th79;

      then

       A1: ((A \or B) \imp ((A \or C) \imp (A \or (B \and C)))) in F by Th45;

      (((A \or B) \imp ((A \or C) \imp (A \or (B \and C)))) \imp (((A \or B) \and (A \or C)) \imp (A \or (B \and C)))) in F by Th48;

      hence thesis by A1, Def38;

    end;

    theorem :: AOFA_L00:83

    

     Th81: ((A \and (B \or C)) \imp ((A \and B) \or (A \and C))) in F

    proof

      set AB = (A \and B), AC = (A \and C), BC = (B \or C);

      set ABC = (A \and BC);

      

       A1: (((( \not A) \or ( \not B)) \and (( \not A) \or ( \not C))) \imp (( \not A) \or (( \not B) \and ( \not C)))) in F by Th80;

      (( \not (A \and B)) \imp (( \not A) \or ( \not B))) in F & (( \not (A \and C)) \imp (( \not A) \or ( \not C))) in F by Th70;

      then

       A2: ((( \not (A \and B)) \and ( \not (A \and C))) \imp ((( \not A) \or ( \not B)) \and (( \not A) \or ( \not C)))) in F by Th72;

      (( \not ((A \and B) \or (A \and C))) \imp (( \not (A \and B)) \and ( \not (A \and C)))) in F by Th71;

      then (( \not ((A \and B) \or (A \and C))) \imp ((( \not A) \or ( \not B)) \and (( \not A) \or ( \not C)))) in F by A2, Th45;

      then

       A3: (( \not ((A \and B) \or (A \and C))) \imp (( \not A) \or (( \not B) \and ( \not C)))) in F by A1, Th45;

      (( \not A) \imp ( \not A)) in F & ((( \not B) \and ( \not C)) \imp ( \not (B \or C))) in F by Th34, Th74;

      then ((( \not A) \or (( \not B) \and ( \not C))) \imp (( \not A) \or ( \not (B \or C)))) in F & ((( \not A) \or ( \not (B \or C))) \imp ( \not (A \and (B \or C)))) in F by Th73, Th59;

      then ((( \not A) \or (( \not B) \and ( \not C))) \imp ( \not (A \and (B \or C)))) in F by Th45;

      then (( \not ((A \and B) \or (A \and C))) \imp ( \not (A \and (B \or C)))) in F by A3, Th45;

      hence thesis by Th58;

    end;

    theorem :: AOFA_L00:84

    

     Th82: ((A \imp B) \imp (( \not A) \or B)) in F

    proof

      

       A1: ((A \imp B) \imp (A \imp B)) in F by Th34;

      (((A \imp B) \imp (A \imp B)) \imp (((A \imp B) \and A) \imp B)) in F by Th48;

      then (((A \imp B) \and A) \imp B) in F & (( \not A) \imp ( \not A)) in F by A1, Def38, Th34;

      then

       A2: ((( \not A) \or ((A \imp B) \and A)) \imp (( \not A) \or B)) in F by Th59;

      (((( \not A) \or (A \imp B)) \and (( \not A) \or A)) \imp (( \not A) \or ((A \imp B) \and A))) in F by Th80;

      then

       A3: (((( \not A) \or (A \imp B)) \and (( \not A) \or A)) \imp (( \not A) \or B)) in F by A2, Th45;

      (((( \not A) \or A) \and (( \not A) \or (A \imp B))) \imp ((( \not A) \or (A \imp B)) \and (( \not A) \or A))) in F by Th50;

      then

       A4: (((( \not A) \or A) \and (( \not A) \or (A \imp B))) \imp (( \not A) \or B)) in F by A3, Th45;

      ((((( \not A) \or A) \and (( \not A) \or (A \imp B))) \imp (( \not A) \or B)) \imp ((( \not A) \or A) \imp ((( \not A) \or (A \imp B)) \imp (( \not A) \or B)))) in F by Th47;

      then

       A5: ((( \not A) \or A) \imp ((( \not A) \or (A \imp B)) \imp (( \not A) \or B))) in F by A4, Def38;

      (A \or ( \not A)) in F & ((A \or ( \not A)) \imp (( \not A) \or A)) in F by Def38, Th36;

      then (( \not A) \or A) in F by Def38;

      then

       A6: ((( \not A) \or (A \imp B)) \imp (( \not A) \or B)) in F by A5, Def38;

      ((A \imp B) \imp (( \not A) \or (A \imp B))) in F by Def38;

      hence thesis by A6, Th45;

    end;

    theorem :: AOFA_L00:85

    ((A \imp B) \imp ( \not (A \and ( \not B)))) in F

    proof

      

       A1: ((A \imp B) \imp (( \not A) \or B)) in F by Th82;

      (( \not A) \imp ( \not A)) in F & (B \imp ( \not ( \not B))) in F by Th64, Th34;

      then ((( \not A) \or B) \imp (( \not A) \or ( \not ( \not B)))) in F by Th59;

      then

       A2: ((A \imp B) \imp (( \not A) \or ( \not ( \not B)))) in F by A1, Th45;

      ((( \not A) \or ( \not ( \not B))) \imp ( \not (A \and ( \not B)))) in F by Th73;

      hence thesis by A2, Th45;

    end;

    theorem :: AOFA_L00:86

    

     Th84: ((B \or (( \not C) \and C)) \imp B) in F

    proof

      ((C \and ( \not C)) \imp B) in F & ((( \not C) \and C) \imp (C \and ( \not C))) in F by Th50, Def38;

      then ((( \not C) \and C) \imp B) in F & (B \imp B) in F by Th34, Th45;

      then ((B \or (( \not C) \and C)) \imp (B \or B)) in F & ((B \or B) \imp B) in F by Th59, Th52;

      hence ((B \or (( \not C) \and C)) \imp B) in F by Th45;

    end;

    theorem :: AOFA_L00:87

    

     Th85: ((B \or (C \and ( \not C))) \imp B) in F

    proof

      ((C \and ( \not C)) \imp B) in F & (B \imp B) in F by Th34, Def38;

      then ((B \or (C \and ( \not C))) \imp (B \or B)) in F & ((B \or B) \imp B) in F by Th59, Th52;

      hence ((B \or (C \and ( \not C))) \imp B) in F by Th45;

    end;

    theorem :: AOFA_L00:88

    

     Th86: ((A \iff B) \imp ((A \and B) \or (( \not A) \and ( \not B)))) in F

    proof

      

       A1: ((A \iff B) \imp (A \imp B)) in F & ((A \iff B) \imp (B \imp A)) in F by Def38;

      ((A \imp B) \imp (( \not A) \or B)) in F & ((B \imp A) \imp (( \not B) \or A)) in F by Th82;

      then

       A2: ((A \iff B) \imp (( \not A) \or B)) in F & ((A \iff B) \imp (( \not B) \or A)) in F by A1, Th45;

      (((A \iff B) \imp (( \not A) \or B)) \imp (((A \iff B) \imp (( \not B) \or A)) \imp ((A \iff B) \imp ((( \not A) \or B) \and (( \not B) \or A))))) in F by Th49;

      then (((A \iff B) \imp (( \not B) \or A)) \imp ((A \iff B) \imp ((( \not A) \or B) \and (( \not B) \or A)))) in F by A2, Def38;

      then

       A3: ((A \iff B) \imp ((( \not A) \or B) \and (( \not B) \or A))) in F by A2, Def38;

      

       A4: (((( \not A) \or B) \and (( \not B) \or A)) \imp (((( \not A) \or B) \and ( \not B)) \or ((( \not A) \or B) \and A))) in F by Th81;

      (((( \not A) \or B) \and ( \not B)) \imp (( \not B) \and (( \not A) \or B))) in F & ((( \not B) \and (( \not A) \or B)) \imp ((( \not B) \and ( \not A)) \or (( \not B) \and B))) in F by Th50, Th81;

      then (((( \not A) \or B) \and ( \not B)) \imp ((( \not B) \and ( \not A)) \or (( \not B) \and B))) in F & (((( \not B) \and ( \not A)) \or (( \not B) \and B)) \imp (( \not B) \and ( \not A))) in F by Th45, Th84;

      then

       A5: (((( \not A) \or B) \and ( \not B)) \imp (( \not B) \and ( \not A))) in F by Th45;

      (((( \not A) \or B) \and A) \imp (A \and (( \not A) \or B))) in F & ((A \and (( \not A) \or B)) \imp ((A \and ( \not A)) \or (A \and B))) in F by Th50, Th81;

      then (((( \not A) \or B) \and A) \imp ((A \and ( \not A)) \or (A \and B))) in F & (((A \and ( \not A)) \or (A \and B)) \imp ((A \and B) \or (A \and ( \not A)))) in F by Th36, Th45;

      then (((( \not A) \or B) \and A) \imp ((A \and B) \or (A \and ( \not A)))) in F & (((A \and B) \or (A \and ( \not A))) \imp (A \and B)) in F by Th45, Th85;

      then (((( \not A) \or B) \and A) \imp (A \and B)) in F by Th45;

      then ((((( \not A) \or B) \and ( \not B)) \or ((( \not A) \or B) \and A)) \imp ((( \not B) \and ( \not A)) \or (A \and B))) in F by A5, Th59;

      then (((( \not A) \or B) \and (( \not B) \or A)) \imp ((( \not B) \and ( \not A)) \or (A \and B))) in F by A4, Th45;

      then

       A6: ((A \iff B) \imp ((( \not B) \and ( \not A)) \or (A \and B))) in F by A3, Th45;

      ((( \not B) \and ( \not A)) \imp (( \not A) \and ( \not B))) in F & ((A \and B) \imp (A \and B)) in F by Th34, Th50;

      then (((( \not B) \and ( \not A)) \or (A \and B)) \imp ((( \not A) \and ( \not B)) \or (A \and B))) in F & (((( \not A) \and ( \not B)) \or (A \and B)) \imp ((A \and B) \or (( \not A) \and ( \not B)))) in F by Th36, Th59;

      then (((( \not B) \and ( \not A)) \or (A \and B)) \imp ((A \and B) \or (( \not A) \and ( \not B)))) in F by Th45;

      hence thesis by A6, Th45;

    end;

    theorem :: AOFA_L00:89

    ((A \iff B) \imp ((A \or ( \not B)) \and (( \not A) \or B))) in F

    proof

      ((( \not A) \and (A \or ( \not B))) \imp ((A \or ( \not B)) \and ( \not A))) in F & ((B \and (A \or ( \not B))) \imp ((A \or ( \not B)) \and B)) in F by Th50;

      then ((((A \or ( \not B)) \and ( \not A)) \or ((A \or ( \not B)) \and B)) \imp ((A \or ( \not B)) \and (( \not A) \or B))) in F & (((( \not A) \and (A \or ( \not B))) \or (B \and (A \or ( \not B)))) \imp (((A \or ( \not B)) \and ( \not A)) \or ((A \or ( \not B)) \and B))) in F by Th54, Th59;

      then

       A1: (((( \not A) \and (A \or ( \not B))) \or (B \and (A \or ( \not B)))) \imp ((A \or ( \not B)) \and (( \not A) \or B))) in F by Th45;

      (((( \not A) \and A) \or (( \not A) \and ( \not B))) \imp (( \not A) \and (A \or ( \not B)))) in F & (((B \and A) \or (B \and ( \not B))) \imp (B \and (A \or ( \not B)))) in F & ((( \not A) \and ( \not B)) \imp ((( \not A) \and A) \or (( \not A) \and ( \not B)))) in F & ((B \and A) \imp ((B \and A) \or (B \and ( \not B)))) in F by Def38, Th54;

      then ((( \not A) \and ( \not B)) \imp (( \not A) \and (A \or ( \not B)))) in F & ((B \and A) \imp (B \and (A \or ( \not B)))) in F by Th45;

      then (((( \not A) \and ( \not B)) \or (B \and A)) \imp ((( \not A) \and (A \or ( \not B))) \or (B \and (A \or ( \not B))))) in F by Th59;

      then

       A2: (((( \not A) \and ( \not B)) \or (B \and A)) \imp ((A \or ( \not B)) \and (( \not A) \or B))) in F by A1, Th45;

      ((A \and B) \imp (B \and A)) in F & ((( \not A) \and ( \not B)) \imp (( \not A) \and ( \not B))) in F by Th34, Th50;

      then (((( \not A) \and ( \not B)) \or (A \and B)) \imp ((( \not A) \and ( \not B)) \or (B \and A))) in F & (((A \and B) \or (( \not A) \and ( \not B))) \imp ((( \not A) \and ( \not B)) \or (A \and B))) in F by Th36, Th59;

      then (((A \and B) \or (( \not A) \and ( \not B))) \imp ((( \not A) \and ( \not B)) \or (B \and A))) in F by Th45;

      then

       A3: (((A \and B) \or (( \not A) \and ( \not B))) \imp ((A \or ( \not B)) \and (( \not A) \or B))) in F by A2, Th45;

      ((A \iff B) \imp ((A \and B) \or (( \not A) \and ( \not B)))) in F by Th86;

      hence thesis by A3, Th45;

    end;

    theorem :: AOFA_L00:90

    ( \not (A \and ( \not A))) in F

    proof

      (( \not A) \imp ( \not A)) in F & (A \imp ( \not ( \not A))) in F by Th34, Th64;

      then ((( \not A) \and A) \imp (( \not A) \and ( \not ( \not A)))) in F & ((( \not A) \and ( \not ( \not A))) \imp ( \not (A \or ( \not A)))) in F by Th74, Th72;

      then ((( \not A) \and A) \imp ( \not (A \or ( \not A)))) in F by Th45;

      then (( \not ( \not (A \or ( \not A)))) \imp ( \not (( \not A) \and A))) in F & ((A \or ( \not A)) \imp ( \not ( \not (A \or ( \not A))))) in F by Th64, Th58;

      then ((A \or ( \not A)) \imp ( \not (( \not A) \and A))) in F & (A \or ( \not A)) in F by Th45, Def38;

      then

       A1: ( \not (( \not A) \and A)) in F by Def38;

      ((A \and ( \not A)) \imp (( \not A) \and A)) in F by Th50;

      then (( \not (( \not A) \and A)) \imp ( \not (A \and ( \not A)))) in F by Th58;

      hence thesis by Def38, A1;

    end;

    theorem :: AOFA_L00:91

    (A \iff A) in F

    proof

      

       A1: (((A \imp A) \and (A \imp A)) \imp (A \iff A)) in F by Def38;

      (A \imp A) in F by Th34;

      then ((A \imp A) \and (A \imp A)) in F by Th35;

      hence thesis by A1, Def38;

    end;

    theorem :: AOFA_L00:92

    

     Th90: (A \iff B) in F implies (B \iff A) in F

    proof

      assume

       A1: (A \iff B) in F;

      ((A \iff B) \imp (A \imp B)) in F & ((A \iff B) \imp (B \imp A)) in F by Def38;

      then (A \imp B) in F & (B \imp A) in F by A1, Def38;

      then

       A2: ((B \imp A) \and (A \imp B)) in F by Th35;

      (((B \imp A) \and (A \imp B)) \imp (B \iff A)) in F by Def38;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:93

    

     Th91: (A \iff B) in F & (B \iff C) in F implies (A \iff C) in F

    proof

      assume

       A1: (A \iff B) in F & (B \iff C) in F;

      ((A \iff B) \imp (A \imp B)) in F & ((A \iff B) \imp (B \imp A)) in F & ((B \iff C) \imp (B \imp C)) in F & ((B \iff C) \imp (C \imp B)) in F by Def38;

      then (A \imp B) in F & (B \imp A) in F & (C \imp B) in F & (B \imp C) in F by A1, Def38;

      then (A \imp C) in F & (C \imp A) in F by Th45;

      then

       A2: ((A \imp C) \and (C \imp A)) in F by Th35;

      (((A \imp C) \and (C \imp A)) \imp (A \iff C)) in F by Def38;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:94

    

     Th92: (A \iff B) in F & (B \imp C) in F implies (A \imp C) in F

    proof

      assume

       A1: (A \iff B) in F & (B \imp C) in F;

      ((A \iff B) \imp (A \imp B)) in F & ((A \iff B) \imp (B \imp A)) in F & ((B \iff C) \imp (B \imp C)) in F & ((B \iff C) \imp (C \imp B)) in F by Def38;

      then (A \imp B) in F by A1, Def38;

      hence thesis by A1, Th45;

    end;

    theorem :: AOFA_L00:95

    

     Th93: (A \imp B) in F & (B \iff C) in F implies (A \imp C) in F

    proof

      assume

       A1: (A \imp B) in F & (B \iff C) in F;

      ((A \iff B) \imp (A \imp B)) in F & ((A \iff B) \imp (B \imp A)) in F & ((B \iff C) \imp (B \imp C)) in F & ((B \iff C) \imp (C \imp B)) in F by Def38;

      then (B \imp C) in F by A1, Def38;

      hence thesis by A1, Th45;

    end;

    theorem :: AOFA_L00:96

    

     Th94: (A \iff B) in F iff (( \not A) \iff ( \not B)) in F

    proof

      hereby

        assume

         A1: (A \iff B) in F;

        ((A \iff B) \imp (A \imp B)) in F & ((A \iff B) \imp (B \imp A)) in F by Def38;

        then (A \imp B) in F & (B \imp A) in F & ((A \imp B) \imp (( \not B) \imp ( \not A))) in F & ((B \imp A) \imp (( \not A) \imp ( \not B))) in F by A1, Def38, Th57;

        then (( \not A) \imp ( \not B)) in F & (( \not B) \imp ( \not A)) in F by Def38;

        then ((( \not A) \imp ( \not B)) \and (( \not B) \imp ( \not A))) in F & (((( \not A) \imp ( \not B)) \and (( \not B) \imp ( \not A))) \imp (( \not A) \iff ( \not B))) in F by Def38, Th35;

        hence (( \not A) \iff ( \not B)) in F by Def38;

      end;

      assume

       A2: (( \not A) \iff ( \not B)) in F;

      ((( \not A) \iff ( \not B)) \imp (( \not A) \imp ( \not B))) in F & ((( \not A) \iff ( \not B)) \imp (( \not B) \imp ( \not A))) in F by Def38;

      then (( \not A) \imp ( \not B)) in F & (( \not B) \imp ( \not A)) in F & ((( \not A) \imp ( \not B)) \imp (B \imp A)) in F & ((( \not B) \imp ( \not A)) \imp (A \imp B)) in F by A2, Def38;

      then (A \imp B) in F & (B \imp A) in F by Def38;

      then ((A \imp B) \and (B \imp A)) in F & (((A \imp B) \and (B \imp A)) \imp (A \iff B)) in F by Def38, Th35;

      hence (A \iff B) in F by Def38;

    end;

    theorem :: AOFA_L00:97

    

     Th95: (A \iff B) in F iff (( \not ( \not A)) \iff B) in F

    proof

      (( \not ( \not A)) \imp A) in F & (A \imp ( \not ( \not A))) in F by Th64, Th65;

      then ((( \not ( \not A)) \imp A) \and (A \imp ( \not ( \not A)))) in F & (((( \not ( \not A)) \imp A) \and (A \imp ( \not ( \not A)))) \imp (( \not ( \not A)) \iff A)) in F by Th35, Def38;

      then

       A1: (( \not ( \not A)) \iff A) in F by Def38;

      then (A \iff ( \not ( \not A))) in F by Th90;

      hence thesis by A1, Th91;

    end;

    theorem :: AOFA_L00:98

    

     Th96: (A \imp (B \imp C)) in F & (D \imp B) in F implies (A \imp (D \imp C)) in F

    proof

      assume

       A1: (A \imp (B \imp C)) in F & (D \imp B) in F;

      ((A \imp (B \imp C)) \imp (B \imp (A \imp C))) in F by Th41;

      then (B \imp (A \imp C)) in F by A1, Def38;

      then

       A2: (D \imp (A \imp C)) in F by A1, Th45;

      ((D \imp (A \imp C)) \imp (A \imp (D \imp C))) in F by Th41;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:99

    

     Th97: (A \iff (B \and C)) in F & (C \iff D) in F implies (A \iff (B \and D)) in F

    proof

      assume

       A1: (A \iff (B \and C)) in F;

      then

       A2: ((B \and C) \iff A) in F by Th90;

      assume (C \iff D) in F;

      then (C \imp D) in F & (D \imp C) in F & (B \imp B) in F by Th43, Th34;

      then ((B \and C) \imp (B \and D)) in F & ((B \and D) \imp (B \and C)) in F by Th72;

      then (A \imp (B \and D)) in F & ((B \and D) \imp A) in F by A1, A2, Th92, Th93;

      hence (A \iff (B \and D)) in F by Th43;

    end;

    theorem :: AOFA_L00:100

    

     Th98: (A \iff (B \and C)) in F & (B \iff D) in F implies (A \iff (D \and C)) in F

    proof

      assume

       A1: (A \iff (B \and C)) in F;

      then

       A2: ((B \and C) \iff A) in F by Th90;

      assume (B \iff D) in F;

      then (B \imp D) in F & (D \imp B) in F & (C \imp C) in F by Th43, Th34;

      then ((B \and C) \imp (D \and C)) in F & ((D \and C) \imp (B \and C)) in F by Th72;

      then (A \imp (D \and C)) in F & ((D \and C) \imp A) in F by A1, A2, Th92, Th93;

      hence (A \iff (D \and C)) in F by Th43;

    end;

    theorem :: AOFA_L00:101

    

     Th99: (A \iff (B \or C)) in F & (C \iff D) in F implies (A \iff (B \or D)) in F

    proof

      assume

       A1: (A \iff (B \or C)) in F;

      then

       A2: ((B \or C) \iff A) in F by Th90;

      assume (C \iff D) in F;

      then (C \imp D) in F & (D \imp C) in F & (B \imp B) in F by Th43, Th34;

      then ((B \or C) \imp (B \or D)) in F & ((B \or D) \imp (B \or C)) in F by Th59;

      then (A \imp (B \or D)) in F & ((B \or D) \imp A) in F by A1, A2, Th92, Th93;

      hence (A \iff (B \or D)) in F by Th43;

    end;

    theorem :: AOFA_L00:102

    

     Th100: (A \iff (B \or C)) in F & (B \iff D) in F implies (A \iff (D \or C)) in F

    proof

      assume

       A1: (A \iff (B \or C)) in F;

      then

       A2: ((B \or C) \iff A) in F by Th90;

      assume (B \iff D) in F;

      then (B \imp D) in F & (D \imp B) in F & (C \imp C) in F by Th43, Th34;

      then ((B \or C) \imp (D \or C)) in F & ((D \or C) \imp (B \or C)) in F by Th59;

      then (A \imp (D \or C)) in F & ((D \or C) \imp A) in F by A1, A2, Th92, Th93;

      hence (A \iff (D \or C)) in F by Th43;

    end;

    theorem :: AOFA_L00:103

    

     Th101: (A \imp B) in F implies ((B \imp C) \imp (A \imp C)) in F

    proof

      ((A \imp B) \imp ((B \imp C) \imp (A \imp C))) in F by Th39;

      hence thesis by Def38;

    end;

    theorem :: AOFA_L00:104

    

     Th102: (A \imp B) in F implies ((C \imp A) \imp (C \imp B)) in F

    proof

      ((C \imp A) \imp ((A \imp B) \imp (C \imp B))) in F by Th39;

      then ((A \imp B) \imp ((C \imp A) \imp (C \imp B))) in F by Th38;

      hence thesis by Def38;

    end;

    theorem :: AOFA_L00:105

    

     Th103: (A \imp B) in F & (C \imp D) in F implies ((B \imp C) \imp (A \imp D)) in F

    proof

      assume (A \imp B) in F & (C \imp D) in F;

      then ((B \imp C) \imp (A \imp C)) in F & ((A \imp C) \imp (A \imp D)) in F by Th101, Th102;

      hence thesis by Th45;

    end;

    begin

    reserve J for non empty non void Signature,

T for non-empty MSAlgebra over J,

X for non empty-yielding GeneratorSet of T,

S1 for J -extension non empty non voidn PC-correct QC-correct QCLangSignature over ( Union X),

L for non-empty Language of (X extended_by ( {} ,the carrier of S1)), S1,

G for QC-theory of L,

A,B,C,D for Formula of L;

    reserve x,y,z for Element of ( Union X);

    reserve x0,y0,z0 for Element of ( Union (X extended_by ( {} ,the carrier of S1)));

    theorem :: AOFA_L00:106

    

     Th104: L is subst-correct implies (( \for (x,A)) \imp A) in G

    proof

      set Y = (X extended_by ( {} ,the carrier of S1));

      assume

       A1: L is subst-correct;

      consider a be object such that

       A2: a in ( dom X) & x in (X . a) by CARD_5: 2;

      J is Subsignature of S1 by Def2;

      then

       A3: the carrier of J c= the carrier of S1 & ( dom Y) = the carrier of S1 & ( dom X) = the carrier of J by PARTFUN1:def 2, INSTALG1: 10;

      then

      reconsider a as SortSymbol of S1 by A2;

      

       A4: x in (Y . a) by A2, A3, Th1;

      then

      reconsider x0 = x as Element of ( Union Y) by A3, CARD_5: 2;

      X c= the Sorts of T by PBOOLE:def 18;

      then (X . a) c= (the Sorts of T . a) = (the Sorts of L . a) by A2, Th16;

      then

      reconsider t = x as Element of (the Sorts of L . a) by A2;

      Y is ManySortedSubset of the Sorts of L by Th23;

      

      then (A / (x0,t)) = (A / (x0,x0)) by A4, Th14

      .= A by A4, A1;

      hence thesis by A2, A4, Def39;

    end;

    theorem :: AOFA_L00:107

    

     Th105: (( \ex (x,A)) \iff ( \not ( \for (x,( \not A))))) in G

    proof

      (( \not ( \ex (x,A))) \iff ( \for (x,( \not A)))) in G by Def39;

      then (( \not ( \not ( \ex (x,A)))) \iff ( \not ( \for (x,( \not A))))) in G by Th94;

      hence (( \ex (x,A)) \iff ( \not ( \for (x,( \not A))))) in G by Th95;

    end;

    theorem :: AOFA_L00:108

    

     Th106: (( \for (x,A)) \iff ( \not ( \ex (x,( \not A))))) in G

    proof

      (( \ex (x,( \not A))) \iff ( \not ( \for (x,A)))) in G by Def39;

      then (( \not ( \for (x,A))) \iff ( \ex (x,( \not A)))) in G by Th90;

      then (( \not ( \not ( \for (x,A)))) \iff ( \not ( \ex (x,( \not A))))) in G by Th94;

      hence (( \for (x,A)) \iff ( \not ( \ex (x,( \not A))))) in G by Th95;

    end;

    theorem :: AOFA_L00:109

    

     Th107: L is subst-correct implies (( \for (x,(A \imp B))) \imp (( \for (x,A)) \imp B)) in G

    proof

      set Y = (X extended_by ( {} ,the carrier of S1));

      consider a be object such that

       A1: a in ( dom X) & x in (X . a) by CARD_5: 2;

      J is Subsignature of S1 by Def2;

      then

       A2: the carrier of J c= the carrier of S1 & ( dom Y) = the carrier of S1 & ( dom X) = the carrier of J by PARTFUN1:def 2, INSTALG1: 10;

      reconsider a as SortSymbol of J by A1;

      

       A3: x in (Y . a) by A1, A2, Th1;

      

       A4: (X . a) is Subset of (the Sorts of T . a) by Th13;

      

       A5: Y is ManySortedSubset of the Sorts of L by Th23;

      then x in ( Union X) = ( Union Y) c= ( Union the Sorts of L) by Th24, MSAFREE4: 1, PBOOLE:def 18;

      then

      reconsider t = x as Element of ( Union the Sorts of L);

      

       A6: (the Sorts of T . a) = (the Sorts of L . a) by Th16;

      reconsider x0 = x as Element of ( Union Y) by Th24;

      assume L is subst-correct;

      then (A / (x0,x0)) = A & ((A \imp B) / (x0,x0)) = (A \imp B) by A1, A2, A3;

      then (A / (x0,t)) = A & ((A \imp B) / (x0,t)) = (A \imp B) by A5, A1, A2, A3, Th14;

      then (( \for (x,(A \imp B))) \imp (A \imp B)) in G & (( \for (x,A)) \imp A) in G by A6, A1, A4, A3, Def39;

      hence (( \for (x,(A \imp B))) \imp (( \for (x,A)) \imp B)) in G by Th96;

    end;

    theorem :: AOFA_L00:110

    

     Th108: for a be SortSymbol of J st x in (X . a) & x nin (( vf A) . a) & ( \for (x,(A \imp B))) in G holds (A \imp ( \for (x,B))) in G

    proof

      let a be SortSymbol of J;

      assume

       A1: x in (X . a) & x nin (( vf A) . a) & ( \for (x,(A \imp B))) in G;

      then (( \for (x,(A \imp B))) \imp (A \imp ( \for (x,B)))) in G by Def39;

      hence thesis by Def38, A1;

    end;

    theorem :: AOFA_L00:111

    

     Th109: L is subst-correct vf-qc-correct implies (( \for (x,(A \imp B))) \imp (( \for (x,A)) \imp ( \for (x,B)))) in G

    proof

      set Y = (X extended_by ( {} ,the carrier of S1));

      consider a be object such that

       A1: a in ( dom X) & x in (X . a) by CARD_5: 2;

      J is Subsignature of S1 by Def2;

      then ( dom X) = the carrier of J c= the carrier of S1 = ( dom Y) by INSTALG1: 10, PARTFUN1:def 2;

      then

      reconsider a as SortSymbol of S1 by A1;

      assume

       A2: L is subst-correct vf-qc-correct;

      then (( \for (x,(A \imp B))) \imp (( \for (x,A)) \imp B)) in G by Th107;

      then

       A3: ( \for (x,(( \for (x,(A \imp B))) \imp (( \for (x,A)) \imp B)))) in G by Def39;

      

       A4: ( vf ( \for (x,(A \imp B)))) = (( vf (A \imp B)) (\) (a -singleton x)) & x in {x} by A1, A2, TARSKI:def 1;

      

      then (( vf ( \for (x,(A \imp B)))) . a) = ((( vf (A \imp B)) . a) \ ((a -singleton x) . a)) by PBOOLE:def 6

      .= ((( vf (A \imp B)) . a) \ {x}) by AOFA_A00: 6;

      then x nin (( vf ( \for (x,(A \imp B)))) . a) by A4, XBOOLE_0:def 5;

      then

       A5: (( \for (x,(A \imp B))) \imp ( \for (x,(( \for (x,A)) \imp B)))) in G by A1, A3, Th108;

      

       A6: ( vf ( \for (x,A))) = (( vf A) (\) (a -singleton x)) & x in {x} by A1, A2, TARSKI:def 1;

      

      then (( vf ( \for (x,A))) . a) = ((( vf A) . a) \ ((a -singleton x) . a)) by PBOOLE:def 6

      .= ((( vf A) . a) \ {x}) by AOFA_A00: 6;

      then x nin (( vf ( \for (x,A))) . a) by A6, XBOOLE_0:def 5;

      then (( \for (x,(( \for (x,A)) \imp B))) \imp (( \for (x,A)) \imp ( \for (x,B)))) in G by A1, Def39;

      hence thesis by A5, Th45;

    end;

    theorem :: AOFA_L00:112

    

     Th110: L is subst-correct implies for a be SortSymbol of J st x in (X . a) & y in (X . a) & x0 = x & y0 = y holds ((A / (x0,y0)) \imp ( \ex (x,A))) in G

    proof

      set Y = (X extended_by ( {} ,the carrier of S1));

      assume

       A1: L is subst-correct;

      let a be SortSymbol of J such that

       A2: x in (X . a) & y in (X . a) & x0 = x & y0 = y;

      J is Subsignature of S1 by Def2;

      then the carrier of J c= the carrier of S1 by INSTALG1: 10;

      then

       A3: a in the carrier of S1 & X c= the Sorts of T & ( dom the Sorts of L) = the carrier of S1 by PARTFUN1:def 2, PBOOLE:def 18;

      then (the Sorts of L . a) in ( rng the Sorts of L) & (the Sorts of L . a) = (the Sorts of T . a) by Th16, FUNCT_1:def 3;

      then

       A4: (X . a) c= (the Sorts of T . a) = (the Sorts of L . a) c= ( Union the Sorts of L) by A3, ZFMISC_1: 74;

      then

      reconsider t = y as Element of ( Union the Sorts of L) by A2;

      

       A5: a is SortSymbol of S1 by Th8;

      then

       A6: x in (Y . a) & y in (Y . a) by A2, Th2;

      

       A7: Y is ManySortedSubset of the Sorts of L by Th23;

      (( \for (x,( \not A))) \imp (( \not A) / (x0,t))) in G by A2, A4, A6, Def39;

      then (( \for (x,( \not A))) \imp (( \not A) / (x0,y0))) in G by A2, A6, A7, A5, Th14;

      then (( \not (( \not A) / (x0,y0))) \imp ( \not ( \for (x,( \not A))))) in G by Th58;

      then (( \not ( \not (A / (x0,y0)))) \imp ( \not ( \for (x,( \not A))))) in G & ((A / (x0,y0)) \imp ( \not ( \not (A / (x0,y0))))) in G & (( \ex (x,A)) \iff ( \not ( \for (x,( \not A))))) in G & ((( \ex (x,A)) \iff ( \not ( \for (x,( \not A))))) \imp (( \not ( \for (x,( \not A)))) \imp ( \ex (x,A)))) in G by A1, A2, A6, A7, A5, Th27, Def38, Th64, Th105;

      then ((A / (x0,y0)) \imp ( \not ( \for (x,( \not A))))) in G & (( \not ( \for (x,( \not A)))) \imp ( \ex (x,A))) in G by Th45, Def38;

      hence thesis by Th45;

    end;

    theorem :: AOFA_L00:113

    

     Th111: L is subst-correct vf-qc-correct implies (( \ex (x,y,A)) \iff ( \not ( \for (x,y,( \not A))))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      

       A2: (( \ex (x,y,A)) \iff ( \not ( \for (x,( \not ( \ex (y,A))))))) in G by Th105;

      (( \ex (y,A)) \iff ( \not ( \for (y,( \not A))))) in G & (( \for (y,( \not A))) \iff ( \not ( \not ( \for (y,( \not A)))))) in G by Th66, Th105;

      then (( \not ( \ex (y,A))) \iff ( \not ( \not ( \for (y,( \not A)))))) in G & (( \not ( \not ( \for (y,( \not A))))) \iff ( \for (y,( \not A)))) in G by Th90, Th94;

      then (( \not ( \ex (y,A))) \iff ( \for (y,( \not A)))) in G by Th91;

      then (( \not ( \ex (y,A))) \imp ( \for (y,( \not A)))) in G & (( \for (y,( \not A))) \imp ( \not ( \ex (y,A)))) in G by Th43;

      then

       A3: ( \for (x,(( \not ( \ex (y,A))) \imp ( \for (y,( \not A)))))) in G & ( \for (x,(( \for (y,( \not A))) \imp ( \not ( \ex (y,A)))))) in G by Def39;

      (( \for (x,(( \not ( \ex (y,A))) \imp ( \for (y,( \not A)))))) \imp (( \for (x,( \not ( \ex (y,A))))) \imp ( \for (x,( \for (y,( \not A))))))) in G & (( \for (x,(( \for (y,( \not A))) \imp ( \not ( \ex (y,A)))))) \imp (( \for (x,( \for (y,( \not A))))) \imp ( \for (x,( \not ( \ex (y,A))))))) in G by A1, Th109;

      then (( \for (x,( \not ( \ex (y,A))))) \imp ( \for (x,( \for (y,( \not A)))))) in G & (( \for (x,( \for (y,( \not A))))) \imp ( \for (x,( \not ( \ex (y,A)))))) in G by A3, Def38;

      then (( \for (x,( \not ( \ex (y,A))))) \iff ( \for (x,y,( \not A)))) in G by Th43;

      then (( \not ( \for (x,( \not ( \ex (y,A)))))) \iff ( \not ( \for (x,y,( \not A))))) in G by Th94;

      hence thesis by A2, Th91;

    end;

    theorem :: AOFA_L00:114

    

     Th112: L is subst-correct implies (A \imp ( \ex (x,A))) in G

    proof

      set Y = (X extended_by ( {} ,the carrier of S1));

      assume

       A1: L is subst-correct;

      consider a be object such that

       A2: a in ( dom X) & x in (X . a) by CARD_5: 2;

      reconsider a as SortSymbol of J by A2;

      

       A3: x in (X . a) & a is SortSymbol of S1 by A2, Th8;

      then

       A4: x in (Y . a) & ( dom Y) = the carrier of S1 by Th2, PARTFUN1:def 2;

      then

      reconsider x0 = x as Element of ( Union Y) by A3, CARD_5: 2;

      ((A / (x0,x0)) \imp ( \ex (x,A))) in G by A1, A2, Th110;

      hence thesis by A1, A3, A4;

    end;

    theorem :: AOFA_L00:115

    

     Th113: L is vf-qc-correct implies for a be SortSymbol of S1 st x in (X . a) holds x nin (( vf ( \for (x,A))) . a)

    proof

      set Y = (X extended_by ( {} ,the carrier of S1));

      assume

       A1: L is vf-qc-correct;

      let a be SortSymbol of S1;

      assume x in (X . a);

      then ( vf ( \for (x,A))) = (( vf A) (\) (a -singleton x)) by A1;

      

      then

       A2: (( vf ( \for (x,A))) . a) = ((( vf A) . a) \ ((a -singleton x) . a)) by PBOOLE:def 6

      .= ((( vf A) . a) \ {x}) by AOFA_A00: 6;

      x in {x} by TARSKI:def 1;

      hence thesis by A2, XBOOLE_0:def 5;

    end;

    theorem :: AOFA_L00:116

    

     Th114: L is vf-qc-correct implies for a be SortSymbol of S1 st x in (X . a) holds x nin (( vf ( \ex (x,A))) . a)

    proof

      assume

       A1: L is vf-qc-correct;

      let a be SortSymbol of S1;

      assume x in (X . a);

      then ( vf ( \ex (x,A))) = (( vf A) (\) (a -singleton x)) by A1;

      

      then

       A2: (( vf ( \ex (x,A))) . a) = ((( vf A) . a) \ ((a -singleton x) . a)) by PBOOLE:def 6

      .= ((( vf A) . a) \ {x}) by AOFA_A00: 6;

      x in {x} by TARSKI:def 1;

      hence thesis by A2, XBOOLE_0:def 5;

    end;

    theorem :: AOFA_L00:117

    

     Th115: L is subst-correct vf-qc-correct & (A \imp B) in G implies (( \for (x,A)) \imp ( \for (x,B))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      assume (A \imp B) in G;

      then

       A2: ( \for (x,(A \imp B))) in G by Def39;

      (( \for (x,(A \imp B))) \imp (( \for (x,A)) \imp ( \for (x,B)))) in G by A1, Th109;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:118

    L is subst-correct vf-qc-correct implies (( \for (x,(( \not A) \imp ( \not B)))) \imp (( \for (x,B)) \imp ( \for (x,A)))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      ((( \not A) \imp ( \not B)) \imp (B \imp A)) in G by Def38;

      then

       A2: (( \for (x,(( \not A) \imp ( \not B)))) \imp ( \for (x,(B \imp A)))) in G by A1, Th115;

      (( \for (x,(B \imp A))) \imp (( \for (x,B)) \imp ( \for (x,A)))) in G by A1, Th109;

      hence (( \for (x,(( \not A) \imp ( \not B)))) \imp (( \for (x,B)) \imp ( \for (x,A)))) in G by A2, Th45;

    end;

    theorem :: AOFA_L00:119

    

     Th117: L is subst-correct vf-qc-correct implies (( \for (x,(A \imp B))) \imp (( \for (x,( \not B))) \imp ( \for (x,( \not A))))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      ((A \imp B) \imp (( \not B) \imp ( \not A))) in G by Th57;

      then

       A2: (( \for (x,(A \imp B))) \imp ( \for (x,(( \not B) \imp ( \not A))))) in G by A1, Th115;

      (( \for (x,(( \not B) \imp ( \not A)))) \imp (( \for (x,( \not B))) \imp ( \for (x,( \not A))))) in G by A1, Th109;

      hence (( \for (x,(A \imp B))) \imp (( \for (x,( \not B))) \imp ( \for (x,( \not A))))) in G by A2, Th45;

    end;

    theorem :: AOFA_L00:120

    L is subst-correct vf-qc-correct & (A \iff B) in G implies (( \for (x,A)) \iff ( \for (x,B))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      set p = (A \imp B), q = (B \imp A), pq = (A \iff B);

      set a = ( \for (x,pq)), b = ( \for (x,p)), c = (( \for (x,A)) \imp ( \for (x,B)));

      (pq \imp p) in G by Def38;

      then

       A2: (a \imp b) in G by A1, Th115;

      (b \imp c) in G by A1, Th109;

      then

       A3: (( \for (x,pq)) \imp (( \for (x,A)) \imp ( \for (x,B)))) in G by A2, Th45;

      ((A \iff B) \imp (B \imp A)) in G by Def38;

      then

       A4: (( \for (x,(A \iff B))) \imp ( \for (x,(B \imp A)))) in G by A1, Th115;

      (( \for (x,(B \imp A))) \imp (( \for (x,B)) \imp ( \for (x,A)))) in G by A1, Th109;

      then

       A5: (( \for (x,(A \iff B))) \imp (( \for (x,B)) \imp ( \for (x,A)))) in G by A4, Th45;

      ((( \for (x,(A \iff B))) \imp (( \for (x,A)) \imp ( \for (x,B)))) \imp ((( \for (x,(A \iff B))) \imp (( \for (x,B)) \imp ( \for (x,A)))) \imp (( \for (x,(A \iff B))) \imp ((( \for (x,A)) \imp ( \for (x,B))) \and (( \for (x,B)) \imp ( \for (x,A))))))) in G by Th49;

      then ((( \for (x,(A \iff B))) \imp (( \for (x,B)) \imp ( \for (x,A)))) \imp (( \for (x,(A \iff B))) \imp ((( \for (x,A)) \imp ( \for (x,B))) \and (( \for (x,B)) \imp ( \for (x,A)))))) in G by A3, Def38;

      then

       A6: (( \for (x,(A \iff B))) \imp ((( \for (x,A)) \imp ( \for (x,B))) \and (( \for (x,B)) \imp ( \for (x,A))))) in G by A5, Def38;

      (((( \for (x,A)) \imp ( \for (x,B))) \and (( \for (x,B)) \imp ( \for (x,A)))) \imp (( \for (x,A)) \iff ( \for (x,B)))) in G by Def38;

      then

       A7: (( \for (x,(A \iff B))) \imp (( \for (x,A)) \iff ( \for (x,B)))) in G by A6, Th45;

      assume (A \iff B) in G;

      then ( \for (x,(A \iff B))) in G by Def39;

      hence thesis by A7, Def38;

    end;

    theorem :: AOFA_L00:121

    (( \ex (x,( \not A))) \iff ( \not ( \for (x,A)))) in G by Def39;

    theorem :: AOFA_L00:122

    

     Th120: L is subst-correct vf-qc-correct implies for a be SortSymbol of J st x in (X . a) & x nin (( vf B) . a) holds (( \for (x,(A \imp B))) \imp (( \ex (x,A)) \imp B)) in G

    proof

      set Y = (X extended_by ( {} ,the carrier of S1));

      assume

       A1: L is subst-correct vf-qc-correct;

      let a be SortSymbol of J;

      assume

       A2: x in (X . a) & x nin (( vf B) . a);

      

       A3: ((A \imp B) \imp (( \not B) \imp ( \not A))) in G by Th57;

      

       A4: (( \for (x,(A \imp B))) \imp ( \for (x,(( \not B) \imp ( \not A))))) in G by A1, A3, Th115;

      x nin (( vf ( \not B)) . a) by A1, A2;

      then (( \for (x,(( \not B) \imp ( \not A)))) \imp (( \not B) \imp ( \for (x,( \not A))))) in G by A2, Def39;

      then

       A5: (( \for (x,(A \imp B))) \imp (( \not B) \imp ( \for (x,( \not A))))) in G by A4, Th45;

      (( \not ( \ex (x,A))) \iff ( \for (x,( \not A)))) in G & ((( \not ( \ex (x,A))) \iff ( \for (x,( \not A)))) \imp (( \for (x,( \not A))) \imp ( \not ( \ex (x,A))))) in G by Def39, Def38;

      then (( \for (x,( \not A))) \imp ( \not ( \ex (x,A)))) in G by Def38;

      then

       A6: (( \for (x,(A \imp B))) \imp (( \not B) \imp ( \not ( \ex (x,A))))) in G by A5, Th69;

      ((( \not B) \imp ( \not ( \ex (x,A)))) \imp (( \ex (x,A)) \imp B)) in G by Def38;

      hence thesis by A6, Th45;

    end;

    theorem :: AOFA_L00:123

    

     Th121: L is subst-correct vf-qc-correct implies (( \for (x,(A \imp B))) \imp (( \ex (x,A)) \imp ( \ex (x,B)))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      

       A2: (( \for (x,(A \imp B))) \imp (( \for (x,( \not B))) \imp ( \for (x,( \not A))))) in G by A1, Th117;

      ((( \for (x,( \not B))) \imp ( \for (x,( \not A)))) \imp (( \not ( \for (x,( \not A)))) \imp ( \not ( \for (x,( \not B)))))) in G by Th57;

      then

       A3: (( \for (x,(A \imp B))) \imp (( \not ( \for (x,( \not A)))) \imp ( \not ( \for (x,( \not B)))))) in G by A2, Th45;

      (( \not ( \ex (x,A))) \iff ( \for (x,( \not A)))) in G by Def39;

      then (( \for (x,( \not A))) \imp ( \not ( \ex (x,A)))) in G by Th43;

      then (( \not ( \not ( \ex (x,A)))) \imp ( \not ( \for (x,( \not A))))) in G & (( \ex (x,A)) \imp ( \not ( \not ( \ex (x,A))))) in G by Th64, Th58;

      then

       A4: (( \ex (x,A)) \imp ( \not ( \for (x,( \not A))))) in G by Th45;

      (( \not ( \ex (x,B))) \iff ( \for (x,( \not B)))) in G by Def39;

      then (( \not ( \ex (x,B))) \imp ( \for (x,( \not B)))) in G by Th43;

      then (( \not ( \for (x,( \not B)))) \imp ( \not ( \not ( \ex (x,B))))) in G & (( \not ( \not ( \ex (x,B)))) \imp ( \ex (x,B))) in G by Th65, Th58;

      then (( \not ( \for (x,( \not B)))) \imp ( \ex (x,B))) in G by Th45;

      then ((( \not ( \for (x,( \not A)))) \imp ( \not ( \for (x,( \not B))))) \imp (( \ex (x,A)) \imp ( \ex (x,B)))) in G by A4, Th103;

      hence (( \for (x,(A \imp B))) \imp (( \ex (x,A)) \imp ( \ex (x,B)))) in G by A3, Th45;

    end;

    theorem :: AOFA_L00:124

    

     Th122: L is subst-correct vf-qc-correct implies (( \for (x,( \not A))) \iff ( \not ( \ex (x,A)))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      (A \imp ( \not ( \not A))) in G by Th64;

      then ( \for (x,(A \imp ( \not ( \not A))))) in G & (( \for (x,(A \imp ( \not ( \not A))))) \imp (( \ex (x,A)) \imp ( \ex (x,( \not ( \not A)))))) in G by A1, Def39, Th121;

      then

       A2: (( \ex (x,A)) \imp ( \ex (x,( \not ( \not A))))) in G by Def38;

      (( \not ( \not A)) \imp A) in G by Th65;

      then ( \for (x,(( \not ( \not A)) \imp A))) in G & (( \for (x,(( \not ( \not A)) \imp A))) \imp (( \ex (x,( \not ( \not A)))) \imp ( \ex (x,A)))) in G by A1, Def39, Th121;

      then (( \ex (x,( \not ( \not A)))) \imp ( \ex (x,A))) in G by Def38;

      then (( \ex (x,A)) \iff ( \ex (x,( \not ( \not A))))) in G & (( \ex (x,( \not ( \not A)))) \iff ( \not ( \for (x,( \not A))))) in G by Def39, A2, Th43;

      then (( \ex (x,A)) \iff ( \not ( \for (x,( \not A))))) in G by Th91;

      then (( \not ( \for (x,( \not A)))) \iff ( \ex (x,A))) in G by Th90;

      then (( \not ( \not ( \for (x,( \not A))))) \iff ( \not ( \ex (x,A)))) in G by Th94;

      hence (( \for (x,( \not A))) \iff ( \not ( \ex (x,A)))) in G by Th95;

    end;

    theorem :: AOFA_L00:125

    L is subst-correct vf-qc-correct implies (( \for (x,y,A)) \iff ( \not ( \ex (x,y,( \not A))))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      

       A2: (( \for (x,y,A)) \iff ( \not ( \ex (x,( \not ( \for (y,A))))))) in G by Th106;

      (( \for (y,A)) \iff ( \not ( \ex (y,( \not A))))) in G & (( \ex (y,( \not A))) \iff ( \not ( \not ( \ex (y,( \not A)))))) in G by Th66, Th106;

      then (( \not ( \for (y,A))) \iff ( \not ( \not ( \ex (y,( \not A)))))) in G & (( \not ( \not ( \ex (y,( \not A))))) \iff ( \ex (y,( \not A)))) in G by Th90, Th94;

      then (( \not ( \for (y,A))) \iff ( \ex (y,( \not A)))) in G by Th91;

      then (( \not ( \for (y,A))) \imp ( \ex (y,( \not A)))) in G & (( \ex (y,( \not A))) \imp ( \not ( \for (y,A)))) in G by Th43;

      then

       A3: ( \for (x,(( \not ( \for (y,A))) \imp ( \ex (y,( \not A)))))) in G & ( \for (x,(( \ex (y,( \not A))) \imp ( \not ( \for (y,A)))))) in G by Def39;

      (( \for (x,(( \not ( \for (y,A))) \imp ( \ex (y,( \not A)))))) \imp (( \ex (x,( \not ( \for (y,A))))) \imp ( \ex (x,( \ex (y,( \not A))))))) in G & (( \for (x,(( \ex (y,( \not A))) \imp ( \not ( \for (y,A)))))) \imp (( \ex (x,( \ex (y,( \not A))))) \imp ( \ex (x,( \not ( \for (y,A))))))) in G by A1, Th121;

      then (( \ex (x,( \not ( \for (y,A))))) \imp ( \ex (x,( \ex (y,( \not A)))))) in G & (( \ex (x,( \ex (y,( \not A))))) \imp ( \ex (x,( \not ( \for (y,A)))))) in G by A3, Def38;

      then (( \ex (x,( \not ( \for (y,A))))) \iff ( \ex (x,y,( \not A)))) in G by Th43;

      then (( \not ( \ex (x,( \not ( \for (y,A)))))) \iff ( \not ( \ex (x,y,( \not A))))) in G by Th94;

      hence thesis by A2, Th91;

    end;

    theorem :: AOFA_L00:126

    L is subst-correct vf-qc-correct implies (( \for (x,A)) \iff ( \for (x,( \not ( \not A))))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      (A \imp ( \not ( \not A))) in G & (( \not ( \not A)) \imp A) in G by Th65, Th64;

      then (( \for (x,A)) \imp ( \for (x,( \not ( \not A))))) in G & (( \for (x,( \not ( \not A)))) \imp ( \for (x,A))) in G by A1, Th115;

      then

       A2: ((( \for (x,A)) \imp ( \for (x,( \not ( \not A))))) \and (( \for (x,( \not ( \not A)))) \imp ( \for (x,A)))) in G by Th35;

      (((( \for (x,A)) \imp ( \for (x,( \not ( \not A))))) \and (( \for (x,( \not ( \not A)))) \imp ( \for (x,A)))) \imp (( \for (x,A)) \iff ( \for (x,( \not ( \not A)))))) in G by Def38;

      hence thesis by A2, Def38;

    end;

    theorem :: AOFA_L00:127

    

     Th125: L is subst-correct vf-qc-correct implies (( \for (x,(A \and B))) \imp (( \for (x,A)) \and ( \for (x,B)))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      ((A \and B) \imp A) in G by Def38;

      then

       A2: (( \for (x,(A \and B))) \imp ( \for (x,A))) in G by A1, Th115;

      ((A \and B) \imp B) in G by Def38;

      then

       A3: (( \for (x,(A \and B))) \imp ( \for (x,B))) in G by A1, Th115;

      ((( \for (x,(A \and B))) \imp ( \for (x,A))) \imp ((( \for (x,(A \and B))) \imp ( \for (x,B))) \imp (( \for (x,(A \and B))) \imp (( \for (x,A)) \and ( \for (x,B)))))) in G by Th49;

      then ((( \for (x,(A \and B))) \imp ( \for (x,B))) \imp (( \for (x,(A \and B))) \imp (( \for (x,A)) \and ( \for (x,B))))) in G by A2, Def38;

      hence thesis by A3, Def38;

    end;

    theorem :: AOFA_L00:128

    

     Th126: L is vf-qc-correct subst-correct implies ((( \for (x,A)) \and ( \for (x,B))) \imp ( \for (x,(A \and B)))) in G

    proof

      set Y = (X extended_by ( {} ,the carrier of S1));

      assume

       A1: L is vf-qc-correct subst-correct;

      then (( \for (x,A)) \imp A) in G & (( \for (x,B)) \imp B) in G by Th104;

      then ((( \for (x,A)) \and ( \for (x,B))) \imp (A \and B)) in G by Th72;

      then

       A2: ( \for (x,((( \for (x,A)) \and ( \for (x,B))) \imp (A \and B)))) in G by Def39;

      consider a be object such that

       A3: a in ( dom X) & x in (X . a) by CARD_5: 2;

      J is Subsignature of S1 by Def2;

      then

       A4: ( dom X) = the carrier of J c= the carrier of S1 = ( dom Y) by INSTALG1: 10, PARTFUN1:def 2;

      reconsider a as SortSymbol of J by A3;

      x nin (( vf ( \for (x,A))) . a) & x nin (( vf ( \for (x,B))) . a) by A1, A3, A4, Th113;

      then x nin ((( vf ( \for (x,A))) . a) \/ (( vf ( \for (x,B))) . a)) by XBOOLE_0:def 3;

      then x nin ((( vf ( \for (x,A))) (\/) ( vf ( \for (x,B)))) . a) by A4, PBOOLE:def 4;

      then x nin (( vf (( \for (x,A)) \and ( \for (x,B)))) . a) by A1;

      hence ((( \for (x,A)) \and ( \for (x,B))) \imp ( \for (x,(A \and B)))) in G by A3, A2, Th108;

    end;

    theorem :: AOFA_L00:129

    

     Th127: L is subst-correct vf-qc-correct implies ((( \for (x,A)) \or ( \for (x,B))) \imp ( \for (x,(A \or B)))) in G

    proof

      set Y = (X extended_by ( {} ,the carrier of S1));

      assume

       A1: L is subst-correct vf-qc-correct;

      then (( \for (x,A)) \imp A) in G & (( \for (x,B)) \imp B) in G by Th104;

      then ((( \for (x,A)) \or ( \for (x,B))) \imp (A \or B)) in G by Th59;

      then

       A2: ( \for (x,((( \for (x,A)) \or ( \for (x,B))) \imp (A \or B)))) in G by Def39;

      consider a be object such that

       A3: a in ( dom X) & x in (X . a) by CARD_5: 2;

      J is Subsignature of S1 by Def2;

      then

       A4: the carrier of J c= the carrier of S1 = ( dom Y) & ( dom X) = the carrier of J by PARTFUN1:def 2, INSTALG1: 10;

      reconsider a as SortSymbol of J by A3;

      reconsider b = a as SortSymbol of S1 by A4;

      x nin (( vf ( \for (x,A))) . b) & x nin (( vf ( \for (x,B))) . b) by A1, A3, Th113;

      then x nin ((( vf ( \for (x,A))) . a) \/ (( vf ( \for (x,B))) . a)) by XBOOLE_0:def 3;

      then x nin ((( vf ( \for (x,A))) (\/) ( vf ( \for (x,B)))) . b) by PBOOLE:def 4;

      then x nin (( vf (( \for (x,A)) \or ( \for (x,B)))) . a) by A1;

      hence ((( \for (x,A)) \or ( \for (x,B))) \imp ( \for (x,(A \or B)))) in G by A2, A3, Th108;

    end;

    theorem :: AOFA_L00:130

    

     Th128: L is subst-correct vf-qc-correct & (A \imp B) in G implies (( \ex (x,A)) \imp ( \ex (x,B))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      assume

       A2: (A \imp B) in G;

      ((A \imp B) \imp (( \not B) \imp ( \not A))) in G by Th57;

      then (( \not B) \imp ( \not A)) in G by A2, Def38;

      then

       A3: (( \for (x,( \not B))) \imp ( \for (x,( \not A)))) in G by A1, Th115;

      ((( \for (x,( \not B))) \imp ( \for (x,( \not A)))) \imp (( \not ( \for (x,( \not A)))) \imp ( \not ( \for (x,( \not B)))))) in G by Th57;

      then

       A4: (( \not ( \for (x,( \not A)))) \imp ( \not ( \for (x,( \not B))))) in G by A3, Def38;

      (( \ex (x,A)) \iff ( \not ( \for (x,( \not A))))) in G by Th105;

      then

       A5: (( \ex (x,A)) \imp ( \not ( \for (x,( \not B))))) in G by A4, Th92;

      (( \ex (x,B)) \iff ( \not ( \for (x,( \not B))))) in G by Th105;

      then (( \not ( \for (x,( \not B)))) \iff ( \ex (x,B))) in G by Th90;

      hence thesis by A5, Th93;

    end;

    theorem :: AOFA_L00:131

    

     Th129: L is subst-correct vf-qc-correct & (A \iff B) in G implies (( \ex (x,A)) \iff ( \ex (x,B))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      assume

       A2: (A \iff B) in G;

      ((A \iff B) \imp (A \imp B)) in G & ((A \iff B) \imp (B \imp A)) in G by Def38;

      then (A \imp B) in G & (B \imp A) in G by A2, Def38;

      then (( \ex (x,A)) \imp ( \ex (x,B))) in G & (( \ex (x,B)) \imp ( \ex (x,A))) in G by A1, Th128;

      then

       A3: ((( \ex (x,A)) \imp ( \ex (x,B))) \and (( \ex (x,B)) \imp ( \ex (x,A)))) in G by Th35;

      (((( \ex (x,A)) \imp ( \ex (x,B))) \and (( \ex (x,B)) \imp ( \ex (x,A)))) \imp (( \ex (x,A)) \iff ( \ex (x,B)))) in G by Def38;

      hence thesis by A3, Def38;

    end;

    theorem :: AOFA_L00:132

    L is subst-correct vf-qc-correct implies (( \ex (x,A)) \iff ( \ex (x,( \not ( \not A))))) in G

    proof

      (A \iff ( \not ( \not A))) in G by Th66;

      hence thesis by Th129;

    end;

    theorem :: AOFA_L00:133

    L is subst-correct vf-qc-correct implies ((( \ex (x,A)) \or ( \ex (x,B))) \iff ( \ex (x,(A \or B)))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      then (( \for (x,(( \not A) \and ( \not B)))) \imp (( \for (x,( \not A))) \and ( \for (x,( \not B))))) in G by Th125;

      then

       A2: (( \not (( \for (x,( \not A))) \and ( \for (x,( \not B))))) \imp ( \not ( \for (x,(( \not A) \and ( \not B)))))) in G by Th58;

      ((( \not ( \for (x,( \not A)))) \or ( \not ( \for (x,( \not B))))) \imp ( \not (( \for (x,( \not A))) \and ( \for (x,( \not B)))))) in G by Th73;

      then

       A3: ((( \not ( \for (x,( \not A)))) \or ( \not ( \for (x,( \not B))))) \imp ( \not ( \for (x,(( \not A) \and ( \not B)))))) in G by A2, Th45;

      (( \not (A \or B)) \imp (( \not A) \and ( \not B))) in G by Th71;

      then (( \for (x,( \not (A \or B)))) \imp ( \for (x,(( \not A) \and ( \not B))))) in G by A1, Th115;

      then (( \not ( \for (x,(( \not A) \and ( \not B))))) \imp ( \not ( \for (x,( \not (A \or B)))))) in G by Th58;

      then

       A4: ((( \not ( \for (x,( \not A)))) \or ( \not ( \for (x,( \not B))))) \imp ( \not ( \for (x,( \not (A \or B)))))) in G by A3, Th45;

      (( \ex (x,(A \or B))) \iff ( \not ( \for (x,( \not (A \or B)))))) in G by Th105;

      then (( \not ( \for (x,( \not (A \or B))))) \iff ( \ex (x,(A \or B)))) in G by Th90;

      then

       A5: ((( \not ( \for (x,( \not A)))) \or ( \not ( \for (x,( \not B))))) \imp ( \ex (x,(A \or B)))) in G by A4, Th93;

      (( \ex (x,A)) \iff ( \not ( \for (x,( \not A))))) in G & (( \ex (x,B)) \iff ( \not ( \for (x,( \not B))))) in G by Th105;

      then (( \ex (x,A)) \imp ( \not ( \for (x,( \not A))))) in G & (( \ex (x,B)) \imp ( \not ( \for (x,( \not B))))) in G by Th43;

      then ((( \ex (x,A)) \or ( \ex (x,B))) \imp (( \not ( \for (x,( \not A)))) \or ( \not ( \for (x,( \not B)))))) in G by Th59;

      then

       A6: ((( \ex (x,A)) \or ( \ex (x,B))) \imp ( \ex (x,(A \or B)))) in G by A5, Th45;

      

       A7: (( \ex (x,A)) \iff ( \not ( \for (x,( \not A))))) in G & (( \ex (x,B)) \iff ( \not ( \for (x,( \not B))))) in G by Th105;

      

       A8: (( \not ( \for (x,( \not A)))) \imp ( \ex (x,A))) in G & (( \not ( \for (x,( \not B)))) \imp ( \ex (x,B))) in G by A7, Th43;

      (( \ex (x,(A \or B))) \iff ( \not ( \for (x,( \not (A \or B)))))) in G by Th105;

      then

       A9: (( \ex (x,(A \or B))) \imp ( \not ( \for (x,( \not (A \or B)))))) in G by Th43;

      ((( \not A) \and ( \not B)) \imp ( \not (A \or B))) in G by Th74;

      then (( \for (x,(( \not A) \and ( \not B)))) \imp ( \for (x,( \not (A \or B))))) in G by A1, Th115;

      then (( \not ( \for (x,( \not (A \or B))))) \imp ( \not ( \for (x,(( \not A) \and ( \not B)))))) in G by Th58;

      then

       A10: (( \ex (x,(A \or B))) \imp ( \not ( \for (x,(( \not A) \and ( \not B)))))) in G by A9, Th45;

      

       A11: ((( \not ( \for (x,( \not A)))) \or ( \not ( \for (x,( \not B))))) \imp (( \ex (x,A)) \or ( \ex (x,B)))) in G by A8, Th59;

      (( \not (( \for (x,( \not A))) \and ( \for (x,( \not B))))) \imp (( \not ( \for (x,( \not A)))) \or ( \not ( \for (x,( \not B)))))) in G by Th70;

      then

       A12: (( \not (( \for (x,( \not A))) \and ( \for (x,( \not B))))) \imp (( \ex (x,A)) \or ( \ex (x,B)))) in G by A11, Th45;

      ((( \for (x,( \not A))) \and ( \for (x,( \not B)))) \imp ( \for (x,(( \not A) \and ( \not B))))) in G by A1, Th126;

      then (( \not ( \for (x,(( \not A) \and ( \not B))))) \imp ( \not (( \for (x,( \not A))) \and ( \for (x,( \not B)))))) in G by Th58;

      then (( \ex (x,(A \or B))) \imp ( \not (( \for (x,( \not A))) \and ( \for (x,( \not B)))))) in G by A10, Th45;

      then (( \ex (x,(A \or B))) \imp (( \ex (x,A)) \or ( \ex (x,B)))) in G by A12, Th45;

      hence thesis by A6, Th43;

    end;

    theorem :: AOFA_L00:134

    L is subst-correct implies for a be SortSymbol of J st x in (X . a) & x nin (( vf A) . a) holds (A \iff ( \for (x,A))) in G

    proof

      assume

       A1: L is subst-correct;

      let a be SortSymbol of J;

      assume

       A2: x in (X . a) & x nin (( vf A) . a);

      

       A3: (( \for (x,(A \imp A))) \imp (( \for (x,A)) \imp A)) in G by A1, Th107;

      (A \imp A) in G by Th34;

      then ( \for (x,(A \imp A))) in G by Def39;

      then (( \for (x,A)) \imp A) in G & (A \imp ( \for (x,A))) in G by A2, A3, Def38, Th108;

      hence thesis by Th43;

    end;

    reserve a for SortSymbol of J;

    theorem :: AOFA_L00:135

    

     Th133: L is subst-correct vf-qc-correct & x in (X . a) & x nin (( vf A) . a) implies (( \for (x,(A \or B))) \imp (A \or ( \for (x,B)))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      assume

       A2: x in (X . a) & x nin (( vf A) . a);

      set c = a, a = ( \not A), b = B;

      x nin (( vf a) . c) by A1, A2;

      then

       A3: (( \for (x,(a \imp b))) \imp (a \imp ( \for (x,b)))) in G by A2, Def39;

      ((A \or b) \imp (a \imp b)) in G by Th62;

      then (( \for (x,(A \or B))) \imp ( \for (x,(a \imp B)))) in G by A1, Th115;

      then

       A4: (( \for (x,(A \or B))) \imp (a \imp ( \for (x,b)))) in G by A3, Th45;

      (( \not a) \imp A) in G & (( \for (x,B)) \imp ( \for (x,B))) in G by Th34, Th65;

      then ((( \not a) \or ( \for (x,B))) \imp (A \or ( \for (x,B)))) in G & ((a \imp ( \for (x,B))) \imp (( \not a) \or ( \for (x,B)))) in G by Th59, Th82;

      then ((a \imp ( \for (x,B))) \imp (A \or ( \for (x,B)))) in G by Th45;

      hence thesis by A4, Th45;

    end;

    theorem :: AOFA_L00:136

    

     Th134: L is subst-correct vf-qc-correct & x in (X . a) & x nin (( vf A) . a) implies (( \ex (x,(A \and B))) \imp (A \and ( \ex (x,B)))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      assume

       A2: x in (X . a) & x nin (( vf A) . a);

      ((( \for (x,( \not A))) \or ( \for (x,( \not B)))) \imp ( \for (x,(( \not A) \or ( \not B))))) in G by A1, Th127;

      then

       A3: (( \not ( \for (x,(( \not A) \or ( \not B))))) \imp ( \not (( \for (x,( \not A))) \or ( \for (x,( \not B)))))) in G by Th58;

      ((( \not A) \or ( \not B)) \imp ( \not (A \and B))) in G by Th73;

      then (( \ex (x,(A \and B))) \iff ( \not ( \for (x,( \not (A \and B)))))) in G & (( \for (x,(( \not A) \or ( \not B)))) \imp ( \for (x,( \not (A \and B))))) in G by A1, Th115, Th105;

      then (( \not ( \for (x,( \not (A \and B))))) \imp ( \not ( \for (x,(( \not A) \or ( \not B)))))) in G & (( \ex (x,(A \and B))) \imp ( \not ( \for (x,( \not (A \and B)))))) in G by Th43, Th58;

      then (( \ex (x,(A \and B))) \imp ( \not ( \for (x,(( \not A) \or ( \not B)))))) in G by Th45;

      then

       A4: (( \ex (x,(A \and B))) \imp ( \not (( \for (x,( \not A))) \or ( \for (x,( \not B)))))) in G by A3, Th45;

      (( \ex (x,A)) \iff ( \not ( \for (x,( \not A))))) in G & (( \ex (x,B)) \iff ( \not ( \for (x,( \not B))))) in G by Th105;

      then (( \not ( \for (x,( \not A)))) \imp ( \ex (x,A))) in G & (( \not ( \for (x,( \not B)))) \imp ( \ex (x,B))) in G by Th43;

      then

       A5: ((( \not ( \for (x,( \not A)))) \and ( \not ( \for (x,( \not B))))) \imp (( \ex (x,A)) \and ( \ex (x,B)))) in G by Th72;

      (( \not (( \for (x,( \not A))) \or ( \for (x,( \not B))))) \imp (( \not ( \for (x,( \not A)))) \and ( \not ( \for (x,( \not B)))))) in G by Th71;

      then (( \ex (x,(A \and B))) \imp (( \not ( \for (x,( \not A)))) \and ( \not ( \for (x,( \not B)))))) in G by A4, Th45;

      then

       A6: (( \ex (x,(A \and B))) \imp (( \ex (x,A)) \and ( \ex (x,B)))) in G by A5, Th45;

      (A \imp A) in G by Th34;

      then ( \for (x,(A \imp A))) in G & (( \for (x,(A \imp A))) \imp (( \ex (x,A)) \imp A)) in G by A1, A2, Th120, Def39;

      then (( \ex (x,A)) \imp A) in G & (( \ex (x,B)) \imp ( \ex (x,B))) in G by Def38, Th34;

      then ((( \ex (x,A)) \and ( \ex (x,B))) \imp (A \and ( \ex (x,B)))) in G by Th72;

      hence (( \ex (x,(A \and B))) \imp (A \and ( \ex (x,B)))) in G by A6, Th45;

    end;

    theorem :: AOFA_L00:137

    L is subst-correct vf-qc-correct & x in (X . a) & x nin (( vf A) . a) implies (( \ex (x,(A \and B))) \iff (A \and ( \ex (x,B)))) in G

    proof

      set Y = (X extended_by ( {} ,the carrier of S1));

      assume

       A1: L is subst-correct vf-qc-correct;

      assume

       A2: x in (X . a);

      assume

       A3: x nin (( vf A) . a);

      ( vf ( \not A)) = ( vf A) by A1;

      then (( \for (x,(( \not A) \or ( \not B)))) \imp (( \not A) \or ( \for (x,( \not B))))) in G by A1, A2, A3, Th133;

      then

       A4: (( \not (( \not A) \or ( \for (x,( \not B))))) \imp ( \not ( \for (x,(( \not A) \or ( \not B)))))) in G by Th58;

      (( \for (x,( \not B))) \iff ( \not ( \ex (x,B)))) in G by A1, Th122;

      then (( \not A) \imp ( \not A)) in G & (( \for (x,( \not B))) \imp ( \not ( \ex (x,B)))) in G by Th34, Th43;

      then ((( \not A) \or ( \not ( \ex (x,B)))) \imp ( \not (A \and ( \ex (x,B))))) in G & ((( \not A) \or ( \for (x,( \not B)))) \imp (( \not A) \or ( \not ( \ex (x,B))))) in G & ((( \not A) \or ( \not ( \ex (x,B)))) \imp ( \not (A \and ( \ex (x,B))))) in G by Th59, Th73;

      then ((A \and ( \ex (x,B))) \imp ( \not (( \not A) \or ( \not ( \ex (x,B)))))) in G & (( \not (( \not A) \or ( \not ( \ex (x,B))))) \imp ( \not (( \not A) \or ( \for (x,( \not B)))))) in G by Th58, Th67;

      then ((A \and ( \ex (x,B))) \imp ( \not (( \not A) \or ( \for (x,( \not B)))))) in G by Th45;

      then

       A5: ((A \and ( \ex (x,B))) \imp ( \not ( \for (x,(( \not A) \or ( \not B)))))) in G by A4, Th45;

      (( \ex (x,(A \and B))) \iff ( \not ( \for (x,( \not (A \and B)))))) in G & (( \not (A \and B)) \imp (( \not A) \or ( \not B))) in G by Th70, Th105;

      then (( \not ( \for (x,( \not (A \and B))))) \imp ( \ex (x,(A \and B)))) in G & ( \for (x,(( \not (A \and B)) \imp (( \not A) \or ( \not B))))) in G & (( \for (x,(( \not (A \and B)) \imp (( \not A) \or ( \not B))))) \imp (( \for (x,( \not (A \and B)))) \imp ( \for (x,(( \not A) \or ( \not B)))))) in G by A1, Def39, Th43, Th109;

      then (( \not ( \ex (x,(A \and B)))) \imp ( \for (x,( \not (A \and B))))) in G & (( \for (x,( \not (A \and B)))) \imp ( \for (x,(( \not A) \or ( \not B))))) in G by Def38, Th68;

      then (( \not ( \ex (x,(A \and B)))) \imp ( \for (x,(( \not A) \or ( \not B))))) in G by Th45;

      then (( \not ( \for (x,(( \not A) \or ( \not B))))) \imp ( \ex (x,(A \and B)))) in G by Th68;

      then

       A6: ((A \and ( \ex (x,B))) \imp ( \ex (x,(A \and B)))) in G by A5, Th45;

      (( \ex (x,(A \and B))) \imp (A \and ( \ex (x,B)))) in G by Th134, A1, A2, A3;

      hence (( \ex (x,(A \and B))) \iff (A \and ( \ex (x,B)))) in G by A6, Th43;

    end;

    theorem :: AOFA_L00:138

    L is subst-correct vf-qc-correct & x in (X . a) & x nin (( vf A) . a) implies (( \ex (x,(A \imp B))) \imp (A \imp ( \ex (x,B)))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      assume

       A2: x in (X . a) & x nin (( vf A) . a);

      (A \imp A) in G by Th34;

      then ( \for (x,(A \imp A))) in G by Def39;

      then (A \imp ( \for (x,A))) in G & (( \for (x,( \not B))) \imp ( \for (x,( \not B)))) in G by A2, Th108, Th34;

      then

       A3: ((A \and ( \for (x,( \not B)))) \imp (( \for (x,A)) \and ( \for (x,( \not B))))) in G by Th72;

      ((( \for (x,A)) \and ( \for (x,( \not B)))) \imp ( \for (x,(A \and ( \not B))))) in G by A1, Th126;

      then ((A \and ( \for (x,( \not B)))) \imp ( \for (x,(A \and ( \not B))))) in G by A3, Th45;

      then

       A4: (( \not ( \for (x,(A \and ( \not B))))) \imp ( \not (A \and ( \for (x,( \not B)))))) in G by Th58;

      (( \not A) \imp ( \not A)) in G & (B \imp ( \not ( \not B))) in G by Th34, Th64;

      then

       A5: ((( \not A) \or B) \imp (( \not A) \or ( \not ( \not B)))) in G by Th59;

      ((( \not A) \or ( \not ( \not B))) \imp ( \not (A \and ( \not B)))) in G by Th73;

      then ((A \and ( \not B)) \imp ( \not ( \not (A \and ( \not B))))) in G & (( \not ( \not (A \and ( \not B)))) \imp ( \not (( \not A) \or ( \not ( \not B))))) in G by Th58, Th64;

      then ((A \imp B) \imp (( \not A) \or B)) in G & (( \not (( \not A) \or ( \not ( \not B)))) \imp ( \not (( \not A) \or B))) in G & ((A \and ( \not B)) \imp ( \not (( \not A) \or ( \not ( \not B))))) in G by A5, Th82, Th58, Th45;

      then (( \not (( \not A) \or B)) \imp ( \not (A \imp B))) in G & ((A \and ( \not B)) \imp ( \not (( \not A) \or B))) in G by Th58, Th45;

      then ((A \and ( \not B)) \imp ( \not (A \imp B))) in G by Th45;

      then (( \for (x,(A \and ( \not B)))) \imp ( \for (x,( \not (A \imp B))))) in G by A1, Th115;

      then (( \ex (x,(A \imp B))) \iff ( \not ( \for (x,( \not (A \imp B)))))) in G & (( \not ( \for (x,( \not (A \imp B))))) \imp ( \not ( \for (x,(A \and ( \not B)))))) in G by Th105, Th58;

      then (( \ex (x,(A \imp B))) \imp ( \not ( \for (x,(A \and ( \not B)))))) in G by Th92;

      then

       A6: (( \ex (x,(A \imp B))) \imp ( \not (A \and ( \for (x,( \not B)))))) in G by A4, Th45;

      (( \ex (x,B)) \iff ( \not ( \for (x,( \not B))))) in G by Th105;

      then (( \not A) \imp ( \not A)) in G & (( \not ( \for (x,( \not B)))) \imp ( \ex (x,B))) in G by Th34, Th43;

      then (( \not (A \and ( \for (x,( \not B))))) \imp (( \not A) \or ( \not ( \for (x,( \not B)))))) in G & ((( \not A) \or ( \not ( \for (x,( \not B))))) \imp (( \not A) \or ( \ex (x,B)))) in G by Th59, Th70;

      then (( \not (A \and ( \for (x,( \not B))))) \imp (( \not A) \or ( \ex (x,B)))) in G by Th45;

      then

       A7: (( \ex (x,(A \imp B))) \imp (( \not A) \or ( \ex (x,B)))) in G by A6, Th45;

      (A \imp ( \not ( \not A))) in G & (( \ex (x,B)) \imp ( \ex (x,B))) in G by Th34, Th64;

      then ((( \not A) \or ( \ex (x,B))) \imp (( \not ( \not A)) \imp ( \ex (x,B)))) in G & ((( \not ( \not A)) \imp ( \ex (x,B))) \imp (A \imp ( \ex (x,B)))) in G by Th62, Th103;

      then ((( \not A) \or ( \ex (x,B))) \imp (A \imp ( \ex (x,B)))) in G by Th45;

      hence (( \ex (x,(A \imp B))) \imp (A \imp ( \ex (x,B)))) in G by A7, Th45;

    end;

    theorem :: AOFA_L00:139

    L is vf-qc-correct implies (( \for (x,A)) \imp ( \for (x,x,A))) in G

    proof

      assume

       A1: L is vf-qc-correct;

      consider a be object such that

       A2: a in ( dom X) & x in (X . a) by CARD_5: 2;

      reconsider a as Element of J by A2;

      set Y = (X extended_by ( {} ,the carrier of S1));

      

       A3: a is SortSymbol of S1 by Th8;

      

       A4: x nin (( vf ( \for (x,A))) . a) by A1, A2, A3, Th113;

      (( \for (x,A)) \imp ( \for (x,A))) in G by Th34;

      then ( \for (x,(( \for (x,A)) \imp ( \for (x,A))))) in G by Def39;

      hence thesis by A2, A4, Th108;

    end;

    theorem :: AOFA_L00:140

    

     Th138: L is vf-qc-correct subst-correct implies (( \for (x,y,A)) \imp ( \for (y,x,A))) in G

    proof

      assume

       A1: L is vf-qc-correct subst-correct;

      then (( \for (y,A)) \imp A) in G by Th104;

      then

       A2: ( \for (x,(( \for (y,A)) \imp A))) in G by Def39;

      (( \for (x,(( \for (y,A)) \imp A))) \imp (( \for (x,( \for (y,A)))) \imp ( \for (x,A)))) in G by A1, Th109;

      then (( \for (x,( \for (y,A)))) \imp ( \for (x,A))) in G by A2, Def38;

      then

       A3: ( \for (y,(( \for (x,( \for (y,A)))) \imp ( \for (x,A))))) in G by Def39;

      consider a be object such that

       A4: a in ( dom X) & y in (X . a) by CARD_5: 2;

      consider b be object such that

       A5: b in ( dom X) & x in (X . b) by CARD_5: 2;

      J is Subsignature of S1 by Def2;

      then ( dom X) = the carrier of J c= the carrier of S1 by PARTFUN1:def 2, INSTALG1: 10;

      then

      reconsider a, b as Element of S1 by A4, A5;

      reconsider c = a as Element of J by A4;

      ( vf ( \for (x,y,A))) = (( vf ( \for (y,A))) (\) (b -singleton x)) by A1, A5;

      then (( vf ( \for (x,y,A))) . a) = ((( vf ( \for (y,A))) . a) \ ((b -singleton x) . a)) by PBOOLE:def 6;

      then y nin (( vf ( \for (x,y,A))) . c) by A1, A4, Th113;

      hence (( \for (x,y,A)) \imp ( \for (y,x,A))) in G by A3, A4, Th108;

    end;

    theorem :: AOFA_L00:141

    L is vf-qc-correct subst-correct implies (( \ex (x,y,A)) \imp ( \ex (y,x,A))) in G

    proof

      assume

       A1: L is vf-qc-correct subst-correct;

      then (( \for (y,x,( \not A))) \imp ( \for (x,y,( \not A)))) in G by Th138;

      then

       A2: (( \not ( \for (x,y,( \not A)))) \imp ( \not ( \for (y,x,( \not A))))) in G by Th58;

      (( \ex (x,y,A)) \iff ( \not ( \for (x,y,( \not A))))) in G & (( \ex (y,x,A)) \iff ( \not ( \for (y,x,( \not A))))) in G by A1, Th111;

      then (( \ex (x,y,A)) \imp ( \not ( \for (y,x,( \not A))))) in G & (( \not ( \for (y,x,( \not A)))) \iff ( \ex (y,x,A))) in G by A2, Th90, Th92;

      hence (( \ex (x,y,A)) \imp ( \ex (y,x,A))) in G by Th93;

    end;

    theorem :: AOFA_L00:142

    L is vf-qc-correct subst-correct implies (( \ex (x,( \for (y,A)))) \imp ( \for (y,( \ex (x,A))))) in G

    proof

      assume

       A1: L is vf-qc-correct subst-correct;

      then (A \imp ( \ex (x,A))) in G by Th112;

      then ( \for (y,(A \imp ( \ex (x,A))))) in G & (( \for (y,(A \imp ( \ex (x,A))))) \imp (( \for (y,A)) \imp ( \for (y,( \ex (x,A)))))) in G by A1, Def39, Th109;

      then (( \for (y,A)) \imp ( \for (y,( \ex (x,A))))) in G by Def38;

      then

       A2: ( \for (x,(( \for (y,A)) \imp ( \for (y,( \ex (x,A))))))) in G by Def39;

      consider a be object such that

       A3: a in ( dom X) & y in (X . a) by CARD_5: 2;

      consider b be object such that

       A4: b in ( dom X) & x in (X . b) by CARD_5: 2;

      J is Subsignature of S1 by Def2;

      then ( dom X) = the carrier of J c= the carrier of S1 by PARTFUN1:def 2, INSTALG1: 10;

      then

      reconsider a, b as Element of S1 by A3, A4;

      reconsider c = b as Element of J by A4;

      ( vf ( \for (y,( \ex (x,A))))) = (( vf ( \ex (x,A))) (\) (a -singleton y)) by A1, A3;

      then (( vf ( \for (y,( \ex (x,A))))) . b) = ((( vf ( \ex (x,A))) . b) \ ((a -singleton y) . b)) by PBOOLE:def 6;

      then x nin (( vf ( \for (y,( \ex (x,A))))) . c) by A1, A4, Th114;

      then (( \for (x,(( \for (y,A)) \imp ( \for (y,( \ex (x,A))))))) \imp (( \ex (x,( \for (y,A)))) \imp ( \for (y,( \ex (x,A)))))) in G by A1, A4, Th120;

      hence (( \ex (x,( \for (y,A)))) \imp ( \for (y,( \ex (x,A))))) in G by A2, Def38;

    end;

    theorem :: AOFA_L00:143

    L is subst-correct vf-qc-correct implies (( \for (x,(A \and A))) \iff ( \for (x,A))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      ((A \and A) \imp A) in G & (A \imp (A \and A)) in G by Def38, Th53;

      then

       A2: ( \for (x,((A \and A) \imp A))) in G & ( \for (x,(A \imp (A \and A)))) in G by Def39;

      (( \for (x,(A \imp (A \and A)))) \imp (( \for (x,A)) \imp ( \for (x,(A \and A))))) in G & (( \for (x,((A \and A) \imp A))) \imp (( \for (x,(A \and A))) \imp ( \for (x,A)))) in G by A1, Th109;

      then (( \for (x,A)) \imp ( \for (x,(A \and A)))) in G & (( \for (x,(A \and A))) \imp ( \for (x,A))) in G by A2, Def38;

      hence (( \for (x,(A \and A))) \iff ( \for (x,A))) in G by Th43;

    end;

    theorem :: AOFA_L00:144

    L is subst-correct vf-qc-correct implies (( \for (x,(A \or A))) \iff ( \for (x,A))) in G

    proof

      assume

       A1: L is subst-correct vf-qc-correct;

      ((A \or A) \imp A) in G & (A \imp (A \or A)) in G by Def38, Th52;

      then

       A2: ( \for (x,((A \or A) \imp A))) in G & ( \for (x,(A \imp (A \or A)))) in G by Def39;

      (( \for (x,(A \imp (A \or A)))) \imp (( \for (x,A)) \imp ( \for (x,(A \or A))))) in G & (( \for (x,((A \or A) \imp A))) \imp (( \for (x,(A \or A))) \imp ( \for (x,A)))) in G by A1, Th109;

      then (( \for (x,A)) \imp ( \for (x,(A \or A)))) in G & (( \for (x,(A \or A))) \imp ( \for (x,A))) in G by A2, Def38;

      hence (( \for (x,(A \or A))) \iff ( \for (x,A))) in G by Th43;

    end;

    theorem :: AOFA_L00:145

    L is subst-correct vf-qc-correct implies (( \ex (x,(A \or A))) \iff ( \ex (x,A))) in G

    proof

      ((A \or A) \imp A) in G & (A \imp (A \or A)) in G by Def38, Th52;

      then ((A \or A) \iff A) in G by Th43;

      hence thesis by Th129;

    end;

    reserve L for non-emptyT -extension Language of (X extended_by ( {} ,the carrier of S1)), S1,

G1 for QC-theory_with_equality of L,

A,B,C,D for Formula of L,

s,s1 for SortSymbol of S1,

t,t9 for Element of L, s,

t1,t2,t3 for Element of L, s1;

    theorem :: AOFA_L00:146

    L is subst-eq-correct & x0 in (X . s) & (t1 '=' (t2,L)) in G1 implies ((t1 / (x0,t)) '=' ((t2 / (x0,t)),L)) in G1

    proof

      assume

       A1: L is subst-eq-correct;

      set Y = (X extended_by ( {} ,the carrier of S1));

      assume

       A2: x0 in (X . s);

      then

       A3: s in ( dom X) = the carrier of J & ( dom Y) = the carrier of S1 by FUNCT_1:def 2, PARTFUN1:def 2;

      then

      reconsider x = x0 as Element of ( Union X) by A2, CARD_5: 2;

      

       A4: (Y . s) = (X . s) by A3, Th1;

      assume (t1 '=' (t2,L)) in G1;

      then ( \for (x,(t1 '=' (t2,L)))) in G1 & (( \for (x,(t1 '=' (t2,L)))) \imp ((t1 '=' (t2,L)) / (x0,t))) in G1 by A3, A4, A2, Def39;

      then ((t1 '=' (t2,L)) / (x0,t)) in G1 by Def38;

      hence ((t1 / (x0,t)) '=' ((t2 / (x0,t)),L)) in G1 by A1, A2;

    end;

    theorem :: AOFA_L00:147

    

     ThOne: L is subst-eq-correct vf-finite subst-correct2 subst-correct3 & s1 in the carrier of J & (X . s1) is infinite implies ((t1 '=' (t2,L)) \imp (t2 '=' (t1,L))) in G1

    proof

      assume that

       A0: L is subst-eq-correct vf-finite subst-correct2 subst-correct3 and

       A1: s1 in the carrier of J and

       A3: (X . s1) is infinite;

      set Y = (X extended_by ( {} ,the carrier of S1));

      ( vf t1) is finite-yielding by A0;

      then (( vf t1) . s1) is finite by FINSET_1:def 5;

      then

       A4: the Element of ((X . s1) \ (( vf t1) . s1)) in (X . s1) & the Element of ((X . s1) \ (( vf t1) . s1)) nin (( vf t1) . s1) by A3, XBOOLE_0:def 5;

      ( dom X) = the carrier of J & ( dom Y) = the carrier of S1 by PARTFUN1:def 2;

      then

       A8: the Element of ((X . s1) \ (( vf t1) . s1)) in (Y . s1) by A1, A4, Th1;

      ( dom X) = the carrier of J & ((X . s1) \ (( vf t1) . s1)) c= (X . s1) by PARTFUN1:def 2;

      then

      reconsider x = the Element of ((X . s1) \ (( vf t1) . s1)) as Element of ( Union X) by A1, A4, CARD_5: 2;

      reconsider x0 = x as Element of ( Union Y) by Th24;

      (X . s1) c= (the Sorts of T . s1) = (the Sorts of L . s1) by A1, Th16, PBOOLE:def 2, PBOOLE:def 18;

      then

      reconsider t = x as Element of L, s1 by A4;

      reconsider j = s1 as SortSymbol of J by A1;

      reconsider q1 = t1, q2 = t2 as Element of T, j by Th16;

      

       A2: ((t1 '=' (t2,L)) \imp (((x '=' (t1,L)) / (x0,t1)) \imp ((x '=' (t1,L)) / (x0,t2)))) in G1 by A4, Def42;

      ((t '=' (t1,L)) / (x0,t1)) = ((t / (x0,t1)) '=' ((t1 / (x0,t1)),L)) by A0, A4

      .= ((t / (x0,t1)) '=' (t1,L)) by A0, A8

      .= (q1 '=' (q1,L)) by A0, A8;

      then

       A9: ((t '=' (t1,L)) / (x0,t1)) in G1 by Def42;

      ((t '=' (t1,L)) / (x0,t2)) = ((t / (x0,t2)) '=' ((t1 / (x0,t2)),L)) by A0, A4

      .= ((t / (x0,t2)) '=' (t1,L)) by A0, A8

      .= (t2 '=' (t1,L)) by A0, A8;

      hence thesis by A2, A9, Th46;

    end;

    theorem :: AOFA_L00:148

    L is subst-eq-correct vf-finite subst-correct2 subst-correct3 & s1 in the carrier of J & (X . s1) is infinite implies (((t1 '=' (t2,L)) \and (t2 '=' (t3,L))) \imp (t1 '=' (t3,L))) in G1

    proof

      assume that

       A0: L is subst-eq-correct vf-finite subst-correct2 subst-correct3 and

       A1: s1 in the carrier of J and

       A3: (X . s1) is infinite;

      set Y = (X extended_by ( {} ,the carrier of S1));

      ( vf t3) is finite-yielding by A0;

      then (( vf t3) . s1) is finite by FINSET_1:def 5;

      then

       A4: the Element of ((X . s1) \ (( vf t3) . s1)) in (X . s1) & the Element of ((X . s1) \ (( vf t3) . s1)) nin (( vf t3) . s1) by A3, XBOOLE_0:def 5;

      ( dom X) = the carrier of J & ( dom Y) = the carrier of S1 by PARTFUN1:def 2;

      then

       A8: the Element of ((X . s1) \ (( vf t3) . s1)) in (Y . s1) by A1, A4, Th1;

      ( dom X) = the carrier of J & ((X . s1) \ (( vf t1) . s1)) c= (X . s1) by PARTFUN1:def 2;

      then

      reconsider x = the Element of ((X . s1) \ (( vf t3) . s1)) as Element of ( Union X) by A1, A4, CARD_5: 2;

      reconsider x0 = x as Element of ( Union Y) by Th24;

      (X . s1) c= (the Sorts of T . s1) = (the Sorts of L . s1) by A1, Th16, PBOOLE:def 2, PBOOLE:def 18;

      then

      reconsider t = x as Element of L, s1 by A4;

      

       A5: ((t2 '=' (t1,L)) \imp (((t '=' (t3,L)) / (x0,t2)) \imp ((t '=' (t3,L)) / (x0,t1)))) in G1 by A4, Def42;

      ((t1 '=' (t2,L)) \imp (t2 '=' (t1,L))) in G1 by A0, A1, A3, ThOne;

      then

       A6: ((t1 '=' (t2,L)) \imp (((t '=' (t3,L)) / (x0,t2)) \imp ((t '=' (t3,L)) / (x0,t1)))) in G1 by A5, Th45;

      

       A7: ((t '=' (t3,L)) / (x0,t2)) = ((t / (x0,t2)) '=' ((t3 / (x0,t2)),L)) by A0, A4

      .= ((t / (x0,t2)) '=' (t3,L)) by A0, A8

      .= (t2 '=' (t3,L)) by A0, A8;

      

       A2: ((t '=' (t3,L)) / (x0,t1)) = ((t / (x0,t1)) '=' ((t3 / (x0,t1)),L)) by A0, A4

      .= ((t / (x0,t1)) '=' (t3,L)) by A0, A8

      .= (t1 '=' (t3,L)) by A0, A8;

      (((t1 '=' (t2,L)) \imp ((t2 '=' (t3,L)) \imp (t1 '=' (t3,L)))) \imp (((t1 '=' (t2,L)) \and (t2 '=' (t3,L))) \imp (t1 '=' (t3,L)))) in G1 by Th48;

      hence thesis by A7, A6, A2, Def38;

    end;

    theorem :: AOFA_L00:149

    L is subst-correct3 vf-finite subst-correct2 subst-correct subst-eq-correct vf-qc-correct vf-eq-correct & x = x0 in (X . s) & y = y0 in (X . s) & x <> y nin (( vf A) . s) & (X . s) is infinite implies ( \for (x,(A \iff ( \ex (y,((x '=' (y,L)) \and (A / (x0,y0)))))))) in G1

    proof

      set Y = (X extended_by ( {} ,the carrier of S1));

      assume that

       A0: L is subst-correct3 vf-finite subst-correct2 subst-correct subst-eq-correct vf-qc-correct vf-eq-correct and

       A1: x = x0 in (X . s) & y = y0 in (X . s) & x <> y nin (( vf A) . s) & (X . s) is infinite;

      

       A2: s in ( dom X) = the carrier of J by A1, FUNCT_1:def 2, PARTFUN1:def 2;

      then (X . s) c= (the Sorts of T . s) = (the Sorts of L . s) by Th16, PBOOLE:def 2, PBOOLE:def 18;

      then

      reconsider t1 = x0, t2 = y0 as Element of L, s by A1;

      reconsider j = s as SortSymbol of J by A2;

      reconsider q1 = t1, q2 = t2 as Element of T, j by Th16;

      

       A3: ((t2 '=' (t1,L)) \imp (((A / (x0,y0)) / (y0,t2)) \imp ((A / (x0,y0)) / (y0,t1)))) in G1 by A1, Def42;

      ((t1 '=' (t2,L)) \imp (t2 '=' (t1,L))) in G1 by A0, A1, A2, ThOne;

      then

       A8: ((t1 '=' (t2,L)) \imp (((A / (x0,y0)) / (y0,t2)) \imp ((A / (x0,y0)) / (y0,t1)))) in G1 by A3, Th45;

      ( dom Y) = the carrier of S1 by PARTFUN1:def 2;

      then

       A4: (X . s) = (Y . s) & (the Sorts of L . the formula-sort of S1) <> {} & Y is ManySortedSubset of the Sorts of L by A2, Th1, Th23;

      

      then

       A5: ((A / (x0,y0)) / (y0,t1)) = ((A / (x0,y0)) / (y0,x0)) by A1, Th14

      .= A by A0, A1, A4;

      

       A6: ((A / (x0,y0)) / (y0,t2)) = ((A / (x0,y0)) / (y0,y0)) by A1, A4, Th14

      .= (A / (x0,y0)) by A0, A1, A4;

      (((t1 '=' (t2,L)) \imp ((A / (x0,y0)) \imp A)) \imp (((t1 '=' (t2,L)) \and (A / (x0,y0))) \imp A)) in G1 by Th48;

      then (((t1 '=' (t2,L)) \and (A / (x0,y0))) \imp A) in G1 by A8, A5, A6, Def38;

      then ( \for (y,(((t1 '=' (t2,L)) \and (A / (x0,y0))) \imp A))) in G1 & (( \for (y,(((t1 '=' (t2,L)) \and (A / (x0,y0))) \imp A))) \imp (( \ex (y,((t1 '=' (t2,L)) \and (A / (x0,y0))))) \imp A)) in G1 by A0, A1, A2, Th120, Def39;

      then

       A9: (( \ex (y,((t1 '=' (t2,L)) \and (A / (x0,y0))))) \imp A) in G1 by Def38;

      

       B1: ((((t1 '=' (t2,L)) \and (A / (x0,y0))) / (y0,x0)) \imp ( \ex (y,((t1 '=' (t2,L)) \and (A / (x0,y0)))))) in G1 by A0, A1, A2, Th110;

      ( vf t1) = (s -singleton x0) by A0, A1;

      then (( vf t1) . s) = {x0} by AOFA_A00: 6;

      then

       B2: y0 nin (( vf t1) . s) by A1, TARSKI:def 1;

      

       B3: (((t1 '=' (t2,L)) \and (A / (x0,y0))) / (y0,x0)) = (((t1 '=' (t2,L)) / (y0,x0)) \and ((A / (x0,y0)) / (y0,x0))) by A0, A1, A4, Th27

      .= (((t1 '=' (t2,L)) / (y0,x0)) \and A) by A0, A1, A4

      .= (((t1 '=' (t2,L)) / (y0,t1)) \and A) by A1, A4, Th14

      .= (((t1 / (y0,t1)) '=' ((t2 / (y0,t1)),L)) \and A) by A0, A1

      .= ((t1 '=' ((t2 / (y0,t1)),L)) \and A) by B2, A0, A1, A4

      .= ((t1 '=' (t1,L)) \and A) by A0, A1, A4;

      (q1 '=' (q1,L)) in G1 by Def42;

      then (A \imp (t1 '=' (t1,L))) in G1 & (A \imp A) in G1 by Th34, Th44;

      then (A \imp ((t1 '=' (t1,L)) \and A)) in G1 by Th201;

      then (A \imp ( \ex (y,((t1 '=' (t2,L)) \and (A / (x0,y0)))))) in G1 by B1, B3, Th45;

      then (A \iff ( \ex (y,((t1 '=' (t2,L)) \and (A / (x0,y0)))))) in G1 by A9, Th43;

      hence thesis by A1, Def39;

    end;

    theorem :: AOFA_L00:150

    L is subst-correct3 vf-finite subst-correct2 subst-correct subst-eq-correct vf-qc-correct vf-eq-correct & x = x0 in (X . s) & y = y0 in (X . s) & x <> y nin (( vf A) . s) & (X . s) is infinite implies ( \for (x,(A \iff ( \for (y,((x '=' (y,L)) \imp (A / (x0,y0)))))))) in G1

    proof

      set Y = (X extended_by ( {} ,the carrier of S1));

      assume that

       A0: L is subst-correct3 vf-finite subst-correct2 subst-correct subst-eq-correct vf-qc-correct vf-eq-correct and

       A1: x = x0 in (X . s) & y = y0 in (X . s) & x <> y nin (( vf A) . s) & (X . s) is infinite;

      

       A2: s in ( dom X) = the carrier of J by A1, FUNCT_1:def 2, PARTFUN1:def 2;

      then (X . s) c= (the Sorts of T . s) = (the Sorts of L . s) by Th16, PBOOLE:def 2, PBOOLE:def 18;

      then

      reconsider t1 = x0, t2 = y0 as Element of L, s by A1;

      reconsider j = s as SortSymbol of J by A2;

      reconsider q1 = t1, q2 = t2 as Element of T, j by Th16;

      

       A3: ((t1 '=' (t2,L)) \imp (((A / (x0,y0)) / (y0,t1)) \imp ((A / (x0,y0)) / (y0,t2)))) in G1 by A1, Def42;

      ( dom Y) = the carrier of S1 by PARTFUN1:def 2;

      then

       A4: (X . s) = (Y . s) & (the Sorts of L . the formula-sort of S1) <> {} & Y is ManySortedSubset of the Sorts of L by A2, Th1, Th23;

      

      then

       A5: ((A / (x0,y0)) / (y0,t1)) = ((A / (x0,y0)) / (y0,x0)) by A1, Th14

      .= A by A0, A1, A4;

      

       A6: ((A / (x0,y0)) / (y0,t2)) = ((A / (x0,y0)) / (y0,y0)) by A1, A4, Th14

      .= (A / (x0,y0)) by A0, A1, A4;

      (A \imp ((t1 '=' (t2,L)) \imp (A / (x0,y0)))) in G1 by A3, A5, A6, Th38;

      then ( \for (y,(A \imp ((t1 '=' (t2,L)) \imp (A / (x0,y0)))))) in G1 by Def39;

      then

       A9: (A \imp ( \for (y,((t1 '=' (t2,L)) \imp (A / (x0,y0)))))) in G1 by A1, A2, Th108;

      

       B1: ((((t1 '=' (t2,L)) \and ( \not (A / (x0,y0)))) / (y0,x0)) \imp ( \ex (y,((t1 '=' (t2,L)) \and ( \not (A / (x0,y0))))))) in G1 by A0, A1, A2, Th110;

      ( vf t1) = (s -singleton x0) by A0, A1;

      then (( vf t1) . s) = {x0} by AOFA_A00: 6;

      then

       B2: y0 nin (( vf t1) . s) by A1, TARSKI:def 1;

      

       B3: (((t1 '=' (t2,L)) \and ( \not (A / (x0,y0)))) / (y0,x0)) = (((t1 '=' (t2,L)) / (y0,x0)) \and (( \not (A / (x0,y0))) / (y0,x0))) by A0, A1, A4, Th27

      .= (((t1 '=' (t2,L)) / (y0,x0)) \and ( \not ((A / (x0,y0)) / (y0,x0)))) by A0, A1, A4, Th27

      .= (((t1 '=' (t2,L)) / (y0,x0)) \and ( \not A)) by A0, A1, A4

      .= (((t1 '=' (t2,L)) / (y0,t1)) \and ( \not A)) by A1, A4, Th14

      .= (((t1 / (y0,t1)) '=' ((t2 / (y0,t1)),L)) \and ( \not A)) by A0, A1

      .= ((t1 '=' ((t2 / (y0,t1)),L)) \and ( \not A)) by B2, A0, A1, A4

      .= ((t1 '=' (t1,L)) \and ( \not A)) by A0, A1, A4;

      (q1 '=' (q1,L)) in G1 by Def42;

      then (( \not A) \imp (t1 '=' (t1,L))) in G1 & (( \not A) \imp ( \not A)) in G1 by Th34, Th44;

      then (( \not A) \imp ((t1 '=' (t1,L)) \and ( \not A))) in G1 by Th201;

      then (( \not A) \imp ( \ex (y,((t1 '=' (t2,L)) \and ( \not (A / (x0,y0))))))) in G1 by B1, B3, Th45;

      then

       B4: (( \not ( \ex (y,((t1 '=' (t2,L)) \and ( \not (A / (x0,y0))))))) \imp A) in G1 by Th68;

      ((A / (x0,y0)) \imp ( \not ( \not (A / (x0,y0))))) in G1 & (( \not (t1 '=' (t2,L))) \imp ( \not (t1 '=' (t2,L)))) in G1 by Th34, Th64;

      then ((( \not (t1 '=' (t2,L))) \or ( \not ( \not (A / (x0,y0))))) \imp ( \not ((t1 '=' (t2,L)) \and ( \not (A / (x0,y0)))))) in G1 & ((( \not (t1 '=' (t2,L))) \or (A / (x0,y0))) \imp (( \not (t1 '=' (t2,L))) \or ( \not ( \not (A / (x0,y0)))))) in G1 by Th73, Th59;

      then ((( \not (t1 '=' (t2,L))) \or (A / (x0,y0))) \imp ( \not ((t1 '=' (t2,L)) \and ( \not (A / (x0,y0)))))) in G1 & (((t1 '=' (t2,L)) \imp (A / (x0,y0))) \imp (( \not (t1 '=' (t2,L))) \or (A / (x0,y0)))) in G1 by Th45, Th82;

      then (((t1 '=' (t2,L)) \imp (A / (x0,y0))) \imp ( \not ((t1 '=' (t2,L)) \and ( \not (A / (x0,y0)))))) in G1 by Th45;

      then (((t1 '=' (t2,L)) \and ( \not (A / (x0,y0)))) \imp ( \not ((t1 '=' (t2,L)) \imp (A / (x0,y0))))) in G1 by Th67;

      then (( \ex (y,((t1 '=' (t2,L)) \and ( \not (A / (x0,y0)))))) \imp ( \ex (y,( \not ((t1 '=' (t2,L)) \imp (A / (x0,y0))))))) in G1 by A0, Th128;

      then (( \not ( \ex (y,( \not ((t1 '=' (t2,L)) \imp (A / (x0,y0))))))) \imp ( \not ( \ex (y,((t1 '=' (t2,L)) \and ( \not (A / (x0,y0)))))))) in G1 by Th58;

      then (( \not ( \ex (y,( \not ((t1 '=' (t2,L)) \imp (A / (x0,y0))))))) \imp A) in G1 & (( \for (y,((t1 '=' (t2,L)) \imp (A / (x0,y0))))) \iff ( \not ( \ex (y,( \not ((t1 '=' (t2,L)) \imp (A / (x0,y0)))))))) in G by B4, Th45, Th106;

      then (( \for (y,((t1 '=' (t2,L)) \imp (A / (x0,y0))))) \imp A) in G1 by Th92;

      then (A \iff ( \for (y,((t1 '=' (t2,L)) \imp (A / (x0,y0)))))) in G1 by A9, Th43;

      hence thesis by A1, Def39;

    end;

    theorem :: AOFA_L00:151

    L is subst-correct subst-eq-correct subst-correct3 vf-eq-correct & x in (X . s) & y in (X . s) & x <> y implies ( \for (x,( \ex (y,(x '=' (y,L)))))) in G1

    proof

      assume that

       A0: L is subst-correct subst-eq-correct subst-correct3 vf-eq-correct and

       A1: x in (X . s) & y in (X . s) & x <> y;

      

       A2: s in ( dom X) = the carrier of J by A1, FUNCT_1:def 2, PARTFUN1:def 2;

      then (X . s) c= (the Sorts of T . s) = (the Sorts of L . s) by Th16, PBOOLE:def 2, PBOOLE:def 18;

      then

      reconsider t1 = x, t2 = y as Element of L, s by A1;

      reconsider j = s as SortSymbol of J by A2;

      reconsider q1 = t1, q2 = t2 as Element of T, j by Th16;

      set Y = (X extended_by ( {} ,the carrier of S1));

      reconsider y0 = y, x0 = x as Element of ( Union Y) by Th24;

      ( dom Y) = the carrier of S1 by PARTFUN1:def 2;

      then

       A4: (X . s) = (Y . s) & (the Sorts of L . the formula-sort of S1) <> {} & Y is ManySortedSubset of the Sorts of L by A2, Th1, Th23;

      ( vf t1) = (s -singleton x0) by A0, A1;

      then (( vf t1) . s) = {x0} by AOFA_A00: 6;

      then

       B2: y0 nin (( vf t1) . s) by A1, TARSKI:def 1;

      

       A3: (((t1 '=' (t2,L)) / (y0,x0)) \imp ( \ex (y,(t1 '=' (t2,L))))) in G1 by A0, A1, A2, Th110;

      

       A5: ((t1 '=' (t2,L)) / (y0,x0)) = ((t1 '=' (t2,L)) / (y0,t1)) by A1, A4, Th14

      .= ((t1 / (y0,t1)) '=' ((t2 / (y0,t1)),L)) by A0, A1

      .= (t1 '=' ((t2 / (y0,t1)),L)) by B2, A0, A1, A4

      .= (t1 '=' (t1,L)) by A0, A1, A4;

      (q1 '=' (q1,L)) in G1 by Def42;

      then ( \ex (y,(x '=' (y,L)))) in G1 by A3, A5, Def38;

      hence thesis by Def39;

    end;

    theorem :: AOFA_L00:152

    

     ThTwo: L is subst-correct & x = x0 in (X . s) & y = y0 in (X . s) implies ((A \and (x '=' (y,L))) \imp (A / (x0,y0))) in G1

    proof

      assume that

       A0: L is subst-correct and

       A1: x = x0 in (X . s) & y = y0 in (X . s);

      

       A2: s in ( dom X) = the carrier of J by A1, FUNCT_1:def 2, PARTFUN1:def 2;

      then (X . s) c= (the Sorts of T . s) = (the Sorts of L . s) by Th16, PBOOLE:def 2, PBOOLE:def 18;

      then

      reconsider t1 = x, t2 = y as Element of L, s by A1;

      reconsider j = s as SortSymbol of J by A2;

      reconsider q1 = t1, q2 = t2 as Element of T, j by Th16;

      set Y = (X extended_by ( {} ,the carrier of S1));

      ( dom Y) = the carrier of S1 by PARTFUN1:def 2;

      then

       A4: (X . s) = (Y . s) & (the Sorts of L . the formula-sort of S1) <> {} & Y is ManySortedSubset of the Sorts of L by A2, Th1, Th23;

      

       A3: ((t1 '=' (t2,L)) \imp ((A / (x0,t1)) \imp (A / (x0,t2)))) in G1 by A1, Def42;

      

       A5: (A / (x0,t1)) = (A / (x0,x0)) by A1, A4, Th14

      .= A by A0, A1, A4;

      (A / (x0,t2)) = (A / (x0,y0)) by A1, A4, Th14;

      then (A \imp ((t1 '=' (t2,L)) \imp (A / (x0,y0)))) in G1 & ((A \imp ((t1 '=' (t2,L)) \imp (A / (x0,y0)))) \imp ((A \and (t1 '=' (t2,L))) \imp (A / (x0,y0)))) in G1 by A3, A5, Th38, Th48;

      hence thesis by Def38;

    end;

    theorem :: AOFA_L00:153

    L is subst-correct & x = x0 in (X . s) & y = y0 in (X . s) implies ((A \and ( \not (A / (x0,y0)))) \imp ( \not (x '=' (y,L)))) in G1

    proof

      assume that

       A0: L is subst-correct and

       A1: x = x0 in (X . s) & y = y0 in (X . s);

      s in ( dom X) = the carrier of J by A1, FUNCT_1:def 2, PARTFUN1:def 2;

      then (X . s) c= (the Sorts of T . s) = (the Sorts of L . s) by Th16, PBOOLE:def 2, PBOOLE:def 18;

      then

      reconsider t1 = x, t2 = y as Element of L, s by A1;

      ((A \and (x '=' (y,L))) \imp (A / (x0,y0))) in G1 & (((A \and (t1 '=' (t2,L))) \imp (A / (x0,y0))) \imp (A \imp ((t1 '=' (t2,L)) \imp (A / (x0,y0))))) in G1 by A0, A1, ThTwo, Th47;

      then (A \imp ((t1 '=' (t2,L)) \imp (A / (x0,y0)))) in G1 & (((t1 '=' (t2,L)) \imp (A / (x0,y0))) \imp (( \not (A / (x0,y0))) \imp ( \not (t1 '=' (t2,L))))) in G1 by Def38, Th57;

      then (A \imp (( \not (A / (x0,y0))) \imp ( \not (t1 '=' (t2,L))))) in G1 & ((A \imp (( \not (A / (x0,y0))) \imp ( \not (t1 '=' (t2,L))))) \imp ((A \and ( \not (A / (x0,y0)))) \imp ( \not (t1 '=' (t2,L))))) in G1 by Th45, Th48;

      hence thesis by Def38;

    end;

    begin

    reserve n for non empty natural number,

J for non empty non void Signature,

T for non-empty VarMSAlgebra over J,

X for non-empty GeneratorSet of T,

S for essentialJ -extension non empty non voidn PC-correct QC-correctn AL-correct AlgLangSignature over ( Union X),

L for non empty IfWhileAlgebra of X, S,

M,M1,M2 for Algorithm of L,

A,B,C,V for Formula of L,

H for AL-theory of V, L,

a for SortSymbol of J,

x,y for Element of (X . a),

t for Element of T, a;

    theorem :: AOFA_L00:154

    ((M * ((A \and B) \and C)) \iff (((M * A) \and (M * B)) \and (M * C))) in H

    proof

      

       A1: ((M * ((A \and B) \and C)) \iff ((M * (A \and B)) \and (M * C))) in H by Def43;

      ((M * (A \and B)) \iff ((M * A) \and (M * B))) in H by Def43;

      hence thesis by A1, Th98;

    end;

    theorem :: AOFA_L00:155

    ((M * ((A \or B) \or C)) \iff (((M * A) \or (M * B)) \or (M * C))) in H

    proof

      

       A1: ((M * ((A \or B) \or C)) \iff ((M * (A \or B)) \or (M * C))) in H by Def43;

      ((M * (A \or B)) \iff ((M * A) \or (M * B))) in H by Def43;

      hence thesis by A1, Th100;

    end;

    theorem :: AOFA_L00:156

    

     Th147: (A \iff B) in H implies (( \Cup (M,A)) \iff ( \Cup (M,B))) in H

    proof

      assume (A \iff B) in H;

      then (A \imp B) in H & (B \imp A) in H by Th43;

      then (( \Cup (M,A)) \imp ( \Cup (M,B))) in H & (( \Cup (M,B)) \imp ( \Cup (M,A))) in H by Def43;

      hence (( \Cup (M,A)) \iff ( \Cup (M,B))) in H by Th43;

    end;

    theorem :: AOFA_L00:157

    

     Th148: (A \iff B) in H implies (( \Cap (M,A)) \iff ( \Cap (M,B))) in H

    proof

      assume (A \iff B) in H;

      then (A \imp B) in H & (B \imp A) in H by Th43;

      then (( \Cap (M,A)) \imp ( \Cap (M,B))) in H & (( \Cap (M,B)) \imp ( \Cap (M,A))) in H by Def43;

      hence (( \Cap (M,A)) \iff ( \Cap (M,B))) in H by Th43;

    end;

    theorem :: AOFA_L00:158

    (( \Cup (M,A)) \iff ((A \or (M * A)) \or ( \Cup (M,((M \; M) * A))))) in H

    proof

      

       A1: (( \Cup (M,A)) \iff (A \or ( \Cup (M,(M * A))))) in H by Def43;

      (( \Cup (M,(M * A))) \iff ((M * A) \or ( \Cup (M,(M * (M * A)))))) in H by Def43;

      then

       A2: (( \Cup (M,A)) \iff (A \or ((M * A) \or ( \Cup (M,(M * (M * A))))))) in H by A1, Th99;

      (((A \or (M * A)) \or ( \Cup (M,(M * (M * A))))) \iff (A \or ((M * A) \or ( \Cup (M,(M * (M * A))))))) in H by Th76;

      then ((A \or ((M * A) \or ( \Cup (M,(M * (M * A)))))) \iff ((A \or (M * A)) \or ( \Cup (M,(M * (M * A)))))) in H by Th90;

      then

       A3: (( \Cup (M,A)) \iff ((A \or (M * A)) \or ( \Cup (M,(M * (M * A)))))) in H by A2, Th91;

      (((M \; M) * A) \iff (M * (M * A))) in H by Def43;

      then ((M * (M * A)) \iff ((M \; M) * A)) in H by Th90;

      then (( \Cup (M,(M * (M * A)))) \iff ( \Cup (M,((M \; M) * A)))) in H by Th147;

      hence thesis by A3, Th99;

    end;

    theorem :: AOFA_L00:159

    (( \Cap (M,A)) \iff ((A \and (M * A)) \and ( \Cap (M,((M \; M) * A))))) in H

    proof

      

       A1: (( \Cap (M,A)) \iff (A \and ( \Cap (M,(M * A))))) in H by Def43;

      (( \Cap (M,(M * A))) \iff ((M * A) \and ( \Cap (M,(M * (M * A)))))) in H by Def43;

      then

       A2: (( \Cap (M,A)) \iff (A \and ((M * A) \and ( \Cap (M,(M * (M * A))))))) in H by A1, Th97;

      (((A \and (M * A)) \and ( \Cap (M,(M * (M * A))))) \iff (A \and ((M * A) \and ( \Cap (M,(M * (M * A))))))) in H by Th78;

      then ((A \and ((M * A) \and ( \Cap (M,(M * (M * A)))))) \iff ((A \and (M * A)) \and ( \Cap (M,(M * (M * A)))))) in H by Th90;

      then

       A3: (( \Cap (M,A)) \iff ((A \and (M * A)) \and ( \Cap (M,(M * (M * A)))))) in H by A2, Th91;

      (((M \; M) * A) \iff (M * (M * A))) in H by Def43;

      then ((M * (M * A)) \iff ((M \; M) * A)) in H by Th90;

      then (( \Cap (M,(M * (M * A)))) \iff ( \Cap (M,((M \; M) * A)))) in H by Th148;

      hence thesis by A3, Th97;

    end;

    theorem :: AOFA_L00:160

    for x0,y0 be Element of ( Union (X extended_by ( {} ,the carrier of S))) st x = x0 & y = y0 holds (((x := (( @ y),L)) * A) \iff (A / (x0,y0))) in H

    proof

      let x0,y0 be Element of ( Union (X extended_by ( {} ,the carrier of S)));

      reconsider b = a as SortSymbol of S by Th8;

      reconsider t = ( @ y) as Element of (the Sorts of L . b) by Th16;

      assume

       A1: x = x0 & y = y0;

      then

       A2: (((x := (( @ y),L)) * A) \iff (A / (x0,t))) in H by Def43;

      

       A3: (X extended_by ( {} ,the carrier of S)) is ManySortedSubset of the Sorts of L by Th23;

      a in the carrier of J = ( dom X) by PARTFUN1:def 2;

      then b in ( dom (X | the carrier of S)) by RELAT_1: 57;

      

      then ((X extended_by ( {} ,the carrier of S)) . b) = ((X | the carrier of S) . b) by FUNCT_4: 13

      .= (X . b) by FUNCT_1: 49;

      hence thesis by A1, A2, A3, Th14;

    end;

    theorem :: AOFA_L00:161

    (M * V) in H & (M * (M1 * A)) in H or (M * ( \not V)) in H & (M * (M2 * A)) in H implies (( if-then-else (M,M1,M2)) * A) in H

    proof

      assume (M * V) in H & (M * (M1 * A)) in H or (M * ( \not V)) in H & (M * (M2 * A)) in H;

      then (((M * V) \and (M * (M1 * A))) in H or ((M * ( \not V)) \and (M * (M2 * A))) in H) & (((M * V) \and (M * (M1 * A))) \imp (((M * V) \and (M * (M1 * A))) \or ((M * ( \not V)) \and (M * (M2 * A))))) in H & (((M * ( \not V)) \and (M * (M2 * A))) \imp (((M * V) \and (M * (M1 * A))) \or ((M * ( \not V)) \and (M * (M2 * A))))) in H by Def38, Th35;

      then

       A1: (((M * V) \and (M * (M1 * A))) \or ((M * ( \not V)) \and (M * (M2 * A)))) in H by Def38;

      ((( if-then-else (M,M1,M2)) * A) \iff (((M * V) \and (M * (M1 * A))) \or ((M * ( \not V)) \and (M * (M2 * A))))) in H by Def43;

      then ((((M * V) \and (M * (M1 * A))) \or ((M * ( \not V)) \and (M * (M2 * A)))) \imp (( if-then-else (M,M1,M2)) * A)) in H by Th43;

      hence thesis by Def38, A1;

    end;

    theorem :: AOFA_L00:162

    (M * ( \not V)) in H & A in H or (M * V) in H & (M * (M1 * (( while (M,M1)) * A))) in H implies (( while (M,M1)) * A) in H

    proof

      assume (M * ( \not V)) in H & A in H or (M * V) in H & (M * (M1 * (( while (M,M1)) * A))) in H;

      then

       A1: ((M * ( \not V)) \and A) in H or ((M * V) \and (M * (M1 * (( while (M,M1)) * A)))) in H by Th35;

      (((M * ( \not V)) \and A) \imp (((M * ( \not V)) \and A) \or ((M * V) \and (M * (M1 * (( while (M,M1)) * A)))))) in H & (((M * V) \and (M * (M1 * (( while (M,M1)) * A)))) \imp (((M * ( \not V)) \and A) \or ((M * V) \and (M * (M1 * (( while (M,M1)) * A)))))) in H by Def38;

      then

       A2: (((M * ( \not V)) \and A) \or ((M * V) \and (M * (M1 * (( while (M,M1)) * A))))) in H by A1, Def38;

      ((( while (M,M1)) * A) \iff (((M * ( \not V)) \and A) \or ((M * V) \and (M * (M1 * (( while (M,M1)) * A)))))) in H by Def43;

      then ((((M * ( \not V)) \and A) \or ((M * V) \and (M * (M1 * (( while (M,M1)) * A))))) \imp (( while (M,M1)) * A)) in H by Th43;

      hence thesis by Def38, A2;

    end;