statement
stringlengths
1
4.33k
proof
stringlengths
0
37.9k
type
stringclasses
25 values
symbolic_name
stringlengths
1
67
library
stringclasses
10 values
filename
stringclasses
112 values
imports
listlengths
2
138
deps
listlengths
0
64
docstring
stringclasses
798 values
source_url
stringclasses
1 value
commit
stringclasses
1 value
is_tautoT l f g : match deduce f g with None => false | Some u => unsat u end -> ~~ NFeval l f || ~~ NFeval l g.
Proof. case: nformula_plus_nformula (@eval_nformula_plus_nformula l f g) => [f'|//]. move=> /(_ f') + if'. rewrite -negb_and; apply: contraPN => /andP[-> ->] /(_ erefl erefl erefl). by rewrite (check_inconsistentT _ _ if'). Qed.
Lemma
is_tautoT
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "NFeval", "apply", "check_inconsistentT", "deduce", "eval_nformula_plus_nformula", "nformula_plus_nformula", "unsat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nth_nth T n s (x0 : T) : ListDef.nth n s x0 = nth x0 s n.
Proof. by elim: s n => [| e s IH] /= [| n]. Qed.
Lemma
nth_nth
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "nth" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eval_eval_Psatz l lf (w : Psatz C) : all (NFeval l) lf -> forall f : NFormula C, eval_Psatz lf w = Some f -> NFeval l f.
Proof. elim: w lf. - move=> p1 IHp1 p2 IHp2 lf elf f /=. case: eval_Psatz (IHp1 lf elf) => [f' /(_ _ erefl) ef'|//]. by apply: IHp2; rewrite /= ef'. - move=> n lf /all_nthP elf f /=[<-]. case: (ltnP n (size lf)) => nslf; first by rewrite nth_nth elf. by rewrite nth_nth nth_default/= ?rmorph0. - by move=> e lf e...
Lemma
eval_eval_Psatz
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "NFeval", "Peval_square", "R_of_C_ge0", "all", "all_nthP", "apply", "c0", "eval_Psatz", "eval_nformula_plus_nformula", "eval_nformula_times_nformula", "eval_pexpr_times_nformula", "f1", "f2", "last", "ltNge", "ltP", "lt_neqAle", "ltnP", "nth_default", "nth_nth", "oppr_ge0", ...
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
check_normalised_formulasT l (lf : seq (NFormula C)) (w : Psatz C) : check_normalised_formulas lf w -> has (fun f => ~~ NFeval l f) lf.
Proof. rewrite has_predC; apply: contraL => /(@eval_eval_Psatz _ _ w). rewrite /check_normalised_formulas; case: eval_Psatz => [f /(_ _ erefl)|//]. by apply: contraL => /check_inconsistentT->. Qed.
Lemma
check_normalised_formulasT
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "NFeval", "apply", "check_inconsistentT", "check_normalised_formulas", "eval_Psatz", "eval_eval_Psatz", "has", "has_predC", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
tauto_checker
:= (tauto_checker (fun c : seq (NFormula C * unit) => check_normalised_formulas (map fst c))).
Notation
tauto_checker
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "check_normalised_formulas", "map", "seq", "unit" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
check_normalised_formulasT
:= (check_normalised_formulasT R_of_C_ge0).
Notation
check_normalised_formulasT
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "R_of_C_ge0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
tauto_checkerT l (f : cnf (NFormula C) unit) (w : seq (Psatz C)) : tauto_checker f w -> eval_cnf (fun f => ~~ NFeval R_of_C l f) f.
Proof. elim: f w => [//| f lf IH] [//| w lw] /=/andP[/(check_normalised_formulasT l)]. by rewrite has_map /eval_clause => -> /IH. Qed.
Lemma
tauto_checkerT
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "NFeval", "check_normalised_formulasT", "cnf", "eval_clause", "eval_cnf", "has_map", "seq", "tauto_checker", "unit" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
unit_Rxx u : unit_R u u.
Proof. by case: u; apply: tt_R. Qed.
Lemma
unit_Rxx
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "apply" ]
a bunch of helper lemmas
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
option_Rxx A (RA : A -> A -> Type) (_ : forall x, RA x x) s : option_R RA s s.
Proof. by case: s => [x |]; constructor. Qed.
Lemma
option_Rxx
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
list_Rxx A (RA : A -> A -> Type) (_ : forall x, RA x x) s : list_R RA s s.
Proof. by elim: s => [| x s IH]; constructor. Qed.
Lemma
list_Rxx
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eKind_Rxx k (rk : kind_R k k) (t : eKind k) : eKind_R rk t t.
Proof. case: k rk t => rk t. - by refine (match rk in kind_R k1 k2 return eKind_R rk (match k1 with isProp => t | isBool => true end) (match k2 with isProp => t | isBool => true end) with | isProp_R => fun _ _ => True | isBool_R => true_R end). - b...
Lemma
eKind_Rxx
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "True", "bool_Rxx" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
erefl1 {A B} {f : A -> B} : forall a1 a2 (ra : a1 = a2), f a1 = f a2.
Proof. by move=> ? ? ->. Qed.
Lemma
erefl1
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "a1", "a2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
erefl2 {A B C} {f : A -> B -> C} : forall a1 a2 (ra : a1 = a2) b1 b2 (rb : b1 = b2), f a1 b1 = f a2 b2.
Proof. by move=> ? ? -> ? ? ->. Qed.
Lemma
erefl2
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "a1", "a2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
erefl2b {A B} {f : A -> B -> bool} : forall a1 a2 (ra : a1 = a2) b1 b2 (rb : b1 = b2), bool_R (f a1 b1) (f a2 b2).
Proof. by move=> ? ? -> ? ? ->; apply: bool_Rxx. Qed.
Lemma
erefl2b
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "a1", "a2", "apply", "bool_Rxx" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
erefl2n {A B} {f : A -> N -> B} : forall a1 a2 (ra : a1 = a2) b1 b2 (rb : N_R b1 b2), f a1 b1 = f a2 b2.
Proof. by move=> _ ? -> _ ? /N_R_eq->. Qed.
Lemma
erefl2n
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "N_R_eq", "a1", "a2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Formula_R_map A B (RAB : A -> B -> Type) (f : A -> B) : (forall a, RAB a (f a)) -> forall g : Formula A, Formula_R RAB g (Fmap f g).
Proof. move=> rf [lhs o rhs]; apply: Build_Formula_R. - exact: PExpr_R_map. - by case: o; constructor. - exact: PExpr_R_map. Qed.
Lemma
Formula_R_map
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "Formula", "PExpr_R_map", "apply", "rhs" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
BFormula_R_map A B (RAB : A -> B -> Type) (f : A -> B) : (forall a, RAB a (f a)) -> forall k (rk : kind_R k k) (g : BFormula (Formula A) k), BFormula_R (Formula_R RAB) rk g (GFmap (Fmap f) g).
Proof. move=> rf k rk g; elim: g rk. - by move=> {}k rk; apply: TT_R. - by move=> {}k rk; apply: FF_R. - by move=> {}k t rk; apply/X_R/eKind_Rxx. - by move=> {}k g u rk; apply: A_R; [apply: Formula_R_map | apply: unit_Rxx]. - by move=> {}k f1 IH1 f2 IH2 rk; apply: AND_R; [apply: IH1 | apply: IH2]. - by move=> {}k f1 IH...
Lemma
BFormula_R_map
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "Formula", "Formula_R_map", "apply", "eKind_Rxx", "f1", "f2", "option_Rxx", "unit_Rxx" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pol_R_map A B (RAB : A -> B -> Type) (f : A -> B) : (forall a, RAB a (f a)) -> forall w : Pol A, Pol_R RAB w (Pmap f w).
Proof. by move=> rf; elim=> [c | j P IH | P IHP i Q IHQ]; constructor=> //; apply: positive_Rxx. Qed.
Lemma
Pol_R_map
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "apply", "positive_Rxx" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Psatz_R_map A B (RAB : A -> B -> Type) (f : A -> B) : (forall a, RAB a (f a)) -> forall w : Psatz A, Psatz_R RAB w (Psatz_map f w).
Proof. move=> rf; elim=> [p1 IH1 p2 IH2|n|p|re e IH|f1 IH1 f2 IH2|f1 IH1 f2 IH2|c|]. - by apply: PsatzLet_R; [apply: IH1 | apply: IH2]. - exact/PsatzIn_R/nat_Rxx. - exact/PsatzSquare_R/Pol_R_map. - by apply: PsatzMulC_R; [apply: Pol_R_map | apply: IH]. - by apply: PsatzMulE_R; [apply: IH1 | apply: IH2]. - by apply: Psa...
Lemma
Psatz_R_map
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "Pol_R_map", "apply", "f1", "f2", "nat_Rxx" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
R_of_AC_eq0 : {mono R_of_AC : x / x == 0}.
Hypothesis
R_of_AC_eq0
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
R_of_AC_ge0 : {mono R_of_AC : x / 0 <= x}.
Hypothesis
R_of_AC_ge0
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
CACD : forall c ac (_ : CAC c ac) c' ac' (_ : CAC c' ac'), CAC (cadd c c') (ac + ac').
Hypothesis
CACD
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
CACM : forall c ac (_ : CAC c ac) c' ac' (_ : CAC c' ac'), CAC (cmul c c') (ac * ac').
Hypothesis
CACM
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
CACB : forall c ac (_ : CAC c ac) c' ac' (_ : CAC c' ac'), CAC (csub c c') (ac - ac').
Hypothesis
CACB
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
CACN : forall c ac, CAC c ac -> CAC (copp c) (- ac).
Hypothesis
CACN
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
CACeq : forall c ac (_ : CAC c ac) c' ac' (_ : CAC c' ac'), ceqb c c' = (ac == ac').
Hypothesis
CACeq
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
CACle : forall c ac (_ : CAC c ac) c' ac' (_ : CAC c' ac'), cleb c c' = (ac <= ac').
Hypothesis
CACle
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
R_of_C_R_of_AC : forall c ac, CAC c ac -> R_of_C c = R_of_AC ac.
Hypothesis
R_of_C_R_of_AC
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
CAC_AC_of_C : forall c, CAC c (AC_of_C c).
Hypothesis
CAC_AC_of_C
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
CTautoChecker_map_AC_of_C f w : @CTautoChecker C cO cI cadd cmul csub copp ceqb cleb f w = @CTautoChecker AC 0 1 +%R *%R (fun x y : AC => x - y) -%R eq_op <=%R (GFmap (Fmap AC_of_C) f) [seq Psatz_map AC_of_C ps | ps <- w].
Proof. have rf : BFormula_R (Formula_R CAC) isProp_R f (GFmap (Fmap AC_of_C) f). exact: BFormula_R_map. have rw : list_R (Psatz_R CAC) w [seq Psatz_map AC_of_C ps | ps <- w]. by apply: list_R_map => w'; apply: Psatz_R_map. by apply: bool_R_eq; apply: CTautoChecker_R rw => //; apply: eq_bool_R2. Qed.
Lemma
CTautoChecker_map_AC_of_C
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "AC", "BFormula_R_map", "Psatz_R_map", "apply", "bool_R_eq", "eq_bool_R2", "list_R_map", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
RBFeval_map_AC_of_C_bool l (f : BFormula (Formula C) isBool) : RBFeval R_of_AC l (GFmap (Fmap AC_of_C) f) = RBFeval R_of_C l f.
Proof. have rl : list_R eq l l by apply: list_Rxx. have rf : BFormula_R (Formula_R CAC) isBool_R f (GFmap (Fmap AC_of_C) f). exact: BFormula_R_map. by rewrite /RBFeval (bool_R_eq (BFKFeval_R erefl erefl erefl2 erefl2 erefl1 erefl2n erefl2b erefl2b erefl2b erefl2b R_of_C_R_of_AC rl rf)). Qed.
Lemma
RBFeval_map_AC_of_C_bool
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "BFormula_R_map", "Formula", "RBFeval", "R_of_C_R_of_AC", "apply", "bool_R_eq", "erefl1", "erefl2", "erefl2b", "erefl2n", "list_Rxx" ]
Unfortunately, we can only use derive.param2 for bool, not Prop
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
RBFeval_map_AC_of_C l k (f : BFormula (Formula C) k) : hold true (eIFF eqb k (RBFeval R_of_AC l (GFmap (Fmap AC_of_C) f)) (RBFeval R_of_C l f)).
Proof. elim: f. - by case. - by case. - by case=> f => [//|/=]; rewrite -/(f == f) eqxx. - case=> f u; last by apply/eqP; rewrite -RBFeval_map_AC_of_C_bool. have rN n n' : N_R n n' -> n = n' by move=> /N_R_eq->. have renv_nth : forall i i' (ii' : positive_R i i') (s s' : seq R) (ss' : list_R eq s s'), env_nth...
Lemma
RBFeval_map_AC_of_C
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "Formula", "Formula_R_map", "N_R_eq", "RBFeval", "RBFeval_map_AC_of_C_bool", "RFevalP", "R_of_C_R_of_AC", "apply", "bool_R_eq", "env_nth", "eqb", "eqxx", "erefl1", "erefl2", "erefl2b", "hold", "last", "list_R_eq", "list_Rxx", "n'", "positive_R_eq", "seq", "split" ]
So we have to do the Prop case by hand (but we can still use Feval_R there and it isn't much work in the end).
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
CTautoCheckerT l f w : @CTautoChecker C cO cI cadd cmul csub copp ceqb cleb f w -> RBFeval R_of_C l f.
Proof. rewrite CTautoChecker_map_AC_of_C => checkfw. apply: (RBFeval_map_AC_of_C l f).1. rewrite -/(hold true (RBFeval R_of_AC l (GFmap (Fmap AC_of_C) f))). apply: eval_cnf_of_GFormula => //; first exact: is_tautoT. exact: tauto_checkerT checkfw. Qed.
Lemma
CTautoCheckerT
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "CTautoChecker_map_AC_of_C", "RBFeval", "RBFeval_map_AC_of_C", "apply", "eval_cnf_of_GFormula", "hold", "is_tautoT", "tauto_checkerT" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
R_of_Q (R : unitRingType) (q : Q) : R
:= let: Qmake n d := q in if d is xH then (int_of_Z n)%:~R else if n is Zpos xH then (Pos.to_nat d)%:R ^-1 else (int_of_Z n)%:~R / (Pos.to_nat d)%:R.
Definition
R_of_Q
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "int_of_Z" ]
Refinement from rat to Q, for actual computation in the reflexive tactic.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
R_of_Q_ratr (R : numFieldType) q r : Qrat q r -> R_of_Q R q = ratr r.
Proof. suff -> : R_of_Q R q = (int_of_Z (Qnum q))%:~R / (Pos.to_nat (Qden q))%:R. by move/eqP => <-; rewrite fmorph_div/= ratr_int ratr_nat. by case: q => n [d | d |]/=; [| |by rewrite Pos_to_nat1 divr1]; case: n => [//| [//|//|/=] |//]; rewrite Pos_to_nat1 div1r. Qed.
Lemma
R_of_Q_ratr
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "Pos_to_nat1", "Qrat", "R_of_Q", "div1r", "divr1", "fmorph_div", "int_of_Z", "ratr", "ratr_int", "ratr_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
QTautoCheckerT (R : realFieldType) (l : seq R) f w : QTautoChecker f w -> RBFeval (R_of_Q R) l f.
Proof. exact: (CTautoCheckerT (ler0q R) Qrat0 Qrat1 QratD QratM QratB QratN Qrat_eq Qrat_le (R_of_Q_ratr R) Qrat_rat_of_Q). Qed.
Lemma
QTautoCheckerT
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "CTautoCheckerT", "Qrat0", "Qrat1", "QratB", "QratD", "QratM", "QratN", "Qrat_eq", "Qrat_le", "Qrat_rat_of_Q", "RBFeval", "R_of_Q", "R_of_Q_ratr", "ler0q", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ZTautoChecker
:= @CTautoChecker Z Z0 (Zpos xH) Z.add Z.mul Z.sub Z.opp Z.eqb Z.leb.
Definition
ZTautoChecker
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "add", "eqb", "mul", "opp", "sub" ]
Refinement from int to Z, for actual computation in the reflexive tactic.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ZTautoCheckerT (R : realDomainType) (l : seq R) f w : ZTautoChecker f w -> RBFeval (R_of_Z R) l f.
Proof. exact: (CTautoCheckerT (ler0z R) (CAC:=Zint) Zint0 _ ZintD ZintM ZintB ZintN Zint_eq Zint_le (R_of_Z_intr R) Zint_int_of_Z). Qed.
Lemma
ZTautoCheckerT
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "CTautoCheckerT", "RBFeval", "R_of_Z", "R_of_Z_intr", "ZTautoChecker", "Zint", "Zint0", "ZintB", "ZintD", "ZintM", "ZintN", "Zint_eq", "Zint_int_of_Z", "Zint_le", "ler0z", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
RFormula R
:= { Rlhs : RExpr R; Rop : Op2; Rrhs : RExpr R }.
Record
RFormula
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "RExpr" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Rnorm_expr
:= (Rnorm R_of_N (R_of_N false N0) (R_of_N false (Npos xH)) add mul opp_intr exp inv true false).
Notation
Rnorm_expr
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "R_of_N", "Rnorm", "add", "exp", "inv", "mul" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Reval_op2 k : Op2 -> R -> R -> eKind k
:= if k is isBool then eval_op2 isBool beq bneq le lt else eval_op2 isProp eq (fun x y => ~ x = y) le lt.
Definition
Reval_op2
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "le", "lt" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Reval_formula k (ff : RFormula R) : eKind k
:= let: Build_RFormula lhs o rhs := ff in Reval_op2 k o (Reval lhs) (Reval rhs).
Definition
Reval_formula
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "RFormula", "Reval", "Reval_op2", "ff", "rhs" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Rnorm_formula k (ff : RFormula R)
:= let: Build_RFormula lhs o rhs := ff in Reval_op2 k o (Rnorm_expr id lhs) (Rnorm_expr id rhs).
Definition
Rnorm_formula
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "RFormula", "Reval_op2", "Rnorm_expr", "ff", "id", "rhs" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Rnorm_formula_correct k (ff : RFormula R) : Reval_formula k ff = Rnorm_formula k ff.
Proof. case: ff => lhs o rhs /=. have e : true = (if R is SemiRing _ then false else true) && true. by case: R R_not_semiring. rewrite !(@Rnorm_correct R true _ e) !R_of_NE addE opp_intrE mulE expE invE. by congr Reval_op2; apply: Rnorm_eq_F_of_N. Qed.
Lemma
Rnorm_formula_correct
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "RFormula", "Reval_formula", "Reval_op2", "Rnorm_correct", "Rnorm_eq_F_of_N", "Rnorm_formula", "SemiRing", "addE", "apply", "expE", "ff", "mulE", "rhs" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Rnorm_bf_correct k (ff : BFormula (RFormula R) k) : BFeval eqb Reval_formula ff = BFeval eqb Rnorm_formula ff.
Proof. elim: ff => // {k}. - by move=> k ff ?; exact: Rnorm_formula_correct. - by move=> k ff1 IH1 ff2 IH2; congr eAND. - by move=> k ff1 IH1 ff2 IH2; congr eOR. - by move=> k ff IH; congr eNOT. - by move=> k ff1 IH1 o ff2 IH2; congr eIMPL. - by move=> k ff1 IH1 ff2 IH2; congr eIFF. - by move=> ff1 IH1 ff2 IH2; congr e...
Lemma
Rnorm_bf_correct
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "RFormula", "Reval_formula", "Rnorm_formula", "Rnorm_formula_correct", "eqb", "ff" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
FTautoChecker_sound (F : realFieldType) (ff : BFormula (RFormula F) isProp) (f : BFormula (Formula Q) isProp) (env : seq F) (w : seq (Psatz Q)) : (forall F_of_Q add mul opp exp beq bneq le lt, let norm_ff := let F_of_N b n := if b then F_of_Q (Qinv (Qmake (Z.of_N n) 1)) ...
Proof. pose F_of_N b n : Field F := if b then R_of_Q F (Qinv (Qmake (Z.of_N n) 1)) else R_of_Q F (Qmake (Z.of_N n) 1). have F_of_NE : F_of_N =2 fun b n => @invi (Field F) b (N.to_nat n)%:R. by move=> [] [|[]]; rewrite //= /inv_id/= ?invr0 ?invr1. rewrite (Rnorm_bf_correct _ F_of_NE erefl erefl erefl erefl erefl)/...
Lemma
FTautoChecker_sound
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "F_of_N", "Formula", "KFeval", "QTautoCheckerT", "RFormula", "R_of_Q", "Reval_formula", "Rnorm_bf_correct", "Rnorm_formula", "add", "env", "eqb", "exp", "ff", "int", "intr", "inv", "inv_id", "invi", "invr0", "invr1", "le", "lt", "mul", "opp", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
RTautoChecker_sound (R : realDomainType) (ff : BFormula (RFormula R) isProp) (f : BFormula (Formula Z) isProp) (env : seq R) (w : seq (Psatz Z)) : (forall R_of_Z add mul opp exp beq bneq le lt, let norm_ff := let R_of_N _ n := R_of_Z (Z.of_N n) in let opp_intr := Some (opp, intr : i...
Proof. pose R_of_N (b : bool) n : Ring R := R_of_Z R (Z.of_N n). have R_of_NE : R_of_N =2 fun b n => @invi (Ring R) b (N.to_nat n)%:R. by case=> [] []. rewrite (Rnorm_bf_correct _ R_of_NE erefl erefl erefl erefl erefl)//. by move/(_ (R_of_Z R)) => -> /(ZTautoCheckerT env). Qed.
Lemma
RTautoChecker_sound
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "Formula", "KFeval", "RFormula", "R_of_N", "R_of_Z", "Reval_formula", "Ring", "Rnorm_bf_correct", "Rnorm_formula", "ZTautoChecker", "ZTautoCheckerT", "add", "env", "eqb", "exp", "ff", "int", "intr", "inv", "invi", "le", "lt", "mul", "opp", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
PExpr_Q2Z (e : PExpr Q) : option (PExpr Z)
:= match e with | PEO => Some PEO | PEI => Some PEI | PEc (Qmake z 1) => Some (PEc z) | PEc _ => None | PEX n => Some (PEX _ n) | PEadd e1 e2 => map_option2 PEadd (PExpr_Q2Z e1) (PExpr_Q2Z e2) | PEsub e1 e2 => map_option2 PEsub (PExpr_Q2Z e1) (PExpr_Q2Z e2) | PEmul e1 e2 => map_option2 PEmul (PExpr_Q2Z e1...
Fixpoint
PExpr_Q2Z
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
Translating formulas and witnesses from Q to Z for the realDomainType case
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Formula_Q2Z (ff : Formula Q) : option (Formula Z)
:= map_option2 (fun l r => Build_Formula l (Fop ff) r) (PExpr_Q2Z (Flhs ff)) (PExpr_Q2Z (Frhs ff)).
Definition
Formula_Q2Z
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "Formula", "PExpr_Q2Z", "ff" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
BFormula_Q2Z [k] (ff : BFormula (Formula Q) k) : option (BFormula (Formula Z) k)
:= match ff with | TT k => Some (TT k) | FF k => Some (FF k) | X k P => Some (X k P) | A k a aa => map_option (A k ^~ aa) (Formula_Q2Z a) | AND _ f1 f2 => map_option2 (fun f => AND f) (BFormula_Q2Z f1) (BFormula_Q2Z f2) | OR _ f1 f2 => map_option2 (fun f => OR f) (BFormula_Q2Z f1) (BFormula_Q2Z ...
Fixpoint
BFormula_Q2Z
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "Formula", "Formula_Q2Z", "f1", "f2", "ff" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pol_Q2Z (p : Pol Q) : Pol Z * positive
:= match p with | Pc (Qmake n d) => (Pc n, d) | Pinj j p => let (p, n) := Pol_Q2Z p in (Pinj j p, n) | PX p1 i p2 => let (p1, n1) := Pol_Q2Z p1 in let (p2, n2) := Pol_Q2Z p2 in let mulc c p := PmulC Z0 (Zpos 1) Z.mul Z.eqb p (Zpos c) in (PX (mulc n2 p1) i (mulc n1 p2), Pos.mul n1 n2) end...
Fixpoint
Pol_Q2Z
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "PmulC", "eqb", "mul" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Psatz_Q2Z (l : seq positive) (p : Psatz Q) : Psatz Z * positive
:= match p with | PsatzC (Qmake n d) => (PsatzC n, d) | PsatzLet p1 p2 => let (p1, n1) := Psatz_Q2Z l p1 in let (p2, n2) := Psatz_Q2Z (n1 :: l) p2 in (PsatzLet p1 p2, n2) | PsatzIn n => (PsatzIn _ n, nth 1%positive l n) | PsatzSquare p => let (p, n) := Pol_Q2Z p in (PsatzSquare p, Pos.mul n ...
Fixpoint
Psatz_Q2Z
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "Pol_Q2Z", "mul", "nth", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
seq_Psatz_Q2Z : seq (Psatz Q) -> seq (Psatz Z)
:= map (fun p => fst (Psatz_Q2Z [::] p)).
Definition
seq_Psatz_Q2Z
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "Psatz_Q2Z", "map", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mclra_witness n f
:= let w := fresh "__wit" in mp_wlra_Q w f.
Ltac
mclra_witness
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
Main tactics, called from the elpi parser (c.f., lra.elpi)
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mcnra_witness n f
:= let w := fresh "__wit" in mp_wnra_Q w f.
Ltac
mcnra_witness
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mcpsatz_witness n f
:= let w := fresh "__wit" in mp_wsos_Q w f || mp_wpsatz_Q n w f.
Ltac
mcpsatz_witness
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mctacF F hyps ff f varmap wit
:= let nff := fresh "__ff" in let nf := fresh "__f" in let nvarmap := fresh "__varmap" in pose (nff := ff); pose (nf := f); pose (nvarmap := varmap); refine (hyps (@FTautoChecker_sound F nff nf nvarmap wit (fun _ _ _ _ _ _ _ _ _ => erefl) _)); [ vm_compute; reflexivity ].
Ltac
mctacF
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "FTautoChecker_sound", "ff" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mctacR R hyps ff f varmap wit
:= let nff := fresh "__ff" in let nf := fresh "__f" in let nvarmap := fresh "__varmap" in lazymatch eval vm_compute in (BFormula_Q2Z f) with | Some ?f => pose (nff := ff); pose (nf := f); pose (nvarmap := varmap); refine (hyps (@RTautoChecker_sound R nff f nvarmap (seq_Psatz_Q2Z wit) ...
Ltac
mctacR
algebra
algebra/arithmetic_tactic.v
[ "elpi", "derive.std", "param2", "Corelib", "BinNums", "micromega_plugin", "PosDef", "NatDef", "IntDef", "RatDef", "formula", "witness", "tactics", "checker", "eval", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "order", "ssralg", "ssrnum", ...
[ "BFormula_Q2Z", "RTautoChecker_sound", "eval", "ff", "seq_Psatz_Q2Z" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat (p : positive) (n : nat)
:= Pos.to_nat p == n.
Definition
pos_nat
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat_Pos_to_nat p : pos_nat p (Pos.to_nat p).
Proof. exact/eqP. Qed.
Lemma
pos_nat_Pos_to_nat
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "pos_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat_spec (p : positive) (n : nat) : positive -> nat -> bool -> Set
:= | Pos_nat_spec_false : pos_nat_spec p n p n false | Pos_nat_spec_xH : p = xH -> n = 1%N -> pos_nat_spec p n xH 1 true | Pos_nat_spec_xO : forall p' n', p = xO p' -> n = n'.*2 -> pos_nat p' n' -> pos_nat_spec p n (xO p') n'.*2 true | Pos_nat_spec_xI : forall p' n', p = xI p' -> n = n'.*2.+...
Variant
pos_nat_spec
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "n'", "nat", "pos_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
iter_opDdoubler p n : Pos.iter_op addn p n.*2 = (Pos.iter_op addn p n).*2.
Proof. by elim: p n => [p ip | p ip |//] n /=; rewrite !addnn ip ?doubleD. Qed.
Lemma
iter_opDdoubler
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "addn", "addnn", "doubleD" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
iter_opD2 p : Pos.iter_op addn p 2 = (Pos.iter_op addn p 1).*2.
Proof. by rewrite -[2]/1.*2 iter_opDdoubler. Qed.
Lemma
iter_opD2
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "addn", "iter_opDdoubler" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_natP p n : pos_nat_spec p n p n (pos_nat p n).
Proof. case: (boolP (pos_nat p n)) => /eqP pn; last exact: Pos_nat_spec_false. elim: p n pn => [p IH | p IH |] n <-; rewrite /Pos.to_nat /= ?iter_opD2. - exact: Pos_nat_spec_xI. - exact: Pos_nat_spec_xO. - exact: Pos_nat_spec_xH. Qed.
Lemma
pos_natP
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "iter_opD2", "last", "pos_nat", "pos_nat_spec" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat_ind (P : positive -> nat -> Prop) : (P xH 1%N) -> (forall p n, pos_nat p n -> P p n -> P (xO p) n.*2) -> (forall p n, pos_nat p n -> P p n -> P (xI p) n.*2.+1) -> forall p n, pos_nat p n -> P p n.
Proof. move=> P1 Pd PdS; elim=> [p Ppn | p Ppn |] n; case: pos_natP => //. - by move=> _ {}n [<-] _ pn _; apply: PdS (Ppn n pn). - by move=> _ {}n [<-] _ pn _; apply: Pd (Ppn n pn). Qed.
Lemma
pos_nat_ind
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "P1", "apply", "nat", "pos_nat", "pos_natP" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_to_nat_gt0 p : (Pos.to_nat p > 0)%N.
Proof. by elim: p => // ? ?; rewrite /Pos.to_nat/= iter_opD2 double_gt0. Qed.
Lemma
Pos_to_nat_gt0
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "double_gt0", "iter_opD2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_to_nat0F p : (Pos.to_nat p == 0) = false.
Proof. by apply/negbTE; rewrite -lt0n Pos_to_nat_gt0. Qed.
Lemma
Pos_to_nat0F
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "Pos_to_nat_gt0", "apply", "lt0n" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat_exS p n : pos_nat p n -> exists2 n', n = n'.+1 & pos_nat p n'.+1.
Proof. by case: n => [|n pn]; [move: (Pos_to_nat_gt0 p) => /[swap]/eqP-> | exists n]. Qed.
Lemma
pos_nat_exS
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "Pos_to_nat_gt0", "n'", "pos_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat1 : pos_nat xH 1.
Proof. by []. Qed.
Lemma
pos_nat1
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "pos_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat_double p n : pos_nat p~0 n.*2 = pos_nat p n.
Proof. apply/idP/idP => [|/eqP<-]; last by rewrite /pos_nat [eqbLHS]iter_opD2. by case: pos_natP => // _ _ [<-] /double_inj<-. Qed.
Lemma
pos_nat_double
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "apply", "double_inj", "eqbLHS", "iter_opD2", "last", "pos_nat", "pos_natP" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat_doubleS p n : pos_nat p~1 n.*2.+1 = pos_nat p n.
Proof. rewrite /pos_nat -[Pos.to_nat p~1]/(Pos.to_nat p~0).+1 eqSS. exact: pos_nat_double. Qed.
Lemma
pos_nat_doubleS
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "eqSS", "pos_nat", "pos_nat_double" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_natE
:= (pos_nat_double, pos_nat_doubleS, pos_nat1).
Definition
pos_natE
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "pos_nat1", "pos_nat_double", "pos_nat_doubleS" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_natS p n : pos_nat p n -> pos_nat (Pos.succ p) (S n).
Proof. by elim/pos_nat_ind => // ? ? ? ?; rewrite -?doubleS pos_natE. Qed.
Lemma
pos_natS
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "doubleS", "pos_nat", "pos_natE", "pos_nat_ind" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_natD p n p' n' : pos_nat p n -> pos_nat p' n' -> pos_nat (Pos.add p p') (n + n').
Proof. move=> pn p'n'; suff: pos_nat (Pos.add p p') (n + n') && pos_nat (Pos.add_carry p p') (n + n').+1 by move=> /andP[]. elim/pos_nat_ind: pn p' n' p'n' => [p' n' {p n} ||]; [|move=> {}p {}n pn IH p' n'..]. - by case: pos_natP => //?? _ _ e; rewrite add1n -doubleS !pos_natE ?e pos_natS. - case: pos_natP => [//...
Lemma
pos_natD
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "add", "add1n", "addSn", "addn1", "addnS", "doubleD", "doubleS", "n'", "pos_nat", "pos_natE", "pos_natP", "pos_natS", "pos_nat_ind" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat_pred_double p n : pos_nat p n -> pos_nat (Pos.pred_double p) n.*2.-1.
Proof. by elim/pos_nat_ind => [//||] {}p {}n; [move=> /pos_nat_exS[?-> pn]|]; rewrite /Pos.pred_double/= -/double -?doubleS !pos_natE. (* when dropping support for Coq 8.20, replace above proof by by elim/pos_nat_ind => [//||] {}p {}n; [move=> /pos_nat_exS[?-> pn]/=|]; rewrite !pos_natE. *) Qed.
Lemma
pos_nat_pred_double
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "double", "doubleS", "pos_nat", "pos_natE", "pos_nat_exS", "pos_nat_ind" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_natM p n p' n' : pos_nat p n -> pos_nat p' n' -> pos_nat (Pos.mul p p') (n * n').
Proof. move=> pn; elim/pos_nat_ind: pn p' n' => [p' n' p'n'||]; [|move=> {}p {}n pn IH p' n' /[dup] p'n' /IH pp'nn' /=..]. - by rewrite mul1n. - by rewrite -doubleMl pos_natE. - by rewrite mulSn pos_natD// -doubleMl pos_natE. Qed.
Lemma
pos_natM
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "doubleMl", "mul", "mul1n", "mulSn", "n'", "pos_nat", "pos_natD", "pos_natE", "pos_nat_ind" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mask_nat m (n : nat)
:= match m with | Pos.IsNul => n == 0 | Pos.IsPos p => pos_nat p n | Pos.IsNeg => false end.
Definition
mask_nat
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "nat", "pos_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mask_nat_double_pred p n : pos_nat p n -> mask_nat (Pos.double_pred_mask p) n.-1.*2.
Proof. by case: pos_natP => [//|//|{}p {}n _ _ pn _|{}p {}n _ _ pn _] /=; rewrite !pos_natE ?pos_nat_pred_double. Qed.
Lemma
mask_nat_double_pred
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "mask_nat", "pos_nat", "pos_natE", "pos_natP", "pos_nat_pred_double" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mask_nat_double m n : mask_nat m n -> mask_nat (Pos.double_mask m) n.*2.
Proof. by case: m => [/eqP->//| p |//] /=; rewrite pos_natE. Qed.
Lemma
mask_nat_double
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "mask_nat", "pos_natE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mask_nat_succ_double m n : mask_nat m n -> mask_nat (Pos.succ_double_mask m) n.*2.+1.
Proof. by case: m => [/eqP->//| p |//] /=; rewrite pos_natE. Qed.
Lemma
mask_nat_succ_double
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "mask_nat", "pos_natE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mask_natB p n (pn : pos_nat p n) p' n' (p'n' : pos_nat p' n') : (n' <= n)%N -> mask_nat (Pos.sub_mask p p') (n - n').
Proof. suff: (n' <= n)%N -> (mask_nat (Pos.sub_mask p p') (n - n')%N /\ ((n' < n)%N -> mask_nat (Pos.sub_mask_carry p p') (n - n').-1)). by move=> /[apply] -[]. elim/pos_nat_ind: pn p' n' p'n' => [p' n' {p n} ||]; [|move=> {}p {}n pn IH p' n'..]. - case: n' => [|n'] /[swap]; first by rewrite /pos_nat Pos_to_n...
Lemma
mask_natB
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "Pos_to_nat0F", "apply", "double0", "doubleB", "doubleS", "double_eq0", "double_pred", "eqSS", "eq_sym", "leq_Sdouble", "leq_double", "leqn0", "ltnS", "ltnW", "ltn_double", "ltnn", "mask_nat", "mask_nat_double", "mask_nat_double_pred", "mask_nat_succ_double", "n'", "neq_dou...
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_sub_mask_Neg i j : (Pos.to_nat i < Pos.to_nat j)%N -> Pos.sub_mask i j = Pos.IsNeg.
Proof. suff: ((Pos.to_nat i < Pos.to_nat j)%N -> Pos.sub_mask i j = Pos.IsNeg) /\ ((Pos.to_nat i <= Pos.to_nat j)%N -> Pos.sub_mask_carry i j = Pos.IsNeg). by move=> []. elim/pos_nat_ind: (pos_nat_Pos_to_nat i) j => [{i}|{}i n pin IH|{}i n pin IH] j. - by case: pos_natP (pos_nat_Pos_to_nat j). - case: pos_natP (p...
Lemma
Pos_sub_mask_Neg
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "Pos_to_nat0F", "double0", "doubleS", "leq_Sdouble", "leq_double", "leqn0", "ltn0", "ltnS", "ltn_double", "pos_nat", "pos_natP", "pos_nat_Pos_to_nat", "pos_nat_ind", "split" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_natB p n (pn : pos_nat p n) p' n' (p'n' : pos_nat p' n') : (n' < n)%N -> pos_nat (Pos.sub p p') (n - n').
Proof. move=> /[dup] /ltnW n'n; rewrite /Pos.sub. case: Pos.sub_mask (mask_natB pn p'n' n'n) => [/=|//|//]. by rewrite -subn_gt0 => /eqP->. Qed.
Lemma
pos_natB
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "ltnW", "mask_natB", "n'", "pos_nat", "sub", "subn_gt0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat_eq p n (pn : pos_nat p n) p' n' (p'n' : pos_nat p' n') : Pos.eqb p p' = (n == n').
Proof. elim/pos_nat_ind: pn p' n' p'n' => [p' n' {p n} ||]; [|move=> {}p {}n pn IH p' n'..]. - case: pos_natP => [//|//||] {}p' {}n' _ _ p'n' _ /=. + by rewrite -double0 neq_doubleS_double. + apply/esym/negbTE; rewrite eqSS eq_sym double_eq0. by rewrite -(eqP p'n') Pos_to_nat0F. - case: pos_natP => [//|_ _ ...
Lemma
pos_nat_eq
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "Pos_to_nat0F", "apply", "double0", "double_eq0", "double_inj", "eqSS", "eq_sym", "eqb", "inj_eq", "n'", "neq_doubleS_double", "pos_nat", "pos_natP", "pos_nat_ind" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat_compare p n (pn : pos_nat p n) p' n' (p'n' : pos_nat p' n') : Pos.compare p p' = if n == n' then Eq else if (n < n')%N then Lt else Gt.
Proof. rewrite /Pos.compare; elim/pos_nat_ind: pn Eq p' n' p'n' => [c p' n' {p n} ||]; [|move=> {}p {}n pn IH c p' n'..]. - case: pos_natP => [//|//||] /= {}p' {}n' _ _ p'n' _. + rewrite -double0 neq_doubleS_double -doubleS leq_double ifT//. by rewrite -(eqP p'n') Pos_to_nat_gt0. + rewrite eqSS eq_sym doubl...
Lemma
pos_nat_compare
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "Pos_to_nat0F", "Pos_to_nat_gt0", "apply", "compare", "double0", "doubleS", "double_eq0", "double_gt0", "double_inj", "eqSS", "eq_sym", "inj_eq", "leq_double", "leq_eqVlt", "leqn0", "lt0n_neq0", "ltnS", "ltn_double", "ltnn", "n'", "neq_doubleS_double", "pos_nat", "pos_nat...
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat_le p n (pn : pos_nat p n) p' n' (p'n' : pos_nat p' n') : Pos.leb p p' = (n <= n')%N.
Proof. rewrite /Pos.leb (pos_nat_compare pn p'n') [RHS]leq_eqVlt. by case: eqP => [//| _ /=]; case: ltnP. Qed.
Lemma
pos_nat_le
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "leq_eqVlt", "ltnP", "n'", "pos_nat", "pos_nat_compare" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_to_natI : injective Pos.to_nat.
Proof. elim=> [i IH | i IH |]; rewrite /Pos.to_nat; case=> [j | j |]//=. - by rewrite !iter_opD2 => -[/double_inj/IH->]. - by move/eqP; rewrite !iter_opD2 neq_doubleS_double. - move: (Pos_to_nat_gt0 i); rewrite iter_opD2 => /[swap] -[/eqP]. by rewrite double_eq0 => /eqP<-; rewrite ltnn. - by move/esym/eqP; rewrite !i...
Lemma
Pos_to_natI
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "Pos_to_nat_gt0", "double0", "double_eq0", "double_inj", "iter_opD2", "ltnn", "neq_doubleS_double" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat_compare_spec (p p' : positive) : positive -> positive -> comparison -> Set
:= | Pos_nat_compare_spec_Eq : pos_nat_compare_spec p p' p p Eq | Pos_nat_compare_spec_Lt : (Pos.to_nat p < Pos.to_nat p')%N -> pos_nat_compare_spec p p' p p' Lt | Pos_nat_compare_spec_Gt : (Pos.to_nat p' < Pos.to_nat p)%N -> pos_nat_compare_spec p p' p p' Gt.
Variant
pos_nat_compare_spec
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_nat_compareP p p' : pos_nat_compare_spec p p' p p' (Pos.compare p p').
Proof. have := pos_nat_compare (pos_nat_Pos_to_nat p) (pos_nat_Pos_to_nat p'). (case: Pos.compare; [|do 2?[case: ifP => //]..]) => [|+ _ _|/[swap]+ + _]. - by case: eqP => [/Pos_to_natI e _|]; [rewrite -{2}e; constructor|case: ifP]. - by constructor. - by move=> e /negbT; rewrite -leqNgt leq_eqVlt eq_sym e/=; construct...
Lemma
pos_nat_compareP
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "Pos_to_natI", "compare", "eq_sym", "leqNgt", "leq_eqVlt", "pos_nat_Pos_to_nat", "pos_nat_compare", "pos_nat_compare_spec" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_to_nat1 : Pos.to_nat xH = 1%N.
Proof. by []. Qed.
Lemma
Pos_to_nat1
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_to_nat_double i : Pos.to_nat (xO i) = (Pos.to_nat i).*2.
Proof. exact/eqP/(eqbRL (pos_nat_double i (Pos.to_nat i))). Qed.
Lemma
Pos_to_nat_double
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "pos_nat_double" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_to_nat_doubleS i : Pos.to_nat (xI i) = (Pos.to_nat i).*2.+1.
Proof. exact/eqP/(eqbRL (pos_nat_doubleS i (Pos.to_nat i))). Qed.
Lemma
Pos_to_nat_doubleS
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "pos_nat_doubleS" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_to_natS i : Pos.to_nat (Pos.succ i) = (Pos.to_nat i).+1.
Proof. exact: eqP (pos_natS (pos_nat_Pos_to_nat i)). Qed.
Lemma
Pos_to_natS
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "pos_natS", "pos_nat_Pos_to_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_to_natD i j : Pos.to_nat (Pos.add i j) = (Pos.to_nat i + Pos.to_nat j)%N.
Proof. exact: eqP (pos_natD (pos_nat_Pos_to_nat i) (pos_nat_Pos_to_nat j)). Qed.
Lemma
Pos_to_natD
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "add", "pos_natD", "pos_nat_Pos_to_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_to_nat_pred_double i : Pos.to_nat (Pos.pred_double i) = (Pos.to_nat i).*2.-1.
Proof. exact: eqP (pos_nat_pred_double (pos_nat_Pos_to_nat i)). Qed.
Lemma
Pos_to_nat_pred_double
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "pos_nat_Pos_to_nat", "pos_nat_pred_double" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_to_natM i j : Pos.to_nat (Pos.mul i j) = (Pos.to_nat i * Pos.to_nat j)%N.
Proof. exact: eqP (pos_natM (pos_nat_Pos_to_nat i) (pos_nat_Pos_to_nat j)). Qed.
Lemma
Pos_to_natM
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "mul", "pos_natM", "pos_nat_Pos_to_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_to_natB i j : (Pos.to_nat j < Pos.to_nat i)%N -> Pos.to_nat (Pos.sub i j) = (Pos.to_nat i - Pos.to_nat j)%N.
Proof. by move/(pos_natB (pos_nat_Pos_to_nat i) (pos_nat_Pos_to_nat j))/eqP. Qed.
Lemma
Pos_to_natB
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "pos_natB", "pos_nat_Pos_to_nat", "sub" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Pos_to_natE
:= (Pos_to_nat1, Pos_to_nat_double, Pos_to_nat_doubleS, Pos_to_natS, Pos_to_natD, Pos_to_nat_pred_double, Pos_to_natM, Pos_to_natB).
Definition
Pos_to_natE
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "Pos_to_nat1", "Pos_to_natB", "Pos_to_natD", "Pos_to_natM", "Pos_to_natS", "Pos_to_nat_double", "Pos_to_nat_doubleS", "Pos_to_nat_pred_double" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Nnat (i : N) (n : nat)
:= N.to_nat i == n.
Definition
Nnat
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Nnat_N_to_nat i : Nnat i (N.to_nat i).
Proof. exact/eqP. Qed.
Lemma
Nnat_N_to_nat
algebra
algebra/binnums.v
[ "micromega_plugin", "PosDef", "NatDef", "Corelib", "IntDef", "RatDef", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "ssralg", "ssrnum", "ssrint", "rat", "GRing.Theory", "Num.Theory" ]
[ "Nnat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d