Article SUBSTUT1, MML version 4.99.1005

:: SUBSTUT1:funcnot 1 => SUBSTUT1:func 1
definition
  func vSUB -> set equals
    PFuncs(bound_QC-variables,bound_QC-variables);
end;

:: SUBSTUT1:def 1
theorem
vSUB = PFuncs(bound_QC-variables,bound_QC-variables);

:: SUBSTUT1:funcreg 1
registration
  cluster vSUB -> non empty;
end;

:: SUBSTUT1:modenot 1
definition
  mode CQC_Substitution is Element of vSUB;
end;

:: SUBSTUT1:funcreg 2
registration
  cluster vSUB -> functional;
end;

:: SUBSTUT1:funcnot 2 => SUBSTUT1:func 2
definition
  let a1 be Element of vSUB;
  func @ A1 -> Function-like Relation of bound_QC-variables,bound_QC-variables equals
    a1;
end;

:: SUBSTUT1:def 2
theorem
for b1 being Element of vSUB holds
   @ b1 = b1;

:: SUBSTUT1:th 1
theorem
for b1 being set
for b2 being Element of vSUB
      st b1 in proj1 b2
   holds b2 . b1 in bound_QC-variables;

:: SUBSTUT1:funcnot 3 => SUBSTUT1:func 3
definition
  let a1 be FinSequence of QC-variables;
  let a2 be Element of vSUB;
  func CQC_Subst(A1,A2) -> FinSequence of QC-variables means
    len it = len a1 &
     (for b1 being Element of NAT
           st 1 <= b1 & b1 <= len a1
        holds (a1 . b1 in proj1 a2 implies it . b1 = a2 . (a1 . b1)) &
         (a1 . b1 in proj1 a2 or it . b1 = a1 . b1));
end;

:: SUBSTUT1:def 3
theorem
for b1 being FinSequence of QC-variables
for b2 being Element of vSUB
for b3 being FinSequence of QC-variables holds
      b3 = CQC_Subst(b1,b2)
   iff
      len b3 = len b1 &
       (for b4 being Element of NAT
             st 1 <= b4 & b4 <= len b1
          holds (b1 . b4 in proj1 b2 implies b3 . b4 = b2 . (b1 . b4)) &
           (b1 . b4 in proj1 b2 or b3 . b4 = b1 . b4));

:: SUBSTUT1:funcnot 4 => SUBSTUT1:func 4
definition
  let a1 be FinSequence of bound_QC-variables;
  func @ A1 -> FinSequence of QC-variables equals
    a1;
end;

:: SUBSTUT1:def 4
theorem
for b1 being FinSequence of bound_QC-variables holds
   @ b1 = b1;

:: SUBSTUT1:funcnot 5 => SUBSTUT1:func 5
definition
  let a1 be FinSequence of bound_QC-variables;
  let a2 be Element of vSUB;
  func CQC_Subst(A1,A2) -> FinSequence of bound_QC-variables equals
    CQC_Subst(@ a1,a2);
end;

:: SUBSTUT1:def 5
theorem
for b1 being FinSequence of bound_QC-variables
for b2 being Element of vSUB holds
   CQC_Subst(b1,b2) = CQC_Subst(@ b1,b2);

:: SUBSTUT1:funcnot 6 => SUBSTUT1:func 6
definition
  let a1 be Element of vSUB;
  let a2 be set;
  redefine func a1 | a2 -> Element of vSUB;
end;

:: SUBSTUT1:exreg 1
registration
  cluster Relation-like Function-like finite Element of vSUB;
end;

:: SUBSTUT1:funcnot 7 => SUBSTUT1:func 7
definition
  let a1 be Element of bound_QC-variables;
  let a2 be Element of QC-WFF;
  let a3 be Element of vSUB;
  func RestrictSub(A1,A2,A3) -> finite Element of vSUB equals
    a3 | {b1 where b1 is Element of bound_QC-variables: b1 in still_not-bound_in a2 & b1 is Element of proj1 a3 & b1 <> a1 & b1 <> a3 . b1};
end;

:: SUBSTUT1:def 6
theorem
for b1 being Element of bound_QC-variables
for b2 being Element of QC-WFF
for b3 being Element of vSUB holds
   RestrictSub(b1,b2,b3) = b3 | {b4 where b4 is Element of bound_QC-variables: b4 in still_not-bound_in b2 & b4 is Element of proj1 b3 & b4 <> b1 & b4 <> b3 . b4};

:: SUBSTUT1:funcnot 8 => SUBSTUT1:func 8
definition
  let a1 be FinSequence of QC-variables;
  func Bound_Vars A1 -> Element of bool bound_QC-variables equals
    {a1 . b1 where b1 is Element of NAT: 1 <= b1 & b1 <= len a1 & a1 . b1 in bound_QC-variables};
end;

:: SUBSTUT1:def 7
theorem
for b1 being FinSequence of QC-variables holds
   Bound_Vars b1 = {b1 . b2 where b2 is Element of NAT: 1 <= b2 & b2 <= len b1 & b1 . b2 in bound_QC-variables};

:: SUBSTUT1:funcnot 9 => SUBSTUT1:func 9
definition
  let a1 be Element of QC-WFF;
  func Bound_Vars A1 -> Element of bool bound_QC-variables means
    ex b1 being Function-like quasi_total Relation of QC-WFF,bool bound_QC-variables st
       it = b1 . a1 &
        (for b2 being Element of QC-WFF
        for b3, b4 being Element of bool bound_QC-variables holds
        (b2 = VERUM implies b1 . b2 = {} bound_QC-variables) &
         (b2 is atomic implies b1 . b2 = Bound_Vars the_arguments_of b2) &
         (b2 is negative & b3 = b1 . the_argument_of b2 implies b1 . b2 = b3) &
         (b2 is conjunctive & b3 = b1 . the_left_argument_of b2 & b4 = b1 . the_right_argument_of b2 implies b1 . b2 = b3 \/ b4) &
         (b2 is universal & b3 = b1 . the_scope_of b2 implies b1 . b2 = b3 \/ {bound_in b2}));
end;

:: SUBSTUT1:def 8
theorem
for b1 being Element of QC-WFF
for b2 being Element of bool bound_QC-variables holds
      b2 = Bound_Vars b1
   iff
      ex b3 being Function-like quasi_total Relation of QC-WFF,bool bound_QC-variables st
         b2 = b3 . b1 &
          (for b4 being Element of QC-WFF
          for b5, b6 being Element of bool bound_QC-variables holds
          (b4 = VERUM implies b3 . b4 = {} bound_QC-variables) &
           (b4 is atomic implies b3 . b4 = Bound_Vars the_arguments_of b4) &
           (b4 is negative & b5 = b3 . the_argument_of b4 implies b3 . b4 = b5) &
           (b4 is conjunctive & b5 = b3 . the_left_argument_of b4 & b6 = b3 . the_right_argument_of b4 implies b3 . b4 = b5 \/ b6) &
           (b4 is universal & b5 = b3 . the_scope_of b4 implies b3 . b4 = b5 \/ {bound_in b4}));

