
theorem Th34: :: Proposition 4.45
  for R being non empty RelStr, s being sequence of R st R is Dickson
  ex t being sequence of R st t is subsequence of s & t is weakly-ascending
proof
  let R be non empty RelStr, s be sequence of R such that
A1: R is Dickson;
  set CR = the carrier of R;
  deffunc Bi(Element of rng s, Element of NAT)
  = {n where n is Element of NAT : $1 <= s.n & $2 < n};
  deffunc Bi2(Element of rng s) = {n where n is Element of NAT : $1 <= s.n};
  defpred P[set,Element of NAT,set] means
  ex N being Subset of CR, B being non empty Subset of CR
  st N = {s.w where w is Element of NAT : s.$2 <= s.w & $2 < w} &
  { w where w is Element of NAT : s.$2 <= s.w & $2 < w} is infinite &
  B = the Element of {BB where BB is Element of Dickson-bases(N,R):
          BB is finite} &
  $3 = s mindex ( the Element of {b where b is Element of B :
  ex b9 being Element of rng s st b9=b & Bi(b9,$2) is infinite}, $2);
  defpred Q[set,Element of NAT,set] means
  {w where w is Element of NAT : s.$2 <= s.w & $2 < w} is infinite
  implies P[$1,$2,$3];
A2: for n being Nat for x being Element of NAT
  ex y being Element of NAT st Q[n,x,y]
  proof
    let n be Nat, x be Element of NAT;
    set N = {s.w where w is Element of NAT : s.x <= s.w & x < w};
    now
      let y be object;
      assume y in N;
      then ex w being Element of NAT st ( y = s.w)&( s.x <= s.w)&( x < w);
      hence y in CR;
    end;
    then reconsider N as Subset of CR by TARSKI:def 3;
    set W = {w where w is Element of NAT : s.x <= s.w & x < w};
    per cases;
    suppose
A3:   N is empty;
      take 1;
      assume W is infinite;
      then consider ww being object such that
A4:   ww in W by XBOOLE_0:def 1;
      consider www being Element of NAT such that www = ww and
A5:   s.x <= s.www and
A6:   x < www by A4;
      s.www in N by A5,A6;
      hence thesis by A3;
    end;
    suppose
A7:   N is non empty;
      set BBX = {BB where BB is Element of Dickson-bases(N,R): BB is finite};
      set B = the Element of BBX;
      consider BD1 being set such that
A8:   BD1 is_Dickson-basis_of N,R and
A9:   BD1 is finite by A1;
      BD1 in Dickson-bases(N,R) by A1,A8,Def13;
      then BD1 in BBX by A9;
      then B in BBX;
      then ex BBB being Element of Dickson-bases(N,R) st ( B = BBB)&(
      BBB is finite);
      then
A10:  B is_Dickson-basis_of N,R by A1,Def13;
      reconsider B as non empty Subset of CR by A7,A10,Th25,XBOOLE_1:1;
      set y = s mindex ( the Element of {b where b is Element of B :
      ex b9 being Element of rng s st b9=b & Bi(b9,x) is infinite}, x);
      take y;
      set W = {w where w is Element of NAT : s.x <= s.w & x < w};
      assume
A11:  W is infinite;
      take N;
      reconsider B as non empty Subset of CR;
      take B;
      thus N = {s.w where w is Element of NAT : s.x <= s.w & x < w};
      thus { w where w is Element of NAT : s.x <= s.w & x < w}
      is infinite by A11;
      thus B = the Element of {BB where BB is Element of Dickson-bases(N,R):
      BB is finite};
      thus thesis;
    end;
  end;
  consider B being set such that
A12: B is_Dickson-basis_of rng s, R and
A13: B is finite by A1;
  reconsider B as non empty set by A12,Th25;
  set BALL = {b where b is Element of B :
  ex b9 being Element of rng s st b9=b & Bi2(b9) is infinite};
  set b1 = the Element of BALL;
  consider f being sequence of NAT such that
A14: f.0 = s mindex b1 and
A15: for n being Nat holds Q[n, f.n, f.(n+1)]
  from RECDEF_1:sch 2(A2);
A16: dom f = NAT by FUNCT_2:def 1;
A17: rng f c= NAT;
  now
A18: B is finite by A13;
    assume
