reserve Al for QC-alphabet;
reserve i,j,k for Nat,
  A,D for non empty set;
reserve f1,f2 for Element of Funcs(Valuations_in(Al,A),BOOLEAN),
  x,x1,y for bound_QC-variable of Al,
  v,v1 for Element of Valuations_in(Al,A);
reserve ll for CQC-variable_list of k,Al;
reserve p,q,s,t for Element of CQC-WFF(Al),
  J for interpretation of Al,A,
  P for QC-pred_symbol of k,Al,
  r for Element of relations_on A;
reserve u,w,z for Element of BOOLEAN;
reserve w,v2 for Element of Valuations_in(Al,A),
  z for bound_QC-variable of Al;

theorem Th27:
  not x in still_not-bound_in p implies for v,w st for y st x<>y
  holds w.y = v.y holds Valid(p,J).v = Valid(p,J).w
proof
  defpred PP[Element of CQC-WFF(Al)] means
    not x in still_not-bound_in $1 implies
  for v,w st for y st x<>y holds w.y = v.y holds Valid($1,J).v = Valid($1,J).w;
A1: now
    let s,t,y,k,ll,P;
    thus PP[VERUM(Al)]
    proof
      assume not x in still_not-bound_in VERUM(Al);
      thus for v,w st for y st x<>y holds w.y = v.y holds
      Valid(VERUM(Al),J).v = Valid(VERUM(Al),J).w
      proof
        let v,w such that
        for y st x <> y holds w.y = v.y;
        Valid(VERUM(Al),J).v = TRUE by Th5;
        hence thesis by Th5;
      end;
    end;
A2: rng ll c= bound_QC-variables(Al) by RELAT_1:def 19;
    thus PP[P!ll]
    proof
      assume
A3:   not x in still_not-bound_in (P!ll);
      thus for v,w st for y st x<>y holds w.y = v.y holds Valid(P!ll,J).v =
      Valid(P!ll,J).w
      proof
        let v,w such that