:: SUBSTUT1:th 2
theorem
Bound_Vars VERUM = {};

:: SUBSTUT1:th 3
theorem
for b1 being Element of QC-WFF
      st b1 is atomic
   holds Bound_Vars b1 = Bound_Vars the_arguments_of b1;

:: SUBSTUT1:th 4
theorem
for b1 being Element of QC-WFF
      st b1 is negative
   holds Bound_Vars b1 = Bound_Vars the_argument_of b1;

:: SUBSTUT1:th 5
theorem
for b1 being Element of QC-WFF
      st b1 is conjunctive
   holds Bound_Vars b1 = (Bound_Vars the_left_argument_of b1) \/ Bound_Vars the_right_argument_of b1;

:: SUBSTUT1:th 6
theorem
for b1 being Element of QC-WFF
      st b1 is universal
   holds Bound_Vars b1 = (Bound_Vars the_scope_of b1) \/ {bound_in b1};

:: SUBSTUT1:funcreg 3
registration
  let a1 be Element of QC-WFF;
  cluster Bound_Vars a1 -> finite;
end;

:: SUBSTUT1:funcnot 10 => SUBSTUT1:func 10
definition
  let a1 be Element of QC-WFF;
  func Dom_Bound_Vars A1 -> finite Element of bool NAT equals
    {b1 where b1 is Element of NAT: x. b1 in Bound_Vars a1};
end;

:: SUBSTUT1:def 9
theorem
for b1 being Element of QC-WFF holds
   Dom_Bound_Vars b1 = {b2 where b2 is Element of NAT: x. b2 in Bound_Vars b1};

:: SUBSTUT1:funcnot 11 => SUBSTUT1:func 11
definition
  let a1 be finite Element of vSUB;
  func Sub_Var A1 -> finite Element of bool NAT equals
    {b1 where b1 is Element of NAT: x. b1 in proj2 a1};
end;

:: SUBSTUT1:def 10
theorem
for b1 being finite Element of vSUB holds
   Sub_Var b1 = {b2 where b2 is Element of NAT: x. b2 in proj2 b1};

:: SUBSTUT1:funcnot 12 => SUBSTUT1:func 12
definition
  let a1 be Element of QC-WFF;
  let a2 be finite Element of vSUB;
  func NSub(A1,A2) -> non empty Element of bool NAT equals
    NAT \ ((Dom_Bound_Vars a1) \/ Sub_Var a2);
end;

:: SUBSTUT1:def 11
theorem
for b1 being Element of QC-WFF
for b2 being finite Element of vSUB holds
   NSub(b1,b2) = NAT \ ((Dom_Bound_Vars b1) \/ Sub_Var b2);

:: SUBSTUT1:funcnot 13 => SUBSTUT1:func 13
definition
  let a1 be finite Element of vSUB;
  let a2 be Element of QC-WFF;
  func upVar(A1,A2) -> Element of NAT equals
    min NSub(a2,a1);
end;

:: SUBSTUT1:def 12
theorem
for b1 being finite Element of vSUB
for b2 being Element of QC-WFF holds
   upVar(b1,b2) = min NSub(b2,b1);

:: SUBSTUT1:funcnot 14 => SUBSTUT1:func 14
definition
  let a1 be Element of bound_QC-variables;
  let a2 be Element of QC-WFF;
  let a3 be finite Element of vSUB;
  assume ex b1 being Element of vSUB st
       a3 = RestrictSub(a1,All(a1,a2),b1);
  func ExpandSub(A1,A2,A3) -> Element of vSUB equals
    a3 \/ {[a1,x. upVar(a3,a2)]}
    if a1 in proj2 a3
    otherwise a3 \/ {[a1,a1]};
end;

:: SUBSTUT1:def 13
theorem
for b1 being Element of bound_QC-variables
for b2 being Element of QC-WFF
for b3 being finite Element of vSUB
      st ex b4 being Element of vSUB st
           b3 = RestrictSub(b1,All(b1,b2),b4)
   holds (b1 in proj2 b3 implies ExpandSub(b1,b2,b3) = b3 \/ {[b1,x. upVar(b3,b2)]}) &
    (b1 in proj2 b3 or ExpandSub(b1,b2,b3) = b3 \/ {[b1,b1]});

:: SUBSTUT1:prednot 1 => SUBSTUT1:pred 1
definition
  let a1 be Element of QC-WFF;
  let a2 be Element of vSUB;
  let a3 be set;
  pred A1,A2 PQSub A3 means
    (a1 is universal implies a3 = ExpandSub(bound_in a1,the_scope_of a1,RestrictSub(bound_in a1,a1,a2))) &
     (a1 is universal or a3 = {});
end;

:: SUBSTUT1:dfs 14
definiens
  let a1 be Element of QC-WFF;
  let a2 be Element of vSUB;
  let a3 be set;
To prove
     a1,a2 PQSub a3
it is sufficient to prove
  thus (a1 is universal implies a3 = ExpandSub(bound_in a1,the_scope_of a1,RestrictSub(bound_in a1,a1,a2))) &
     (a1 is universal or a3 = {});

:: SUBSTUT1:def 14
theorem
for b1 being Element of QC-WFF
for b2 being Element of vSUB
for b3 being set holds
      b1,b2 PQSub b3
   iff
      (b1 is universal implies b3 = ExpandSub(bound_in b1,the_scope_of b1,RestrictSub(bound_in b1,b1,b2))) &
       (b1 is universal or b3 = {});

:: SUBSTUT1:funcnot 15 => SUBSTUT1:func 15
definition
  func QSub -> Relation-like Function-like set means
    for b1 being set holds
          b1 in it
       iff
          ex b2 being Element of QC-WFF st
             ex b3 being Element of vSUB st
                ex b4 being set st
                   b1 = [[b2,b3],b4] & b2,b3 PQSub b4;
end;

:: SUBSTUT1:def 15
theorem
for b1 being Relation-like Function-like set holds
      b1 = QSub
   iff
      for b2 being set holds
            b2 in b1
         iff
            ex b3 being Element of QC-WFF st
               ex b4 being Element of vSUB st
                  ex b5 being set st
                     b2 = [[b3,b4],b5] & b3,b4 PQSub b5;

