
theorem Th34: :: exercise 5.16, p. 194
  for n being Ordinal, T being connected TermOrder of n, L being
  add-associative right_complementable right_zeroed non trivial addLoopStr, p
  being Polynomial of n,L holds HM(p,T) <= p,T
proof
  let n be Ordinal, T be connected TermOrder of n, L be add-associative
right_complementable right_zeroed non trivial addLoopStr, p9 be Polynomial of
  n,L;
  per cases;
  suppose
A1: p9 = 0_(n,L);
    now
      assume Support(HM(p9,T)) <> {};
      then consider u being bag of n such that
A2:   Support(HM(p9,T)) = {u} by POLYNOM7:6;
A3:   u in Support(HM(p9,T)) by A2,TARSKI:def 1;
      now
        let v be bag of n;
        assume v in Support(HM(p9,T));
        then u = v by A2,TARSKI:def 1;
        hence v <= u,T by TERMORD:6;
      end;
      then
A4:   HT(HM(p9,T),T) = u by A3,TERMORD:def 6;
      0.L = p9.(HT(p9,T)) by A1,POLYNOM1:22
        .= HC(p9,T) by TERMORD:def 7
        .= HC(HM(p9,T),T) by TERMORD:27
        .= HM(p9,T).u by A4,TERMORD:def 7;
      hence contradiction by A3,POLYNOM1:def 4;
    end;
    then HM(p9,T) = 0_(n,L) by POLYNOM7:1;
    hence thesis by A1,Th25;
  end;
  suppose
    p9 <> 0_(n,L);
    then reconsider p = p9 as non-zero Polynomial of n,L by POLYNOM7:def 1;
    set hmp = HM(p,T), R = RelStr(#Bags n,T#);
    set x = Support(hmp,T), y = Support(p,T);
A5: x\{PosetMax x} is Element of Fin the carrier of R & y\{PosetMax y} is
    Element of Fin the carrier of R by BAGORDER:37;
A6: PosetMax(x) = HT(hmp,T) by Th24
      .= HT(p,T) by TERMORD:26;
 p <> 0_(n,L) by POLYNOM7:def 1;
    then
A7: Support p <> {} by POLYNOM7:1;
    hmp.(HT(p,T)) = p.(HT(p,T)) by TERMORD:18
      .= HC(p,T) by TERMORD:def 7;
    then
A8: hmp.(HT(p,T)) <> 0.L;
    then
A9: x <> {} by POLYNOM1:def 4;
    HT(p,T) in Support(hmp) by A8,POLYNOM1:def 4;
    then Support hmp = {HT(p,T)} by TERMORD:21;
    then x\{PosetMax x} = {} by A6,XBOOLE_1:37;
    then
A10: [x\{PosetMax x},y\{PosetMax y}] in union rng FinOrd-Approx R by A5,
BAGORDER:35;
    PosetMax(x) = PosetMax(y) by A6,Th24;
    then [x,y] in union rng FinOrd-Approx R by A7,A9,A10,BAGORDER:35;
    then [x,y] in FinOrd R by BAGORDER:def 15;
    hence thesis;
  end;
end;