A19: for b being Element of rng s st b in B holds Bi2(b) is finite;
    set Ball = {Bi2(b) where b is Element of rng s: b in B};
A20: Ball is finite from FRAENKEL:sch 21(A18);
    now
      let X be set;
      assume X in Ball;
      then ex b being Element of rng s st ( X = Bi2(b))&( b in B);
      hence X is finite by A19;
    end;
    then
A21: union Ball is finite by A20,FINSET_1:7;
    now
      let x be object;
      assume x in NAT;
      then reconsider x9= x as Element of NAT;
      dom s = NAT by FUNCT_2:def 1;
      then x9 in dom s;
      then
A22:  s.x in rng s by FUNCT_1:3;
      then reconsider sx = s.x as Element of R;
      consider b being Element of R such that
A23:  b in B and
A24:  b <= sx by A12,A22;
      B c= rng s by A12;
      then reconsider b as Element of rng s by A23;
A25:  x9 in Bi2(b) by A24;
      Bi2(b) in Ball by A23;
      hence x in union Ball by A25,TARSKI:def 4;
    end;
    then NAT c= union Ball;
    hence contradiction by A21;
  end;
  then consider tb being Element of rng s such that
A26: tb in B and
A27: Bi2(tb) is infinite;
A28: tb in BALL by A26,A27;
  then b1 in BALL;
  then
A29: ex bt being Element of B st ( b1 = bt)&( ex b9 being
  Element of rng s st b9 = bt & Bi2(b9) is infinite);
  dom s = NAT by NORMSP_1:12;
  then
A30: s.(f.0) = b1 by A14,A29,Def11;
  b1 in BALL by A28;
  then
A31: ex eb being Element of B st ( b1 = eb)&( ex eb9 being
  Element of rng s st eb9=eb & Bi2(eb9) is infinite);
  deffunc F(set) = $1;
  defpred P[Nat] means 0 <= $1 & s.(f.0) <= s.$1;
  set W1 = {w where w is Element of NAT: s.(f.0) <= s.w};
  set W2 = {w where w is Element of NAT: s.(f.0) <= s.w & f.0 < w};
  set W3 = {F(w) where w is Nat: w <= f.0 & P[w]};
A32: W3 is finite from FINSEQ_1:sch 6;
  now
    let x be object;
    hereby
      assume x in W1;
      then consider w being Element of NAT such that
A33:  x = w and
A34:  s.(f.0) <= s.w;
A35:  0 <= w by NAT_1:2;
      w <= f.0 or w > f.0;
      then x in W2 or x in W3 by A33,A34,A35;
      hence x in W2 \/ W3 by XBOOLE_0:def 3;
    end;
    assume
A36: x in W2 \/ W3;
    per cases by A36,XBOOLE_0:def 3;
    suppose x in W2;
      then ex w being Element of NAT st ( x = w)&( s.(f.0) <= s.w)&( f .0 < w);
      hence x in W1;
    end;
    suppose x in W3;
      then
A37:    ex w being Nat st x = w & w <= f.0 & 0 <= w & s.(f.0) <= s.w;
       then reconsider w=x as Element of NAT by ORDINAL1:def 12;
       0 <= w & w <= f.0 & s.(f.0) <= s.w by A37;
      hence x in W1;
    end;
  end;
  then
A38: W2 is infinite by A30,A31,A32,TARSKI:2;
  defpred R[Nat] means P[$1, f.$1, f.($1+1)];
A39: R[ 0 ] by A15,A38;
A40: now
    let k be Nat;
    assume R[k];
    then consider
    N being Subset of CR, B being non empty Subset of CR such that
A41: N = {s.w where w is Element of NAT : s.(f.k) <= s.w & f.k < w} and
A42: {w where w is Element of NAT : s.(f.k) <= s.w & f.k < w} is infinite and
A43: B = the Element of {BB where BB is Element of Dickson-bases(N, R) :
    BB is finite} and
A44: f.(k+1)=s mindex (the Element of {b where b is Element of B :
    ex b9 being Element of rng s
    st b9=b & Bi(b9,f.k) is infinite},f.k);
    set BALL={b where b is Element of B: ex b9 being Element of rng s
    st b9=b & Bi(b9,f.k) is infinite};
    set BBX ={BB where BB is Element of Dickson-bases(N, R): BB is finite};
    set iN = {w where w is Element of NAT : s.(f.k) <= s.w & f.k < w};
    consider BD being set such that
