reserve Al for QC-alphabet;
reserve a,b,b1 for object,
  i,j,k,n for Nat,
  p,q,r,s for Element of CQC-WFF(Al),
  x,y,y1 for bound_QC-variable of Al,
  P for QC-pred_symbol of k,Al,
  l,ll for CQC-variable_list of k,Al,
  Sub,Sub1 for CQC_Substitution of Al,
  S,S1,S2 for Element of CQC-Sub-WFF(Al),
  P1,P2 for Element of QC-pred_symbols(Al);
reserve F1,F2,F3 for QC-formula of Al,
  L for FinSequence;

theorem Th28:
  for L being PATH of F1,p st F1 is_subformula_of p & 1 <= i & i
  <= len L holds L.i is Element of CQC-WFF(Al)
proof
  let L be PATH of F1,p;
  set n = len L;
  assume that
A1: F1 is_subformula_of p and
A2: 1 <= i and
A3: i <= n;
  n+1 <= n+i by A2,XREAL_1:6;
  then n+1+(-1) <= n+i+(-1) by XREAL_1:6;
  then
A4: n+(-i) <= n-1+i+(-i) by XREAL_1:6;
  i+(-i) <= n+(-i) by A3,XREAL_1:6;
  then reconsider l = n-i as Element of NAT by INT_1:3;
  defpred P[Nat] means $1 <= n-1 implies L.(n-$1) is Element of
  CQC-WFF(Al);
A5: for k st P[k] holds P[k+1]
  proof
    let k such that
A6: P[k];
    assume
A7: k+1 <= n-1;
    then k+1+1 <= n-1+1 by XREAL_1:6;
    then
A8: 2+k+(-k) <= n+(-k) by XREAL_1:6;
    then reconsider j = n-k as Element of NAT by INT_1:3;
    k < k+1 by NAT_1:13;
    then reconsider q = L.j as Element of CQC-WFF(Al) by A6,A7,XXREAL_0:2;
    n <= n+k by NAT_1:11;
    then n+(-k) <= n+k+(-k) by XREAL_1:6;
    then
A9: j-1 < n by XREAL_1:146,XXREAL_0:2;
A10: 1+1+(-1) <= j+(-1) by A8,XREAL_1:6;
    then reconsider j1 = j-1 as Element of NAT by INT_1:3;
    j1+1 = j;
    then consider G1,H1 being Element of QC-WFF(Al) such that
A11: L.j1 = G1 and
A12: q = H1 & G1 is_immediate_constituent_of H1 by A1,A10,A9,Def5;
A13: (ex F being Element of QC-WFF(Al) st q = G1 '&' F) implies thesis by A11,
CQC_LANG:9;
A14: (ex x st q = All(x,G1)) implies thesis by A11,CQC_LANG:13;
A15: (ex F being Element of QC-WFF(Al) st q = F '&' G1) implies thesis by A11,
CQC_LANG:9;
    q = 'not' G1 implies thesis by A11,CQC_LANG:8;
    hence thesis by A12,A13,A15,A14,QC_LANG2:def 19;
  end;
A16: P[0] by A1,Def5;
  for k holds P[k] from NAT_1:sch 2(A16,A5);
  then L.(n-l) is Element of CQC-WFF(Al) by A4;
  hence thesis;
end;
