
theorem :: lemma 5.17 (iv), p. 195
  for n being Ordinal, T being admissible connected TermOrder of n, L
being right_zeroed non empty addLoopStr, p,q being Polynomial of n,L holds HT
  (p+q,T) <= max(HT(p,T),HT(q,T),T), T
proof
  let n be Ordinal, O being admissible connected TermOrder of n, L be
  right_zeroed non empty addLoopStr, p,q be Polynomial of n,L;
  per cases;
  suppose
A1: HT(p+q,O) in Support(p+q);
A2: Support(p+q) c= Support p \/ Support q by POLYNOM1:20;
    now
      per cases by A1,A2,XBOOLE_0:def 3;
      case
A3:     HT(p+q,O) in Support(p);
        then
A4:     HT(p+q,O) <= HT(p,O),O by Def6;
        now
          per cases by Th12;
          case
            max(HT(p,O),HT(q,O),O) = HT(p,O);
            hence thesis by A3,Def6;
          end;
          case
A5:         max(HT(p,O),HT(q,O),O) = HT(q,O);
            then HT(p,O) <= HT(q,O),O by Th14;
            hence thesis by A4,A5,Th8;
          end;
        end;
        hence thesis;
      end;
      case
A6:     HT(p+q,O) in Support(q);
        then
A7:     HT(p+q,O) <= HT(q,O),O by Def6;
        now
          per cases by Th12;
          case
            max(HT(p,O),HT(q,O),O) = HT(q,O);
            hence thesis by A6,Def6;
          end;
          case
A8:         max(HT(p,O),HT(q,O),O) = HT(p,O);
            then HT(q,O) <= HT(p,O),O by Th14;
            hence thesis by A7,A8,Th8;
          end;
        end;
        hence thesis;
      end;
    end;
    hence thesis;
  end;
  suppose
    not HT(p+q,O) in Support(p+q);
    then HT(p+q,O) = EmptyBag n by Def6;
    then [HT(p+q,O),max(HT(p,O),HT(q,O),O)] in O by BAGORDER:def 5;
    hence thesis;
  end;
end;
