reserve Omega for non empty set;
reserve Sigma for SigmaField of Omega;
reserve T for Nat;
 reserve TFix for Element of StoppingSetExt(T);
 reserve MyFunc for Filtration of StoppingSet(T),Sigma;
 reserve k,k1,k2 for Function of Omega,StoppingSetExt(T);

theorem KJK:
  k is_StoppingTime_wrt MyFunc,T iff
   for t being Element of StoppingSet(T) holds
     {w where w is Element of Omega: k.w<=t} in MyFunc.t
proof
  thus k is_StoppingTime_wrt MyFunc,T implies
    for t being Element of StoppingSet(T) holds
         {w where w is Element of Omega: k.w<=t} in MyFunc.t
  proof
   assume ASS: k is_StoppingTime_wrt MyFunc,T;
   for t being Element of StoppingSet(T) holds
         {w where w is Element of Omega: k.w<=t} in MyFunc.t
   proof
    defpred J[Nat] means
     $1 in StoppingSet(T) implies
      {w where w is Element of Omega: k.w<=$1} in MyFunc.$1;
      K1: {w where w is Element of Omega: k.w<=0}=
        {w where w is Element of Omega: k.w=0}
      proof
       for q being object holds
       q in {w where w is Element of Omega: k.w<=0} iff
        q in {w where w is Element of Omega: k.w=0}
       proof
         let q be object;
         I1: (ex q1 being Element of Omega st q=q1 & k.q1<=0) implies
         (ex q2 being Element of Omega st q=q2 & k.q2=0)
         proof
          given q2 being Element of Omega such that II: q=q2 & k.q2<=0;
          k.q2=0
          proof
           per cases by XBOOLE_0:def 3;
           suppose k.q2 in StoppingSet T;
             then ex s being Element of NAT st k.q2=s & 0<=s & s<=T;
             hence thesis by II;
           end;
           suppose k.q2 in {+infty};
           hence thesis by II,TARSKI:def 1;
           end;
           end;
          hence thesis by II;
          end;
         (ex q2 being Element of Omega st q=q2 & k.q2=0) implies
          (ex q1 being Element of Omega st q=q1 & k.q1<=0);
        hence thesis by I1;
        end;
       hence thesis by TARSKI:2;
       end;
    J0: J[0]
    proof
     {w where w is Element of Omega: k.w<=0} in MyFunc.0
     proof
      0 in StoppingSet T;
      hence thesis by K1,ASS;
     end;
    hence thesis;
    end;
    J1: for n being Nat st J[n] holds J[n+1]
    proof
     let n be Nat;
     assume j1: J[n];
     n+1 in StoppingSet(T) implies
      {w where w is Element of Omega: k.w<=n+1} in MyFunc.(n+1)
     proof
      assume ASSJ10: n+1 in StoppingSet(T);
      J10: {w where w is Element of Omega: k.w<=n+1} =
      ({w where w is Element of Omega: k.w<=n} \/
       {w where w is Element of Omega: k.w=n+1})
      proof
       for x being object holds
        x in {w where w is Element of Omega: k.w<=n+1} iff
        x in ({w where w is Element of Omega: k.w<=n} \/
             {w where w is Element of Omega: k.w=n+1})
       proof
        let x be object;
        thus x in {w where w is Element of Omega: k.w<=n+1} implies
            x in ({w where w is Element of Omega: k.w<=n} \/
                 {w where w is Element of Omega: k.w=n+1})
        proof
         assume x in {w where w is Element of Omega: k.w<=n+1}; then
         consider w being Element of Omega such that XX: x=w & k.w<=n+1;
          set KW=k.w;
         per cases by XX;
         suppose x=w & k.w<=n;
          then x in {w where w is Element of Omega: k.w<=n};
          hence thesis by XBOOLE_0:def 3;
         end;
         suppose S1:x=w & not k.w<=n;
          k.w=n+1
          proof
           k.w is Element of NAT or k.w=+infty
           proof
            k.w in StoppingSet T or k.w in {+infty} by XBOOLE_0:def 3; then
            per cases by TARSKI:def 1;
            suppose k.w=+infty; hence thesis; end;
            suppose k.w in StoppingSet T;
            then ex q being Element of NAT st k.w=q & 0<=q<=T;
            hence thesis;
            end;
           end; then
           reconsider KW as Element of NAT by NUMBERS:19,XX,XXREAL_0:9;
           per cases by XX,NAT_1:8;
           suppose KW<=n; hence thesis by S1; end;
           suppose KW=n+1; hence thesis; end;
          end;
          then x in {w where w is Element of Omega: k.w=n+1} by XX;
          hence thesis by XBOOLE_0:def 3;
        end;
        end;
         assume x in {w where w is Element of Omega: k.w<=n} \/
           {w where w is Element of Omega: k.w=n+1};
         then per cases by XBOOLE_0:def 3;
         suppose JP:x in {w where w is Element of Omega: k.w<=n};
         x in {w where w is Element of Omega: k.w<=n+1}
         proof
          consider q being Element of Omega such that Q1:x=q & k.q<=n by JP;
          set KJ=k.q;
           KJ is Element of NAT or KJ=+infty
           proof
            k.q in StoppingSet T or k.q in {+infty}
             by XBOOLE_0:def 3;
            then per cases by TARSKI:def 1;
            suppose k.q=+infty; hence thesis; end;
            suppose k.q in StoppingSet T;
            then ex q1 being Element of NAT st k.q=q1 & 0<=q1 & q1<=T;
            hence thesis;
            end;
           end;
           then reconsider KJ as Element of NAT
             by XREAL_0:def 1,Q1,XXREAL_0:9;
          KJ<=n implies KJ<=n+1 by NAT_1:12;
         hence thesis by Q1;
         end;
         hence thesis; end;
         suppose JP:x in {w where w is Element of Omega: k.w=n+1};
         x in {w where w is Element of Omega: k.w<=n+1}
         proof
          ex q being Element of Omega st x=q & k.q=n+1 by JP;
          hence thesis;
         end;
         hence thesis; end;
       end;
      hence thesis by TARSKI:2;
      end;
      reconsider n as Element of NAT by ORDINAL1:def 12;
     {w where w is Element of Omega: k.w<=n} \/
       {w where w is Element of Omega: k.w=n+1} in MyFunc.(n+1)
     proof
      set A={w where w is Element of Omega: k.w<=n};
      set B={w where w is Element of Omega: k.w=n+1};
      set C=MyFunc.(n+1);
      reconsider C as SigmaField of Omega by ASSJ10,KOLMOG01:def 2;
      n in StoppingSet T
      proof
       consider t being Element of NAT such that
       Y20: n+1=t & 0<=t & t<=T by ASSJ10;
       0<=n & n<=T by Y20,NAT_1:13;
       hence thesis;
      end; then
      reconsider n as Element of StoppingSet(T);
