Inductive minusP :
list (Term A n) -> list (Term A n) -> list (Term A n) -> Prop :=
  | mnillu1 :
      forall l1 : list (Term A n),
      minusP (pO A n) l1
        (mults (A:=A) multA (n:=n) (invTerm (A:=A) invA (n:=n) (T1 A1 n)) l1)
  | mnillu2 : forall l1 : list (Term A n), minusP l1 (pO A n) l1
  | mmainu1 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a2 a1 ->
      minusP l1 (pX a2 l2) l3 -> minusP (pX a1 l1) (pX a2 l2) (pX a1 l3)
  | mmainu2a :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2) l3
  | mmainu2b :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      ~ zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2)
        (pX (minusTerm (A:=A) minusA (n:=n) a1 a2) l3)
  | mmainu3 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a1 a2 ->
      minusP (pX a1 l1) l2 l3 ->
      minusP (pX a1 l1) (pX a2 l2) (pX (invTerm (A:=A) invA (n:=n) a2) l3).Inductive minusP :
list (Term A n) -> list (Term A n) -> list (Term A n) -> Prop :=
  | mnillu1 :
      forall l1 : list (Term A n),
      minusP (pO A n) l1
        (mults (A:=A) multA (n:=n) (invTerm (A:=A) invA (n:=n) (T1 A1 n)) l1)
  | mnillu2 : forall l1 : list (Term A n), minusP l1 (pO A n) l1
  | mmainu1 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a2 a1 ->
      minusP l1 (pX a2 l2) l3 -> minusP (pX a1 l1) (pX a2 l2) (pX a1 l3)
  | mmainu2a :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2) l3
  | mmainu2b :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      ~ zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2)
        (pX (minusTerm (A:=A) minusA (n:=n) a1 a2) l3)
  | mmainu3 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a1 a2 ->
      minusP (pX a1 l1) l2 l3 ->
      minusP (pX a1 l1) (pX a2 l2) (pX (invTerm (A:=A) invA (n:=n) a2) l3).Inductive minusP :
list (Term A n) -> list (Term A n) -> list (Term A n) -> Prop :=
  | mnillu1 :
      forall l1 : list (Term A n),
      minusP (pO A n) l1
        (mults (A:=A) multA (n:=n) (invTerm (A:=A) invA (n:=n) (T1 A1 n)) l1)
  | mnillu2 : forall l1 : list (Term A n), minusP l1 (pO A n) l1
  | mmainu1 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a2 a1 ->
      minusP l1 (pX a2 l2) l3 -> minusP (pX a1 l1) (pX a2 l2) (pX a1 l3)
  | mmainu2a :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2) l3
  | mmainu2b :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      ~ zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2)
        (pX (minusTerm (A:=A) minusA (n:=n) a1 a2) l3)
  | mmainu3 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a1 a2 ->
      minusP (pX a1 l1) l2 l3 ->
      minusP (pX a1 l1) (pX a2 l2) (pX (invTerm (A:=A) invA (n:=n) a2) l3).Inductive minusP :
list (Term A n) -> list (Term A n) -> list (Term A n) -> Prop :=
  | mnillu1 :
      forall l1 : list (Term A n),
      minusP (pO A n) l1
        (mults (A:=A) multA (n:=n) (invTerm (A:=A) invA (n:=n) (T1 A1 n)) l1)
  | mnillu2 : forall l1 : list (Term A n), minusP l1 (pO A n) l1
  | mmainu1 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a2 a1 ->
      minusP l1 (pX a2 l2) l3 -> minusP (pX a1 l1) (pX a2 l2) (pX a1 l3)
  | mmainu2a :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2) l3
  | mmainu2b :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      ~ zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2)
        (pX (minusTerm (A:=A) minusA (n:=n) a1 a2) l3)
  | mmainu3 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a1 a2 ->
      minusP (pX a1 l1) l2 l3 ->
      minusP (pX a1 l1) (pX a2 l2) (pX (invTerm (A:=A) invA (n:=n) a2) l3).Inductive minusP :
