reserve k,n,m for Nat,
  a,x,X,Y for set,
  D,D1,D2,S for non empty set,
  p,q for FinSequence of NAT;
reserve F,F1,G,G1,H,H1,H2 for LTL-formula;
reserve sq,sq9 for FinSequence;
reserve L,L9 for FinSequence;
reserve j for Nat;
reserve j1 for Element of NAT;

theorem Th34:
  F is_proper_subformula_of G & G is_proper_subformula_of H
  implies F is_proper_subformula_of H
proof
  assume that
A1: F is_subformula_of G and
A2: F <> G and
A3: G is_subformula_of H and
A4: G <> H;
  consider m,L9 such that
A5: 1 <= m and
A6: len L9 = m and
A7: L9.1 = G and
A8: L9.m = H and
A9: for k st 1 <= k & k < m ex H1,F1 st L9.k = H1 & L9.(k + 1) = F1 &
  H1 is_immediate_constituent_of F1 by A3;
  consider n,L such that
A10: 1 <= n and
A11: len L = n and
A12: L.1 = F and
A13: L.n = G and
A14: for k st 1 <= k & k < n ex H1,F1 st L.k = H1 & L.(k + 1) = F1 & H1
  is_immediate_constituent_of F1 by A1;
  1 < n by A2,A10,A12,A13,XXREAL_0:1;
  then 1 + 1 <= n by NAT_1:13;
  then consider k be Nat such that
A15: n = 2 + k by NAT_1:10;
  reconsider L1 = L|(Seg(1 + k)) as FinSequence by FINSEQ_1:15;
  thus F is_subformula_of H
  proof
    take l = 1 + k + m, K = L1^L9;
A16: 1 + k + m - (1 + k) = m;
    m <= m + (1 + k) by NAT_1:11;
    hence 1 <= l by A5,XXREAL_0:2;
    1 + 1 + k = 1 + k + 1;
    then
A17: 1 + k <= n by A15,NAT_1:11;
    then
A18: len L1 = 1 + k by A11,FINSEQ_1:17;
    hence
A19: len K = l by A6,FINSEQ_1:22;
A20: now
      let j;
      assume 1 <= j & j <= 1 + k;
      then
A21:  j in Seg(1 + k) by FINSEQ_1:1;
      then j in dom L1 by A11,A17,FINSEQ_1:17;
      then K.j = L1.j by FINSEQ_1:def 7;
      hence K.j = L.j by A21,FUNCT_1:49;
    end;
    1 <= 1 + k by NAT_1:11;
    hence K.1 = F by A12,A20;
    len L1 + 1 <= len L1 + m by A5,XREAL_1:7;
    then len L1 < l by A18,NAT_1:13;
    then K.l = L9.(l - len L1) by A19,FINSEQ_1:24;
    hence K.l = H by A11,A8,A17,A16,FINSEQ_1:17;
    let j such that
A22: 1 <= j and
A23: j < l;
    j + 0 <= j + 1 by XREAL_1:7;
    then
A24: 1 <= j + 1 by A22,XXREAL_0:2;
A25: now
      assume
A26:  j < 1 + k;
      then
A27:  j + 1 <= 1 + k by NAT_1:13;
      then j + 1 <= n by A17,XXREAL_0:2;
      then j < n by NAT_1:13;
      then consider F1,G1 such that
A28:  L.j = F1 & L.(j + 1) = G1 & F1 is_immediate_constituent_of G1 by A14,A22;
      take F1, G1;
      thus K.j = F1 & K.(j + 1) = G1 & F1 is_immediate_constituent_of G1 by A20
,A22,A24,A26,A27,A28;
    end;
A29: now
A30:  j + 1 <= l by A23,NAT_1:13;
      assume
A31:  1 + k < j;
      then
A32:  1 + k < j + 1 by NAT_1:13;
      1 + k + 1 <= j by A31,NAT_1:13;
      then consider j1 be Nat such that
A33:  j = 1 + k + 1 + j1 by NAT_1:10;
      j - (1 + k) < l - (1 + k) by A23,XREAL_1:9;
      then consider F1,G1 such that
A34:  L9.(1 + j1) = F1 & L9.(1 + j1 + 1) = G1 & F1
      is_immediate_constituent_of G1 by A9,A33,NAT_1:11;
      take F1, G1;
A35:  1 + j1 + (1 + k) - (1 + k) = 1 + j1 + (1 + k) + -(1 + k);
      j + 1 - len L1 = 1 + (j + -len L1)
        .= 1 + j1 + 1 by A11,A17,A33,A35,FINSEQ_1:17;
      hence K.j = F1 & K.(j + 1) = G1 & F1 is_immediate_constituent_of G1 by
A18,A19,A23,A31,A32,A30,A35,A34,FINSEQ_1:24;
    end;
    now
A36:  j + 1 <= l & j + 1 - j = j + 1 + -j by A23,NAT_1:13;
      assume
A37:  j = 1 + k;
      then j < 1 + k + 1 by NAT_1:13;
      then consider F1,G1 such that
A38:  L.j = F1 & L.(j + 1) = G1 & F1 is_immediate_constituent_of G1
      by A14,A15,A22;
      take F1, G1;
      1 + k < j + 1 by A37,NAT_1:13;
      hence
      K.j = F1 & K.(j + 1) = G1 & F1 is_immediate_constituent_of G1 by A13,A7
,A15,A18,A19,A20,A22,A37,A36,A38,FINSEQ_1:24;
    end;
    hence thesis by A25,A29,XXREAL_0:1;
  end;
  assume
A39: F = H;
  F is_proper_subformula_of G by A1,A2;
  then
A40: len F < len G by Th32;
  G is_proper_subformula_of H by A3,A4;
  hence contradiction by A39,A40,Th32;
end;