A45: BD is_Dickson-basis_of N,R and
A46: BD is finite by A1;
    BD in Dickson-bases(N,R) by A1,A45,Def13;
    then BD in BBX by A46;
    then B in BBX by A43;
    then
A47: ex BB being Element of Dickson-bases(N,R) st ( B = BB)&( BB is finite);
    then
A48: B is_Dickson-basis_of N,R by A1,Def13;
    now
      deffunc F(Element of rng s) = Bi($1, f.k);
A49:  B is finite by A47;
      assume
A50:  for b being Element of rng s st b in B holds Bi(b, f.k) is finite;
      set Ball = {F(b) where b is Element of rng s : b in B };
A51:  Ball is finite from FRAENKEL:sch 21(A49);
      now
        let X be set;
        assume X in Ball;
        then ex b being Element of rng s st ( X = Bi(b, f.k))&( b in B);
        hence X is finite by A50;
      end;
      then
A52:  union Ball is finite by A51,FINSET_1:7;
      iN c= union Ball
      proof
        let x be object;
        assume x in iN;
        then consider w being Element of NAT such that
A53:    x = w and
A54:    s.(f.k) <= s.w and
A55:    f.k < w;
A56:    s.w in N by A41,A54,A55;
        reconsider sw = s.w as Element of R;
        consider b being Element of R such that
A57:    b in B and
A58:    b <= sw by A48,A56;
A59:    B c= N by A48;
        N c= rng s
        proof
          let x be object;
          assume x in N;
          then
A60:      ex u being Element of NAT st ( x = s.u)&( s.(f.k) <= s.u)&(
          f.k < u) by A41;
          dom s = NAT by FUNCT_2:def 1;
          hence thesis by A60,FUNCT_1:3;
        end;
        then B c= rng s by A59;
        then reconsider b as Element of rng s by A57;
A61:    w in Bi(b, f.k) by A55,A58;
        Bi(b, f.k) in Ball by A57;
        hence thesis by A53,A61,TARSKI:def 4;
      end;
      hence contradiction by A42,A52;
    end;
    then consider b being Element of rng s such that
A62: b in B and
A63: Bi(b, f.k) is infinite;
    b in BALL by A62,A63;
    then the Element of BALL in BALL;
    then consider b being Element of B such that
A64: b = the Element of BALL and
A65: ex b9 being Element of rng s st b9=b & Bi(b9,f.k) is infinite;
    B c= N by A48;
    then b in N;
    then
A66: ex w being Element of NAT st ( b = s.w)&( s.(f.k) <= s.w)&(
    f.k < w) by A41;
    then
A67: s.(f.(k+1)) = the Element of BALL by A44,A64,Def12;
A68: f.k < f.(k+1) by A44,A64,A66,Def12;
    deffunc F(set) = $1;
    defpred P[Nat] means f.k < $1 & s.(f.(k+1)) <= s.$1;
    set W1 = {w1 where w1 is Element of NAT : s.(f.(k+1)) <= s.w1 & f.k < w1};
    set W2 = {w1 where w1 is Element of NAT :
    s.(f.(k+1)) <= s.w1 & f.(k+1) < w1};
    set W3 = {F(w1) where w1 is Nat : w1 <= f.(k+1) & P[w1]};
A69: W3 is finite from FINSEQ_1:sch 6;
    now
      let x be object;
      hereby
        assume x in W1;
        then consider w being Element of NAT such that
A70:    x = w and
A71:    s.(f.(k+1)) <= s.w and
A72:    f.k < w;
        w <= f.(k+1) or w > f.(k+1);
        then x in W2 or x in W3 by A70,A71,A72;
        hence x in W2 \/ W3 by XBOOLE_0:def 3;
      end;
      assume
A73:  x in W2 \/ W3;
      per cases by A73,XBOOLE_0:def 3;
      suppose x in W2;
        then consider w being Element of NAT such that
A74:    x = w and
A75:    s.(f.(k+1)) <= s.w and
A76:    f.(k+1) < w;
        f.k < w by A68,A76,XXREAL_0:2;
        hence x in W1 by A74,A75;
      end;
      suppose x in W3;
        then consider w being Nat such that
