(*************************************************)
(* Variable isolation tactic                     *)
(*************************************************)

(* 
This module defines a few tactics :

   IsoleVar x H isolates one occurence of x in H 
   Warning it does not factorize, but it is still usefull.

   NormalizeRing H normalize the hypothesis H using ring.
   RewriteVar x H, isolates x in H and then substitutes x 
   everywhere.     
*)


Ltac NormalizeRing H :=
  match goal with
  | i:(?X1 = ?X2) |- _ =>
      match constr:(i) with
      | H => generalize H; ring_simplify X1 X2; clear H; intro H
      | _ => fail
      end
  end.

(* Specifications: *)
Lemma Lc : forall a b : F, a = b -> a - b = 0.
Lemma Lcinv : forall a b : F, a - b = 0 -> a = b.
Lemma Lcp1 : forall a b c : F, a + b = c -> a = c - b.
Lemma Lcp2 : forall a b c : F, a + b = c -> b = c - a.
Lemma Lcm1 : forall a b c : F, a - b = c -> a = c + b.
Lemma Lcm2 : forall a b c : F, a - b = c -> b = a - c.
Lemma Lcop1 : forall a b : F, - a = b -> a = - b.
Lemma Lcmult1 : forall a b c : F, b <> 0 -> a * b = c -> a = c / b.
Lemma Lcmult2 : forall a b c : F, a <> 0 -> a * b = c -> b = c / a.
Lemma Lcdiv1 : forall a b c : F, b <> 0 -> a / b = c -> a = b * c.
Lemma Lcdiv2 : forall a b c : F, b <> 0 -> c <> 0 -> a / b = c -> b = a / c.