:: SUBSTUT1:th 7
theorem
[:QC-WFF,vSUB:] is Element of bool [:[:NAT,NAT:] *,vSUB:] &
 (for b1 being Element of NAT
 for b2 being Element of b1 -ary_QC-pred_symbols
 for b3 being QC-variable_list of b1
 for b4 being Element of vSUB holds
    [<*b2*> ^ b3,b4] in [:QC-WFF,vSUB:]) &
 (for b1 being Element of vSUB holds
    [<*[0,0]*>,b1] in [:QC-WFF,vSUB:]) &
 (for b1 being FinSequence of [:NAT,NAT:]
 for b2 being Element of vSUB
       st [b1,b2] in [:QC-WFF,vSUB:]
    holds [<*[1,0]*> ^ b1,b2] in [:QC-WFF,vSUB:]) &
 (for b1, b2 being FinSequence of [:NAT,NAT:]
 for b3 being Element of vSUB
       st [b1,b3] in [:QC-WFF,vSUB:] &
          [b2,b3] in [:QC-WFF,vSUB:]
    holds [(<*[2,0]*> ^ b1) ^ b2,b3] in [:QC-WFF,vSUB:]) &
 (for b1 being Element of bound_QC-variables
 for b2 being FinSequence of [:NAT,NAT:]
 for b3 being Element of vSUB
       st [b2,QSub . [(<*[3,0]*> ^ <*b1*>) ^ b2,b3]] in [:QC-WFF,vSUB:]
    holds [(<*[3,0]*> ^ <*b1*>) ^ b2,b3] in [:QC-WFF,vSUB:]);

:: SUBSTUT1:attrnot 1 => SUBSTUT1:attr 1
definition
  let a1 be set;
  attr a1 is QC-Sub-closed means
    a1 is Element of bool [:[:NAT,NAT:] *,vSUB:] &
     (for b1 being Element of NAT
     for b2 being Element of b1 -ary_QC-pred_symbols
     for b3 being QC-variable_list of b1
     for b4 being Element of vSUB holds
        [<*b2*> ^ b3,b4] in a1) &
     (for b1 being Element of vSUB holds
        [<*[0,0]*>,b1] in a1) &
     (for b1 being FinSequence of [:NAT,NAT:]
     for b2 being Element of vSUB
           st [b1,b2] in a1
        holds [<*[1,0]*> ^ b1,b2] in a1) &
     (for b1, b2 being FinSequence of [:NAT,NAT:]
     for b3 being Element of vSUB
           st [b1,b3] in a1 & [b2,b3] in a1
        holds [(<*[2,0]*> ^ b1) ^ b2,b3] in a1) &
     (for b1 being Element of bound_QC-variables
     for b2 being FinSequence of [:NAT,NAT:]
     for b3 being Element of vSUB
           st [b2,QSub . [(<*[3,0]*> ^ <*b1*>) ^ b2,b3]] in a1
        holds [(<*[3,0]*> ^ <*b1*>) ^ b2,b3] in a1);
end;

:: SUBSTUT1:dfs 16
definiens
  let a1 be set;
To prove
     a1 is QC-Sub-closed
it is sufficient to prove
  thus a1 is Element of bool [:[:NAT,NAT:] *,vSUB:] &
     (for b1 being Element of NAT
     for b2 being Element of b1 -ary_QC-pred_symbols
     for b3 being QC-variable_list of b1
     for b4 being Element of vSUB holds
        [<*b2*> ^ b3,b4] in a1) &
     (for b1 being Element of vSUB holds
        [<*[0,0]*>,b1] in a1) &
     (for b1 being FinSequence of [:NAT,NAT:]
     for b2 being Element of vSUB
           st [b1,b2] in a1
        holds [<*[1,0]*> ^ b1,b2] in a1) &
     (for b1, b2 being FinSequence of [:NAT,NAT:]
     for b3 being Element of vSUB
           st [b1,b3] in a1 & [b2,b3] in a1
        holds [(<*[2,0]*> ^ b1) ^ b2,b3] in a1) &
     (for b1 being Element of bound_QC-variables
     for b2 being FinSequence of [:NAT,NAT:]
     for b3 being Element of vSUB
           st [b2,QSub . [(<*[3,0]*> ^ <*b1*>) ^ b2,b3]] in a1
        holds [(<*[3,0]*> ^ <*b1*>) ^ b2,b3] in a1);

:: SUBSTUT1:def 16
theorem
for b1 being set holds
      b1 is QC-Sub-closed
   iff
      b1 is Element of bool [:[:NAT,NAT:] *,vSUB:] &
       (for b2 being Element of NAT
       for b3 being Element of b2 -ary_QC-pred_symbols
       for b4 being QC-variable_list of b2
       for b5 being Element of vSUB holds
          [<*b3*> ^ b4,b5] in b1) &
       (for b2 being Element of vSUB holds
          [<*[0,0]*>,b2] in b1) &
       (for b2 being FinSequence of [:NAT,NAT:]
       for b3 being Element of vSUB
             st [b2,b3] in b1
          holds [<*[1,0]*> ^ b2,b3] in b1) &
       (for b2, b3 being FinSequence of [:NAT,NAT:]
       for b4 being Element of vSUB
             st [b2,b4] in b1 & [b3,b4] in b1
          holds [(<*[2,0]*> ^ b2) ^ b3,b4] in b1) &
       (for b2 being Element of bound_QC-variables
       for b3 being FinSequence of [:NAT,NAT:]
       for b4 being Element of vSUB
             st [b3,QSub . [(<*[3,0]*> ^ <*b2*>) ^ b3,b4]] in b1
          holds [(<*[3,0]*> ^ <*b2*>) ^ b3,b4] in b1);

:: SUBSTUT1:exreg 2
registration
  cluster non empty QC-Sub-closed set;
end;

:: SUBSTUT1:funcnot 16 => SUBSTUT1:func 16
definition
  func QC-Sub-WFF -> non empty set means
    it is QC-Sub-closed &
     (for b1 being non empty set
           st b1 is QC-Sub-closed
        holds it c= b1);
end;

:: SUBSTUT1:def 17
theorem
for b1 being non empty set holds
      b1 = QC-Sub-WFF
   iff
      b1 is QC-Sub-closed &
       (for b2 being non empty set
             st b2 is QC-Sub-closed
          holds b1 c= b2);

:: SUBSTUT1:th 8
theorem
for b1 being Element of QC-Sub-WFF holds
   ex b2 being Element of QC-WFF st
      ex b3 being Element of vSUB st
         b1 = [b2,b3];

:: SUBSTUT1:funcreg 4
registration
  cluster QC-Sub-WFF -> non empty QC-Sub-closed;
end;

:: SUBSTUT1:funcnot 17 => SUBSTUT1:func 17
definition
  let a1 be Element of QC-pred_symbols;
  let a2 be FinSequence of QC-variables;
  let a3 be Element of vSUB;
  assume the_arity_of a1 = len a2;
  func Sub_P(A1,A2,A3) -> Element of QC-Sub-WFF equals
    [a1 ! a2,a3];
end;

:: SUBSTUT1:def 18
theorem
for b1 being Element of QC-pred_symbols
for b2 being FinSequence of QC-variables
for b3 being Element of vSUB
      st the_arity_of b1 = len b2
   holds Sub_P(b1,b2,b3) = [b1 ! b2,b3];

:: SUBSTUT1:th 9
theorem
for b1 being Element of vSUB
for b2 being Element of NAT
for b3 being Element of b2 -ary_QC-pred_symbols
for b4 being QC-variable_list of b2 holds
   Sub_P(b3,b4,b1) = [b3 ! b4,b1];