h2:    A is Element of C
       proof
         for x being set holds x in MyFunc.n implies x in MyFunc.(n+1)
         proof
          MyFunc.n is Subset of MyFunc.(n+1) by FINANCE3:def 9,NAT_1:12,ASSJ10;
          hence thesis;
         end;
        hence thesis by j1;
       end;
      B is Event of C by ASSJ10,ASS; then
      A\/B is Event of C by h2,PROB_1:21;
      hence thesis;
     end;
     hence thesis by J10;
     end;
    hence thesis;
    end;
    Q1: for n being Nat holds J[n] from NAT_1:sch 2(J0,J1);
    for t being Element of StoppingSet(T) holds
    {w where w is Element of Omega: k.w<=t} in MyFunc.t
    proof
     let t be Element of StoppingSet(T);
      t in StoppingSet T; then
      ex s being Element of NAT st t=s & 0<=s<=T;
      hence thesis by Q1;
    end;
   hence thesis;
   end;
  hence thesis;
  end;
   assume ASSJ1: for t being Element of StoppingSet(T) holds
    {w where w is Element of Omega: k.w<=t} in MyFunc.t;
   for t being Element of StoppingSet(T) holds
    {w where w is Element of Omega: k.w=t} in MyFunc.t
   proof
    let t be Element of StoppingSet(T);
    defpred J[Nat] means
     ($1+1) in StoppingSet(T) implies
      {w where w is Element of Omega: k.w<$1+1} in MyFunc.($1+1);
    J01: J[0]
    proof
     (0+1) in StoppingSet(T) implies
      {w where w is Element of Omega: k.w<0+1} in MyFunc.(0+1)
     proof
      assume ASS: 0+1 in StoppingSet(T);
      {w where w is Element of Omega: k.w<0+1} in MyFunc.(0+1)
      proof
       H1: {w where w is Element of Omega: k.w<=0} =
       {w where w is Element of Omega: k.w<0+1}
       proof
        for x being object holds
         x in {w where w is Element of Omega: k.w<=0} iff
          x in {w where w is Element of Omega: k.w<0+1}
        proof
         let x be object;
         thus x in {w where w is Element of Omega: k.w<=0} implies
              x in {w where w is Element of Omega: k.w<0+1}
         proof
           assume x in {w where w is Element of Omega: k.w<=0}; then
           consider w1 being Element of Omega such that
           W1: x=w1 & k.w1<=0;
           thus thesis by W1;
         end;
          assume x in {w where w is Element of Omega: k.w<0+1};
          then consider w1 being Element of Omega such that
          W1: x=w1 & k.w1<0+1;
          set KWJ=k.w1;
           KWJ is Element of NAT or KWJ=+infty
           proof
            k.w1 in StoppingSet T or k.w1 in {+infty}
             by XBOOLE_0:def 3;
            then per cases by TARSKI:def 1;
            suppose k.w1=+infty; hence thesis; end;
            suppose k.w1 in StoppingSet T;
             then ex q1 being Element of NAT st k.w1=q1 & 0<=q1<=T;
             hence thesis;
            end;
           end; then
          reconsider KWJ as Nat by NUMBERS:19,W1,XXREAL_0:9;
          KWJ<=0 by NAT_1:13,W1;
         hence thesis by W1;
        end;
       hence thesis by TARSKI:2;
       end;
