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
p
:= p'.+1.
Let
p
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp1
:= (@Zp1 p').
Notation
Zp1
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
inZp
:= (inZp p').
Notation
inZp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_mul1z : left_id Zp1 Zp_mul.
Proof. by move=> x; apply: val_inj; rewrite /= modnMml mul1n modZp. Qed.
Lemma
Zp_mul1z
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp1", "Zp_mul", "apply", "modZp", "modnMml", "mul1n", "val_inj" ]
Ring properties
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_mulz1 : right_id Zp1 Zp_mul.
Proof. by move=> x; rewrite Zp_mulC Zp_mul1z. Qed.
Lemma
Zp_mulz1
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp1", "Zp_mul", "Zp_mul1z", "Zp_mulC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_mulVz x : coprime p x -> Zp_mul (Zp_inv x) x = Zp1.
Proof. move=> co_p_x; apply: val_inj; rewrite /Zp_inv co_p_x /= modnMml. by rewrite -(chinese_modl co_p_x 1 0) /chinese addn0 mul1n mulnC. Qed.
Lemma
Zp_mulVz
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp1", "Zp_inv", "Zp_mul", "addn0", "apply", "chinese", "chinese_modl", "coprime", "modnMml", "mul1n", "mulnC", "val_inj" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_mulzV x : coprime p x -> Zp_mul x (Zp_inv x) = Zp1.
Proof. by move=> Ux; rewrite /= Zp_mulC Zp_mulVz. Qed.
Lemma
Zp_mulzV
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp1", "Zp_inv", "Zp_mul", "Zp_mulC", "Zp_mulVz", "coprime" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_intro_unit x y : Zp_mul y x = Zp1 -> coprime p x.
Proof. case=> yx1; have:= coprimen1 p. by rewrite -coprime_modr -yx1 coprime_modr coprimeMr; case/andP. Qed.
Lemma
Zp_intro_unit
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp1", "Zp_mul", "coprime", "coprimeMr", "coprime_modr", "coprimen1" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_mulrn x n : x *+ n = inZp (x * n).
Proof. apply: val_inj => /=; elim: n => [|n IHn]; first by rewrite muln0 modn_small. by rewrite !GRing.mulrS /= IHn modnDmr mulnS. Qed.
Lemma
Zp_mulrn
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "apply", "inZp", "modnDmr", "modn_small", "muln0", "mulnS", "mulrS", "val_inj" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_mulgC : @commutative 'I_p _ mul.
Proof. exact: Zp_addC. Qed.
Lemma
Zp_mulgC
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_addC", "mul" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_abelian : abelian [set: 'I_p].
Proof. exact: FinRing.zmod_abelian. Qed.
Lemma
Zp_abelian
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "abelian", "zmod_abelian" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_expg x n : x ^+ n = inZp (x * n).
Proof. exact: Zp_mulrn. Qed.
Lemma
Zp_expg
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_mulrn", "inZp" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp1_expgz x : Zp1 ^+ x = x.
Proof. rewrite Zp_expg; apply/val_inj. by move: (Zp_mul1z x) => /(congr1 val). Qed.
Lemma
Zp1_expgz
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp1", "Zp_expg", "Zp_mul1z", "apply", "val", "val_inj" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_cycle : setT = <[Zp1]>.
Proof. by apply/setP=> x; rewrite -[x]Zp1_expgz inE groupX ?mem_gen ?set11. Qed.
Lemma
Zp_cycle
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp1", "Zp1_expgz", "apply", "groupX", "inE", "mem_gen", "set11", "setP", "setT" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
order_Zp1 : #[Zp1] = p.
Proof. by rewrite orderE -Zp_cycle cardsT card_ord. Qed.
Lemma
order_Zp1
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp1", "Zp_cycle", "card_ord", "cardsT", "orderE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
big_ord1
:= big_ord1 (only parsing).
Notation
big_ord1
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[]
TODO: bigop is imported after zmodp in matrix.v and intdiv.v to prevent these warnings from triggering. We should restore the order of imports when these are removed.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
big_ord1_cond
:= big_ord1_cond (only parsing).
Notation
big_ord1_cond
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
p
:= p'.+2.
Notation
p
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_nontrivial : Zp1 != 0 :> 'I_p.
Proof. by []. Qed.
Lemma
Zp_nontrivial
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp1" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_nat n : n%:R = inZp n :> 'I_p.
Proof. by apply: val_inj; rewrite [n%:R]Zp_mulrn /= modnMml mul1n. Qed.
Lemma
Zp_nat
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_mulrn", "apply", "inZp", "modnMml", "mul1n", "val_inj" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
natr_Zp (x : 'I_p) : x%:R = x.
Proof. by rewrite Zp_nat valZpK. Qed.
Lemma
natr_Zp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_nat", "valZpK" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
natr_negZp (x : 'I_p) : (- x)%:R = - x.
Proof. by apply: val_inj; rewrite /= Zp_nat /= modn_mod. Qed.
Lemma
natr_negZp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_nat", "apply", "modn_mod", "val_inj" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
unit_Zp_mulgC : @commutative {unit 'I_p} _ mul.
Proof. by move=> u v; apply: val_inj; rewrite /= GRing.mulrC. Qed.
Lemma
unit_Zp_mulgC
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "apply", "mul", "mulrC", "unit", "val_inj" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
unit_Zp_expg (u : {unit 'I_p}) n : val (u ^+ n) = inZp (val u ^ n) :> 'I_p.
Proof. apply: val_inj => /=; elim: n => [|n IHn] //. by rewrite expgS /= IHn expnS modnMmr. Qed.
Lemma
unit_Zp_expg
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "apply", "expgS", "expnS", "inZp", "modnMmr", "unit", "val", "val_inj" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_trunc p
:= p.-2.
Definition
Zp_trunc
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"''Z_' p"
:= 'I_(Zp_trunc p).+2 (at level 0, p at level 2, format "''Z_' p") : type_scope.
Notation
''Z_' p
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_trunc" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"''F_' p"
:= 'Z_(pdiv p) (at level 0, p at level 2, format "''F_' p") : type_scope.
Notation
''F_' p
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "pdiv" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
add_1_Zp p (x : 'Z_p) : 1 + x = ordS x.
Proof. by case: p => [|[|p]] in x *; apply/val_inj. Qed.
Lemma
add_1_Zp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "apply", "ordS", "val_inj" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
add_Zp_1 p (x : 'Z_p) : x + 1 = ordS x.
Proof. by rewrite addrC add_1_Zp. Qed.
Lemma
add_Zp_1
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "add_1_Zp", "addrC", "ordS" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
sub_Zp_1 p (x : 'Z_p) : x - 1 = ord_pred x.
Proof. by apply: (addIr 1); rewrite addrNK add_Zp_1 ord_predK. Qed.
Lemma
sub_Zp_1
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "addIr", "add_Zp_1", "addrNK", "apply", "ord_pred", "ord_predK" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
add_N1_Zp p (x : 'Z_p) : -1 + x = ord_pred x.
Proof. by rewrite addrC sub_Zp_1. Qed.
Lemma
add_N1_Zp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "addrC", "ord_pred", "sub_Zp_1" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp
:= if p > 1 then [set: 'Z_p] else 1%g.
Definition
Zp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
units_Zp
:= [set: {unit 'Z_p}].
Definition
units_Zp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "unit" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_cast : p > 1 -> (Zp_trunc p).+2 = p.
Proof. by case: p => [|[]]. Qed.
Lemma
Zp_cast
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_trunc" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
val_Zp_nat (p_gt1 : p > 1) n : (n%:R : 'Z_p) = (n %% p)%N :> nat.
Proof. by rewrite Zp_nat /= Zp_cast. Qed.
Lemma
val_Zp_nat
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_cast", "Zp_nat", "nat", "p_gt1" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_nat_mod (p_gt1 : p > 1)m : (m %% p)%:R = m%:R :> 'Z_p.
Proof. by apply: ord_inj; rewrite !val_Zp_nat // modn_mod. Qed.
Lemma
Zp_nat_mod
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "apply", "modn_mod", "ord_inj", "p_gt1", "val_Zp_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pchar_Zp : p > 1 -> p%:R = 0 :> 'Z_p.
Proof. by move=> p_gt1; rewrite -Zp_nat_mod ?modnn. Qed.
Lemma
pchar_Zp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_nat_mod", "modnn", "p_gt1" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
unitZpE x : p > 1 -> ((x%:R : 'Z_p) \is a GRing.unit) = coprime p x.
Proof. move=> p_gt1; rewrite qualifE /=. by rewrite val_Zp_nat ?Zp_cast ?coprime_modr. Qed.
Lemma
unitZpE
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_cast", "coprime", "coprime_modr", "p_gt1", "unit", "val_Zp_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_group_set : group_set Zp.
Proof. by rewrite /Zp; case: (p > 1); apply: groupP. Qed.
Lemma
Zp_group_set
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp", "apply", "groupP", "group_set" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Zp_group
:= Group Zp_group_set.
Canonical
Zp_group
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_group_set" ]
FIX ME : is this ok something similar is done in fingroup
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
card_Zp : p > 0 -> #|Zp| = p.
Proof. rewrite /Zp; case: p => [|[|p']] //= _; first by rewrite cards1. by rewrite cardsT card_ord. Qed.
Lemma
card_Zp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp", "card_ord", "cards1", "cardsT" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_Zp x : p > 1 -> x \in Zp.
Proof. by rewrite /Zp => ->. Qed.
Lemma
mem_Zp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
units_Zp_group
:= [group of units_Zp].
Canonical
units_Zp_group
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "group", "units_Zp" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
card_units_Zp : p > 0 -> #|units_Zp| = totient p.
Proof. move=> p_gt0; transitivity (totient p.-2.+2); last by case: p p_gt0 => [|[|p']]. rewrite cardsT card_sub -sum1_card big_mkcond /=. by rewrite totient_count_coprime big_mkord. Qed.
Lemma
card_units_Zp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "big_mkcond", "big_mkord", "card_sub", "cardsT", "last", "p_gt0", "sum1_card", "totient", "totient_count_coprime", "units_Zp" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
units_Zp_abelian : abelian units_Zp.
Proof. by apply/centsP=> u _ v _; apply: unit_Zp_mulgC. Qed.
Lemma
units_Zp_abelian
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "abelian", "apply", "centsP", "unit_Zp_mulgC", "units_Zp" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
char_Zp
:= (pchar_Zp) (only parsing).
Notation
char_Zp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "pchar_Zp" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
p_pr : prime p.
Hypothesis
p_pr
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "prime" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Fp_Zcast : Zp_trunc (pdiv p) = Zp_trunc p.
Proof. by rewrite /pdiv primes_prime. Qed.
Lemma
Fp_Zcast
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_trunc", "pdiv", "primes_prime" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Fp_cast : (Zp_trunc (pdiv p)).+2 = p.
Proof. by rewrite Fp_Zcast ?Zp_cast ?prime_gt1. Qed.
Lemma
Fp_cast
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Fp_Zcast", "Zp_cast", "Zp_trunc", "pdiv", "prime_gt1" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
card_Fp : #|'F_p| = p.
Proof. by rewrite card_ord Fp_cast. Qed.
Lemma
card_Fp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Fp_cast", "card_ord" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
val_Fp_nat n : (n%:R : 'F_p) = (n %% p)%N :> nat.
Proof. by rewrite Zp_nat /= Fp_cast. Qed.
Lemma
val_Fp_nat
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Fp_cast", "Zp_nat", "nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Fp_nat_mod m : (m %% p)%:R = m%:R :> 'F_p.
Proof. by apply: ord_inj; rewrite !val_Fp_nat // modn_mod. Qed.
Lemma
Fp_nat_mod
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "apply", "modn_mod", "ord_inj", "val_Fp_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pchar_Fp : p \in [pchar 'F_p].
Proof. by rewrite !inE -Fp_nat_mod p_pr ?modnn. Qed.
Lemma
pchar_Fp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Fp_nat_mod", "inE", "modnn", "p_pr", "pchar" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pchar_Fp_0 : p%:R = 0 :> 'F_p.
Proof. exact: GRing.pcharf0 pchar_Fp. Qed.
Lemma
pchar_Fp_0
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "pchar_Fp", "pcharf0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
unitFpE x : ((x%:R : 'F_p) \is a GRing.unit) = coprime p x.
Proof. by rewrite pdiv_id // unitZpE // prime_gt1. Qed.
Lemma
unitFpE
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "coprime", "pdiv_id", "prime_gt1", "unit", "unitZpE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Fp_fieldMixin : GRing.ComUnitRing_isField 'F_p.
Proof. constructor => x nzx. rewrite qualifE /= prime_coprime ?gtnNdvd ?lt0n //. case: (ltnP 1 p) => [lt1p | ]; last by case: p => [|[|p']]. by rewrite Zp_cast ?prime_gt1 ?pdiv_prime. Qed.
Lemma
Fp_fieldMixin
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "Zp_cast", "gtnNdvd", "last", "lt0n", "ltnP", "pdiv_prime", "prime_coprime", "prime_gt1" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
gen_tperm_step n (k : 'I_n.+1) : coprime n.+1 k -> <<[set tperm i (i + k) | i : 'I_n.+1]>>%g = [set: 'S_n.+1].
Proof. case: n k => [|n] k. move=> _; apply/eqP; rewrite eqEsubset subsetT/= -(gen_tperm 0)/= gen_subG. apply/subsetP => s /imsetP[/= [][|//] lt01 _ ->]. have ->: (Ordinal lt01) = 0 by apply/val_inj. by rewrite tperm1 group1. rewrite -unitZpE// natr_Zp => k_unit. apply/eqP; rewrite eqEsubset subsetT/= -(gen_tpe...
Lemma
gen_tperm_step
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "apply", "contraTneq", "coprime", "eqEsubset", "eqVneq", "eq_sym", "gen_subG", "gen_tperm", "group1", "groupJ", "imsetP", "lt01", "mem_gen", "mulVKr", "mulr1n", "mulrSr", "mulr_natr", "mulrnBr", "natr_Zp", "subSnn", "subr_eq0", "subsetP", "subsetT", "tperm", "tperm1",...
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
perm_addr1X n m (j k : 'I_n.+1) : (perm (addrI m%R) ^+ j)%g k = m *+ j + k.
Proof. by rewrite permX (eq_iter (permE _)) iter_addr. Qed.
Lemma
perm_addr1X
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "addrI", "eq_iter", "iter_addr", "permE", "permX" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
gen_tpermn_circular_shift n (i j : 'I_n.+2) (c := perm (addrI 1)) : coprime n.+2 (j - i)%R -> <<[set tperm i j ; c]>>%g = [set: 'S_n.+2].
Proof. move=> jBi_coprime; apply/eqP; rewrite eqEsubset subsetT/=. rewrite -(gen_tperm_step jBi_coprime) gen_subG. apply/subsetP => s /imsetP[/= k _ ->]. suff -> : tperm k (k + (j - i)) = (tperm i j ^ c ^+ (k - i)%R)%g. by rewrite groupJ ?groupX ?mem_gen ?inE ?eqxx ?orbT. by rewrite tpermJ !perm_addr1X natr_Zp addrNK...
Lemma
gen_tpermn_circular_shift
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "addrA", "addrAC", "addrI", "addrNK", "apply", "coprime", "eqEsubset", "eqxx", "gen_subG", "gen_tperm_step", "groupJ", "groupX", "imsetP", "inE", "mem_gen", "natr_Zp", "perm_addr1X", "subsetP", "subsetT", "tperm", "tpermJ" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
char_Fp
:= (pchar_Fp) (only parsing).
Notation
char_Fp
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "pchar_Fp" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
char_Fp_0
:= (pchar_Fp_0) (only parsing).
Notation
char_Fp_0
algebra
algebra/zmodp.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "choice", "eqtype", "ssrnat", "seq", "div", "fintype", "bigop", "finset", "prime", "fingroup", "perm", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "countalg", "finalg", "GRing.Theory" ]
[ "pchar_Fp_0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
term : Type
:= | Var of nat | Const of R | NatConst of nat | Add of term & term | Opp of term | NatMul of term & nat | Mul of term & term | Inv of term | Exp of term & nat.
Inductive
term
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "Add", "nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
formula : Type
:= | Bool of bool | Equal of term & term | Unit of term | And of formula & formula | Or of formula & formula | Implies of formula & formula | Not of formula | Exists of nat & formula | Forall of nat & formula.
Inductive
formula
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "And", "Bool", "nat", "term" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
True
:= (Bool true).
Notation
True
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "Bool" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
False
:= (Bool false).
Notation
False
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "Bool" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"''X_' i"
:= (Var _ i) : term_scope.
Notation
''X_' i
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"n %:R"
:= (NatConst _ n) : term_scope.
Notation
n %:R
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"x %:T"
:= (Const x) : term_scope.
Notation
x %:T
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"0"
:= 0%:R%T : term_scope.
Notation
0
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"1"
:= 1%:R%T : term_scope.
Notation
1
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"- t"
:= (Opp t) : term_scope.
Notation
- t
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"t - u"
:= (Add t (- u)) : term_scope.
Notation
t - u
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "Add" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"t ^-1"
:= (Inv t) : term_scope.
Notation
t ^-1
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"t / u"
:= (Mul t u^-1) : term_scope.
Notation
t / u
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"~ f"
:= (Not f) : term_scope.
Notation
~ f
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"x != y"
:= (Not (x == y)) : term_scope.
Notation
x != y
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"''exists' ''X_' i , f"
:= (Exists i f) : term_scope.
Notation
''exists' ''X_' i , f
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"''forall' ''X_' i , f"
:= (Forall i f) : term_scope.
Notation
''forall' ''X_' i , f
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
tsubst (t : term R) (s : nat * term R)
:= match t with | 'X_i => if i == s.1 then s.2 else t | _%:T | _%:R => t | t1 + t2 => tsubst t1 s + tsubst t2 s | - t1 => - tsubst t1 s | t1 *+ n => tsubst t1 s *+ n | t1 * t2 => tsubst t1 s * tsubst t2 s | t1^-1 => (tsubst t1 s)^-1 | t1 ^+ n => tsubst t1 s ^+ n end%T.
Fixpoint
tsubst
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "nat", "term" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
fsubst (f : formula R) (s : nat * term R)
:= match f with | Bool _ => f | t1 == t2 => tsubst t1 s == tsubst t2 s | Unit t1 => Unit (tsubst t1 s) | f1 /\ f2 => fsubst f1 s /\ fsubst f2 s | f1 \/ f2 => fsubst f1 s \/ fsubst f2 s | f1 ==> f2 => fsubst f1 s ==> fsubst f2 s | ~ f1 => ~ fsubst f1 s | ('exists 'X_i, f1) => 'exists 'X_i, if i == s.1 ...
Fixpoint
fsubst
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "Bool", "f1", "f2", "formula", "nat", "term", "tsubst" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eval (e : seq R) (t : term R) {struct t} : R
:= match t with | ('X_i)%T => e`_i | (x%:T)%T => x | (n%:R)%T => n%:R | (t1 + t2)%T => eval e t1 + eval e t2 | (- t1)%T => - eval e t1 | (t1 *+ n)%T => eval e t1 *+ n | (t1 * t2)%T => eval e t1 * eval e t2 | t1^-1%T => (eval e t1)^-1 | (t1 ^+ n)%T => eval e t1 ^+ n end.
Fixpoint
eval
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "seq", "term" ]
Evaluation of a reified term into R a ring with units
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
same_env (e e' : seq R)
:= nth 0 e =1 nth 0 e'.
Definition
same_env
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "e'", "nth", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eq_eval e e' t : same_env e e' -> eval e t = eval e' t.
Proof. by move=> eq_e; elim: t => //= t1 -> // t2 ->. Qed.
Lemma
eq_eval
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "e'", "eval", "same_env" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eval_tsubst e t s : eval e (tsubst t s) = eval (set_nth 0 e s.1 (eval e s.2)) t.
Proof. case: s => i u; elim: t => //=; do 2?[move=> ? -> //] => j. by rewrite nth_set_nth /=; case: (_ == _). Qed.
Lemma
eval_tsubst
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "eval", "nth_set_nth", "set_nth", "tsubst" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
holds (e : seq R) (f : formula R) {struct f} : Prop
:= match f with | Bool b => b | (t1 == t2)%T => eval e t1 = eval e t2 | Unit t1 => eval e t1 \in unit | (f1 /\ f2)%T => holds e f1 /\ holds e f2 | (f1 \/ f2)%T => holds e f1 \/ holds e f2 | (f1 ==> f2)%T => holds e f1 -> holds e f2 | (~ f1)%T => ~ holds e f1 | ('exists 'X_i, f1)%T => exists x, holds (...
Fixpoint
holds
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "Bool", "eval", "f1", "f2", "formula", "seq", "set_nth", "unit" ]
Evaluation of a reified formula
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
same_env_sym e e' : same_env e e' -> same_env e' e.
Proof. exact: fsym. Qed.
Lemma
same_env_sym
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "e'", "same_env" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eq_holds e e' f : same_env e e' -> holds e f -> holds e' f.
Proof. pose sv := set_nth (0 : R). have eq_i i v e1 e2: same_env e1 e2 -> same_env (sv e1 i v) (sv e2 i v). by move=> eq_e j; rewrite !nth_set_nth /= eq_e. elim: f e e' => //=. - by move=> t1 t2 e e' eq_e; rewrite !(eq_eval _ eq_e). - by move=> t e e' eq_e; rewrite (eq_eval _ eq_e). - by move=> f1 IH1 f2 IH2 e e' eq_...
Lemma
eq_holds
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "e'", "eq_eval", "f1", "f2", "holds", "nth_set_nth", "same_env", "same_env_sym", "set_nth", "sv" ]
Extensionality of formula evaluation
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
holds_fsubst e f i v : holds e (fsubst f (i, v%:T)%T) <-> holds (set_nth 0 e i v) f.
Proof. elim: f e => //=; do [ by move=> *; rewrite !eval_tsubst | move=> f1 IHf1 f2 IHf2 e; move: (IHf1 e) (IHf2 e); tauto | move=> f IHf e; move: (IHf e); tauto | move=> j f IHf e]. - case eq_ji: (j == i); first rewrite (eqP eq_ji). by split=> [] [x f_x]; exists x; rewrite set_set_nth eqxx in f_x *. split=> []...
Lemma
holds_fsubst
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "eq_sym", "eqxx", "eval_tsubst", "f1", "f2", "fsubst", "holds", "set_nth", "set_set_nth", "split" ]
Evaluation and substitution by a constant
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rterm (t : term R)
:= match t with | _^-1 => false | t1 + t2 | t1 * t2 => rterm t1 && rterm t2 | - t1 | t1 *+ _ | t1 ^+ _ => rterm t1 | _ => true end%T.
Fixpoint
rterm
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "term" ]
Boolean test selecting terms in the language of rings
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rformula (f : formula R)
:= match f with | Bool _ => true | t1 == t2 => rterm t1 && rterm t2 | Unit t1 => false | f1 /\ f2 | f1 \/ f2 | f1 ==> f2 => rformula f1 && rformula f2 | ~ f1 | ('exists 'X__, f1) | ('forall 'X__, f1) => rformula f1 end%T.
Fixpoint
rformula
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "Bool", "f1", "f2", "formula", "rterm" ]
Boolean test selecting formulas in the theory of rings
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ub_var (t : term R)
:= match t with | 'X_i => i.+1 | t1 + t2 | t1 * t2 => maxn (ub_var t1) (ub_var t2) | - t1 | t1 *+ _ | t1 ^+ _ | t1^-1 => ub_var t1 | _ => 0%N end%T.
Fixpoint
ub_var
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "maxn", "term" ]
Upper bound of the names used in a term
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
to_rterm (t : term R) (r : seq (term R)) (n : nat) {struct t}
:= match t with | t1^-1 => let: (t1', r1) := to_rterm t1 r n in ('X_(n + size r1), rcons r1 t1') | t1 + t2 => let: (t1', r1) := to_rterm t1 r n in let: (t2', r2) := to_rterm t2 r1 n in (t1' + t2', r2) | - t1 => let: (t1', r1) := to_rterm t1 r n in (- t1', r1) | t1 *+ m => le...
Fixpoint
to_rterm
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "nat", "r1", "r2", "rcons", "seq", "size", "term" ]
substitution.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
to_rterm_id t r n : rterm t -> to_rterm t r n = (t, r).
Proof. elim: t r n => //. - by move=> t1 IHt1 t2 IHt2 r n /= /andP[rt1 rt2]; rewrite {}IHt1 // IHt2. - by move=> t IHt r n /= rt; rewrite {}IHt. - by move=> t IHt r n m /= rt; rewrite {}IHt. - by move=> t1 IHt1 t2 IHt2 r n /= /andP[rt1 rt2]; rewrite {}IHt1 // IHt2. - by move=> t IHt r n m /= rt; rewrite {}IHt. Qed.
Lemma
to_rterm_id
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "rterm", "to_rterm" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eq0_rform t1
:= let m := ub_var t1 in let: (t1', r1) := to_rterm t1 [::] m in let fix loop r i := match r with | [::] => t1' == 0 | t :: r' => let f := 'X_i * t == 1 /\ t * 'X_i == 1 in 'forall 'X_i, (f \/ 'X_i == t /\ ~ ('exists 'X_i, f)) ==> loop r' i.+1 end%T in loop r1 m.
Definition
eq0_rform
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "r1", "to_rterm", "ub_var" ]
Also applies to non commutative rings.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
to_rform f
:= match f with | Bool b => f | t1 == t2 => eq0_rform (t1 - t2) | Unit t1 => eq0_rform (t1 * t1^-1 - 1) | f1 /\ f2 => to_rform f1 /\ to_rform f2 | f1 \/ f2 => to_rform f1 \/ to_rform f2 | f1 ==> f2 => to_rform f1 ==> to_rform f2 | ~ f1 => ~ to_rform f1 | ('exists 'X_i, f1) => 'exists 'X_i, to_rform f...
Fixpoint
to_rform
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "Bool", "eq0_rform", "f1", "f2" ]
equivalent formula in the sub-theory of rings.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
to_rform_rformula f : rformula (to_rform f).
Proof. suffices eq0_ring t1: rformula (eq0_rform t1) by elim: f => //= => f1 ->. rewrite /eq0_rform; move: (ub_var t1) => m; set tr := _ m. suffices: all rterm (tr.1 :: tr.2). case: tr => {}t1 r /= /andP[t1_r]. by elim: r m => [|t r IHr] m; rewrite /= ?andbT // => /andP[->]; apply: IHr. have: all rterm [::] by []. ...
Lemma
to_rform_rformula
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "all", "all_rcons", "apply", "eq0_rform", "f1", "rformula", "rterm", "to_rform", "to_rterm", "ub_var" ]
The transformation gives a ring formula.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
to_rformP e f : holds e (to_rform f) <-> holds e f.
Proof. suffices{e f} equal0_equiv e t1 t2: holds e (eq0_rform (t1 - t2)) <-> (eval e t1 == eval e t2). - elim: f e => /=; try tauto. + move=> t1 t2 e. by split; [move/equal0_equiv/eqP | move/eqP/equal0_equiv]. + by move=> t1 e; rewrite unitrE; apply: equal0_equiv. + by move=> f1 IHf1 f2 IHf2 e; move: (IHf1 ...
Lemma
to_rformP
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "add0r", "addSnnS", "addn0", "addnA", "addnS", "addrK", "apply", "can2_eq", "cat_take_drop", "cats1", "def_r", "divrr", "drop", "eq0_rform", "eqxx", "eval", "eval_tsubst", "f1", "f2", "geq_max", "geq_min", "holds", "invr_out", "leq0n", "leqW", "leq_addr", "leq_tra...
Correctness of the transformation.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
qf_form (f : formula R)
:= match f with | Bool _ | _ == _ | Unit _ => true | f1 /\ f2 | f1 \/ f2 | f1 ==> f2 => qf_form f1 && qf_form f2 | ~ f1 => qf_form f1 | _ => false end%T.
Fixpoint
qf_form
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "Bool", "f1", "f2", "formula" ]
The quantifier elimination check.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
qf_eval e
:= fix loop (f : formula R) : bool := match f with | Bool b => b | t1 == t2 => (eval e t1 == eval e t2)%bool | Unit t1 => eval e t1 \in unit | f1 /\ f2 => loop f1 && loop f2 | f1 \/ f2 => loop f1 || loop f2 | f1 ==> f2 => (loop f1 ==> loop f2)%bool | ~ f1 => ~~ loop f1 |_ => false end%T.
Definition
qf_eval
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "Bool", "eval", "f1", "f2", "formula", "unit" ]
Boolean holds predicate for quantifier free formulas
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
qf_evalP e f : qf_form f -> reflect (holds e f) (qf_eval e f).
Proof. elim: f => //=; try by move=> *; apply: idP. - by move=> t1 t2 _; apply: eqP. - move=> f1 IHf1 f2 IHf2 /= /andP[/IHf1[] f1T]; last by right; case. by case/IHf2; [left | right; case]. - move=> f1 IHf1 f2 IHf2 /= /andP[/IHf1[] f1F]; first by do 2 left. by case/IHf2; [left; right | right; case]. - move=> f1 IHf...
Lemma
qf_evalP
algebra.algebraic_hierarchy
algebra/algebraic_hierarchy/decfield.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "finfun", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "GRing", "GRing.Theory", "AllExports" ]
[ "apply", "f1", "f2", "holds", "last", "qf_eval", "qf_form" ]
qf_eval is equivalent to holds
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d