list (Term A n) -> list (Term A n) -> list (Term A n) -> Prop :=
  | mnillu1 :
      forall l1 : list (Term A n),
      minusP (pO A n) l1
        (mults (A:=A) multA (n:=n) (invTerm (A:=A) invA (n:=n) (T1 A1 n)) l1)
  | mnillu2 : forall l1 : list (Term A n), minusP l1 (pO A n) l1
  | mmainu1 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a2 a1 ->
      minusP l1 (pX a2 l2) l3 -> minusP (pX a1 l1) (pX a2 l2) (pX a1 l3)
  | mmainu2a :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2) l3
  | mmainu2b :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      ~ zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2)
        (pX (minusTerm (A:=A) minusA (n:=n) a1 a2) l3)
  | mmainu3 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a1 a2 ->
      minusP (pX a1 l1) l2 l3 ->
      minusP (pX a1 l1) (pX a2 l2) (pX (invTerm (A:=A) invA (n:=n) a2) l3).Inductive minusP :
list (Term A n) -> list (Term A n) -> list (Term A n) -> Prop :=
  | mnillu1 :
      forall l1 : list (Term A n),
      minusP (pO A n) l1
        (mults (A:=A) multA (n:=n) (invTerm (A:=A) invA (n:=n) (T1 A1 n)) l1)
  | mnillu2 : forall l1 : list (Term A n), minusP l1 (pO A n) l1
  | mmainu1 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a2 a1 ->
      minusP l1 (pX a2 l2) l3 -> minusP (pX a1 l1) (pX a2 l2) (pX a1 l3)
  | mmainu2a :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2) l3
  | mmainu2b :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      ~ zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2)
        (pX (minusTerm (A:=A) minusA (n:=n) a1 a2) l3)
  | mmainu3 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a1 a2 ->
      minusP (pX a1 l1) l2 l3 ->
      minusP (pX a1 l1) (pX a2 l2) (pX (invTerm (A:=A) invA (n:=n) a2) l3).Inductive minusP :
list (Term A n) -> list (Term A n) -> list (Term A n) -> Prop :=
  | mnillu1 :
      forall l1 : list (Term A n),
      minusP (pO A n) l1
        (mults (A:=A) multA (n:=n) (invTerm (A:=A) invA (n:=n) (T1 A1 n)) l1)
  | mnillu2 : forall l1 : list (Term A n), minusP l1 (pO A n) l1
  | mmainu1 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a2 a1 ->
      minusP l1 (pX a2 l2) l3 -> minusP (pX a1 l1) (pX a2 l2) (pX a1 l3)
  | mmainu2a :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2) l3
  | mmainu2b :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      minusP l1 l2 l3 ->
      eqT a1 a2 ->
      ~ zeroP (A:=A) A0 eqA (n:=n) (minusTerm (A:=A) minusA (n:=n) a1 a2) ->
      minusP (pX a1 l1) (pX a2 l2)
        (pX (minusTerm (A:=A) minusA (n:=n) a1 a2) l3)
  | mmainu3 :
      forall (a1 a2 : Term A n) (l1 l2 l3 : list (Term A n)),
      ltT ltM a1 a2 ->
      minusP (pX a1 l1) l2 l3 ->
      minusP (pX a1 l1) (pX a2 l2) (pX (invTerm (A:=A) invA (n:=n) a2) l3).Definition minuspp :
  forall l : list (Term A n) * list (Term A n),
  {a : list (Term A n) | minusP (fst l) (snd l) a}.Definition minuspf (l1 l2 : list (Term A n)) :=
  projsig1 (list (Term A n)) _ (minuspp (l1, l2)).

Theorem Opm_ind : forall (P : list (Term A n) -> list (Term A n) -> Prop) (p q : list (Term A n)), (forall p : list (Term A n), P (pO A n) p) -> (forall p : list (Term A n), P p (pO A n)) -> (forall (a b : Term A n) (p q : list (Term A n)), P (pX a p) q -> ltT ltM a b -> P (pX a p) (pX b q)) -> (forall (a b : Term A n) (p q : list (Term A n)), P p (pX b q) -> ltT ltM b a -> P (pX a p) (pX b q)) -> (forall (a b : Term A n) (p q : list (Term A n)), P p q -> eqT a b -> P (pX a p) (pX b q)) -> forall p q : list (Term A n), P p q.