A77:       x = w & w <= f.(k+1) & f.k < w & s.(f.(k+1)) <= s.w;
        reconsider w as Element of NAT by ORDINAL1:def 12;
        x = w & f.k < w & w <= f.(k+1) & s.(f.(k+1)) <= s.w by A77;

        hence x in W1;
      end;
    end;
    then W2 is infinite by A64,A65,A67,A69,TARSKI:2;
    hence R[k+1] by A15;
  end;
A78: for n being Nat holds R[n] from NAT_1:sch 2(A39,A40);
  set t = s * f;
  take t;
  reconsider f as sequence of  REAL by FUNCT_2:7,NUMBERS:19;
  now
    now
      let n be Nat;
A79:    n in NAT by ORDINAL1:def 12;
      f.n in rng f by A16,A79,FUNCT_1:def 3;
      then reconsider fn = f.n as Element of NAT by A17;
      consider N being Subset of CR, B being non empty Subset of CR such that
A80:  N = {s.w where w is Element of NAT : s.(fn) <= s.w & fn < w} and
A81:  {w where w is Element of NAT : s.(fn) <= s.w & fn < w} is infinite and
A82:  B = the Element of {BB where BB is Element of Dickson-bases(N, R):
      BB is finite} and
A83:  f.(n+1) = s mindex (the Element of {b where b is Element of B :
      ex b9 being Element of rng s st b9=b & Bi(b9,fn) is infinite}, fn)
      by A78;
      set BBX = {BB where BB is Element of Dickson-bases(N, R): BB is finite};
      set BJ = {b where b is Element of B : ex b9 being Element of rng s
      st b9=b & Bi(b9,fn) is infinite};
      set BC = the Element of BJ;
      consider BD being set such that
A84:  BD is_Dickson-basis_of N,R and
A85:  BD is finite by A1;
      BD in Dickson-bases(N,R) by A1,A84,Def13;
      then BD in BBX by A85;
      then B in BBX by A82;
      then
A86:  ex BB being Element of Dickson-bases(N,R) st ( B = BB)&( BB is finite);
      then
A87:  B is_Dickson-basis_of N,R by A1,Def13;
      then
A88:  B c= N;
      now
A89:    B is finite by A86;
        assume
A90:    for b being Element of rng s st b in B holds Bi(b, fn) is finite;
        deffunc F(Element of rng s) = Bi($1, fn);
        set Ball = {F(b) where b is Element of rng s : b in B};
        set iN = {w where w is Element of NAT : s.(fn) <= s.w & fn < w};
A91:    Ball is finite from FRAENKEL:sch 21(A89);
        now
          let X be set;
          assume X in Ball;
          then ex b being Element of rng s st ( X = Bi(b, fn))&( b in B);
          hence X is finite by A90;
        end;
        then
A92:    union Ball is finite by A91,FINSET_1:7;
        iN c= union Ball
        proof
          let x be object;
          assume x in iN;
          then consider w being Element of NAT such that
A93:      x = w and
A94:      s.(fn) <= s.w and
A95:      f.n < w;
A96:      s.w in N by A80,A94,A95;
          reconsider sw = s.w as Element of R;
          consider b being Element of R such that
A97:      b in B and
A98:      b <= sw by A87,A96;
A99:      B c= N by A87;
          N c= rng s
          proof
            let x be object;
            assume x in N;
            then
A100:        ex u being Element of NAT st ( x = s.u)&( s.(fn) <= s.u)&(
            fn < u) by A80;
            dom s = NAT by FUNCT_2:def 1;
            hence thesis by A100,FUNCT_1:3;
          end;
          then B c= rng s by A99;
          then reconsider b as Element of rng s by A97;
A101:      w in Bi(b, fn) by A95,A98;
          Bi(b, fn) in Ball by A97;
          hence thesis by A93,A101,TARSKI:def 4;
        end;
        hence contradiction by A81,A92;
      end;
      then consider b being Element of rng s such that
