
theorem Th35:
  for R being connected non empty Poset
  holds union (rng FinOrd-Approx R) is Order of Fin the carrier of R
proof
  let R be connected non empty Poset;
  set IR = the InternalRel of R, CR = the carrier of R;
  set X = union (rng FinOrd-Approx R);
  set FOAR = FinOrd-Approx R;
  set FOAR0 = {[a,b] where a,b is Element of Fin CR: a={} or (a<>{} &
  b<>{} & PosetMax a <> PosetMax b & [PosetMax a,PosetMax b] in IR)};
A1: (FOAR).0 = FOAR0 by Def14;
  now
    let x be object;
    assume x in X;
    then
A2: ex Y being set st ( x in Y)&( Y in rng FOAR) by TARSKI:def 4;
    rng FOAR c= bool [:Fin CR,Fin CR:] by RELAT_1:def 19;
    hence x in [:Fin CR, Fin CR:] by A2;
  end;
  then reconsider X as Relation of Fin CR by TARSKI:def 3;
A3: now
    let x be object such that
A4: x in Fin CR;
    0 in NAT;
    then 0 in dom FOAR by Def14;
    then
A5: (FOAR).0 in rng FOAR by FUNCT_1:def 3;
    reconsider x9=x as Element of Fin CR by A4;
    defpred P[Nat] means
    (for x being Element of Fin CR st card x = $1
    holds [x,x] in union rng FOAR);
A6: P[ 0 ]
    proof
      let x be Element of Fin CR;
      assume card x = 0;
      then x = {};
      then [x,x] in (FOAR).0 by A1;
      hence thesis by A5,TARSKI:def 4;
    end;
A7: for n being Nat st P[n] holds P[n+1]
    proof
      let n be Nat such that
A8:   for x being Element of Fin CR st card x = n
      holds [x,x] in union rng FOAR;
      let y be Element of Fin CR such that
A9:   card y = n+1;
      per cases;
      suppose y = {};
        then [y,y] in (FOAR).0 by A1;
        hence thesis by A5,TARSKI:def 4;
      end;
      suppose
A10:    y <> {};
        set z = y\{PosetMax y};
        reconsider z as Element of Fin CR by Th34;
        card z = n by A9,Lm1;
        then [z,z] in union rng FOAR by A8;
        hence thesis by A10,Th32;
      end;
    end;
A11: for n being Nat holds P[n] from NAT_1:sch 2(A6, A7);
    reconsider xx=x as set by TARSKI:1;
    card x9 = card xx;
    hence [x,x] in X by A11;
  end;
A12: now
    let x,y be object such that
A13: x in Fin CR and
A14: y in Fin CR and
A15: [x,y] in X and
A16: [y,x] in X;
    reconsider x9=x as Element of Fin CR by A13;
    defpred R[Nat] means (for x, y being Element of Fin CR
    st card x = $1 & [x,y] in X & [y,x] in X holds x = y);
    now
      let a,b be Element of Fin CR such that
A17:  card a = 0 and [a,b] in X and
A18:  [b,a] in X;
      reconsider a9=a as finite set;
      a9 = {} by A17;
      hence a = b by A18,Th33;
    end;
    then
A19: R[ 0 ];
    now
      let n be Nat such that
A20:  for a,b being Element of Fin CR
      st card a = n & [a,b] in X & [b,a] in X holds a = b;
      let a,b be Element of Fin CR such that
A21:  card a = n+1 and
A22:  [a,b] in X and
A23:  [b,a] in X;
      per cases by A22,Th32;
      suppose a = {};
        hence a = b by A21;
      end;
      suppose
A24:    a <> {} & b <>{} & PosetMax a <> PosetMax b &
        [PosetMax a, PosetMax b] in IR;
        now per cases by A23,Th32;
          suppose b = {};
            hence a = b by A24;
          end;
          suppose b<>{} & a<>{} & PosetMax b <> PosetMax a &
            [PosetMax b, PosetMax a] in IR;
            hence a = b by A24,ORDERS_1:4;
          end;
          suppose b <>{} & a <>{} & PosetMax b = PosetMax a &
            [b\{PosetMax b}, a\{PosetMax a}] in X;
            hence a = b by A24;
          end;
        end;
        hence a = b;
      end;
      suppose
A25:    a <> {} & b <>{} & PosetMax a = PosetMax b &
        [a\{PosetMax a}, b\{PosetMax b}] in X;
        now per cases by A23,Th32;
          suppose b = {};
            hence a = b by A25;
          end;
          suppose b<>{} & a<>{} & PosetMax b <> PosetMax a &
            [PosetMax b, PosetMax a] in IR;
            hence a = b by A25;
          end;
          suppose
A26:        b <>{} & a <>{} & PosetMax b = PosetMax a &
            [b\{PosetMax b}, a\{PosetMax a}] in X;
            reconsider a9= a as finite set;
            reconsider b9 = b as finite set;
            set za = a9\{PosetMax a}, zb = b9\{PosetMax b};
            reconsider za,zb as Element of Fin CR by Th34;
            card (za)=n by A21,Lm1;
            then
A27:        za = zb by A20,A25,A26;
            now
              let z be object;
              assume z in {PosetMax a};
              then z = PosetMax a by TARSKI:def 1;
              hence z in a by A26,Def13;
            end;
            then {PosetMax a} c= a;
            then
