 reserve i,j,n,k,l for Nat;
 reserve T,S,X,Y,Z for Subset of MC-wff;
 reserve p,q,r,t,F,H,G for Element of MC-wff;
 reserve s,U,V for MC-formula;
reserve f,g for FinSequence of [:MC-wff,Proof_Step_Kinds_IPC:];
 reserve X,T for Subset of MC-wff;
 reserve F,G,H,p,q,r,t for Element of MC-wff;
 reserve s,h for MC-formula;
 reserve f for FinSequence of [:MC-wff,Proof_Step_Kinds_IPC:];
 reserve i,j for Element of NAT;

theorem Th53: :: Deduction theorem
 (X \/ {F})|-_IPC G implies X |-_IPC F => G
proof
  assume (X \/ {F}) |-_IPC G; then
  G in CnIPC(X \/ {F});
  then consider f such that
A3: f is_a_proof_wrt_IPC (X \/ {F}) and
A4: Effect_IPC f = G by Th16;
  f <> {} by A3; then
A5: G = (f.len f)`1 by A4,Def5;
  defpred P[Nat] means 1 <= $1 & $1 <= len f implies for H st H = (f.$1)`1
  holds X|-_IPC F => H;
A6: for n being Nat st for k being Nat st k < n holds P[k] holds P[n]
  proof
    let n be Nat such that
A7: for k being Nat st k < n holds 1 <= k & k <= len f implies for H
    st H = (f.k)`1 holds X|-_IPC F => H;
    assume that
A8: 1 <= n and
A9: n <= len f;
A10: f,n is_a_correct_step_wrt_IPC (X \/ {F}) by A3,A8,A9;
    let H such that
A11: H = (f.n)`1;
    now
     (f.n)`2 = 0 or ... or (f.n)`2 = 10 by A8,A9,Th3;
      then per cases;
      suppose
        (f.n)`2 = 0;
        then H in X \/ {F} by A11,A10,Def3; then
A12:    H in X or H in {F} by XBOOLE_0:def 3;
        now
          per cases by A12,TARSKI:def 1;
          suppose
A13:        H in X;
            X c= CnIPC(X) by INTPRO_1:12; then
A14:        X|-_IPC H by A13;
            X|-_IPC H => (F => H) by INTPRO_1:1;
            hence thesis by A14,INTPRO_1:10;
          end;
          suppose
            H = F;
            hence thesis by Th49;
          end;
        end;
        hence thesis;
      end;
      suppose
        (f.n)`2 = 1;
        then ex p,q st H = p => (q => p) by A11,A10,Def3;
        then H is valid_IPC by Th39;
        hence thesis by Th51,Th52;
      end;
      suppose
        (f.n)`2 = 2;
        then ex p,q,r st H = (p => (q => r)) => ((p => q) => (p => r))
         by A11,A10,Def3;
        then H is valid_IPC by Th40;
        hence thesis by Th51,Th52;
      end;
      suppose
        (f.n)`2 = 3;
        then ex p,q st H = (p '&' q) => p by A11,A10,Def3;
        then H is valid_IPC by Th41;
        hence thesis by Th51,Th52;
      end;
      suppose
        (f.n)`2 = 4;
        then ex p,q st H = (p '&' q) => q by A11,A10,Def3;
        then H is valid_IPC by Th42;
        hence thesis by Th51,Th52;
      end;
      suppose
        (f.n)`2 = 5;
        then ex p,q st H = p => (q => (p '&' q)) by A11,A10,Def3;
        then H is valid_IPC by Th43;
        hence thesis by Th51,Th52;
      end;
      suppose
        (f.n)`2 = 6;
        then ex p,q st H = p => (p 'or' q) by A11,A10,Def3;
        then H is valid_IPC by Th44;
        hence thesis by Th51,Th52;
      end;
      suppose
        (f.n)`2 = 7;
        then ex p,q st H = q => (p 'or' q) by A11,A10,Def3;
        then H is valid_IPC by Th45;
        hence thesis by Th51,Th52;
      end;
      suppose
        (f.n)`2 = 8;
        then ex p,q,r st H = (p => r) => ((q => r) => ((p 'or' q) => r))
         by A11,A10,Def3;
        then H is valid_IPC by Th46;
        hence thesis by Th51,Th52;
      end;
      suppose
        (f.n)`2 = 9;
        then ex p st H = FALSUM => p by A11,A10,Def3;
        then H is valid_IPC by Th47;
        hence thesis by Th51,Th52;
      end;
      suppose
        (f.n)`2 = 10;
        then consider i,j being Nat, p,q such that
A15:    1 <= i and
A16:    i < n and
A17:    1 <= j and
A18:    j < i and
A19:    p = (f.j)`1 and
A20:    q = H and
A21:    (f.i)`1 = p => q by A11,A10,Def3;
        i <= len f by A9,A16,XXREAL_0:2; then
A22:    X|-_IPC F => (p => q) by A7,A15,A16,A21;
        X|-_IPC (F => (p => q)) => ((F => p) => (F => q)) by INTPRO_1:2;
        then
A23:    X|-_IPC (F => p) => (F => q) by A22,INTPRO_1:10;
        j < n by A16,A18,XXREAL_0:2; then
A24:    j <= len f by A9,XXREAL_0:2;
        j < n by A16,A18,XXREAL_0:2;
        then X|-_IPC F => p by A7,A17,A19,A24;
        hence thesis by A20,A23,INTPRO_1:10;
      end;
    end;
    hence thesis;
  end;
A40: for n be Nat holds P[n] from NAT_1:sch 4(A6);
  1 <= len f by A3,Th5;
  hence thesis by A40,A5;
end;
