reserve A for QC-alphabet;
reserve sq for FinSequence,
  x,y,z for bound_QC-variable of A,
  p,q,p1,p2,q1 for Element of QC-WFF(A);
reserve s,t for bound_QC-variable of A;
reserve F,G,H,H1 for Element of QC-WFF(A);
reserve x,y,z for bound_QC-variable of A,
  k,n,m for Nat,
  P for ( QC-pred_symbol of k, A),
  V for QC-variable_list of k, A;
reserve L,L9 for FinSequence;

theorem Th66:
  F is_subformula_of H iff F is_proper_subformula_of 'not' H
proof
  H is_immediate_constituent_of 'not' H;
  hence F is_subformula_of H implies F is_proper_subformula_of 'not' H by Th63;
  given n,L such that
A1: 1 <= n and
A2: len L = n and
A3: L.1 = F and
A4: L.n = 'not' H and
A5: for k st 1 <= k & k < n ex H1,F1 being Element of QC-WFF(A) st L.k = H1
  & L.(k + 1) = F1 & H1 is_immediate_constituent_of F1;
  assume F <> 'not' H;
  then 1 < n by A1,A3,A4,XXREAL_0:1;
  then 1 + 1 <= n by NAT_1:13;
  then consider k being Nat such that
A6: n = 2 + k by NAT_1:10;
  reconsider k as Nat;
  reconsider L1 = L|(Seg(1 + k)) as FinSequence by FINSEQ_1:15;
  take m = 1 + k, L1;
  thus
A7: 1 <= m by NAT_1:11;
  1 + k <= 1 + k + 1 by NAT_1:11;
  hence len L1 = m by A2,A6,FINSEQ_1:17;
A8: for j being Nat st 1 <= j <= m holds L1.j = L.j
       by FUNCT_1:49, FINSEQ_1:1;
  hence L1.1 = F by A3,A7;
  m < m + 1 by NAT_1:13;
  then consider F1,G1 be Element of QC-WFF(A) such that
A9: L.m = F1 and
A10: L.(m + 1) = G1 & F1 is_immediate_constituent_of G1 by A5,A6,NAT_1:11;
  F1 = H by A4,A6,A10,Th43;
  hence L1.m = H by A7,A8,A9;
  let j be Nat;
  assume that
A11: 1 <= j and
A12: j < m;
  m <= m + 1 by NAT_1:11;
  then j < n by A6,A12,XXREAL_0:2;
  then consider F1,G1 be Element of QC-WFF(A) such that
A13: L.j = F1 & L.(j + 1) = G1 & F1 is_immediate_constituent_of G1 by A5,A11;
  take F1,G1;
  1 <= 1 + j & j + 1 <= m by A11,A12,NAT_1:13;
  hence thesis by A8,A11,A12,A13;
end;