A28:        a = {PosetMax a} \/ za by XBOOLE_1:45;
            now
              let z be object;
              assume z in {PosetMax b};
              then z = PosetMax b by TARSKI:def 1;
              hence z in b by A26,Def13;
            end;
            then {PosetMax b} c= b;
            hence a = b by A26,A27,A28,XBOOLE_1:45;
          end;
        end;
        hence a = b;
      end;
    end;
    then
A29: for n being Nat st R[n] holds R[n+1];
A30: for n being Nat holds R[n] from NAT_1:sch 2(A19,A29);
    reconsider xx=x as set by TARSKI:1;
    card x9 = card xx;
   hence x = y by A14,A15,A16,A30;
  end;
A31: now
    let x,y,z be object such that
A32: x in Fin CR and
A33: y in Fin CR and
A34: z in Fin CR and
A35: [x,y] in X and
A36: [y,z] in X;
    defpred S[Nat] means (for a,b,c being Element of Fin CR
    st card a = $1 & [a,b] in X & [b,c] in X holds [a,c] in X);
    now
      let a,b,c be Element of Fin CR such that
A37:  card a = 0 and [a,b] in X
      and [b,c] in X;
      reconsider a9=a as finite set;
      a9 = {} by A37;
      hence [a,c] in X by Th32;
    end;
    then
A38: S[ 0 ];
    now
      let n be Nat such that
A39:  for a,b,c being Element of Fin CR
      st card a = n & [a,b] in X & [b,c] in X holds [a,c] in X;
      let a,b,c be Element of Fin CR such that
A40:  card a = n+1 and
A41:  [a,b] in X and
A42:  [b,c] in X;
      per cases by A41,Th32;
      suppose a = {};
        hence [a,c] in X by Th32;
      end;
      suppose
A43:    a <> {} & b <> {} & PosetMax a <> PosetMax b &
        [PosetMax a, PosetMax b] in IR;
        now per cases by A42,Th32;
          suppose b = {};
            hence [a,c] in X by A43;
          end;
          suppose
A44:        b<>{} & c <> {} & PosetMax b <> PosetMax c &
            [PosetMax b, PosetMax c] in IR;
            then
A45:        [PosetMax a, PosetMax c] in IR by A43,ORDERS_1:5;
            now per cases;
              suppose PosetMax a <> PosetMax c;
                hence [a,c] in X by A43,A44,A45,Th32;
              end;
              suppose PosetMax a = PosetMax c;
                hence [a,c] in X by A43,A44,ORDERS_1:4;
              end;
            end;
            hence [a,c] in X;
          end;
          suppose b<>{} & c <> {} & PosetMax b = PosetMax c &
            [b\{PosetMax b}, c\{PosetMax c}] in union rng FOAR;
            hence [a,c] in X by A43,Th32;
          end;
        end;
        hence [a,c] in X;
      end;
      suppose
A46:    a <> {} & b <> {} & PosetMax a = PosetMax b &
        [a\{PosetMax a}, b\{PosetMax b}] in union rng FOAR;
        now per cases by A42,Th32;
          suppose b = {};
            hence [a,c] in X by A46;
          end;
          suppose b<>{} & c <>{} & PosetMax b <> PosetMax c &
            [PosetMax b, PosetMax c] in IR;
            hence [a,c] in X by A46,Th32;
          end;
          suppose
A47:        b<>{} & c <>{} & PosetMax b = PosetMax c &
            [b\{PosetMax b}, c\{PosetMax c}] in union rng FOAR;
            set z = a\{PosetMax a};
            reconsider z as Element of Fin CR by Th34;
A48:        card z = n by A40,Lm1;
A49:        c c= CR by FINSUB_1:def 5;
            reconsider c9=c as finite set;
            set zc = c9\{PosetMax c};
            zc c= CR by A49;
            then reconsider zc as Element of Fin CR by FINSUB_1:def 5;
A50:        b c= CR by FINSUB_1:def 5;
            reconsider b9=b as finite set;
            set zb = b9\{PosetMax b};
            zb c= CR by A50;
            then reconsider zb as Element of Fin CR by FINSUB_1:def 5;
            [z,zb] in union rng FOAR by A46;
            then [z,zc] in union rng FOAR by A39,A47,A48;
            hence [a,c] in X by A46,A47,Th32;
          end;
        end;
        hence [a,c] in X;
      end;
    end;
    then
A51: for n being Nat st S[n] holds S[n+1];
A52: for n being Nat holds S[n] from NAT_1:sch 2(A38, A51);
    reconsider x9=x as Element of Fin CR by A32;
    reconsider xx=x as set by TARSKI:1;
    card x9 = card xx;
   hence [x,z] in X by A33,A34,A35,A36,A52;
  end;
A53: X is_reflexive_in Fin CR by A3;
A54: X is_antisymmetric_in Fin CR by A12;
A55: X is_transitive_in Fin CR by A31;
  reconsider R = union rng FOAR as Relation of Fin CR by A3;
A56: dom R = Fin CR by A53,ORDERS_1:13;
  field R = Fin CR by A53,ORDERS_1:13;
  hence thesis by A53,A54,A55,A56,PARTFUN1:def 2,RELAT_2:def 9,def 12,def 16;
end;
