(** We define our own field tactic based on the new ring *)
(** This tactic is geared toward automation because it does not generate non nullity conditions 
but it assumes that we know that the denominators of the input are not zero (syntactically !) *)
(** This tactic is also used to reduce a term to a unique fraction *)
(** This tactic is not reflexive, it is basically a reduction to the same denominators
but even using the legacy ring it is quicker than the legacy field tactic 
on our examples *)

Ltac assumption_or_ax := assumption || apply chara_not_2.Ltac solve_conds :=  
repeat split;
repeat (assumption_or_ax || 
           apply nonzeromult || 
           apply nonzerodiv ||
           apply nonzeroinv).Ltac smart_field := field; solve_conds.Ltac smart_field_simplify_eq := field_simplify_eq;solve_conds.

(* Specifications: *)
Lemma same_denom_add_1 : forall a b c d : F, b<>0 -> d<>0 -> a/b + c/d = (a*d+c*b) / (b*d).
Lemma same_denom_add_2 : forall a b c : F, b<>0 -> a/b + c = (a+c*b) / b.
Lemma same_denom_add_3 : forall a c d : F, d<>0 -> a + c/d = (a*d+c) / d.
Lemma same_denom_min_1 : forall a b c d : F, b<>0 -> d<>0 -> a/b - c/d = (a*d-c*b) / (b*d).
Lemma same_denom_min_2 : forall a b c : F, b<>0 -> a/b - c = (a-c*b) / b.
Lemma same_denom_min_3 : forall a c d : F, d<>0 -> a - (c/d) = (a*d-c) / d.
Lemma same_denom_mul_1 : forall a b c d : F, b<>0 -> d<>0 -> a/b * c/d = (a*c) / (b*d).
Lemma same_denom_mul_2 : forall a b c : F, b<>0 -> a/b * c = (a*c) / b.
Lemma same_denom_mul_3 : forall a c d : F, d<>0 -> a * (c/d) = (a*c) / d.
Lemma same_denom_div_1 : forall a b c d : F, b<>0 -> c/d<>0 -> d<>0 -> (a/b) / (c/d) = (a*d) / (b*c).
Lemma invariant_div_1 : forall b c d, b<>0 -> c/d<>0 -> d<>0 -> b*c <> 0.
Lemma same_denom_div_3 : forall a c d : F, c/d<>0 -> d<>0 -> a / (c/d) = (a*d) / c.
Lemma invariant_div_3 : forall c d, c/d<>0 -> d<>0 -> c <> 0.
Lemma same_denom_div_2 : forall a b c : F, b<>0 -> c<>0 -> (a/b) / c = a / (b*c).
Lemma remove_inv : forall a : F, Finv a = 1/a.
Lemma remove_opp : forall a : F, -a = 0-a.
Lemma simp_1 : forall a : F, a*0 = 0.
Lemma simp_2 : forall a : F, 0*a = 0.
Lemma simp_3 : forall a : F, 1*a = a.
Lemma simp_4 : forall a : F, a*1 = a.
Lemma simp_5 : forall a : F, 0+a = a.
Lemma simp_6: forall a : F, a+0 = a.
Lemma simp_7: forall a : F, a-0 = a.
Lemma simp_8: forall a : F, a-a = 0.
Lemma simp_9: forall a : F, -a+a = 0.
Lemma simp_10: forall a b : F, a+ -(b)= a-b.
Lemma simp_11 : -0=0.
Lemma simp_12 : forall a, - - a=a.
Lemma simp_13 : forall a b, - a * -b=a*b.
Lemma simp_14 : forall a b, (- a) * b=-(a*b).
Lemma simp_15 : forall a b, a * (- b)=-(a*b).
Lemma simp_frac_1: forall a : F, a<>0 -> a/a = 1.
Lemma simp_frac_2: forall a : F, a<>0 -> a * Finv a = 1.
Lemma simp_frac_3: forall a : F, a<>0 -> a * - Finv a = - (1).
Lemma simp_frac_4: forall a : F, a<>0 -> (-a) * - Finv a = 1.
Lemma simp_frac_5: forall a : F, a<>0 -> (-a) / a = - (1).
Lemma simp_frac_6: forall a : F, -a<>0 -> a / -a = - (1).
Lemma simp_frac_7: forall a : F, -a<>0 -> (-a) / -a = 1.
Lemma simp_frac_8: forall a b c : F, a*c<>0 -> (a*b) / (a*c) = b/c.
Lemma simp_frac_9: forall a b c : F, c*a<>0 -> (b*a) / (c*a) = b/c.
Lemma simp_frac_10 : forall a, a<>0 -> 0/a=0.
Lemma simp_frac_11 : forall a, a<>0 -> a*(1/a)=1.
Lemma simp_frac_12: forall a b : F, b<>0 -> (a*b) / b = a.
Lemma simp_frac_13: forall a b : F, a<>0 -> (a*b) / a = b.
Lemma simp_frac_14: forall a b : F, b<>0 -> (-a) / b = -(a/b).
Lemma simp_frac_15: forall a : F, a / 1 = a.
Lemma simp_frac_16: forall a b : F, -b<>0 -> a/(-b) = - (a/b).
Lemma simp_frac_16_inv : forall a, -a<>0 -> a<>0.