:: SUBSTUT1:attrnot 2 => SUBSTUT1:attr 2
definition
  let a1 be Element of QC-Sub-WFF;
  attr a1 is Sub_VERUM means
    ex b1 being Element of vSUB st
       a1 = [VERUM,b1];
end;

:: SUBSTUT1:dfs 19
definiens
  let a1 be Element of QC-Sub-WFF;
To prove
     a1 is Sub_VERUM
it is sufficient to prove
  thus ex b1 being Element of vSUB st
       a1 = [VERUM,b1];

:: SUBSTUT1:def 19
theorem
for b1 being Element of QC-Sub-WFF holds
      b1 is Sub_VERUM
   iff
      ex b2 being Element of vSUB st
         b1 = [VERUM,b2];

:: SUBSTUT1:funcnot 18 => SUBSTUT1:func 18
definition
  let a1 be Element of QC-Sub-WFF;
  redefine func a1 `1 -> Element of QC-WFF;
end;

:: SUBSTUT1:funcnot 19 => SUBSTUT1:func 19
definition
  let a1 be Element of QC-Sub-WFF;
  redefine func a1 `2 -> Element of vSUB;
end;

:: SUBSTUT1:th 10
theorem
for b1 being Element of QC-Sub-WFF holds
   b1 = [b1 `1,b1 `2];

