reserve Al for QC-alphabet;
reserve b,c,d for set,
  X,Y for Subset of CQC-WFF(Al),
  i,j,k,m,n for Nat,
  p,p1,q,r,s,s1 for Element of CQC-WFF(Al),
  x,x1,x2,y,y1 for bound_QC-variable of Al,
  A for non empty set,
  J for interpretation of Al, A,
  v for Element of Valuations_in(Al,A),
  f1,f2 for FinSequence of CQC-WFF(Al),
  CX,CY,CZ for Consistent Subset of CQC-WFF(Al),
  JH for Henkin_interpretation of CX,
  a for Element of A,
  t,u for QC-symbol of Al;
reserve L for PATH of q,p,
  F1,F3 for QC-formula of Al,
  a for set;

theorem Th15:
  for p st QuantNbr(p) = 1 holds (CX is negation_faithful & CX is with_examples
  implies (JH,valH(Al) |= p iff CX |- p))
proof
  let p such that
A1: QuantNbr(p) = 1 and
A2: CX is negation_faithful and
A3: CX is with_examples;
  consider q such that
A4: q is_subformula_of p and
A5: ex x,r st q = All(x,r) by A1,SUBSTUT2:32;
  consider x,r such that
A6: q = All(x,r) by A5;
A7: QuantNbr(q) <= 1 by A1,A4,SUBSTUT2:30;
A8: QuantNbr(q) = QuantNbr(r) + 1 by A6,CQC_SIM1:18;
  then 1 <= QuantNbr(q) by NAT_1:11;
  then
A9: 1 = QuantNbr(q) by A7,XXREAL_0:1;
  set L =the  PATH of q,p;
A10: 1 <= len L by A4,SUBSTUT2:def 5;
  defpred P[Nat] means 1 <= $1 & $1 <= len L implies
  ex p1 st p1 = L.$1 & QuantNbr(q) <= QuantNbr(p1) &
  (CX |- p1 iff JH,valH(Al) |= p1);
A11: P[0];
A12: for k st P[k] holds P[k + 1]
  proof
    let k such that
A13: P[k];
    assume that
A14: 1 <= k+1 and
A15: k+1 <= len L;
    set j = k+1;
A16: now
      assume k = 0;
      then
A17:  L.j = q by A4,SUBSTUT2:def 5;
      take q;
      thus QuantNbr(q) <= QuantNbr(q);
A18:  now
        assume JH,valH(Al) |= Ex(x,'not' r);
        then consider y such that
A19:    JH,valH(Al) |= ('not' r).(x,y) by Th10;
        QuantNbr('not' r) = 0 by A8,A9,CQC_SIM1:16;
        then QuantNbr(('not' r).(x,y)) = 0 by Th14;
        then CX |- ('not' r).(x,y) by A2,A3,A19,Th8;
        hence CX |- Ex(x,'not' r) by A3,Th3;
      end;
      now
        assume CX |- Ex(x,'not' r);
        then consider y such that
A20:    CX |- ('not' r).(x,y) by A3,Th3;
        QuantNbr('not' r) = 0 by A8,A9,CQC_SIM1:16;
        then QuantNbr(('not' r).(x,y)) = 0 by Th14;
        then JH,valH(Al) |= ('not' r).(x,y) by A2,A3,A20,Th8;
        hence JH,valH(Al) |= Ex(x,'not' r) by Th10;
      end;
      then JH,valH(Al) |= 'not' Ex(x,'not' r) iff CX |- 'not' Ex(x,'not' r)
      by A2,A18,HENMODEL:def 2,VALUAT_1:17;
      then JH,valH(Al) |= q iff CX |- q by A6,Th11,Th12;
      hence thesis by A17;
    end;
    now
      assume k <> 0;
      then 0 < k by NAT_1:3;
      then
A21:  0+1 <= k by NAT_1:13;
      k < len L by A15,NAT_1:13;
      then consider G1,H1 being Element of QC-WFF(Al) such that
A22:  L.k = G1 and
A23:  L.j = H1 and
A24:  G1 is_immediate_constituent_of H1 by A4,A21,SUBSTUT2:def 5;
      consider p1 such that
