(************************************************************************)
(*         *      The Rocq Prover / The Rocq Development Team           *)
(*  v      *         Copyright INRIA, CNRS and contributors             *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
(*                                                                      *)
(* Micromega: A reflexive tactic using the Positivstellensatz           *)
(*                                                                      *)
(*  Frédéric Besson (Irisa/Inria) 2006-2011                             *)
(*                                                                      *)
(************************************************************************)
Require PreOmega.
Local Open Scope Z_scope.
Ltac flatten_bool :=
repeat match goal with
[ id : (_ && _)%bool = true |- _ ] =>  destruct (andb_prop _ _ id); clear id
|  [ id : (_ || _)%bool = true |- _ ] =>  destruct (orb_prop _ _ id); clear id
end.
Ltac inv H := inversion H ; try subst ; clear H.

(* Specifications: *)
Lemma eq_le_iff : forall x, 0 = x  <-> (0 <= x /\ x <= 0).
Lemma lt_le_iff : forall x,
0 < x <-> 0 <= x - 1.
Lemma le_0_iff : forall x y,
x <= y <-> 0 <= y - x.
Lemma le_neg : forall x,
((0 <= x) -> False) <-> 0 < -x.
Lemma eq_cnf : forall x,
(0 <= x - 1 -> False) /\ (0 <= -1 - x -> False) <-> x = 0.
Lemma Zsor : SOR 0 1 Z.add Z.mul Z.sub Z.opp (@eq Z) Z.le Z.lt.
Lemma ZSORaddon :
SORaddon 0 1 Z.add Z.mul Z.sub Z.opp  (@eq Z) Z.le (* ring elements *)
0%Z 1%Z Z.add Z.mul Z.sub Z.opp (* coefficients *)
Zeq_bool Z.leb
(fun x => x) (fun x => x) (pow_N 1 Z.mul).