T1:    0 in StoppingSet(T); then
       reconsider JA = 0 as Element of StoppingSet(T);
       reconsider JB = 0 + 1 as Element of StoppingSet(T) by ASS;
h2:    MyFunc.JA is Subset of MyFunc.JB by FINANCE3:def 9;
       {w where w is Element of Omega: k.w<=0} in MyFunc.0 by ASSJ1,T1;
       hence thesis by H1,h2;
      end;
     hence thesis;
     end;
    hence thesis;
    end;
J11: for n being Nat st J[n] holds J[n+1]
    proof
     let n be Nat;
     assume J[n];
     (n+1)+1 in StoppingSet(T) implies
      {w where w is Element of Omega: k.w<(n+1)+1} in MyFunc.((n+1)+1)
      proof
       assume N01: (n+1)+1 in StoppingSet(T);
       M10: {w where w is Element of Omega: k.w<(n+1)+1}=
        {w where w is Element of Omega: k.w<=n+1}
       proof
        for x being object holds
         x in {w where w is Element of Omega: k.w<(n+1)+1} iff
          x in {w where w is Element of Omega: k.w<=n+1}
        proof
         let x be object;
          thus x in {w where w is Element of Omega: k.w<(n+1)+1} implies
          x in {w where w is Element of Omega: k.w<=n+1}
          proof
          assume x in {w where w is Element of Omega: k.w<(n+1)+1};
          then consider w being Element of Omega such that
           F11: x=w & k.w<(n+1)+1;
           set KW=k.w;
a1:        k.w in StoppingSet T
           proof
            (n+1)+1 in REAL by NUMBERS:19; then
            k.w < +infty by F11,XXREAL_0:2,XXREAL_0:9; then
            not k.w in {+infty} by TARSKI:def 1;
            hence thesis by XBOOLE_0:def 3;
           end;
           consider w2 being Element of NAT such that
           L21: KW=w2 & 0<=w2<=T by a1;
          KW<(n+1)+1 iff KW<=n+1 by NAT_1:13,L21;
        hence thesis by F11;
        end;
          assume x in {w where w is Element of Omega: k.w<=n+1};
          then consider w3 being Element of Omega such that
           QZ1: x=w3 & k.w3<=n+1;
          set KW=k.w3;
          k.w3 in StoppingSet T
          proof
           not k.w3 in {+infty}
           proof
            n+1 < +infty by XXREAL_0:9,NUMBERS:19;
            hence thesis by TARSKI:def 1,QZ1;
           end;
          hence thesis by XBOOLE_0:def 3;
          end; then
          consider w2 being Element of NAT such that
           L21: k.w3=w2 & 0<=w2<=T;
           KW<(n+1)+1 by QZ1,NAT_1:13,L21;
          hence thesis by QZ1;
        end;
       hence thesis by TARSKI:2;
       end;