A25:  p1 = L.k and
A26:  QuantNbr(q) <= QuantNbr(p1) and
A27:  CX |- p1 iff JH,valH(Al) |= p1 by A13,A15,A21,NAT_1:13;
A28:  ex F3 st ( F3 = L.j)&( F3 is_subformula_of p) by A4,A14,A15,SUBSTUT2:27;
      reconsider s = H1 as Element of CQC-WFF(Al)
      by A4,A14,A15,A23,SUBSTUT2:28;
      take s;
A29:  now
        assume
A30:    s = 'not' p1;
        then
A31:    QuantNbr(q) <= QuantNbr(s) by A26,CQC_SIM1:16;
        CX |- s iff JH,valH(Al) |= s
        by A2,A27,A30,HENMODEL:def 2,VALUAT_1:17;
        hence thesis by A23,A31;
      end;
A32:  QuantNbr(s) <= 1 by A1,A23,A28,SUBSTUT2:30;
A33:  now
        given F1 such that
A34:    s = p1 '&' F1;
        reconsider F1 as Element of CQC-WFF(Al) by A34,CQC_LANG:9;
        QuantNbr(s) = QuantNbr(p1) + QuantNbr(F1) by A34,CQC_SIM1:17;
        then
A35:    QuantNbr(p1) <= QuantNbr(s) by NAT_1:11;
        then
A36:    QuantNbr(p1) <= 1 by A32,XXREAL_0:2;
A37:    1 <= QuantNbr(s) by A9,A26,A35,XXREAL_0:2;
A38:    QuantNbr(p1) = 1 by A9,A26,A36,XXREAL_0:1;
        QuantNbr(s) = 1 by A32,A37,XXREAL_0:1;
        then 1-1 = QuantNbr(F1)+1-1 by A34,A38,CQC_SIM1:17;
        then
A39:    CX |- F1 iff JH,valH(Al) |= F1 by A2,A3,Th8;
A40:    QuantNbr(q) <= QuantNbr(s) by A26,A35,XXREAL_0:2;
        CX |- s iff JH,valH(Al) |= s by A27,A34,A39,Th6,VALUAT_1:18;
        hence thesis by A23,A40;
      end;
A41:  now
        given F1 such that
A42:    s = F1 '&' p1;
        reconsider F1 as Element of CQC-WFF(Al) by A42,CQC_LANG:9;
A43:    QuantNbr(s) = QuantNbr(p1) + QuantNbr(F1) by A42,CQC_SIM1:17;
        then
A44:    QuantNbr(p1) <= QuantNbr(s) by NAT_1:11;
        then
A45:    QuantNbr(p1) <= 1 by A32,XXREAL_0:2;
A46:    1 <= QuantNbr(s) by A9,A26,A44,XXREAL_0:2;
A47:    QuantNbr(p1) = 1 by A9,A26,A45,XXREAL_0:1;
        QuantNbr(s) = 1 by A32,A46,XXREAL_0:1;
        then
A48:    CX |- F1 iff JH,valH(Al) |= F1 by A2,A3,A43,A47,Th8;
A49:    QuantNbr(q) <= QuantNbr(s) by A26,A44,XXREAL_0:2;
        CX |- s iff JH,valH(Al) |= s by A27,A42,A48,Th6,VALUAT_1:18;
        hence thesis by A23,A49;
      end;
      now
        given x such that
A50:    s = All(x,p1);
        1 < QuantNbr(p1) + 1 by A9,A26,NAT_1:13;
        hence contradiction by A32,A50,CQC_SIM1:18;
      end;
      hence thesis by A22,A24,A25,A29,A33,A41,QC_LANG2:def 19;
    end;
    hence thesis by A16;
  end;
  for k holds P[k] from NAT_1:sch 2(A11,A12);
  then ex p1 st ( p1 = L.(len L))&( QuantNbr(q) <= QuantNbr(p1))&(
  CX |- p1 iff JH,valH(Al) |= p1) by A10;
  hence thesis by A4,SUBSTUT2:def 5;
end;