A102: b in B and
A103: Bi(b, fn) is infinite;
      b in BJ by A102,A103;
      then BC in BJ;
      then ex b being Element of B st ( BC = b)&( ex b9 being Element
      of rng s st b9=b & Bi(b9,fn) is infinite);
      then BC in N by A88;
      then ex j being Element of NAT st ( BC = s.j)&( s.(fn) <= s.j)&(
      fn < j) by A80;
      hence f.n < f.(n+1) by A83,Def12;
    end;
    hence f is increasing by SEQM_3:def 6;
    let n be Element of NAT;
    f.n in rng f by A16,FUNCT_1:def 3;
    hence f.n is Element of NAT by A17;
  end;
  then reconsider f as increasing sequence of NAT;
  t = s * f;
  hence t is subsequence of s;
  let n be Nat;
   n in NAT by ORDINAL1:def 12;
   then
A104: t.n = s.(f.n) by A16,FUNCT_1:13;
A105: t.(n+1) = s.(f.(n+1)) by A16,FUNCT_1:13;
  consider N being Subset of CR, B being non empty Subset of CR such that
A106: N = {s.w where w is Element of NAT : s.(f.n) <= s.w & f.n < w} and
A107: {w where w is Element of NAT: s.(f.n) <= s.w & f.n < w} is infinite and
A108: B = the Element of
     {BB where BB is Element of Dickson-bases(N, R):BB is finite}
  and
A109: f.(n+1) = s mindex ( the Element of {b where b is Element of B :
  ex b9 being Element of rng s st b9=b & Bi(b9,f.n) is infinite}, f.n) by A78;
  set BX = {b where b is Element of B : ex b9 being Element of rng s
  st b9=b & Bi(b9,f.n) is infinite};
  set sfn1 = the Element of BX;
  set BBX = {BB where BB is Element of Dickson-bases(N, R):BB is finite};
  consider BD being set such that
A110: BD is_Dickson-basis_of N,R and
A111: BD is finite by A1;
  BD in Dickson-bases(N,R) by A1,A110,Def13;
  then BD in BBX by A111;
  then B in BBX by A108;
  then
A112: ex BB being Element of Dickson-bases(N, R) st ( BB = B)&( BB is finite);
  then
A113: B is_Dickson-basis_of N,R by A1,Def13;
  now
A114: B is finite by A112;
    assume
A115: for b being Element of rng s st b in B holds Bi(b, f.n) is finite;
    deffunc F(Element of rng s) = Bi($1, f.n);
    set Ball = {F(b) where b is Element of rng s : b in B };
    set iN = {w where w is Element of NAT : s.(f.n) <= s.w & f.n < w};
A116: Ball is finite from FRAENKEL:sch 21(A114);
    now
      let X be set;
      assume X in Ball;
      then ex b being Element of rng s st ( X = Bi(b, f.n))&( b in B);
      hence X is finite by A115;
    end;
    then
A117: union Ball is finite by A116,FINSET_1:7;
    iN c= union Ball
    proof
      let x be object;
      assume x in iN;
      then consider w being Element of NAT such that
A118: x = w and
A119: s.(f.n) <= s.w and
A120: f.n < w;
A121: s.w in N by A106,A119,A120;
      reconsider sw = s.w as Element of R;
      consider b being Element of R such that
A122: b in B and
A123: b <= sw by A113,A121;
A124: B c= N by A113;
      N c= rng s
      proof
        let x be object;
        assume x in N;
        then
A125:   ex u being Element of NAT st ( x = s.u)&( s.(f.n) <= s.u)&(
        f.n < u) by A106;
        dom s = NAT by FUNCT_2:def 1;
        hence thesis by A125,FUNCT_1:3;
      end;
      then B c= rng s by A124;
      then reconsider b as Element of rng s by A122;
A126: w in Bi(b, f.n) by A120,A123;
      Bi(b, f.n) in Ball by A122;
      hence thesis by A118,A126,TARSKI:def 4;
    end;
    hence contradiction by A107,A117;
  end;
  then consider b being Element of rng s such that
A127: b in B and
A128: Bi(b, f.n) is infinite;
  b in BX by A127,A128;
  then sfn1 in BX;
  then ex b being Element of B st ( b = sfn1)&( ex b9 being
  Element of rng s st b9 = b & Bi(b9,f.n) is infinite);
  then
A129: sfn1 in B;
  B c= N by A113;
  then sfn1 in N by A129;
  then ex w being Element of NAT st ( sfn1 = s.w)&( s.(f.n) <= s.w
  )&( f.n < w) by A106;
  then t.n <= t.(n+1) by A104,A105,A109,Def12;
  hence [t.n, t.(n+1)] in the InternalRel of R;
end;
