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;

theorem Th6:
  rng L = Subformulae H & L is one-to-one & F in W implies len(L,W\
  {F}) = len(L,W) - len F
proof
  assume that
A1: rng L = Subformulae H and
A2: L is one-to-one and
A3: F in W;
  consider x being object such that
A4: x in dom L and
A5: L.x = F by A1,A3,FUNCT_1:def 3;
  set R2= Partial_seq(L,W\{F});
  set R1 = Partial_seq(L,W);
  set n = len L;
A6: F in LTL_WFF by MODELC_2:1;
  x in Seg n by A4,FINSEQ_1:def 3;
  then x in { k where k is Nat: 1 <= k & k <= n } by FINSEQ_1:def 1;
  then consider k being Nat such that
A7: x=k and
  1<=k and
A8: k <= n;
  reconsider k as Nat;
  L.k in {F} by A5,A7,TARSKI:def 1;
  then not L.k in W\{F} by XBOOLE_0:def 5;
  then
A9: R2.k= 0 by Def24;
  for i st i<=n & not i=k holds R1.i = R2.i
  proof
    let i such that
    i<=n and
A10: not i=k;
    now
      per cases;
      suppose
        not i in dom L;
        then
A11:    L.i = {} by FUNCT_1:def 2;
        then
A12:    not L.i in W by Lm24;
        not L.i in W\{F} by A11,Lm24;
        then R2.i = 0 by Def24
          .= R1.i by A12,Def24;
        hence thesis;
      end;
      suppose
        i in dom L;
        then not L.i = F by A2,A4,A5,A7,A10,FUNCT_1:def 4;
        then
A13:    not L.i in {F} by TARSKI:def 1;
        now
          per cases;
          suppose
A14:        L.i in W;
            then L.i in W\{F} by A13,XBOOLE_0:def 5;
            then R2.i = len CastLTL(L.i) by Def24
              .= R1.i by A14,Def24;
            hence thesis;
          end;
          suppose
A15:        not L.i in W;
            then not L.i in W\{F} by XBOOLE_0:def 5;
            then R2.i = 0 by Def24
              .= R1.i by A15,Def24;
            hence thesis;
          end;
        end;
        hence thesis;
      end;
    end;
    hence thesis;
  end;
  then
A16: Sum(R1, n) - R1.k = Sum(R2, n) - R2.k by A8,Lm26;
  R1.k = len CastLTL(L.k) by A3,A5,A7,Def24
    .= len F by A5,A7,A6,MODELC_2:def 25;
  hence thesis by A9,A16;
end;
