(***************************************************************************)
(* Formalization of the Chou, Gao and Zhang's decision procedure.          *)
(* Julien Narboux (Julien@narboux.fr)                                      *)
(* LIX/INRIA FUTURS 2004-2006                                              *)
(* University of Strasbourg 2008                                           *)
(***************************************************************************)
Require Export field_general_properties.
(** 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.
Hint Rewrite
simp_1 simp_2 simp_3 simp_4 simp_5
simp_6 simp_7 simp_8 simp_9 simp_10
simp_11 simp_12 simp_13 simp_14 simp_15
: ring_simplification.
Hint Rewrite
same_denom_add_1
same_denom_add_2
same_denom_add_3
same_denom_min_1
same_denom_min_2
same_denom_min_3
same_denom_mul_1
same_denom_mul_2
same_denom_mul_3
same_denom_div_1
same_denom_div_2
same_denom_div_3
: same_denom.

Lemma simp_frac_14: forall a b : F,
b<>0 ->
(-a) / b = -(a/b).