:: SUBSTUT1:funcnot 20 => SUBSTUT1:func 20
definition
  let a1 be Element of QC-Sub-WFF;
  func Sub_not A1 -> Element of QC-Sub-WFF equals
    ['not' (a1 `1),a1 `2];
end;

:: SUBSTUT1:def 20
theorem
for b1 being Element of QC-Sub-WFF holds
   Sub_not b1 = ['not' (b1 `1),b1 `2];

:: SUBSTUT1:funcnot 21 => SUBSTUT1:func 21
definition
  let a1, a2 be Element of QC-Sub-WFF;
  assume a1 `2 = a2 `2;
  func Sub_&(A1,A2) -> Element of QC-Sub-WFF equals
    [a1 `1 '&' (a2 `1),a1 `2];
end;

:: SUBSTUT1:def 21
theorem
for b1, b2 being Element of QC-Sub-WFF
      st b1 `2 = b2 `2
   holds Sub_&(b1,b2) = [b1 `1 '&' (b2 `1),b1 `2];

:: SUBSTUT1:funcnot 22 => SUBSTUT1:func 22
definition
  let a1 be Element of [:QC-Sub-WFF,bound_QC-variables:];
  redefine func a1 `1 -> Element of QC-Sub-WFF;
end;

:: SUBSTUT1:funcnot 23 => SUBSTUT1:func 23
definition
  let a1 be Element of [:QC-Sub-WFF,bound_QC-variables:];
  redefine func a1 `2 -> Element of bound_QC-variables;
end;

:: SUBSTUT1:attrnot 3 => SUBSTUT1:attr 3
definition
  let a1 be Element of [:QC-Sub-WFF,bound_QC-variables:];
  attr a1 is quantifiable means
    ex b1 being Element of vSUB st
       a1 `1 `2 = QSub . [All(a1 `2,a1 `1 `1),b1];
end;

:: SUBSTUT1:dfs 22
definiens
  let a1 be Element of [:QC-Sub-WFF,bound_QC-variables:];
To prove
     a1 is quantifiable
it is sufficient to prove
  thus ex b1 being Element of vSUB st
       a1 `1 `2 = QSub . [All(a1 `2,a1 `1 `1),b1];

:: SUBSTUT1:def 22
theorem
for b1 being Element of [:QC-Sub-WFF,bound_QC-variables:] holds
      b1 is quantifiable
   iff
      ex b2 being Element of vSUB st
         b1 `1 `2 = QSub . [All(b1 `2,b1 `1 `1),b2];

:: SUBSTUT1:modenot 2 => SUBSTUT1:mode 1
definition
  let a1 be Element of [:QC-Sub-WFF,bound_QC-variables:];
  assume a1 is quantifiable;
  mode second_Q_comp of A1 -> Element of vSUB means
    a1 `1 `2 = QSub . [All(a1 `2,a1 `1 `1),it];
end;

:: SUBSTUT1:dfs 23
definiens
  let a1 be Element of [:QC-Sub-WFF,bound_QC-variables:];
  let a2 be Element of vSUB;
To prove
     a2 is second_Q_comp of a1
it is sufficient to prove
thus a1 is quantifiable;
  thus a1 `1 `2 = QSub . [All(a1 `2,a1 `1 `1),a2];

:: SUBSTUT1:def 23
theorem
for b1 being Element of [:QC-Sub-WFF,bound_QC-variables:]
   st b1 is quantifiable
for b2 being Element of vSUB holds
      b2 is second_Q_comp of b1
   iff
      b1 `1 `2 = QSub . [All(b1 `2,b1 `1 `1),b2];

:: SUBSTUT1:funcnot 24 => SUBSTUT1:func 24
definition
  let a1 be Element of [:QC-Sub-WFF,bound_QC-variables:];
  let a2 be second_Q_comp of a1;
  assume a1 is quantifiable;
  func Sub_All(A1,A2) -> Element of QC-Sub-WFF equals
    [All(a1 `2,a1 `1 `1),a2];
end;

:: SUBSTUT1:def 24
theorem
for b1 being Element of [:QC-Sub-WFF,bound_QC-variables:]
for b2 being second_Q_comp of b1
      st b1 is quantifiable
   holds Sub_All(b1,b2) = [All(b1 `2,b1 `1 `1),b2];

:: SUBSTUT1:funcnot 25 => SUBSTUT1:func 25
definition
  let a1 be Element of QC-Sub-WFF;
  let a2 be Element of bound_QC-variables;
  redefine func [a1, a2] -> Element of [:QC-Sub-WFF,bound_QC-variables:];
end;

:: SUBSTUT1:sch 1
scheme SUBSTUT1:sch 1
for b1 being Element of QC-Sub-WFF holds
   P1[b1]
provided
   for b1 being Element of NAT
   for b2 being Element of b1 -ary_QC-pred_symbols
   for b3 being QC-variable_list of b1
   for b4 being Element of vSUB holds
      P1[Sub_P(b2,b3,b4)]
and
   for b1 being Element of QC-Sub-WFF
         st b1 is Sub_VERUM
      holds P1[b1]
and
   for b1 being Element of QC-Sub-WFF
         st P1[b1]
      holds P1[Sub_not b1]
and
   for b1, b2 being Element of QC-Sub-WFF
         st b1 `2 = b2 `2 & P1[b1] & P1[b2]
      holds P1[Sub_&(b1,b2)]
and
   for b1 being Element of bound_QC-variables
   for b2 being Element of QC-Sub-WFF
   for b3 being second_Q_comp of [b2,b1]
         st [b2,b1] is quantifiable & P1[b2]
      holds P1[Sub_All([b2,b1],b3)];


:: SUBSTUT1:attrnot 4 => SUBSTUT1:attr 4
definition
  let a1 be Element of QC-Sub-WFF;
  attr a1 is Sub_atomic means
    ex b1 being Element of NAT st
       ex b2 being Element of b1 -ary_QC-pred_symbols st
          ex b3 being QC-variable_list of b1 st
             ex b4 being Element of vSUB st
                a1 = Sub_P(b2,b3,b4);
end;

:: SUBSTUT1:dfs 25
definiens
  let a1 be Element of QC-Sub-WFF;
To prove
     a1 is Sub_atomic
it is sufficient to prove
  thus ex b1 being Element of NAT st
       ex b2 being Element of b1 -ary_QC-pred_symbols st
          ex b3 being QC-variable_list of b1 st
             ex b4 being Element of vSUB st
                a1 = Sub_P(b2,b3,b4);

:: SUBSTUT1:def 25
theorem
for b1 being Element of QC-Sub-WFF holds
      b1 is Sub_atomic
   iff
      ex b2 being Element of NAT st
         ex b3 being Element of b2 -ary_QC-pred_symbols st
            ex b4 being QC-variable_list of b2 st
               ex b5 being Element of vSUB st
                  b1 = Sub_P(b3,b4,b5);

:: SUBSTUT1:th 11
theorem
for b1 being Element of QC-Sub-WFF
      st b1 is Sub_atomic
   holds b1 `1 is atomic;

:: SUBSTUT1:funcreg 5
registration
  let a1 be Element of NAT;
  let a2 be Element of a1 -ary_QC-pred_symbols;
  let a3 be QC-variable_list of a1;
  let a4 be Element of vSUB;
  cluster Sub_P(a2,a3,a4) -> Sub_atomic;
end;

:: SUBSTUT1:attrnot 5 => SUBSTUT1:attr 5
definition
  let a1 be Element of QC-Sub-WFF;
  attr a1 is Sub_negative means
    ex b1 being Element of QC-Sub-WFF st
       a1 = Sub_not b1;
end;

:: SUBSTUT1:dfs 26
definiens
  let a1 be Element of QC-Sub-WFF;
To prove
     a1 is Sub_negative
it is sufficient to prove
  thus ex b1 being Element of QC-Sub-WFF st
       a1 = Sub_not b1;

:: SUBSTUT1:def 26
theorem
for b1 being Element of QC-Sub-WFF holds
      b1 is Sub_negative
   iff
      ex b2 being Element of QC-Sub-WFF st
         b1 = Sub_not b2;

:: SUBSTUT1:attrnot 6 => SUBSTUT1:attr 6
definition
  let a1 be Element of QC-Sub-WFF;
  attr a1 is Sub_conjunctive means
    ex b1, b2 being Element of QC-Sub-WFF st
       a1 = Sub_&(b1,b2) & b1 `2 = b2 `2;
end;

:: SUBSTUT1:dfs 27
definiens
  let a1 be Element of QC-Sub-WFF;
To prove
     a1 is Sub_conjunctive
it is sufficient to prove
  thus ex b1, b2 being Element of QC-Sub-WFF st
       a1 = Sub_&(b1,b2) & b1 `2 = b2 `2;

:: SUBSTUT1:def 27
theorem
for b1 being Element of QC-Sub-WFF holds
      b1 is Sub_conjunctive
   iff
      ex b2, b3 being Element of QC-Sub-WFF st
         b1 = Sub_&(b2,b3) & b2 `2 = b3 `2;

:: SUBSTUT1:attrnot 7 => SUBSTUT1:attr 7
definition
  let a1 be set;
  attr a1 is Sub_universal means
    ex b1 being Element of [:QC-Sub-WFF,bound_QC-variables:] st
       ex b2 being second_Q_comp of b1 st
          a1 = Sub_All(b1,b2) & b1 is quantifiable;
end;

:: SUBSTUT1:dfs 28
definiens
  let a1 be set;
To prove
     a1 is Sub_universal
it is sufficient to prove
  thus ex b1 being Element of [:QC-Sub-WFF,bound_QC-variables:] st
       ex b2 being second_Q_comp of b1 st
          a1 = Sub_All(b1,b2) & b1 is quantifiable;

:: SUBSTUT1:def 28
theorem
for b1 being set holds
      b1 is Sub_universal
   iff
      ex b2 being Element of [:QC-Sub-WFF,bound_QC-variables:] st
         ex b3 being second_Q_comp of b2 st
            b1 = Sub_All(b2,b3) & b2 is quantifiable;

:: SUBSTUT1:th 12
theorem
for b1 being Element of QC-Sub-WFF
      st b1 is not Sub_VERUM & b1 is not Sub_atomic & b1 is not Sub_negative & b1 is not Sub_conjunctive
   holds b1 is Sub_universal;

:: SUBSTUT1:funcnot 26 => SUBSTUT1:func 26
definition
  let a1 be Element of QC-Sub-WFF;
  assume a1 is Sub_atomic;
  func Sub_the_arguments_of A1 -> FinSequence of QC-variables means
    ex b1 being Element of NAT st
       ex b2 being Element of b1 -ary_QC-pred_symbols st
          ex b3 being QC-variable_list of b1 st
             ex b4 being Element of vSUB st
                it = b3 & a1 = Sub_P(b2,b3,b4);
end;

:: SUBSTUT1:def 29
theorem
for b1 being Element of QC-Sub-WFF
   st b1 is Sub_atomic
for b2 being FinSequence of QC-variables holds
      b2 = Sub_the_arguments_of b1
   iff
      ex b3 being Element of NAT st
         ex b4 being Element of b3 -ary_QC-pred_symbols st
            ex b5 being QC-variable_list of b3 st
               ex b6 being Element of vSUB st
                  b2 = b5 & b1 = Sub_P(b4,b5,b6);

:: SUBSTUT1:funcnot 27 => SUBSTUT1:func 27
definition
  let a1 be Element of QC-Sub-WFF;
  assume a1 is Sub_negative;
  func Sub_the_argument_of A1 -> Element of QC-Sub-WFF means
    a1 = Sub_not it;
end;

:: SUBSTUT1:def 30
theorem
for b1 being Element of QC-Sub-WFF
   st b1 is Sub_negative
for b2 being Element of QC-Sub-WFF holds
      b2 = Sub_the_argument_of b1
   iff
      b1 = Sub_not b2;

:: SUBSTUT1:funcnot 28 => SUBSTUT1:func 28
definition
  let a1 be Element of QC-Sub-WFF;
  assume a1 is Sub_conjunctive;
  func Sub_the_left_argument_of A1 -> Element of QC-Sub-WFF means
    ex b1 being Element of QC-Sub-WFF st
       a1 = Sub_&(it,b1) & it `2 = b1 `2;
end;

:: SUBSTUT1:def 31
theorem
for b1 being Element of QC-Sub-WFF
   st b1 is Sub_conjunctive
for b2 being Element of QC-Sub-WFF holds
      b2 = Sub_the_left_argument_of b1
   iff
      ex b3 being Element of QC-Sub-WFF st
         b1 = Sub_&(b2,b3) & b2 `2 = b3 `2;

:: SUBSTUT1:funcnot 29 => SUBSTUT1:func 29
definition
  let a1 be Element of QC-Sub-WFF;
  assume a1 is Sub_conjunctive;
  func Sub_the_right_argument_of A1 -> Element of QC-Sub-WFF means
    ex b1 being Element of QC-Sub-WFF st
       a1 = Sub_&(b1,it) & b1 `2 = it `2;
end;

:: SUBSTUT1:def 32
theorem
for b1 being Element of QC-Sub-WFF
   st b1 is Sub_conjunctive
for b2 being Element of QC-Sub-WFF holds
      b2 = Sub_the_right_argument_of b1
   iff
      ex b3 being Element of QC-Sub-WFF st
         b1 = Sub_&(b3,b2) & b3 `2 = b2 `2;

:: SUBSTUT1:funcnot 30 => SUBSTUT1:func 30
definition
  let a1 be set;
  assume a1 is Sub_universal;
  func Sub_the_bound_of A1 -> Element of bound_QC-variables means
    ex b1 being Element of [:QC-Sub-WFF,bound_QC-variables:] st
       ex b2 being second_Q_comp of b1 st
          a1 = Sub_All(b1,b2) & b1 `2 = it & b1 is quantifiable;
end;

:: SUBSTUT1:def 33
theorem
for b1 being set
   st b1 is Sub_universal
for b2 being Element of bound_QC-variables holds
      b2 = Sub_the_bound_of b1
   iff
      ex b3 being Element of [:QC-Sub-WFF,bound_QC-variables:] st
         ex b4 being second_Q_comp of b3 st
            b1 = Sub_All(b3,b4) & b3 `2 = b2 & b3 is quantifiable;

:: SUBSTUT1:funcnot 31 => SUBSTUT1:func 31
definition
  let a1 be set;
  assume a1 is Sub_universal;
  func Sub_the_scope_of A1 -> Element of QC-Sub-WFF means
    ex b1 being Element of [:QC-Sub-WFF,bound_QC-variables:] st
       ex b2 being second_Q_comp of b1 st
          a1 = Sub_All(b1,b2) & b1 `1 = it & b1 is quantifiable;
end;

:: SUBSTUT1:def 34
theorem
for b1 being set
   st b1 is Sub_universal
for b2 being Element of QC-Sub-WFF holds
      b2 = Sub_the_scope_of b1
   iff
      ex b3 being Element of [:QC-Sub-WFF,bound_QC-variables:] st
         ex b4 being second_Q_comp of b3 st
            b1 = Sub_All(b3,b4) & b3 `1 = b2 & b3 is quantifiable;

:: SUBSTUT1:funcreg 6
registration
  let a1 be Element of QC-Sub-WFF;
  cluster Sub_not a1 -> Sub_negative;
end;

:: SUBSTUT1:th 13
theorem
for b1, b2 being Element of QC-Sub-WFF
      st b1 `2 = b2 `2
   holds Sub_&(b1,b2) is Sub_conjunctive;

:: SUBSTUT1:th 14
theorem
for b1 being Element of [:QC-Sub-WFF,bound_QC-variables:]
for b2 being second_Q_comp of b1
      st b1 is quantifiable
   holds Sub_All(b1,b2) is Sub_universal;

:: SUBSTUT1:th 15
theorem
for b1, b2 being Element of QC-Sub-WFF
      st Sub_not b1 = Sub_not b2
   holds b1 = b2;

:: SUBSTUT1:th 16
theorem
for b1 being Element of QC-Sub-WFF holds
   Sub_the_argument_of Sub_not b1 = b1;

:: SUBSTUT1:th 17
theorem
for b1, b2, b3, b4 being Element of QC-Sub-WFF
      st b1 `2 = b2 `2 & b3 `2 = b4 `2 & Sub_&(b1,b2) = Sub_&(b3,b4)
   holds b1 = b3 & b2 = b4;

:: SUBSTUT1:th 18
theorem
for b1, b2 being Element of QC-Sub-WFF
      st b1 `2 = b2 `2
   holds Sub_the_left_argument_of Sub_&(b1,b2) = b1;

:: SUBSTUT1:th 19
theorem
for b1, b2 being Element of QC-Sub-WFF
      st b1 `2 = b2 `2
   holds Sub_the_right_argument_of Sub_&(b1,b2) = b2;

:: SUBSTUT1:th 20
theorem
for b1, b2 being Element of [:QC-Sub-WFF,bound_QC-variables:]
for b3 being second_Q_comp of b1
for b4 being second_Q_comp of b2
      st b1 is quantifiable & b2 is quantifiable & Sub_All(b1,b3) = Sub_All(b2,b4)
   holds b1 = b2;

:: SUBSTUT1:th 21
theorem
for b1 being Element of [:QC-Sub-WFF,bound_QC-variables:]
for b2 being second_Q_comp of b1
      st b1 is quantifiable
   holds Sub_the_scope_of Sub_All(b1,b2) = b1 `1;

:: SUBSTUT1:sch 2
scheme SUBSTUT1:sch 2
for b1 being Element of QC-Sub-WFF holds
   P1[b1]
provided
   for b1 being Element of QC-Sub-WFF holds
      (b1 is Sub_atomic implies P1[b1]) &
       (b1 is Sub_VERUM implies P1[b1]) &
       (b1 is Sub_negative & P1[Sub_the_argument_of b1] implies P1[b1]) &
       (b1 is Sub_conjunctive & P1[Sub_the_left_argument_of b1] & P1[Sub_the_right_argument_of b1] implies P1[b1]) &
       (b1 is Sub_universal & P1[Sub_the_scope_of b1] implies P1[b1]);


:: SUBSTUT1:th 22
theorem
for b1 being Element of QC-Sub-WFF
      st b1 is Sub_negative
   holds len @ ((Sub_the_argument_of b1) `1) < len @ (b1 `1);

:: SUBSTUT1:th 23
theorem
for b1 being Element of QC-Sub-WFF
      st b1 is Sub_conjunctive
   holds len @ ((Sub_the_left_argument_of b1) `1) < len @ (b1 `1) &
    len @ ((Sub_the_right_argument_of b1) `1) < len @ (b1 `1);

:: SUBSTUT1:th 24
theorem
for b1 being Element of QC-Sub-WFF
      st b1 is Sub_universal
   holds len @ ((Sub_the_scope_of b1) `1) < len @ (b1 `1);

:: SUBSTUT1:th 25
theorem
for b1 being Element of QC-Sub-WFF holds
   (b1 is Sub_VERUM implies ((@ (b1 `1)) . 1) `1 = 0) &
    (b1 is Sub_atomic implies ex b2 being Element of NAT st
       (@ (b1 `1)) . 1 is Element of b2 -ary_QC-pred_symbols) &
    (b1 is Sub_negative implies ((@ (b1 `1)) . 1) `1 = 1) &
    (b1 is Sub_conjunctive implies ((@ (b1 `1)) . 1) `1 = 2) &
    (b1 is Sub_universal implies ((@ (b1 `1)) . 1) `1 = 3);

:: SUBSTUT1:th 26
theorem
for b1 being Element of QC-Sub-WFF
      st b1 is Sub_atomic
   holds ((@ (b1 `1)) . 1) `1 <> 0 &
    ((@ (b1 `1)) . 1) `1 <> 1 &
    ((@ (b1 `1)) . 1) `1 <> 2 &
    ((@ (b1 `1)) . 1) `1 <> 3;

:: SUBSTUT1:th 27
theorem
for b1 being Element of QC-Sub-WFF holds
   (b1 is Sub_atomic implies b1 is not Sub_negative) & (b1 is Sub_atomic implies b1 is not Sub_conjunctive) & (b1 is Sub_atomic implies b1 is not Sub_universal) & (b1 is Sub_negative implies b1 is not Sub_conjunctive) & (b1 is Sub_negative implies b1 is not Sub_universal) & (b1 is Sub_conjunctive implies b1 is not Sub_universal) & (b1 is Sub_VERUM implies b1 is not Sub_atomic) & (b1 is Sub_VERUM implies b1 is not Sub_negative) & (b1 is Sub_VERUM implies b1 is not Sub_conjunctive) & (b1 is Sub_VERUM implies b1 is not Sub_universal);

:: SUBSTUT1:sch 3
scheme SUBSTUT1:sch 3
{F1 -> non empty set,
  F2 -> Element of F1(),
  F3 -> Element of F1(),
  F4 -> Element of F1(),
  F5 -> Element of F1(),
  F6 -> Element of F1()}:
ex b1 being Function-like quasi_total Relation of QC-Sub-WFF,F1() st
   for b2 being Element of QC-Sub-WFF
   for b3, b4 being Element of F1() holds
   (b2 is Sub_VERUM implies b1 . b2 = F2()) &
    (b2 is Sub_atomic implies b1 . b2 = F3(b2)) &
    (b2 is Sub_negative & b3 = b1 . Sub_the_argument_of b2 implies b1 . b2 = F4(b3)) &
    (b2 is Sub_conjunctive & b3 = b1 . Sub_the_left_argument_of b2 & b4 = b1 . Sub_the_right_argument_of b2 implies b1 . b2 = F5(b3, b4)) &
    (b2 is Sub_universal & b3 = b1 . Sub_the_scope_of b2 implies b1 . b2 = F6(b2, b3))


:: SUBSTUT1:sch 4
scheme SUBSTUT1:sch 4
{F1 -> non empty set,
  F2 -> Function-like quasi_total Relation of QC-Sub-WFF,F1(),
  F3 -> Function-like quasi_total Relation of QC-Sub-WFF,F1(),
  F4 -> Element of F1(),
  F5 -> Element of F1(),
  F6 -> Element of F1(),
  F7 -> Element of F1(),
  F8 -> Element of F1()}:
F2() = F3()
provided
   for b1 being Element of QC-Sub-WFF
   for b2, b3 being Element of F1() holds
   (b1 is Sub_VERUM implies F2() . b1 = F4()) &
    (b1 is Sub_atomic implies F2() . b1 = F5(b1)) &
    (b1 is Sub_negative & b2 = F2() . Sub_the_argument_of b1 implies F2() . b1 = F6(b2)) &
    (b1 is Sub_conjunctive & b2 = F2() . Sub_the_left_argument_of b1 & b3 = F2() . Sub_the_right_argument_of b1 implies F2() . b1 = F7(b2, b3)) &
    (b1 is Sub_universal & b2 = F2() . Sub_the_scope_of b1 implies F2() . b1 = F8(b1, b2))
and
   for b1 being Element of QC-Sub-WFF
   for b2, b3 being Element of F1() holds
   (b1 is Sub_VERUM implies F3() . b1 = F4()) &
    (b1 is Sub_atomic implies F3() . b1 = F5(b1)) &
    (b1 is Sub_negative & b2 = F3() . Sub_the_argument_of b1 implies F3() . b1 = F6(b2)) &
    (b1 is Sub_conjunctive & b2 = F3() . Sub_the_left_argument_of b1 & b3 = F3() . Sub_the_right_argument_of b1 implies F3() . b1 = F7(b2, b3)) &
    (b1 is Sub_universal & b2 = F3() . Sub_the_scope_of b1 implies F3() . b1 = F8(b1, b2));


:: SUBSTUT1:funcnot 32 => SUBSTUT1:func 32
definition
  let a1 be Element of QC-Sub-WFF;
  func @ A1 -> Element of [:QC-WFF,vSUB:] equals
    a1;
end;

:: SUBSTUT1:def 35
theorem
for b1 being Element of QC-Sub-WFF holds
   @ b1 = b1;

:: SUBSTUT1:funcnot 33 => SUBSTUT1:func 33
definition
  let a1 be Element of [:QC-WFF,vSUB:];
  redefine func a1 `1 -> Element of QC-WFF;