s1:     n+1 in StoppingSet(T)
        proof
         consider w3 being Element of NAT such that
          QZ10: w3=(n+1)+1 & 0<=w3 & w3<=T by N01;
         n+1<T by NAT_1:13,QZ10;
         hence thesis;
        end;
        n+1 in StoppingSet(T) & n+1<=(n+1)+1 by NAT_1:13,s1; then
        MyFunc.(n+1) is Subset of MyFunc.((n+1)+1) by FINANCE3:def 9,N01;
        then MyFunc.(n+1) c= MyFunc.((n+1)+1);
      hence thesis by M10,ASSJ1,s1;
      end;
     hence thesis;
    end;
    Q1: for n being Nat holds J[n] from NAT_1:sch 2(J01,J11);
    reconsider M = MyFunc.t as SigmaField of Omega by KOLMOG01:def 2;
    QH1: {w where w is Element of Omega: k.w<=t} is Element of M by ASSJ1;
    t in StoppingSet T; then
    consider q being Element of NAT such that QH3: t=q & 0<=q<=T;
    reconsider t as Nat by QH3;
    Q2: {w where w is Element of Omega: k.w<=t} \
         {w where w is Element of Omega: k.w<t} is Event of M
    proof
     {w where w is Element of Omega: k.w<t} is Element of M
     proof
      per cases;
      suppose S1:t=0;
s2:    {w where w is Element of Omega: k.w<0} c= {}
       proof
         let x be object;
         assume x in {w where w is Element of Omega: k.w<0}; then
         consider w being Element of Omega such that
TT:      x = w & k.w < 0;
         k.w>=0
         proof
          k.w in StoppingSet T or k.w in {+infty} by XBOOLE_0:def 3; then
          per cases by TARSKI:def 1;
          suppose k.w in StoppingSet T;
          then ex t being Element of NAT st t=k.w & 0<=t<=T;
          hence thesis;
          end;
          suppose k.w=+infty;
          hence thesis;
          end;
         end;
         hence thesis by TT;
       end;
       reconsider M as SigmaField of Omega;
       {} is Element of M by PROB_1:22;
      hence thesis by s2,S1;
      end;
      suppose t>0; then
        {w where w is Element of Omega: k.w<(t-1)+1} is Element
          of MyFunc.((t-1)+1) by Q1;
        hence thesis;
      end;
     end;
    hence thesis by QH1,PROB_1:24;
    end;
    {w where w is Element of Omega: k.w<=t} \
         {w where w is Element of Omega: k.w<t} =
        {w where w is Element of Omega: k.w=t}
    proof
     for x being object holds
      x in {w where w is Element of Omega: k.w<=t} \
            {w where w is Element of Omega: k.w<t} iff
       x in {w where w is Element of Omega: k.w=t}
     proof
      let x be object;
       thus x in {w where w is Element of Omega: k.w<=t} \
              {w where w is Element of Omega: k.w<t} implies
            x in {w where w is Element of Omega: k.w=t}
       proof
        assume x in {w where w is Element of Omega: k.w<=t} \
                     {w where w is Element of Omega: k.w<t}; then
        JJJ:x in {w where w is Element of Omega: k.w<=t} &
        not x in {w where w is Element of Omega: k.w<t} by XBOOLE_0:def 5;
          then
        consider w1 being Element of Omega such that
        JJJ1: w1=x & k.w1<=t;
        w1 in {w where w is Element of Omega: k.w=t}
        proof
         k.w1<=t & k.w1>=t implies k.w1=t
         proof
          assume Q0: k.w1<=t & k.w1>=t;
          set W=k.w1;
          W in StoppingSet T or W in {+infty} by XBOOLE_0:def 3; then
          (ex w3 being Element of NAT st w3=W & 0<=w3 & w3<=T) or
            W=+infty by TARSKI:def 1;
          then reconsider W as Nat by JJJ1,XXREAL_0:9;
          W+1>t by NAT_1:13,Q0;
         hence thesis by Q0,NAT_1:22;
         end;
        hence thesis by JJJ1,JJJ;
        end;
       hence thesis by JJJ1;
       end;
        assume x in {w where w is Element of Omega: k.w=t};
        then consider w being Element of Omega such that
         W1: x=w & k.w=t;
        (ex w1 being Element of Omega st x=w1 & k.w1<=t) &
        (not ex w1 being Element of Omega st x=w1 & k.w1<t) by W1; then
        x in {w where w is Element of Omega: k.w<=t} &
              (not x in {w where w is Element of Omega: k.w<t});
       hence thesis by XBOOLE_0:def 5;
     end;
    hence thesis by TARSKI:2;
    end;
   hence thesis by Q2;
  end;
  hence thesis;
end;
