reserve k,n,n1,m,m1,m0,h,i,j for Nat,
  a,x,y,X,X1,X2,X3,X4,Y for set;
reserve L,L1,L2 for FinSequence;
reserve F,F1,G,G1,H for LTL-formula;
reserve W,W1,W2 for Subset of Subformulae H;
reserve v for LTL-formula;
reserve N,N1,N2,N10,N20,M for strict LTLnode over v;
reserve w for Element of Inf_seq(AtomicFamily);
reserve R1,R2 for Real_Sequence;
reserve s,s0,s1,s2 for elementary strict LTLnode over v;

theorem Th49:
  for f being Function of LTLNodes(v),LTLNodes(v) st f
is_succ_homomorphism v,w holds for x st x in LTLNodes(v) & CastNode(x,v) is non
elementary & w |= *CastNode(x,v) holds ex n st (for i st i<n holds CastNode((f
  |**i).x,v) is non elementary) & CastNode((f|**n).x,v) is elementary
proof
  set LN = LTLNodes(v);
  let f be Function of LN,LN;
  assume
A1: f is_succ_homomorphism v,w;
  for x st x in LN & CastNode(x,v) is non elementary & w |= *CastNode(x,v)
  holds ex n st (for i st i<n holds CastNode((f|**i).x,v) is non elementary) &
  CastNode((f|**n).x,v) is elementary
  proof
    let x such that
A2: x in LN and
A3: CastNode(x,v) is non elementary and
A4: w |= *CastNode(x,v);
    deffunc F(set) = (f|**CastNat($1)).x;
    set len1=len(CastNode(f.x,v))+1;
    0<0+len1;
    then
A5: 1<=len1 by NAT_1:19;
    reconsider len1 as Nat;
    consider L such that
A6: len(L) =len1 & for k being Nat st k in dom L holds L.k=F(k) from
    FINSEQ_1:sch 2;
    set X ={m where m is Element of NAT: 1<=m & m<=len1 & CastNode((f|**m).x,v
    ) is elementary};
A7: Seg len1 = dom L by A6,FINSEQ_1:def 3;
A8: for k st 1<= k & k<=len(L) holds L.k= (f|**k).x
    proof
      let k;
      assume 1<= k & k<=len(L);
      then k in Seg len1 by A6,FINSEQ_1:1;
      then L.k = (f|**CastNat(k)).x by A6,A7;
      hence thesis by MODELC_2:def 1;
    end;
A9: now
      assume
A10:  X = {};
A11:  for k st 1<=k & k<=len(L) holds CastNode((f|**k).x,v) is non elementary
      proof
        let k such that
A12:    1<=k & k<=len(L);
        reconsider k as Element of NAT by ORDINAL1:def 12;
        not k in X by A10;
        hence thesis by A6,A12;
      end;
A13:  for k st 1<= k & k<len(L) holds CastNode((f|**(k+1)).x,v) is_succ_of
      CastNode((f|**k).x,v)
      proof
        let k such that
        1<=k and
A14:    k<len(L);
        for i st i<=k holds CastNode((f|**i).x,v) is non elementary
        proof
          let i;
          assume i<=k;
          then
A15:      i < len(L) by A14,XXREAL_0:2;
          now
            per cases by Lm6;
            suppose
              1<=i;
              hence thesis by A11,A15;
            end;
            suppose
              i = 0;
              then f|**i = id LN by FUNCT_7:84;
              hence thesis by A2,A3,FUNCT_1:18;
            end;
          end;
          hence thesis;
        end;
        hence thesis by A1,A2,A3,A4,Th48;
      end;
      for m st 1 <= m & m < len(L) holds ex N,M st N = L.m & M=L.(m+1) &
      M is_succ_of N
      proof
        let m such that
A16:    1 <= m & m < len(L);
        set M = L.(m+1);
        1<=m+1 & m+1<=len(L) by A16,NAT_1:13;
        then
A17:    M=(f|**(m+1)).x by A8;
        then M in LN by A2,FUNCT_2:5;
        then
A18:    ex M1 being strict LTLnode over v st M=M1 by Def30;
        set N = L.m;
A19:    N=(f|**m).x by A8,A16;
        then N in LN by A2,FUNCT_2:5;
        then
A20:    ex N1 being strict LTLnode over v st N=N1 by Def30;
        reconsider M as strict LTLnode over v by A18;
        reconsider N as strict LTLnode over v by A20;
        CastNode(N,v) = N & CastNode(M,v) = M by Def16;
        hence thesis by A13,A16,A19,A17;
      end;
      then L is_Finseq_for v;
      then len(CastNode(L.len1,v)) <= len(CastNode(L.1,v)) -len1+1 by A5,A6
,Th36;
      then len(CastNode(L.len1,v))<=len(CastNode((f|**1).x,v)) -len1+1 by A5,A6
,A8;
      then len(CastNode(L.len1,v)) <= len(CastNode(f.x,v)) -len1 +1 by
FUNCT_7:70;
      then len(CastNode((f|**len1).x,v)) <= 0 by A5,A6,A8;
      then the LTLnew of CastNode((f|**len1).x,v) = {}v by Th22;
      then CastNode((f|**len1).x,v) is elementary;
      then len1 in X by A5;
      hence contradiction by A10;
    end;
    X c= Seg len1
    proof
      let y be object;
      assume y in X;
      then
      ex m being Element of NAT st y = m & 1<=m & m<=len1 & CastNode((f|**
      m).x,v) is elementary;
      hence thesis by FINSEQ_1:1;
    end;
    then consider n such that
    1<=n and
A21: n<=len1 and
A22: n in X and
A23: for i st 1<=i & i<n holds not i in X by A9,Lm30;
A24: for i st i<n holds CastNode((f|**i).x,v) is non elementary
    proof
      let i such that
A25:  i<n;
      now
        per cases by Lm6;
        suppose
          i=0;
          then f|**i = id LN by FUNCT_7:84;
          hence thesis by A2,A3,FUNCT_1:18;
        end;
        suppose
A26:      1<=i;
          then
A27:      not i in X by A23,A25;
          now
            assume
A28:        CastNode((f|**i).x,v) is elementary;
            reconsider i as Element of NAT by ORDINAL1:def 12;
            i<len1 by A21,A25,XXREAL_0:2;
            hence contradiction by A26,A27,A28;
          end;
          hence thesis;
        end;
      end;
      hence thesis;
    end;
    CastNode((f|**n).x,v) is elementary
    proof
      ex m being Element of NAT st n=m & 1<=m & m<=len1 & CastNode((f|**m)
      .x,v) is elementary by A22;
      hence thesis;
    end;
    hence thesis by A24;
  end;
  hence thesis;
end;
