
theorem Th31:

:: according to p. 193
  for n being Nat, T being admissible connected TermOrder of n, L
  being add-associative right_complementable right_zeroed well-unital
  distributive non trivial doubleLoopStr, P being non empty Subset of
  Polynom-Ring(n,L) holds ex p being Polynomial of n,L st p in P & for q being
  Polynomial of n,L st q in P holds p <= q,T
proof
  let n be Nat, T be admissible connected TermOrder of n, L be add-associative
  right_complementable right_zeroed well-unital distributive non trivial
  doubleLoopStr, P be non empty Subset of Polynom-Ring(n,L);
  set P9 = { Support(p,T) where p is Polynomial of n,L : p in P};
  set p = the Element of P;
  reconsider p as Polynomial of n,L by POLYNOM1:def 11;
  Support(p,T) in P9;
  then reconsider P9 as non empty set;
  set R = RelStr(#Bags n, T#), FR = FinPoset R;
  set m = MinElement(P9,FR);
A1: FR = RelStr (# Fin the carrier of R, FinOrd R #) by BAGORDER:def 16;
  now
    let u be object;
    assume u in P9;
    then ex p being Polynomial of n,L st u = Support(p,T) & p in P;
    hence u in the carrier of FR by A1;
  end;
  then
A2: P9 c= the carrier of FR by TARSKI:def 3;
A3: FR is well_founded by BAGORDER:41;
  then m in P9 by A2,BAGORDER:def 17;
  then consider p being Polynomial of n,L such that
A4: Support(p,T) = m and
A5: p in P;
  take p;
A6: m is_minimal_wrt P9,the InternalRel of FR by A2,A3,BAGORDER:def 17;
  now
    let q be Polynomial of n,L;
    set sq = Support(q,T);
    assume q in P;
    then
A7: sq in P9;
    now
      per cases;
      case
        Support p = Support q;
        hence p <= q,T by Th26;
      end;
      case
        Support p <> Support q;
        then not([Support(q,T),m]) in the InternalRel of FR by A6,A4,A7,
WAYBEL_4:def 25;
        then not q <= p,T by A1,A4;
        hence p <= q,T by Th28;
      end;
    end;
    hence p <= q,T;
  end;
  hence thesis by A5;
end;