end;

:: SUBSTUT1:funcnot 34 => SUBSTUT1:func 34
definition
  let a1 be Element of [:QC-WFF,vSUB:];
  redefine func a1 `2 -> Element of vSUB;
end;

:: SUBSTUT1:funcnot 35 => SUBSTUT1:func 35
definition
  let a1 be Element of [:QC-WFF,vSUB:];
  func S_Bound A1 -> Element of bound_QC-variables equals
    x. upVar(RestrictSub(bound_in (a1 `1),a1 `1,a1 `2),the_scope_of (a1 `1))
    if bound_in (a1 `1) in proj2 RestrictSub(bound_in (a1 `1),a1 `1,a1 `2)
    otherwise bound_in (a1 `1);
end;

:: SUBSTUT1:def 36
theorem
for b1 being Element of [:QC-WFF,vSUB:] holds
   (bound_in (b1 `1) in proj2 RestrictSub(bound_in (b1 `1),b1 `1,b1 `2) implies S_Bound b1 = x. upVar(RestrictSub(bound_in (b1 `1),b1 `1,b1 `2),the_scope_of (b1 `1))) &
    (bound_in (b1 `1) in proj2 RestrictSub(bound_in (b1 `1),b1 `1,b1 `2) or S_Bound b1 = bound_in (b1 `1));

:: SUBSTUT1:funcnot 36 => SUBSTUT1:func 36
definition
  let a1 be Element of QC-Sub-WFF;
  let a2 be Element of QC-WFF;
  func Quant(A1,A2) -> Element of QC-WFF equals
    All(S_Bound @ a1,a2);
end;

:: SUBSTUT1:def 37
theorem
for b1 being Element of QC-Sub-WFF
for b2 being Element of QC-WFF holds
   Quant(b1,b2) = All(S_Bound @ b1,b2);

:: SUBSTUT1:funcnot 37 => SUBSTUT1:func 37
definition
  let a1 be Element of QC-Sub-WFF;
  func CQC_Sub A1 -> Element of QC-WFF means
    ex b1 being Function-like quasi_total Relation of QC-Sub-WFF,QC-WFF st
       it = b1 . a1 &
        (for b2 being Element of QC-Sub-WFF holds
           (b2 is Sub_VERUM implies b1 . b2 = VERUM) &
            (b2 is Sub_atomic implies b1 . b2 = (the_pred_symbol_of (b2 `1)) ! CQC_Subst(Sub_the_arguments_of b2,b2 `2)) &
            (b2 is Sub_negative implies b1 . b2 = 'not' (b1 . Sub_the_argument_of b2)) &
            (b2 is Sub_conjunctive implies b1 . b2 = (b1 . Sub_the_left_argument_of b2) '&' (b1 . Sub_the_right_argument_of b2)) &
            (b2 is Sub_universal implies b1 . b2 = Quant(b2,b1 . Sub_the_scope_of b2)));
end;

:: SUBSTUT1:def 38
theorem
for b1 being Element of QC-Sub-WFF
for b2 being Element of QC-WFF holds
      b2 = CQC_Sub b1
   iff
      ex b3 being Function-like quasi_total Relation of QC-Sub-WFF,QC-WFF st
         b2 = b3 . b1 &
          (for b4 being Element of QC-Sub-WFF holds
             (b4 is Sub_VERUM implies b3 . b4 = VERUM) &
              (b4 is Sub_atomic implies b3 . b4 = (the_pred_symbol_of (b4 `1)) ! CQC_Subst(Sub_the_arguments_of b4,b4 `2)) &
              (b4 is Sub_negative implies b3 . b4 = 'not' (b3 . Sub_the_argument_of b4)) &
              (b4 is Sub_conjunctive implies b3 . b4 = (b3 . Sub_the_left_argument_of b4) '&' (b3 . Sub_the_right_argument_of b4)) &
              (b4 is Sub_universal implies b3 . b4 = Quant(b4,b3 . Sub_the_scope_of b4)));

:: SUBSTUT1:th 28
theorem
for b1 being Element of QC-Sub-WFF
      st b1 is Sub_negative
   holds CQC_Sub b1 = 'not' CQC_Sub Sub_the_argument_of b1;

:: SUBSTUT1:th 29
theorem
for b1 being Element of QC-Sub-WFF holds
   CQC_Sub Sub_not b1 = 'not' CQC_Sub b1;

:: SUBSTUT1:th 30
theorem
for b1 being Element of QC-Sub-WFF
      st b1 is Sub_conjunctive
   holds CQC_Sub b1 = (CQC_Sub Sub_the_left_argument_of b1) '&' CQC_Sub Sub_the_right_argument_of b1;

:: SUBSTUT1:th 31
theorem
for b1, b2 being Element of QC-Sub-WFF
      st b1 `2 = b2 `2
   holds CQC_Sub Sub_&(b1,b2) = (CQC_Sub b1) '&' CQC_Sub b2;

:: SUBSTUT1:th 32
theorem
for b1 being Element of QC-Sub-WFF
      st b1 is Sub_universal
   holds CQC_Sub b1 = Quant(b1,CQC_Sub Sub_the_scope_of b1);

:: SUBSTUT1:funcnot 38 => SUBSTUT1:func 38
definition
  func CQC-Sub-WFF -> Element of bool QC-Sub-WFF equals
    {b1 where b1 is Element of QC-Sub-WFF: b1 `1 is Element of CQC-WFF};
