Dataset Viewer
Auto-converted to Parquet Duplicate
statement
stringlengths
1
1.51k
proof
stringlengths
0
19.7k
type
stringclasses
22 values
symbolic_name
stringlengths
1
47
library
stringclasses
40 values
filename
stringclasses
367 values
imports
listlengths
0
43
deps
listlengths
0
64
docstring
stringlengths
0
4.03k
source_url
stringclasses
1 value
commit
stringclasses
1 value
Bernstein (n i:nat) {struct n}: (i <= n) -> cpoly_cring R
:= match n return (i <= n) -> cpoly_cring R with O => fun _ => [1] |S n' => match i return (i <= S n') -> cpoly_cring R with O => fun _ => ([1][-]_X_)[*](Bernstein (Nat.le_0_l n')) |S i' => fun p => match (le_lt_eq_dec _ _ p) with | left p' => ([1][-]_X_)[*](Bernstein (proj1 (Nat.lt_succ_r _ _) p'))[...
Fixpoint
Bernstein
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "cpoly_cring" ]
[Bernstein n i] is the ith element of the n dimensional Bernstein basis
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Bernstein_inv1 : forall n i (H:i < n) (H0:S i <= S n), Bernstein H0[=]([1][-]_X_)[*](Bernstein (proj1 (Nat.lt_succ_r _ _) (proj1 (Nat.succ_lt_mono _ _) H)))[+]_X_[*](Bernstein (le_S_n _ _ H0)).
Proof. intros n i H H0. simpl (Bernstein H0). destruct (le_lt_eq_dec _ _ H0). replace (proj1 (Nat.lt_succ_r (S i) n) l) with (proj1 (Nat.lt_succ_r _ _) (proj1 (Nat.succ_lt_mono _ _) H)) by apply le_irrelevent. reflexivity. exfalso; lia. Qed.
Lemma
Bernstein_inv1
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Bernstein", "H0", "apply", "le_irrelevent" ]
These lemmas provide an induction principle for polynomials using the Bernstien basis
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Bernstein_inv2 : forall n (H:S n <= S n), Bernstein H[=]_X_[*](Bernstein (le_S_n _ _ H)).
Proof. intros n H. simpl (Bernstein H). destruct (le_lt_eq_dec _ _ H). exfalso; lia. replace (proj1 (Nat.lt_succ_r n n) H) with (le_S_n n n H) by apply le_irrelevent. reflexivity. Qed.
Lemma
Bernstein_inv2
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Bernstein", "apply", "le_irrelevent" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Bernstein_ind : forall n i (H:i<=n) (P : nat -> nat -> cpoly_cring R -> Prop), P 0 0 [1] -> (forall n p, P n 0 p -> P (S n) 0 (([1][-]_X_)[*]p)) -> (forall n p, P n n p -> P (S n) (S n) (_X_[*]p)) -> (forall i n p q, (i < n) -> P n i p -> P n (S i) q -> P (S n) (S i) (([1][-]_X_)[*]q[+]_X_[*]p)) -> P n i (Bernstein H).
Proof. intros n i H P H0 H1 H2 H3. revert n i H. induction n; intros [|i] H. apply H0. exfalso; auto with *. apply H1. apply IHn. simpl. destruct (le_lt_eq_dec (S i) (S n)). apply H3; auto with *. inversion e. revert H. rewrite H5. intros H. apply H2. auto with *. Qed.
Lemma
Bernstein_ind
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Bernstein", "H0", "H1", "H2", "H3", "apply", "cpoly_cring" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
partitionOfUnity : forall n, @Sumx (cpoly_cring R) _ (fun i H => Bernstein (proj1 (Nat.lt_succ_r i n) H)) [=][1].
Proof. induction n. reflexivity. set (A:=(fun (i : nat) (H : i < S n) => Bernstein (proj1 (Nat.lt_succ_r i n) H))) in *. set (B:=(fun i => ([1][-]_X_)[*](part_tot_nat_fun (cpoly_cring R) _ A i)[+]_X_[*]match i with O => [0] | S i' => (part_tot_nat_fun _ _ A i') end)). rewrite -> (fun a b => Sumx_Sum0 _ a b B). ...
Lemma
partitionOfUnity
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Bernstein", "Hi", "Hj", "Sum", "Sum0", "Sum0_plus_Sum0", "Sum_first", "Sum_last", "Sum_shift", "Sumx", "Sumx_Sum0", "Sumx_to_Sum", "apply", "cpoly_cring", "eq_reflexive", "le_irrelevent", "mult_distr_sum0_lft", "part_tot_nat_fun" ]
[1] important property of the Bernstein basis is that its elements form a partition of unity
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
RaiseDegreeA : forall n i (H:i<=n), (nring (S n))[*]_X_[*]Bernstein H[=](nring (S i))[*]Bernstein (le_n_S _ _ H).
Proof. induction n. intros [|i] H; [|exfalso; lia]. repeat split; ring. intros i H. change (nring (S (S n)):cpoly_cring R) with (nring (S n)[+][1]:cpoly_cring R). rstepl (nring (S n)[*]_X_[*]Bernstein H[+]_X_[*]Bernstein H). destruct i as [|i]. simpl (Bernstein H) at 1. rstepl (([1][-]_X_)[*](nring (S n)[*...
Lemma
RaiseDegreeA
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Bernstein", "Bernstein_inv1", "Bernstein_inv2", "apply", "cpoly_cring", "le_irrelevent", "nring", "repeat", "split" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
RaiseDegreeB : forall n i (H:i<=n), (nring (S n))[*]([1][-]_X_)[*]Bernstein H[=](nring (S n - i))[*]Bernstein (le_S _ _ H).
Proof. induction n. intros [|i] H; [|exfalso; lia]. repeat split; ring. intros i H. change (nring (S (S n)):cpoly_cring R) with (nring (S n)[+][1]:cpoly_cring R). set (X0:=([1][-](@cpoly_var R))) in *. rstepl (nring (S n)[*]X0[*]Bernstein H[+]X0[*]Bernstein H). destruct i as [|i]. simpl (Bernstein H) at 1. ...
Lemma
RaiseDegreeB
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Bernstein", "Bernstein_inv1", "apply", "cpoly_cring", "cpoly_var", "le_irrelevent", "nring", "repeat", "split" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
RaiseDegree : forall n i (H: i<=n), (nring (S n))[*]Bernstein H[=](nring (S n - i))[*]Bernstein (le_S _ _ H)[+](nring (S i))[*]Bernstein (le_n_S _ _ H).
Proof. intros n i H. rstepl ((nring (S n))[*]([1][-]_X_)[*]Bernstein H[+](nring (S n))[*]_X_[*]Bernstein H). rewrite RaiseDegreeA, RaiseDegreeB. reflexivity. Qed.
Lemma
RaiseDegree
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Bernstein", "RaiseDegreeA", "RaiseDegreeB", "nring" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
evalBernsteinBasisH (n i:nat) (v:Vector.t R i) : i <= n -> cpoly_cring R
:= match v in Vector.t _ i return i <= n -> cpoly_cring R with |Vector.nil => fun _ => [0] |Vector.cons a i' v' => match n as n return (S i' <= n) -> cpoly_cring R with | O => fun p => False_rect _ (Nat.nle_succ_0 _ p) | S n' => fun p => _C_ a[*]Bernstein (le_S_n _ _ p)[+]evalBernsteinBasisH v' (Nat.lt_le_incl _ ...
Fixpoint
evalBernsteinBasisH
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Bernstein", "Vector", "cpoly_cring" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
evalBernsteinBasis (n:nat) (v:Vector.t R n) : cpoly_cring R
:= evalBernsteinBasisH v (Nat.le_refl n).
Definition
evalBernsteinBasis
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Vector", "cpoly_cring", "evalBernsteinBasisH", "le_refl" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Vbinary : forall (n : nat), Vector.t A n -> Vector.t A n -> Vector.t A n.
Proof. induction n as [| n h]; intros v v0. apply Vector.nil. inversion v as [| a n0 H0 H1]; inversion v0 as [| a0 n1 H2 H3]. exact (Vector.cons (g a a0) n (h H0 H2)). Defined.
Lemma
Vbinary
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "H0", "H1", "H2", "H3", "Vector", "apply" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Vid n : Vector.t A n -> Vector.t A n
:= match n with | O => fun _ => Vector.nil | S n' => fun v : Vector.t A (S n') => Vector.cons (Vector.hd v) _ (Vector.tl v) end.
Definition
Vid
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Vector" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Vid_eq : forall (n:nat) (v:Vector.t A n), v = Vid v.
Proof. destruct v; auto. Qed.
Lemma
Vid_eq
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Vector", "Vid" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
VSn_eq : forall (n : nat) (v : Vector.t A (S n)), v = Vector.cons (Vector.hd v) _ (Vector.tl v).
Proof. intros. exact (Vid_eq v). Qed.
Lemma
VSn_eq
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Vector", "Vid_eq" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
V0_eq : forall (v : Vector.t A 0), v = Vector.nil.
Proof. intros. exact (Vid_eq v). Qed.
Lemma
V0_eq
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Vector", "Vid_eq" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
evalBernsteinBasisPlus : forall n (v1 v2: Vector.t R n), evalBernsteinBasis (Vbinary (fun (x y:R)=>x[+]y) v1 v2)[=]evalBernsteinBasis v1[+]evalBernsteinBasis v2.
Proof. unfold evalBernsteinBasis. intros n. generalize (Nat.le_refl n). generalize n at 1 3 4 6 7 9 11. intros i. induction i. intros l v1 v2. rewrite (V0_eq v1), (V0_eq v2). ring. intros l v1 v2. destruct n as [|n]. exfalso; auto with *. rewrite (VSn_eq v1), (VSn_eq v2). simpl. rewrite IHi. rewrite...
Lemma
evalBernsteinBasisPlus
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "V0_eq", "VSn_eq", "Vbinary", "Vector", "c_plus", "evalBernsteinBasis", "le_refl" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
evalBernsteinBasisConst : forall n c, evalBernsteinBasis (Vector.const c (S n))[=]_C_ c.
Proof. intros n c. stepr (evalBernsteinBasis (Vector.const c (S n))[+]_C_ c[*]Sum (S n) n (part_tot_nat_fun _ _ (fun (i : nat) (H : i < S n) => Bernstein (proj1 (Nat.lt_succ_r i n) H)))). rewrite -> Sum_empty by auto with *. ring. unfold evalBernsteinBasis. generalize (Nat.le_refl (S n)). generalize (S n) at 1...
Lemma
evalBernsteinBasisConst
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Bernstein", "H'", "Sum", "Sum_empty", "Sum_first", "Sumx_to_Sum", "Vector", "apply", "const", "cpoly_cring", "evalBernsteinBasis", "evalBernsteinBasisH", "le_irrelevent", "le_refl", "part_tot_nat_fun", "partitionOfUnity" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
BernsteinBasisTimesXH (n i:nat) (v:Vector.t R i) : i <= n -> Vector.t R (S i)
:= match v in Vector.t _ i return i <= n -> Vector.t R (S i) with | Vector.nil => fun _ => Vector.cons [0] _ Vector.nil | Vector.cons a i' v' => match n as n return S i' <= n -> Vector.t R (S (S i')) with | O => fun p => False_rect _ (Nat.nle_succ_0 _ p) | S n' => fun p => Vector.cons (eta(Qred (i#P_of_succ_nat n')...
Fixpoint
BernsteinBasisTimesXH
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Vector", "eta" ]
To convert a polynomial to the Bernstein basis, we need to know how to multiply a bernstein basis element by [_X_] can convert it to the Bernstein basis. At this point we must work with rational coeffients. So we assume there is a ring homomorphism from [Q] to R
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
BernsteinBasisTimesX (n:nat) (v:Vector.t R n) : Vector.t R (S n)
:= BernsteinBasisTimesXH v (Nat.le_refl n).
Definition
BernsteinBasisTimesX
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "BernsteinBasisTimesXH", "Vector", "le_refl" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
evalBernsteinBasisTimesX : forall n (v:Vector.t R n), evalBernsteinBasis (BernsteinBasisTimesX v)[=]_X_[*]evalBernsteinBasis v.
Proof. intros n. unfold evalBernsteinBasis, BernsteinBasisTimesX. generalize (Nat.le_refl (S n)) (Nat.le_refl n). generalize n at 1 3 5 7 9 11. intros i. induction i. intros l l0 v. rewrite (V0_eq v). simpl. rewrite <- c_zero. ring. intros l l0 v. destruct n as [|n]. exfalso; auto with *. rewrite (VS...
Lemma
evalBernsteinBasisTimesX
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Bernstein", "BernsteinBasisTimesX", "Hn", "Q_as_CField", "Qap", "RHcompose", "RaiseDegreeA", "V0_eq", "VSn_eq", "Vector", "Zpos", "apply", "c_mult", "c_zero", "cpoly_cring", "csbf_wd", "csf_wd", "div_1", "eta", "evalBernsteinBasis", "le_irrelevent", "le_refl", "mult_asso...
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
BernsteinCoefficents (p:cpoly_cring R) : sigT (Vector.t R)
:= match p with | cpoly_zero _ => existT _ _ Vector.nil | cpoly_linear _ c p' => let (n', b') := (BernsteinCoefficents p') in existT _ _ (Vbinary (fun (x y:R)=>x[+]y) (Vector.const c _) (BernsteinBasisTimesX b')) end.
Fixpoint
BernsteinCoefficents
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "BernsteinBasisTimesX", "Vbinary", "Vector", "b'", "const", "cpoly_cring" ]
Convert a polynomial to the Bernstein basis
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
evalBernsteinCoefficents : forall p, (let (n,b) := BernsteinCoefficents p in evalBernsteinBasis b)[=]p.
Proof. induction p. reflexivity. simpl. destruct (BernsteinCoefficents p). rewrite -> evalBernsteinBasisPlus. rewrite -> evalBernsteinBasisConst. rewrite -> evalBernsteinBasisTimesX. rewrite -> IHp. rewrite -> poly_linear. ring. Qed.
Lemma
evalBernsteinCoefficents
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "BernsteinCoefficents", "evalBernsteinBasis", "evalBernsteinBasisConst", "evalBernsteinBasisPlus", "evalBernsteinBasisTimesX", "poly_linear" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
BernsteinNonNeg : forall x:F, [0] [<=] x -> x [<=] [1] -> forall n i (p:Nat.le i n), [0][<=](Bernstein F p)!x.
Proof. intros x Hx0 Hx1. induction n. intros i p. simpl (Bernstein F p). autorewrite with apply. auto with *. intros [|i] p; simpl (Bernstein F p). autorewrite with apply. auto with *. destruct (le_lt_eq_dec (S i) (S n) p); autorewrite with apply; auto with *. Qed.
Lemma
BernsteinNonNeg
algebra
algebra/Bernstein.v
[ "CoRN.algebra.CPolynomials", "CoRN.algebra.CSums", "CoRN.tactics.Rational", "CoRN.model.ordfields.Qordfield", "CoRN.algebra.COrdFields2", "CoRN.algebra.CRing_Homomorphisms", "Coq.Vectors.Vector", "Vector.VectorNotations", "Coq", "Lia" ]
[ "Bernstein", "Hx0", "apply", "le" ]
A second important property of the Bernstein polynomials is that they are all non-negative on the unit interval.
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
is_CAbGroup (G : CGroup)
:= commutes (csg_op (c:=G)).
Definition
is_CAbGroup
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "CGroup", "commutes" ]
* Abelian Groups Now we introduce commutativity and add some results.
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
CAbGroup : Type
:= {cag_crr : CGroup; cag_proof : is_CAbGroup cag_crr}.
Record
CAbGroup
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "CGroup", "cag_crr", "is_CAbGroup" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
cag_crr : CAbGroup >-> CGroup.
Coercion
cag_crr
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "CAbGroup", "CGroup" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
CAbGroup_is_CAbGroup : is_CAbGroup G.
Proof. elim G; auto. Qed.
Lemma
CAbGroup_is_CAbGroup
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "is_CAbGroup" ]
%\begin{convention}% Let [G] be an Abelian Group. %\end{convention}%
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
cag_commutes : commutes (csg_op (c:=G)).
Proof. exact CAbGroup_is_CAbGroup. Qed.
Lemma
cag_commutes
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "CAbGroup_is_CAbGroup", "commutes" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
cag_commutes_unfolded : forall x y : G, x[+]y [=] y[+]x.
Proof cag_commutes.
Lemma
cag_commutes_unfolded
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "cag_commutes" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
subcrr : CGroup
:= Build_SubCGroup _ _ Punit op_pres_P inv_pres_P.
Let
subcrr
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Build_SubCGroup", "CGroup" ]
%\begin{convention}% Let [G] be an Abelian Group and [P] be a ([CProp]-valued) predicate on [G] that contains [Zero] and is closed under [[+]] and [[--]]. %\end{convention}%
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
isabgrp_scrr : is_CAbGroup subcrr.
Proof. red in |- *. intros x y. case x. case y. intros. simpl in |- *. apply cag_commutes_unfolded. Qed.
Lemma
isabgrp_scrr
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "apply", "cag_commutes_unfolded", "is_CAbGroup", "subcrr" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Build_SubCAbGroup : CAbGroup
:= Build_CAbGroup subcrr isabgrp_scrr.
Definition
Build_SubCAbGroup
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "CAbGroup", "isabgrp_scrr", "subcrr" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
cag_op_inv : forall x y : G, [--] (x[+]y) [=] [--]x[+] [--]y.
Proof. intros x y. astepr ([--]y[+] [--]x). apply cg_inv_op. Qed.
Lemma
cag_op_inv
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "apply", "astepr", "cg_inv_op" ]
%\begin{convention}% Let [G] be an Abelian Group. %\end{convention}%
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
assoc_1 : forall x y z : G, x[-] (y[-]z) [=] x[-]y[+]z.
Proof. intros x y z; unfold cg_minus in |- *. astepr (x[+]([--]y[+]z)). Step_final (x[+]([--]y[+] [--][--]z)). Qed.
Lemma
assoc_1
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "astepr", "cg_minus" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
minus_plus : forall x y z : G, x[-] (y[+]z) [=] x[-]y[-]z.
Proof. intros x y z. unfold cg_minus in |- *. Step_final (x[+]([--]y[+] [--]z)). Qed.
Lemma
minus_plus
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "cg_minus" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
op_lft_resp_ap : forall x y z : G, y [#] z -> x[+]y [#] x[+]z.
Proof. intros x y z H. astepl (y[+]x). astepr (z[+]x). apply op_rht_resp_ap; assumption. Qed.
Lemma
op_lft_resp_ap
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "apply", "astepl", "astepr", "op_rht_resp_ap" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
cag_ap_cancel_lft : forall x y z : G, x[+]y [#] x[+]z -> y [#] z.
Proof. intros x y z H. apply ap_symmetric_unfolded. apply cg_ap_cancel_rht with x. apply ap_symmetric_unfolded. astepl (x[+]y). astepr (x[+]z). auto. Qed.
Lemma
cag_ap_cancel_lft
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "ap_symmetric_unfolded", "apply", "astepl", "astepr", "cg_ap_cancel_rht" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
plus_cancel_ap_lft : forall x y z : G, z[+]x [#] z[+]y -> x [#] y.
Proof. intros x y z H. apply cag_ap_cancel_lft with z. assumption. Qed.
Lemma
plus_cancel_ap_lft
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "apply", "cag_ap_cancel_lft" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
plus_lext : forall x y z : S, plus x z [#] plus y z -> x [#] y.
Hypothesis
plus_lext
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "plus" ]
%\begin{convention}% Let [S] be a Setoid and [unit:S], [plus:S->S->S] and [inv] a unary setoid operation on [S]. Assume that [plus] is commutative, associative and `left-strongly-extensional ([(plus x z) [#] (plus y z) -> x [#] y]), that [unit] is a left-unit for [plus] and [(inv x)] is a right-inverse of [x] w.r.t.%\%...
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
plus_lunit : forall x : S, plus unit x [=] x.
Hypothesis
plus_lunit
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "plus" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
plus_comm : forall x y : S, plus x y [=] plus y x.
Hypothesis
plus_comm
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "plus" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
plus_assoc : associative plus.
Hypothesis
plus_assoc
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "associative", "plus" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
inv_inv : forall x : S, plus x (inv x) [=] unit.
Hypothesis
inv_inv
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "inv", "plus" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
plus_rext : forall x y z : S, plus x y [#] plus x z -> y [#] z.
Proof. intros x y z H. apply plus_lext with x. astepl (plus x y). astepr (plus x z). auto. Qed.
Lemma
plus_rext
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "apply", "astepl", "astepr", "plus", "plus_lext" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
plus_runit : forall x : S, plus x unit [=] x.
Proof. intro x. Step_final (plus unit x). Qed.
Lemma
plus_runit
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "plus" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
plus_is_fun : bin_fun_strext _ _ _ plus.
Proof. intros x x' y y' H. elim (ap_cotransitive_unfolded _ _ _ H (plus x y')); intro H'. right; apply plus_lext with x. astepl (plus x y); astepr (plus x y'); auto. left; eauto. Qed.
Lemma
plus_is_fun
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "H'", "ap_cotransitive_unfolded", "apply", "astepl", "astepr", "bin_fun_strext", "plus", "plus_lext" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
inv_inv' : forall x : S, plus (inv x) x [=] unit.
Proof. intro. Step_final (plus x (inv x)). Qed.
Lemma
inv_inv'
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "inv", "plus" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
plus_fun : CSetoid_bin_op S
:= Build_CSetoid_bin_fun _ _ _ plus plus_is_fun.
Definition
plus_fun
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "CSetoid_bin_op", "plus", "plus_is_fun" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Build_CSemiGroup' : CSemiGroup.
Proof. apply Build_CSemiGroup with S plus_fun. exact plus_assoc. Defined.
Definition
Build_CSemiGroup'
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "CSemiGroup", "apply", "plus_assoc", "plus_fun" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Build_CMonoid' : CMonoid.
Proof. apply Build_CMonoid with Build_CSemiGroup' unit. apply Build_is_CMonoid. exact plus_runit. exact plus_lunit. Defined.
Definition
Build_CMonoid'
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Build_CSemiGroup'", "CMonoid", "apply", "plus_lunit", "plus_runit" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Build_CGroup' : CGroup.
Proof. apply Build_CGroup with Build_CMonoid' inv. split. auto. apply inv_inv'. Defined.
Definition
Build_CGroup'
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Build_CMonoid'", "CGroup", "apply", "inv", "inv_inv'", "split" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Build_CAbGroup' : CAbGroup.
Proof. apply Build_CAbGroup with Build_CGroup'. exact plus_comm. Defined.
Definition
Build_CAbGroup'
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Build_CGroup'", "CAbGroup", "apply", "plus_comm" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
nmult (a:G) (n:nat) {struct n} : G
:= match n with | O => [0] | S p => a[+]nmult a p end.
Fixpoint
nmult
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
nmult_wd : forall (x y:G) (n m:nat), (x [=] y) -> n = m -> nmult x n [=] nmult y m.
Proof. simple induction n; intros. rewrite <- H0; algebra. rewrite <- H1; simpl in |- *; algebra. Qed.
Lemma
nmult_wd
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "H0", "H1", "algebra", "nmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
nmult_one : forall x:G, nmult x 1 [=] x.
Proof. simpl in |- *; algebra. Qed.
Lemma
nmult_one
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "algebra", "nmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
nmult_Zero : forall n:nat, nmult [0] n [=] [0].
Proof. intro n. induction n. algebra. simpl in |- *; Step_final (([0]:G)[+][0]). Qed.
Lemma
nmult_Zero
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "algebra", "nmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
nmult_plus : forall m n x, nmult x m[+]nmult x n [=] nmult x (m + n).
Proof. simple induction m. simpl in |- *; algebra. clear m; intro m. intros. simpl in |- *. Step_final (x[+](nmult x m[+]nmult x n)). Qed.
Lemma
nmult_plus
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "algebra", "nmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
nmult_mult : forall n m x, nmult (nmult x m) n [=] nmult x (m * n).
Proof. simple induction n. intro. rewrite Nat.mul_0_r. algebra. clear n; intros. simpl in |- *. rewrite Nat.mul_comm. simpl in |- *. eapply eq_transitive_unfolded. 2: apply nmult_plus. rewrite Nat.mul_comm. algebra. Qed.
Lemma
nmult_mult
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "algebra", "apply", "eq_transitive_unfolded", "nmult", "nmult_plus" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
nmult_inv : forall n x, nmult [--]x n [=] [--] (nmult x n).
Proof. intro; induction n; simpl in |- *. algebra. intros. Step_final ([--]x[+] [--](nmult x n)). Qed.
Lemma
nmult_inv
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "algebra", "nmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
nmult_plus' : forall n x y, nmult x n[+]nmult y n [=] nmult (x[+]y) n.
Proof. intro; induction n; simpl in |- *; intros. algebra. astepr (x[+]y[+](nmult x n[+]nmult y n)). astepr (x[+](y[+](nmult x n[+]nmult y n))). astepr (x[+](y[+]nmult x n[+]nmult y n)). astepr (x[+](nmult x n[+]y[+]nmult y n)). Step_final (x[+](nmult x n[+](y[+]nmult y n))). Qed.
Lemma
nmult_plus'
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "algebra", "astepr", "nmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
zmult a z
:= caseZ_diff z (fun n m => nmult a n[-]nmult a m).
Definition
zmult
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "caseZ_diff", "nmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
zmult_char : forall (m n:nat) z, z = (m - n)%Z -> forall x, zmult x z [=] nmult x m[-]nmult x n.
Proof. simple induction z; intros. simpl in |- *. replace m with n. Step_final ([0]:G). auto with zarith. simpl in |- *. astepl (nmult x (nat_of_P p)). apply cg_cancel_rht with (nmult x n). astepr (nmult x m). astepl (nmult x (nat_of_P p + n)). apply nmult_wd; algebra. rewrite <- convert_is_POS i...
Lemma
zmult_char
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "algebra", "apply", "astepl", "astepr", "cg_cancel_lft", "cg_cancel_rht", "cg_minus", "convert_is_POS", "min_convert_is_NEG", "nat_of_P", "nmult", "nmult_wd", "un_op_wd_unfolded", "zmult" ]
Lemma Zeq_imp_nat_eq : forall m n:nat, m = n -> m = n. auto. intro m; induction m. intro n; induction n; auto. intro; induction n. intro. inversion H. intros. rewrite (IHm n). auto. repeat rewrite inj_S in H. auto with zarith. Qed.
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
zmult_wd : forall (x y:G) (n m:Z), (x [=] y) -> n = m -> zmult x n [=] zmult y m.
Proof. do 3 intro. case n; intros; inversion H0. algebra. unfold zmult in |- *. simpl in |- *. astepl (nmult x (nat_of_P p)); Step_final (nmult y (nat_of_P p)). simpl in |- *. astepl [--](nmult x (nat_of_P p)). Step_final [--](nmult y (nat_of_P p)). Qed.
Lemma
zmult_wd
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "H0", "Step_final", "algebra", "astepl", "nat_of_P", "nmult", "zmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
zmult_one : forall x:G, zmult x 1 [=] x.
Proof. simpl in |- *; algebra. Qed.
Lemma
zmult_one
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "algebra", "zmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
zmult_min_one : forall x:G, zmult x (-1) [=] [--]x.
Proof. intros; simpl in |- *; Step_final ([0][-]x). Qed.
Lemma
zmult_min_one
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "zmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
zmult_zero : forall x:G, zmult x 0 [=] [0].
Proof. simpl in |- *; algebra. Qed.
Lemma
zmult_zero
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "algebra", "zmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
zmult_Zero : forall k:Z, zmult [0] k [=] [0].
Proof. intro; induction k; simpl in |- *. algebra. Step_final (([0]:G)[-][0]). Step_final (([0]:G)[-][0]). Qed.
Lemma
zmult_Zero
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "algebra", "zmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
zmult_plus : forall m n x, zmult x m[+]zmult x n [=] zmult x (m + n).
Proof. intros; case m; case n; intros. simpl in |- *; Step_final ([0][+]([0][-][0]):G). simpl in |- *; Step_final ([0][+](nmult x (nat_of_P p)[-][0])). simpl in |- *; Step_final ([0][+]([0][-]nmult x (nat_of_P p))). simpl in |- *; Step_final (nmult x (nat_of_P p)[-][0][+][0]). simpl ...
Lemma
zmult_plus
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "Zpos", "apply", "astepl", "astepr", "convert_is_POS", "eq_symmetric_unfolded", "min_convert_is_NEG", "nat_of_P", "nmult", "nmult_plus", "un_op_wd_unfolded", "zmult", "zmult_char" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
zmult_mult : forall m n x, zmult (zmult x m) n [=] zmult x (m * n).
Proof. simple induction m; simple induction n; simpl in |- *; intros. Step_final ([0][-][0][+]([0]:G)). astepr ([0]:G). astepl (nmult ([0][-][0]) (nat_of_P p)). Step_final (nmult [0] (nat_of_P p)). astepr [--]([0]:G). astepl [--](nmult ([0][-][0]) (nat_of_P p)). Step_final [--](n...
Lemma
zmult_mult
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "Step_final", "algebra", "apply", "astepl", "astepr", "eq_transitive_unfolded", "nat_of_P", "nmult", "nmult_inv", "nmult_mult", "un_op_wd_unfolded", "zmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
zmult_plus' : forall z x y, zmult x z[+]zmult y z [=] zmult (x[+]y) z.
Proof. intro z; pattern z in |- *. apply nats_Z_ind. intro n; case n. intros; simpl in |- *. Step_final (([0]:G)[+]([0][-][0])). clear n; intros. rewrite POS_anti_convert; simpl in |- *. set (p := nat_of_P (P_of_succ_nat n)) in *. astepl (nmult x p[+]nmult y p). Step_final (nmult (x[+]y) p). intro n; ca...
Lemma
zmult_plus'
algebra
algebra/CAbGroups.v
[ "CoRN.algebra.CGroups", "CGroups.coercions" ]
[ "NEG_anti_convert", "POS_anti_convert", "Step_final", "apply", "astepl", "astepr", "nat_of_P", "nats_Z_ind", "nmult", "zmult" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
is_CAbMonoid (G : CMonoid)
:= commutes (csg_op (c:=G)).
Definition
is_CAbMonoid
algebra
algebra/CAbMonoids.v
[ "CoRN.algebra.CMonoids", "CoRN.util.SetoidPermutation", "Coq.Setoids.Setoid", "Coq.Classes.Morphisms" ]
[ "CMonoid", "commutes" ]
* Abelian Monoids Now we introduce commutativity and add some results.
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
CAbMonoid : Type
:= {cam_crr :> CMonoid; cam_proof : is_CAbMonoid cam_crr}.
Record
CAbMonoid
algebra
algebra/CAbMonoids.v
[ "CoRN.algebra.CMonoids", "CoRN.util.SetoidPermutation", "Coq.Setoids.Setoid", "Coq.Classes.Morphisms" ]
[ "CMonoid", "is_CAbMonoid" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
CAbMonoid_is_CAbMonoid : is_CAbMonoid M.
Proof. elim M; auto. Qed.
Lemma
CAbMonoid_is_CAbMonoid
algebra
algebra/CAbMonoids.v
[ "CoRN.algebra.CMonoids", "CoRN.util.SetoidPermutation", "Coq.Setoids.Setoid", "Coq.Classes.Morphisms" ]
[ "is_CAbMonoid" ]
%\begin{convention}% Let [M] be an abelian monoid. %\end{convention}%
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
cam_commutes : commutes (csg_op (c:=M)).
Proof. exact CAbMonoid_is_CAbMonoid. Qed.
Lemma
cam_commutes
algebra
algebra/CAbMonoids.v
[ "CoRN.algebra.CMonoids", "CoRN.util.SetoidPermutation", "Coq.Setoids.Setoid", "Coq.Classes.Morphisms" ]
[ "CAbMonoid_is_CAbMonoid", "commutes" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
cam_commutes_unfolded : forall x y : M, x[+]y [=] y[+]x.
Proof cam_commutes.
Lemma
cam_commutes_unfolded
algebra
algebra/CAbMonoids.v
[ "CoRN.algebra.CMonoids", "CoRN.util.SetoidPermutation", "Coq.Setoids.Setoid", "Coq.Classes.Morphisms" ]
[ "cam_commutes" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
cm_Sum_AbMonoid_Proper: forall {M: CAbMonoid}, Proper (SetoidPermutation (@st_eq M) ==> @st_eq M) cm_Sum.
Proof. repeat intro. apply cm_Sum_Proper. apply cam_proof. assumption. Qed.
Instance
cm_Sum_AbMonoid_Proper
algebra
algebra/CAbMonoids.v
[ "CoRN.algebra.CMonoids", "CoRN.util.SetoidPermutation", "Coq.Setoids.Setoid", "Coq.Classes.Morphisms" ]
[ "CAbMonoid", "SetoidPermutation", "apply", "cm_Sum", "cm_Sum_Proper", "repeat" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
subcrr : CMonoid
:= Build_SubCMonoid _ _ Punit op_pres_P.
Let
subcrr
algebra
algebra/CAbMonoids.v
[ "CoRN.algebra.CMonoids", "CoRN.util.SetoidPermutation", "Coq.Setoids.Setoid", "Coq.Classes.Morphisms" ]
[ "Build_SubCMonoid", "CMonoid" ]
%\begin{convention}% Let [M] be an Abelian Monoid and [P] be a ([CProp]-valued) predicate on [M] that contains [Zero] and is closed under [[+]] and [[--]]. %\end{convention}%
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
isabgrp_scrr : is_CAbMonoid subcrr.
Proof. red in |- *. intros x y. case x. case y. intros. simpl in |- *. apply cam_commutes_unfolded. Qed.
Lemma
isabgrp_scrr
algebra
algebra/CAbMonoids.v
[ "CoRN.algebra.CMonoids", "CoRN.util.SetoidPermutation", "Coq.Setoids.Setoid", "Coq.Classes.Morphisms" ]
[ "apply", "cam_commutes_unfolded", "is_CAbMonoid", "subcrr" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Build_SubCAbMonoid : CAbMonoid
:= Build_CAbMonoid _ isabgrp_scrr.
Definition
Build_SubCAbMonoid
algebra
algebra/CAbMonoids.v
[ "CoRN.algebra.CMonoids", "CoRN.util.SetoidPermutation", "Coq.Setoids.Setoid", "Coq.Classes.Morphisms" ]
[ "CAbMonoid", "isabgrp_scrr" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_Set
:= CauchySeq F.
Definition
R_Set
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "CauchySeq" ]
** Setoid Structure [R_Set] is the setoid of Cauchy sequences over [F]; given two sequences [x,y] over [F], we say that [x] is smaller than [y] if from some point onwards [(y n) [-] (x n)] is greater than some fixed, positive [e]. Apartness of two sequences means that one of them is smaller than the other, equality i...
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_lt (x y : R_Set)
:= {N : nat | {e : F | [0] [<] e | forall n, N <= n -> e [<=] CS_seq _ y n[-]CS_seq _ x n}}.
Definition
R_lt
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "R_Set" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_ap (x y : R_Set)
:= R_lt x y or R_lt y x.
Definition
R_ap
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "R_Set", "R_lt" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_eq (x y : R_Set)
:= Not (R_ap x y).
Definition
R_eq
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "Not", "R_Set", "R_ap" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_lt_cotrans : cotransitive R_lt.
Proof. red in |- *. intros x y. elim x; intros x_ px. elim y; intros y_ py. intros Hxy z. elim z; intros z_ pz. elim Hxy; intros N H. elim H; clear Hxy H; intros e He HN. simpl in HN. set (e3 := e [/]ThreeNZ) in *. cut ([0] [<] e3); [ intro He3 | unfold e3 in |- *; apply pos_div_three; auto ]. set (e6 := e ...
Lemma
R_lt_cotrans
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "He", "Hn", "R_lt", "apply", "astepl", "cg_minus", "cotransitive", "leEq_transitive", "leEq_wdl", "le_trans", "less_cotransitive_unfolded", "less_leEq", "less_leEq_trans", "less_wdl", "max", "minus_resp_leEq_rht", "plus_resp_leEq_both", "pos_div_six", "pos_div_three", "pos_div_...
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_ap_cotrans : cotransitive R_ap.
Proof. red in |- *; intros x y Hxy z. elim Hxy; intro H; elim (R_lt_cotrans _ _ H z); unfold R_ap in |- *; auto. Qed.
Lemma
R_ap_cotrans
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "R_ap", "R_lt_cotrans", "cotransitive" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_ap_symmetric : Csymmetric R_ap.
Proof. red in |- *; intros x y Hxy. elim Hxy; unfold R_ap in |- *; auto. Qed.
Lemma
R_ap_symmetric
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "Csymmetric", "R_ap" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_lt_irreflexive : irreflexive R_lt.
Proof. red in |- *; intros x Hx. elim Hx; intros N HN. elim HN; clear Hx HN; intros e He HN. apply (ap_irreflexive_unfolded _ (x N)). apply less_imp_ap. apply less_leEq_trans with (x N[+]e). astepl (x N[+][0]); apply plus_resp_less_lft; auto. apply shift_plus_leEq'; auto with arith. Qed.
Lemma
R_lt_irreflexive
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "He", "Hx", "R_lt", "ap_irreflexive_unfolded", "apply", "astepl", "irreflexive", "less_imp_ap", "less_leEq_trans", "plus_resp_less_lft", "shift_plus_leEq'" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_ap_irreflexive : irreflexive R_ap.
Proof. red in |- *; intros x Hx. elim (R_lt_irreflexive x). elim Hx; auto. Qed.
Lemma
R_ap_irreflexive
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "Hx", "R_ap", "R_lt_irreflexive", "irreflexive" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_ap_eq_tight : tight_apart R_eq R_ap.
Proof. split; auto. Qed.
Lemma
R_ap_eq_tight
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "R_ap", "R_eq", "split", "tight_apart" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_CSetoid : CSetoid.
Proof. apply Build_CSetoid with R_Set R_eq R_ap. split. exact R_ap_irreflexive. exact R_ap_symmetric. exact R_ap_cotrans. exact R_ap_eq_tight. Defined.
Definition
R_CSetoid
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "Build_CSetoid", "CSetoid", "R_Set", "R_ap", "R_ap_cotrans", "R_ap_eq_tight", "R_ap_irreflexive", "R_ap_symmetric", "R_eq", "apply", "split" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_plus (x y : R_CSetoid) : R_CSetoid
:= Build_CauchySeq _ _ (CS_seq_plus F _ _ (CS_proof _ x) (CS_proof _ y)).
Definition
R_plus
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "CS_seq_plus", "R_CSetoid" ]
** Group Structure The group structure is just the expected one; the lemmas which are specifically proved are just the necessary ones to get the group axioms.
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_zero
:= Build_CauchySeq _ _ (CS_seq_const F [0]).
Definition
R_zero
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "CS_seq_const" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_plus_lft_ext : forall x y z, R_plus x z [#] R_plus y z -> x [#] y.
Proof. intros x y z Hxy. elim Hxy; clear Hxy; intro H; [ left | right ]; elim H; intros N HN; elim HN; clear H HN; intros e He HN; exists N; exists e; auto; intros n Hn; simpl in HN. rstepr (CS_seq _ y n[+]CS_seq _ z n[-] (CS_seq _ x n[+]CS_seq _ z n)); auto. rstepr (CS_seq _ x n[+]CS_seq _ z n[-] (CS_seq _ y n...
Lemma
R_plus_lft_ext
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "He", "Hn", "R_plus" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_plus_assoc : associative R_plus.
Proof. intros x y z Hap. elim Hap; clear Hap; intro H; elim H; intros N HN; elim HN; clear H HN; intros e He HN; simpl in HN; apply (less_irreflexive_unfolded _ e). apply leEq_less_trans with (CS_seq _ x N[+]CS_seq _ y N[+]CS_seq _ z N[-] (CS_seq _ x N[+] (CS_seq _ y N[+]CS_seq _ z N))); auto. rstepl ([0]:...
Lemma
R_plus_assoc
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "Hap", "He", "R_plus", "apply", "associative", "leEq_less_trans", "less_irreflexive_unfolded" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_zero_lft_unit : forall x, R_plus R_zero x [=] x.
Proof. intro x; intro x_ap. apply (R_lt_irreflexive x). elim x_ap; clear x_ap; intro x_lt; elim x_lt; intros N H; elim H; clear x_lt H; intros e He HN; exists N; exists e; auto; simpl in HN; intros n Hn. astepr (CS_seq _ x n[-] ([0][+]CS_seq _ x n)); auto. astepr ([0][+]CS_seq _ x n[-]CS_seq _ x n); auto. Qed.
Lemma
R_zero_lft_unit
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "He", "Hn", "R_lt_irreflexive", "R_plus", "R_zero", "apply", "astepr" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_plus_comm : forall x y, R_plus x y [=] R_plus y x.
Proof. intros x y Hxy. elim Hxy; clear Hxy; intro H; elim H; intros N HN; elim HN; clear H HN; intros e He HN; simpl in HN; apply (less_irreflexive_unfolded _ e). apply leEq_less_trans with (CS_seq _ y N[+]CS_seq _ x N[-] (CS_seq _ x N[+]CS_seq _ y N)); auto. rstepl ([0]:F); auto. apply leEq_less_trans with (...
Lemma
R_plus_comm
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "He", "R_plus", "apply", "leEq_less_trans", "less_irreflexive_unfolded" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_inv (x : R_CSetoid) : R_CSetoid
:= Build_CauchySeq _ _ (CS_seq_inv F _ (CS_proof _ x)).
Definition
R_inv
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "CS_seq_inv", "R_CSetoid" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_inv_is_inv : forall x, R_plus x (R_inv x) [=] R_zero.
Proof. intro x; intro x_ap. apply (R_lt_irreflexive R_zero). elim x_ap; clear x_ap; intro x_lt; elim x_lt; intros N H; elim H; clear x_lt H; intros e He HN; exists N; exists e; auto; simpl in HN; intros n Hn. simpl in |- *; astepr ([0][-] (CS_seq _ x n[+][--] (CS_seq _ x n))); auto. simpl in |- *; astepr (CS_s...
Lemma
R_inv_is_inv
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "He", "Hn", "R_inv", "R_lt_irreflexive", "R_plus", "R_zero", "apply", "astepr" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
R_inv_ext : un_op_strext _ R_inv.
Proof. intros x y Hxy. elim Hxy; clear Hxy; intro x_lt; [ right | left ]; elim x_lt; intros N H; elim H; clear x_lt H; intros e He HN; exists N; exists e; auto; simpl in HN; intros n Hn. rstepr ([--] (CS_seq _ y n) [-][--] (CS_seq _ x n)); auto. rstepr ([--] (CS_seq _ x n) [-][--] (CS_seq _ y n)); auto. Qed.
Lemma
R_inv_ext
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "He", "Hn", "R_inv", "un_op_strext" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
Rinv : CSetoid_un_op R_CSetoid.
Proof. red in |- *. apply Build_CSetoid_un_op with R_inv. exact R_inv_ext. Defined.
Definition
Rinv
algebra
algebra/Cauchy_COF.v
[ "CoRN.algebra.COrdCauchy", "CoRN.tactics.RingReflection" ]
[ "Build_CSetoid_un_op", "CSetoid_un_op", "R_CSetoid", "R_inv", "R_inv_ext", "apply" ]
https://github.com/coq-community/corn
ada7c0b497ff15dd67cf7932c6f20e143a2aee2f
End of preview. Expand in Data Studio

Coq-Corn

Structured dataset from CoRN (Coq Repository at Nijmegen) — Constructive real analysis and algebra.

Source

Schema

Column Type Description
statement string Declaration signature/claim with the leading keyword removed (verbatim slice); the full declaration minus its proof
proof string Verbatim proof/body, empty if the declaration has none
type string Declaration keyword
symbolic_name string Declaration identifier
library string Sub-library
filename string Repository-relative source path
imports list[string] File-level Require/Import modules
deps list[string] Intra-corpus identifiers referenced
docstring string Preceding documentation comment, empty if absent
source_url string Upstream repository
commit string Upstream commit extracted

Statistics

  • Entries: 11,334
  • With proof: 10,900 (96.2%)
  • With docstring: 2,132 (18.8%)
  • Libraries: 40

By type

Type Count
Lemma 6,807
Definition 2,367
Instance 525
Let 408
Hypothesis 339
Notation 267
Fixpoint 187
Ltac 89
Record 87
Theorem 62
Canonical 59
Class 55
Inductive 33
Coercion 19
Hypotheses 10
Example 9
Structure 2
Axiom 2
Parameter 2
Variant 2
CoFixpoint 2
Remark 1

Example

Bernstein_inv2 : forall n (H:S n <= S n),
 Bernstein H[=]_X_[*](Bernstein (le_S_n _ _ H)).
Proof.
 intros n H.
 simpl (Bernstein H).
 destruct (le_lt_eq_dec _ _ H).
  exfalso; lia.
 replace (proj1 (Nat.lt_succ_r n n) H) with (le_S_n n n H) by apply le_irrelevent.
 reflexivity.
Qed.
  • type: Lemma | symbolic_name: Bernstein_inv2 | algebra/Bernstein.v

Use

Each declaration is split into a statement (signature/claim) and a proof (body) that are disjoint and together form the complete declaration, for proof modeling, autoformalization, retrieval, and dependency analysis via deps.

Citation

@misc{coq_corn_dataset,
  title  = {Coq-Corn},
  author = {Norton, Charles},
  year   = {2026},
  note   = {Extracted from https://github.com/coq-community/corn, commit ada7c0b497ff},
  url    = {https://huggingface.co/datasets/phanerozoic/Coq-Corn}
}
Downloads last month
72

Collection including phanerozoic/Coq-Corn