A4:     for y st x <> y holds w.y = v.y;
A5:     now
A6:       len (v*'ll) = k by Def3;
A7:       now
            let i be Nat;
            assume
A8:         1 <= i & i <= len (v*'ll);
A9:         len (v*'ll) = len ll by A6,CARD_1:def 7;
            then i in dom ll by A8,FINSEQ_3:25;
            then ll.i in rng ll by FUNCT_1:def 3;
            then reconsider z = ll.i as bound_QC-variable of Al by A2;
            ll.i <> x
            proof
              reconsider M = still_not-bound_in ll as set;
              not x in M by A3,QC_LANG3:5;
              then not x in variables_in(ll,bound_QC-variables(Al))
                by QC_LANG3:2;
              then not x in {ll.i2 where i2 is Nat: 1 <= i2 & i2
              <= len ll & ll.i2 in bound_QC-variables(Al)} by QC_LANG3:def 1;
              hence thesis by A8,A9;
            end;
            then
A10:        w.z = v.z by A4;
            (v*'ll).i = v.(ll.i) by A6,A8,Def3;
            hence (v*'ll).i = (w*'ll).i by A6,A8,A10,Def3;
          end;
          assume
A11:      Valid(P!ll,J).v = TRUE;
          then (ll 'in' (J.P)).v = TRUE by Lm1;
          then
A12:      v*'ll in (J.P) by Def4;
          len (w*'ll) = k by Def3;
          then w*'ll in (J.P) by A12,A6,A7,FINSEQ_1:14;
          then (ll 'in' (J.P)).w = TRUE by Def4;
          hence thesis by A11,Lm1;
        end;
        now
A13:      len (v*'ll) = k by Def3;
A14:      now
            let i be Nat;
            assume
A15:        1 <= i & i <= len (v*'ll);
A16:        len (v*'ll) = len ll by A13,CARD_1:def 7;
            then i in dom ll by A15,FINSEQ_3:25;
            then ll.i in rng ll by FUNCT_1:def 3;
            then reconsider z = ll.i as bound_QC-variable of Al by A2;
            ll.i <> x
            proof
              reconsider M = still_not-bound_in ll as set;
              not x in M by A3,QC_LANG3:5;
              then not x in variables_in(ll,bound_QC-variables(Al))
                by QC_LANG3:2;
              then i in NAT & not x in {ll.i2 where i2 is Nat : 1
<= i2 & i2 <= len ll & ll.i2 in bound_QC-variables(Al)} by ORDINAL1:def 12
,QC_LANG3:def 1;
              hence thesis by A15,A16;
            end;
            then
A17:        w.z = v.z by A4;
            (v*'ll).i = v.(ll.i) by A13,A15,Def3;
            hence (v*'ll).i = (w*'ll).i by A13,A15,A17,Def3;
          end;
          assume
A18:      Valid(P!ll,J).v = FALSE;
          then (ll 'in' (J.P)).v = FALSE by Lm1;
          then
A19:      not v*'ll in (J.P) by Def4;
          len (w*'ll) = k by Def3;
          then not w*'ll in (J.P) by A19,A13,A14,FINSEQ_1:14;
          then (ll 'in' (J.P)).w = FALSE by Def4;
          hence thesis by A18,Lm1;
        end;
        hence thesis by A5,XBOOLEAN:def 3;
      end;
    end;
    thus PP[s] implies PP['not' s]
    proof
      assume
A20:  ( not x in still_not-bound_in s implies for v,w st for y st x<>
      y holds w.y = v. y holds Valid(s,J).v = Valid(s,J).w)& not x in
      still_not-bound_in 'not' s;
      thus for v,w st for y st x<>y holds w.y = v.y holds Valid('not' s,J).v =
      Valid('not' s,J).w
      proof
        let v,w such that
A21:    for y st x<>y holds w.y = v.y;
A22:    now
          assume
A23:      Valid('not' s,J).v = FALSE;
          then 'not'(Valid(s,J).v) = FALSE by Th10;
          then Valid(s,J).v = TRUE by MARGREL1:11;
          then Valid(s,J).w = TRUE by A20,A21,QC_LANG3:7;
          then 'not'(Valid(s,J).w) = FALSE by MARGREL1:11;
          hence thesis by A23,Th10;
        end;
        now
          assume
A24:      Valid('not' s,J).v = TRUE;
          then 'not'(Valid(s,J).v) = TRUE by Th10;
          then Valid(s,J).v = FALSE by MARGREL1:11;
          then Valid(s,J).w = FALSE by A20,A21,QC_LANG3:7;
          then 'not'(Valid(s,J).w) = TRUE by MARGREL1:11;
          hence thesis by A24,Th10;
        end;
        hence thesis by A22,XBOOLEAN:def 3;
      end;
    end;
    thus PP[s] & PP[t] implies PP[s '&' t]
    proof
      assume that
A25:  not x in still_not-bound_in s implies for v,w st for y st x<>y
      holds w.y = v.y holds Valid(s,J).v = Valid(s,J).w and
A26:  not x in still_not-bound_in t implies for v,w st for y st x<>y
      holds w.y = v.y holds Valid(t,J).v = Valid(t,J).w and
A27:  not x in still_not-bound_in s '&' t;
A28:  not x in (still_not-bound_in s) \/ (still_not-bound_in t) by A27,
QC_LANG3:10;
      thus for v,w st for y st x<>y holds w.y = v.y holds Valid(s '&' t,J).v =
      Valid(s '&' t, J).w
      proof
        let v,w such that
A29:    for y st x<>y holds w.y = v.y;
A30:    now
          assume
A31:      Valid(s '&' t,J).v = FALSE;
A32:      now
            assume Valid(s,J).v = FALSE;
            then Valid(s,J).w = FALSE by A25,A28,A29,XBOOLE_0:def 3;
            then (Valid(s,J).w) '&' (Valid(t,J).w) = FALSE by MARGREL1:12;
            hence thesis by A31,Th12;
          end;
A33:      now
            assume Valid(t,J).v = FALSE;
            then Valid(t,J).w = FALSE by A26,A28,A29,XBOOLE_0:def 3;
            then (Valid(s,J).w) '&' (Valid(t,J).w) = FALSE by MARGREL1:12;
            hence thesis by A31,Th12;
          end;
          (Valid(s,J).v) '&' (Valid(t,J).v) = FALSE by A31,Th12;
          hence thesis by A32,A33,MARGREL1:12;
        end;
        now
          assume
A34:      Valid(s '&' t,J).v = TRUE;
          then
A35:      (Valid(s,J).v) '&' (Valid(t,J).v) = TRUE by Th12;
          then Valid(t,J).v = TRUE by MARGREL1:12;
          then
A36:      Valid(t,J).w = TRUE by A26,A28,A29,XBOOLE_0:def 3;
          Valid(s,J).v = TRUE by A35,MARGREL1:12;
          then Valid(s,J).w = TRUE by A25,A28,A29,XBOOLE_0:def 3;
          then (Valid(s,J).w) '&' (Valid(t,J).w) = TRUE by A36;
          hence thesis by A34,Th12;
        end;
        hence thesis by A30,XBOOLEAN:def 3;
      end;
    end;
    thus PP[s] implies PP[All(y,s)]
    proof
      assume that
A37:  not x in still_not-bound_in s implies for v,w st for y st x<>y
      holds w.y = v.y holds Valid(s,J).v = Valid(s,J).w and
A38:  not x in still_not-bound_in All(y,s);
A39:  not x in (still_not-bound_in s) \ {y} by A38,QC_LANG3:12;
      thus for v,w st for z st x<>z holds w.z = v.z holds Valid(All(y,s),J).v
      = Valid(All(y,s),J).w
      proof
        let v,w such that
A40:    for z st x<>z holds w.z = v.z;
A41:    now
          assume
A42:      Valid(All(y,s),J).v = FALSE;
          then FOR_ALL(y,Valid(s,J)).v = FALSE by Lm1;
          then consider v1 such that
A43:      Valid(s,J).v1 = FALSE and
A44:      for z st y <> z holds v1.z = v.z by Th2;
A45:      now
            assume
A46:        not x in (still_not-bound_in s);
            consider v2 such that
A47:        (for z st z <> y holds v2.z = w.z) & v2.y = v1.y by Lm3;
            take v2;
            for z st x <> z holds v2.z = v1.z
            proof
              let z such that
A48:          x <> z;
              now
                assume
A49:            z <> y;
                hence v2.z = w.z by A47
                  .= v.z by A40,A48
                  .= v1.z by A44,A49;
              end;
              hence thesis by A47;
            end;
            hence Valid(s,J).v2 = FALSE by A37,A43,A46;
            thus for z st y <> z holds v2.z = w.z by A47;
          end;
          now
            assume
A50:        x in {y};
            take v2 = v1;
            thus Valid(s,J).v2 = FALSE by A43;
            for z st y <> z holds v1.z = w.z
            proof
              let z;
              assume
A51:          y <> z;
              then
A52:          x <> z by A50,TARSKI:def 1;
              thus v1.z = v.z by A44,A51
                .= w.z by A40,A52;
            end;
            hence for z st y <> z holds v2.z = w.z;
          end;
          then FOR_ALL(y,Valid(s,J)).w = FALSE by A39,A45,Th2,XBOOLE_0:def 5;
          hence thesis by A42,Lm1;
        end;
        now
          assume
A53:      Valid(All(y,s),J).v = TRUE;
          then
A54:      FOR_ALL(y,Valid(s,J)).v = TRUE by Lm1;
          for v1 st for z st y<>z holds v1.z = w.z holds Valid(s,J).v1 = TRUE
          proof
            let v1 such that
A55:        for z st y<>z holds v1.z = w.z;
A56:        now
              assume
A57:          not x in (still_not-bound_in s);
              consider v2 such that
A58:          (for z st z <> y holds v2.z = v.z) & v2.y = v1.y by Lm3;
A59:          for z st x <> z holds v2.z = v1.z
              proof
                let z such that
A60:            x <> z;
                now
                  assume
A61:              z <> y;
                  hence v2.z = v.z by A58
                    .= w.z by A40,A60
                    .= v1.z by A55,A61;
                end;
                hence thesis by A58;
              end;
              Valid(s,J).v2 = TRUE by A54,A58,Th3;
              hence thesis by A37,A57,A59;
            end;
            now
              assume x in {y};
              then
A62:          x = y by TARSKI:def 1;
              for z st y <> z holds v1.z = v.z
              proof
                let z;
                assume
A63:            y <> z;
                hence v.z = w.z by A40,A62
                  .= v1.z by A55,A63;
              end;
              hence thesis by A54,Th3;
            end;
            hence thesis by A39,A56,XBOOLE_0:def 5;
          end;
          then FOR_ALL(y,Valid(s,J)).w = TRUE by Th3;
          hence thesis by A53,Lm1;
        end;
        hence thesis by A41,XBOOLEAN:def 3;
      end;
    end;
  end;
  for s holds PP[s] from CQC_LANG:sch 1(A1);
  hence thesis;
end;