end;

:: SUBSTUT1:def 39
theorem
CQC-Sub-WFF = {b1 where b1 is Element of QC-Sub-WFF: b1 `1 is Element of CQC-WFF};

:: SUBSTUT1:funcreg 7
registration
  cluster CQC-Sub-WFF -> non empty;
end;

:: SUBSTUT1:th 33
theorem
for b1 being Element of QC-Sub-WFF
      st b1 is Sub_VERUM
   holds CQC_Sub b1 is Element of CQC-WFF;

:: SUBSTUT1:th 34
theorem
for b1 being Element of NAT
for b2 being Relation-like Function-like FinSequence-like set holds
      b2 is CQC-variable_list-like QC-variable_list of b1
   iff
      b2 is FinSequence of bound_QC-variables & len b2 = b1;

:: SUBSTUT1:th 35
theorem
for b1 being Element of NAT
for b2 being Element of b1 -ary_QC-pred_symbols
for b3 being CQC-variable_list-like QC-variable_list of b1
for b4 being Element of vSUB holds
   CQC_Sub Sub_P(b2,b3,b4) is Element of CQC-WFF;

:: SUBSTUT1:th 36
theorem
for b1 being Element of QC-Sub-WFF
      st CQC_Sub b1 is Element of CQC-WFF
   holds CQC_Sub Sub_not b1 is Element of CQC-WFF;

:: SUBSTUT1:th 37
theorem
for b1, b2 being Element of QC-Sub-WFF
      st b1 `2 = b2 `2 & CQC_Sub b1 is Element of CQC-WFF & CQC_Sub b2 is Element of CQC-WFF
   holds CQC_Sub Sub_&(b1,b2) is Element of CQC-WFF;

:: SUBSTUT1:th 38
theorem
for b1 being Element of bound_QC-variables
for b2 being Element of QC-Sub-WFF
for b3 being second_Q_comp of [b2,b1]
      st CQC_Sub b2 is Element of CQC-WFF & [b2,b1] is quantifiable
   holds CQC_Sub Sub_All([b2,b1],b3) is Element of CQC-WFF;

:: SUBSTUT1:sch 5
scheme SUBSTUT1:sch 5
for b1 being Element of CQC-Sub-WFF holds
   P1[b1]
provided
   for b1, b2 being Element of CQC-Sub-WFF
   for b3 being Element of bound_QC-variables
   for b4 being second_Q_comp of [b1,b3]
   for b5 being Element of NAT
   for b6 being CQC-variable_list-like QC-variable_list of b5
   for b7 being Element of b5 -ary_QC-pred_symbols
   for b8 being Element of vSUB holds
      P1[Sub_P(b7,b6,b8)] &
       (b1 is Sub_VERUM implies P1[b1]) &
       (P1[b1] implies P1[Sub_not b1]) &
       (b1 `2 = b2 `2 & P1[b1] & P1[b2] implies P1[Sub_&(b1,b2)]) &
       ([b1,b3] is quantifiable & P1[b1] implies P1[Sub_All([b1,b3],b4)]);


:: SUBSTUT1:funcnot 39 => SUBSTUT1:func 39
definition
  let a1 be Element of CQC-Sub-WFF;
  redefine func CQC_Sub a1 -> Element of CQC-WFF;
end;