
theorem Th19:
  for R being non empty RelStr holds R\~ is well_founded iff
  for N being Subset of R st N <> {}
   ex x being object st x in min-classes N
proof
  let R be non empty RelStr;
  set CR = the carrier of R;
  set IR9= the InternalRel of R\~, CR9 = the carrier of R\~;
  hereby
    assume R\~ is well_founded;
    then
A1: IR9 is_well_founded_in CR9 by WELLFND1:def 2;
    let N be Subset of CR such that
A2: N <> {};
    reconsider N9=N as Subset of CR9;
    consider y being object such that
A3: y in N9 and
A4: IR9-Seg(y) misses N9 by A1,A2,WELLORD1:def 3;
A5: IR9-Seg(y) /\ N9 = {} by A4,XBOOLE_0:def 7;
    reconsider y as Element of R\~ by A3;
    set x = Class(EqRel R, y) /\ N;
    now
      assume ex z being set st z in N & z <> y & [z,y] in IR9;
      then consider z being set such that
A6:   z in N and
A7:   z <> y and
A8:   [z,y] in IR9;
      z in IR9-Seg(y) by A7,A8,WELLORD1:1;
      hence contradiction by A5,A6,XBOOLE_0:def 4;
    end;
    then y is_minimal_wrt N, IR9 by A3,WAYBEL_4:def 25;
    then x in min-classes N by Def8;
    hence ex x being object st x in min-classes N;
  end;
  assume
A9: for N being Subset of R st N <> {}
ex x being object st x in min-classes N;
  now
    let N be set such that
A10: N c= CR9 and
A11: N <> {};
    reconsider N9=N as Subset of R by A10;
    consider x being object such that
A12: x in min-classes N9 by A9,A11;
    consider a being Element of R\~ such that
A13: a is_minimal_wrt N9, IR9 and x = Class(EqRel R, a) /\ N9 by A12,Def8;
    reconsider a9=a as object;
    take a9;
    thus a9 in N by A13,WAYBEL_4:def 25;
    now
      assume IR9-Seg(a9) /\ N <> {};
      then consider z being object such that
A14:  z in IR9-Seg(a9) /\ N by XBOOLE_0:def 1;
A15:  z in IR9-Seg(a9) by A14,XBOOLE_0:def 4;
A16:  z in N by A14,XBOOLE_0:def 4;
      then reconsider z as Element of R\~ by A10;
A17:  z <> a9 by A15,WELLORD1:1;
      [z,a] in IR9 by A15,WELLORD1:1;
      hence contradiction by A13,A16,A17,WAYBEL_4:def 25;
    end;
    hence IR9-Seg(a9) misses N by XBOOLE_0:def 7;
  end;
  then IR9 is_well_founded_in CR9 by WELLORD1:def 3;
  hence thesis by WELLFND1:def 2;
end;
