fact
stringlengths
0
6.66k
type
stringclasses
10 values
imports
stringclasses
399 values
filename
stringclasses
465 values
symbolic_name
stringlengths
1
75
index_level
int64
0
7.85k
{R : Ring} (x : R) `{IsInvertible R x} : R := left_inverse_elem x.
Definition
Require Import WildCat. Require Import Spaces.Nat.Core Spaces.Nat.Arithmetic. Require Import Classes.interfaces.abstract_algebra. Require Import Algebra.Groups.Group Algebra.Groups.Subgroup. Require Import Modalities.ReflectiveSubuniverse.
Algebra\Rings\Ring.v
inverse_elem
1,300
{R : Ring} (x : R) `{IsInvertible R x} : inverse_elem x * x = 1. Proof. apply left_inverse_eq. Defined.
Definition
Require Import WildCat. Require Import Spaces.Nat.Core Spaces.Nat.Arithmetic. Require Import Classes.interfaces.abstract_algebra. Require Import Algebra.Groups.Group Algebra.Groups.Subgroup. Require Import Modalities.ReflectiveSubuniverse.
Algebra\Rings\Ring.v
rng_inv_l
1,301
{R : Ring} (x : R) `{IsInvertible R x} : x * inverse_elem x = 1. Proof. rhs_V nrapply (right_inverse_eq x). f_ap. apply path_left_inverse_elem_right_inverse_elem. Defined.
Definition
Require Import WildCat. Require Import Spaces.Nat.Core Spaces.Nat.Arithmetic. Require Import Classes.interfaces.abstract_algebra. Require Import Algebra.Groups.Group Algebra.Groups.Subgroup. Require Import Modalities.ReflectiveSubuniverse.
Algebra\Rings\Ring.v
rng_inv_r
1,302
{R : Ring} (x y : R) `{IsInvertible R x} `{IsInvertible R y} (p : x = y) : inverse_elem x = inverse_elem y. Proof. destruct p. snrapply (path_left_right_inverse x). - apply rng_inv_l. - apply rng_inv_r. Defined.
Definition
Require Import WildCat. Require Import Spaces.Nat.Core Spaces.Nat.Arithmetic. Require Import Classes.interfaces.abstract_algebra. Require Import Algebra.Groups.Group Algebra.Groups.Subgroup. Require Import Modalities.ReflectiveSubuniverse.
Algebra\Rings\Ring.v
isinvertible_unique
1,303
{R : Ring} (x : R) : {inv : R & prod (inv * x = 1) (x * inv = 1)} <~> IsInvertible R x. Proof. equiv_via { i : IsInvertible R x & right_inverse_elem x = left_inverse_elem x }. 1: make_equiv_contr_basedpaths. apply equiv_sigma_contr; intro i. rapply contr_inhabited_hprop. symmetry; apply path_left_inverse_elem_right_inverse_elem. Defined.
Definition
Require Import WildCat. Require Import Spaces.Nat.Core Spaces.Nat.Arithmetic. Require Import Classes.interfaces.abstract_algebra. Require Import Algebra.Groups.Group Algebra.Groups.Subgroup. Require Import Modalities.ReflectiveSubuniverse.
Algebra\Rings\Ring.v
equiv_isinvertible_left_right_inverse
1,304
{R : Ring} {x y : R} `{IsInvertible R x, IsInvertible R y} : x = y <~> inverse_elem x = inverse_elem y. Proof. srapply equiv_iff_hprop. - exact (isinvertible_unique x y). - exact (isinvertible_unique (inverse_elem x) (inverse_elem y)). Defined.
Definition
Require Import WildCat. Require Import Spaces.Nat.Core Spaces.Nat.Arithmetic. Require Import Classes.interfaces.abstract_algebra. Require Import Algebra.Groups.Group Algebra.Groups.Subgroup. Require Import Modalities.ReflectiveSubuniverse.
Algebra\Rings\Ring.v
equiv_path_inverse_elem
1,305
(R : Ring) : Group. Proof. snrapply Build_Group. - exact {x : R & IsInvertible R x}. - intros [x p] [y q]. exists (x * y). exact _. - exists 1. exact _. - intros [x p]. exists (inverse_elem x). exact _. - repeat split. 1: exact _. 1-5: hnf; intros; apply path_sigma_hprop. + rapply simple_associativity. + rapply left_identity. + rapply right_identity. + apply rng_inv_l. + apply rng_inv_r. Defined.
Definition
Require Import WildCat. Require Import Spaces.Nat.Core Spaces.Nat.Arithmetic. Require Import Classes.interfaces.abstract_algebra. Require Import Algebra.Groups.Group Algebra.Groups.Subgroup. Require Import Modalities.ReflectiveSubuniverse.
Algebra\Rings\Ring.v
rng_unit_group
1,306
{R : Ring} {x y z : R} `{IsInvertible R y} : y * x = z <~> x = inverse_elem y * z := equiv_moveL_equiv_V (f := (y *.
Definition
Require Import WildCat. Require Import Spaces.Nat.Core Spaces.Nat.Arithmetic. Require Import Classes.interfaces.abstract_algebra. Require Import Algebra.Groups.Group Algebra.Groups.Subgroup. Require Import Modalities.ReflectiveSubuniverse.
Algebra\Rings\Ring.v
rng_inv_moveL_Vr
1,307
{R : Ring} {x y z : R} `{IsInvertible R y} : x * y = z <~> x = z * inverse_elem y := equiv_moveL_equiv_V (f := (.
Definition
Require Import WildCat. Require Import Spaces.Nat.Core Spaces.Nat.Arithmetic. Require Import Classes.interfaces.abstract_algebra. Require Import Algebra.Groups.Group Algebra.Groups.Subgroup. Require Import Modalities.ReflectiveSubuniverse.
Algebra\Rings\Ring.v
rng_inv_moveL_rV
1,308
{R : Ring} {x y z : R} `{IsInvertible R y} : x = y * z <~> inverse_elem y * x = z := equiv_moveR_equiv_V (f := (y *.
Definition
Require Import WildCat. Require Import Spaces.Nat.Core Spaces.Nat.Arithmetic. Require Import Classes.interfaces.abstract_algebra. Require Import Algebra.Groups.Group Algebra.Groups.Subgroup. Require Import Modalities.ReflectiveSubuniverse.
Algebra\Rings\Ring.v
rng_inv_moveR_Vr
1,309
{R : Ring} {x y z : R} `{IsInvertible R y} : x = z * y <~> x * inverse_elem y = z := equiv_moveR_equiv_V (f := (.
Definition
Require Import WildCat. Require Import Spaces.Nat.Core Spaces.Nat.Arithmetic. Require Import Classes.interfaces.abstract_algebra. Require Import Algebra.Groups.Group Algebra.Groups.Subgroup. Require Import Modalities.ReflectiveSubuniverse.
Algebra\Rings\Ring.v
rng_inv_moveR_rV
1,310
Vector@{i|} (A : Type@{i}) (n : nat) : Type@{i} := { l : list A & length l = n }.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
Vector@
1,311
(A : Type) (n : nat) (f : forall (i : nat), (i < n)%nat -> A) : Vector A n. Proof. exists (list_map (fun '(i; Hi) => f i Hi) (seq' n)). lhs nrapply length_list_map. apply length_seq'. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
Build_Vector
1,312
{A : Type} {n : nat} (v : Vector A n) i {Hi : (i < n)%nat} : A := nth' (pr1 v) i ((pr2 v)^ # Hi).
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
entry
1,313
{A : Type} {n} (f : forall (i : nat), (i < n)%nat -> A) i {Hi : (i < n)%nat} : entry (Build_Vector A n f) i = f i Hi. Proof. snrefine (nth'_list_map _ _ _ (_^ # Hi) _ @ _). 1: nrapply length_seq'. snrapply ap011D. 1: nrapply nth'_seq'. rapply path_ishprop. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
entry_Build_Vector
1,314
path_vector@{i} (A : Type@{i}) {n : nat} (v1 v2 : Vector@{i} A n) (H : forall i (H : (i < n)%nat), entry v1 i = entry v2 i) : v1 = v2. Proof. rapply path_sigma_hprop@{i i i}. snrapply path_list_nth'. 1: exact (pr2 v1 @ (pr2 v2)^). intros i Hi. snrefine (_ @ H i (pr2 v1 # Hi) @ _). 1, 2: apply nth'_nth'. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
path_vector@
1,315
{A : Type} {n : nat} (v : Vector A n) (i j : nat) (Hi : (i < n)%nat) (Hj : (j < n)%nat) (p : i = j) : entry v i = entry v j. Proof. destruct p. apply nth'_nth'. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
path_entry_vector
1,316
{A B : Type} {n} (f : A -> B) : Vector A n -> Vector B n := fun v => Build_Vector B n (fun i _ => f (entry v i)).
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
vector_map
1,317
{A B C : Type} {n} (f : A -> B -> C) : Vector A n -> Vector B n -> Vector C n := fun v1 v2 => Build_Vector C n (fun i _ => f (entry v1 i) (entry v2 i)).
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
vector_map2
1,318
Plus (Vector A n) := vector_map2 (+).
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
vector_plus
1,319
Zero (Vector A n) := Build_Vector A n (fun _ _ => 0).
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
vector_zero
1,320
Negate (Vector A n) := vector_map (-).
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
vector_neg
1,321
Associative vector_plus. Proof. intros v1 v2 v3; apply path_vector; intros i Hi. rewrite 4 entry_Build_Vector. apply associativity. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
associative_vector_plus
1,322
Commutative vector_plus. Proof. intros v1 v2; apply path_vector; intros i Hi. rewrite 2 entry_Build_Vector. apply commutativity. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
commutative_vector_plus
1,323
LeftIdentity vector_plus vector_zero. Proof. intros v; apply path_vector; intros i Hi. rewrite 2 entry_Build_Vector. apply left_identity. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
left_identity_vector_plus
1,324
RightIdentity vector_plus vector_zero. Proof. intros v; apply path_vector; intros i Hi. rewrite 2 entry_Build_Vector. apply right_identity. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
right_identity_vector_plus
1,325
LeftInverse vector_plus vector_neg vector_zero. Proof. intros v; apply path_vector; intros i Hi. rewrite 3 entry_Build_Vector. apply left_inverse. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
left_inverse_vector_plus
1,326
RightInverse vector_plus vector_neg vector_zero. Proof. intros v; apply path_vector; intros i Hi. rewrite 3 entry_Build_Vector. apply right_inverse. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
right_inverse_vector_plus
1,327
AbGroup. Proof. snrapply Build_AbGroup. 1: snrapply Build_Group. 5: repeat split. - exact (Vector A n). - exact vector_plus. - exact vector_zero. - exact vector_neg. - exact _. - exact associative_vector_plus. - exact left_identity_vector_plus. - exact right_identity_vector_plus. - exact left_inverse_vector_plus. - exact right_inverse_vector_plus. - exact commutative_vector_plus. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
abgroup_vector
1,328
(r : R) : Vector M n -> Vector M n := vector_map (lact r).
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
vector_lact
1,329
LeftHeteroDistribute vector_lact vector_plus vector_plus. Proof. intros r v1 v2; apply path_vector; intros i Hi. rewrite 5 entry_Build_Vector. apply distribute_l. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
left_heterodistribute_vector_lact_plus
1,330
RightHeteroDistribute vector_lact (+) vector_plus. Proof. intros r1 r2 v; apply path_vector; intros i Hi. rewrite 4 entry_Build_Vector. apply distribute_r. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
right_heterodistribute_vector_lact_plus
1,331
HeteroAssociative vector_lact vector_lact vector_lact (.*.). Proof. intros r s v; apply path_vector; intros i Hi. rewrite 3 entry_Build_Vector. apply associativity. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
heteroassociative_vector_lact_plus
1,332
LeftIdentity vector_lact 1. Proof. intros v; apply path_vector; intros i Hi. rewrite entry_Build_Vector. apply left_identity. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
left_identity_vector_lact
1,333
IsLeftModule R (abgroup_vector M n). Proof. snrapply Build_IsLeftModule. - exact vector_lact. - exact left_heterodistribute_vector_lact_plus. - exact right_heterodistribute_vector_lact_plus. - exact heteroassociative_vector_lact_plus. - exact left_identity_vector_lact. Defined.
Definition
Require Import Basics.Overture Basics.Trunc Basics.Tactics Basics.PathGroupoids. Require Import Types.Sigma. Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring Algebra.Rings.Module. Require Import Spaces.Nat.Core. Require Import Spaces.List.Core Spaces.List.Theory Spaces.List.Paths. Require Import abstract_algebra.
Algebra\Rings\Vector.v
isleftmodule_isleftmodule_vector
1,334
CRing. Proof. snrapply Build_CRing'. - exact abgroup_Z. - exact 1%int. - exact int_mul. - exact int_mul_comm. - exact int_mul_assoc. - exact int_dist_l. - exact int_mul_1_l. Defined.
Definition
Require Import Classes.interfaces.canonical_names. Require Import Algebra.AbGroups. Require Import Algebra.Rings.CRing. Require Import Spaces.Int Spaces.Pos. Require Import WildCat.Core.
Algebra\Rings\Z.v
cring_Z
1,335
(R : Ring) := grp_pow_homo : R -> Int -> R.
Definition
Require Import Classes.interfaces.canonical_names. Require Import Algebra.AbGroups. Require Import Algebra.Rings.CRing. Require Import Spaces.Int Spaces.Pos. Require Import WildCat.Core.
Algebra\Rings\Z.v
rng_int_mult
1,336
{R : Ring} (r : R) (n : cring_Z) : rng_int_mult R r n = (rng_int_mult R 1 n) * r. Proof. cbn. rhs nrapply (grp_pow_natural (grp_homo_rng_right_mult r)); cbn. by rewrite rng_mult_one_l. Defined.
Definition
Require Import Classes.interfaces.canonical_names. Require Import Algebra.AbGroups. Require Import Algebra.Rings.CRing. Require Import Spaces.Int Spaces.Pos. Require Import WildCat.Core.
Algebra\Rings\Z.v
rng_int_mult_dist_r
1,337
{R : Ring} (r : R) (n : cring_Z) : rng_int_mult R r n = r * (rng_int_mult R 1 n). Proof. cbn. rhs nrapply (grp_pow_natural (grp_homo_rng_left_mult r)); cbn. by rewrite rng_mult_one_r. Defined.
Definition
Require Import Classes.interfaces.canonical_names. Require Import Algebra.AbGroups. Require Import Algebra.Rings.CRing. Require Import Spaces.Int Spaces.Pos. Require Import WildCat.Core.
Algebra\Rings\Z.v
rng_int_mult_dist_l
1,338
(R : Ring) : (cring_Z : Ring) $-> R. Proof. snrapply Build_RingHomomorphism. 1: exact (rng_int_mult R 1). repeat split. 1,2: exact _. apply rng_plus_zero_r. Defined.
Definition
Require Import Classes.interfaces.canonical_names. Require Import Algebra.AbGroups. Require Import Algebra.Rings.CRing. Require Import Spaces.Int Spaces.Pos. Require Import WildCat.Core.
Algebra\Rings\Z.v
rng_homo_int
1,339
{Sort : Type} := Build_SymbolTypeOf
Record
Require Import
Algebra\Universal\Algebra.v
SymbolTypeOf
1,340
Build_Signature
Record
Require Import
Algebra\Universal\Algebra.v
Signature
1,341
{σ} (A : Carriers σ) (w : SymbolType σ) : Type := DomOperation A w -> A (sort_cod w).
Definition
Require Import
Algebra\Universal\Algebra.v
Operation
1,342
{σ : Signature} : Type := Build_Algebra
Record
Require Import
Algebra\Universal\Algebra.v
Algebra
1,343
(σ : Signature) : Type := {c : Carriers σ | { _ : forall (u : Symbol σ), Operation c (σ u) | forall (s : Sort σ), IsHSet (c s) } }.
Definition
Require Import
Algebra\Universal\Algebra.v
SigAlgebra
1,344
(σ : Signature) : SigAlgebra σ <~> Algebra σ. Proof. issig. Defined.
Lemma
Require Import
Algebra\Universal\Algebra.v
issig_algebra
1,345
`{Funext} {σ : Signature} (A B : Algebra σ) (p : carriers A = carriers B) (q : transport (fun i => forall u, Operation i (σ u)) p (operations A) = operations B) : A = B. Proof. apply (ap (issig_algebra σ)^-1)^-1; cbn. apply (path_sigma' _ p). refine (transport_sigma p _ @ _). apply path_sigma_hprop. exact q. Defined.
Lemma
Require Import
Algebra\Universal\Algebra.v
path_algebra
1,346
`{Funext} {σ} (A B : Algebra σ) (p : carriers A = carriers B) (q : transport (fun i => forall u, Operation i (σ u)) p (operations A) = operations B) : ap carriers (path_algebra A B p q) = p. Proof. destruct A as [A a ha], B as [B b hb]; cbn in p, q. destruct p, q. unfold path_algebra, path_sigma_hprop, path_sigma_uncurried. cbn -[center]. by destruct (center (ha = hb)). Defined.
Lemma
Require Import
Algebra\Universal\Algebra.v
path_ap_carriers_path_algebra
1,347
{σ : Signature} {A B : Algebra σ} (p q : A = B) (r : ap (issig_algebra σ)^-1 p = ap (issig_algebra σ)^-1 q) : p = q. Proof. set (e := (equiv_ap (issig_algebra σ)^-1 A B)). by apply (@equiv_inv _ _ (ap e) (Equivalences.isequiv_ap _ _)). Defined.
Lemma
Require Import
Algebra\Universal\Algebra.v
path_path_algebra_issig
1,348
`{Funext} {σ} {A B : Algebra σ} (p q : A = B) (r : ap carriers p = ap carriers q) : p = q. Proof. apply path_path_algebra_issig. unshelve eapply path_path_sigma. - transitivity (ap carriers p); [by destruct p |]. transitivity (ap carriers q); [exact r | by destruct q]. - apply path_ishprop. Defined.
Lemma
Require Import
Algebra\Universal\Algebra.v
path_path_algebra
1,349
{w : SymbolType σ} (f : Operation A w) : Type := forall (a b : DomOperation A w), (forall i : Arity w, Φ (sorts_dom w i) (a i) (b i)) -> Φ (sort_cod w) (f a) (f b). Class OpsCompatible : Type := ops_compatible : forall (u : Symbol σ), u.#A. Global Instance trunc_ops_compatible `{Funext} {n : trunc_index} `{!forall s x y, IsTrunc n (Φ s x y)} : IsTrunc n OpsCompatible. Proof. apply istrunc_forall. Defined.
Definition
Require Import
Algebra\Universal\Congruence.v
OpCompatible
1,350
{σ : Signature} {A B : Algebra σ} (Φ : forall s, Relation (A s)) `{!IsCongruence A Φ} (f : forall s, A s -> B s) `{!IsHomomorphism f} : Type := forall s (x y : A s), Φ s x y -> f s x = f s y.
Definition
Require Import
Algebra\Universal\Congruence.v
HomCompatible
1,351
{w : SymbolType σ} (α : Operation A w) (β : Operation B w) : Type := forall a : DomOperation A w, f (sort_cod w) (α a) = β (fun i => f (sorts_dom w i) (a i)). Global Instance hprop_oppreserving `{Funext} {w : SymbolType σ} (α : Operation A w) (β : Operation B w) : IsHProp ( α β). Proof. apply istrunc_forall. Qed.
Definition
Require Import
Algebra\Universal\Homomorphism.v
OpPreserving
1,352
{σ} {A B : Algebra σ} : Type := Build_Homomorphism
Record
Require Import
Algebra\Universal\Homomorphism.v
Homomorphism
1,353
{σ} {A B : Algebra σ} {f g : A $-> B} : f = g -> forall s, f s == g s. Proof. intro p. by destruct p. Defined.
Lemma
Require Import
Algebra\Universal\Homomorphism.v
apD10_homomorphism
1,354
{σ} (A B : Algebra σ) : Type := { def_hom : forall s, A s -> B s | IsHomomorphism def_hom }.
Definition
Require Import
Algebra\Universal\Homomorphism.v
SigHomomorphism
1,355
{σ} (A B : Algebra σ) : SigHomomorphism A B <~> (A $-> B). Proof. issig. Defined.
Lemma
Require Import
Algebra\Universal\Homomorphism.v
issig_homomorphism
1,356
`{Funext} {σ} {A B : Algebra σ} (f g : A $-> B) (p : def_homomorphism f = def_homomorphism g) : f = g. Proof. apply (ap (issig_homomorphism A B)^-1)^-1. unfold issig_homomorphism; cbn. apply path_sigma_hprop. exact p. Defined.
Lemma
Require Import
Algebra\Universal\Homomorphism.v
path_homomorphism
1,357
A $-> A := Build_Homomorphism (fun s (x : A s) => x). End . Arguments {σ} A%_Algebra_scope , {σ} {A}. Section homomorphism_compose. Context {σ} {A B C : Algebra σ}. Global Instance is_homomorphism_compose (g : forall s, B s -> C s) `{!IsHomomorphism g} (f : forall s, A s -> B s) `{!IsHomomorphism f} : IsHomomorphism (fun s => g s o f s). Proof. intros u a. by rewrite <- (oppreserving_hom g), (oppreserving_hom f). Qed.
Definition
Require Import
Algebra\Universal\Homomorphism.v
homomorphism_id
1,358
(g : B $-> C) (f : A $-> B) : A $-> C := Build_Homomorphism (fun s => g s o f s).
Definition
Require Import
Algebra\Universal\Homomorphism.v
homomorphism_compose
1,359
`{Funext} {σ} {A B C D : Algebra σ} (h : C $-> D) (g : B $-> C) (f : A $-> B) : (h $o g) $o f = h $o (g $o f). Proof. by apply path_homomorphism. Defined.
Lemma
Require Import
Algebra\Universal\Homomorphism.v
assoc_homomorphism_compose
1,360
`{Funext} {σ} {A B : Algebra σ} (f : A $-> B) : Id B $o f = f. Proof. by apply path_homomorphism. Defined.
Lemma
Require Import
Algebra\Universal\Homomorphism.v
left_id_homomorphism_compose
1,361
`{Funext} {σ} {A B : Algebra σ} (f : A $-> B) : f $o Id A = f. Proof. by apply path_homomorphism. Defined.
Lemma
Require Import
Algebra\Universal\Homomorphism.v
right_id_homomorphism_compose
1,362
{σ} (A : Carriers σ) {n : nat} (ss : FinSeq n.
Definition
Require Import
Algebra\Universal\Operation.v
cons_dom
1,363
{σ} (A : Carriers σ) (ss : FinSeq 0 (Sort σ)) : forall i : Fin 0, A (ss i) := Empty_ind (A o ss).
Definition
Require Import
Algebra\Universal\Operation.v
nil_dom
1,364
{σ : Signature} (A : Carriers σ) {n : nat} (ss : FinSeq n (Sort σ)) (t : Sort σ) : Type := Operation A {| Arity := Fin n; sorts_dom := ss; sort_cod := t |}.
Definition
Require Import
Algebra\Universal\Operation.v
FiniteOperation
1,365
{σ} (A : Carriers σ) {n : nat} : (FinSeq n (Sort σ)) -> Sort σ -> Type := match n with | 0 => fun ss t => A t | n'.
Fixpoint
Require Import
Algebra\Universal\Operation.v
CurriedOperation
1,366
{σ} (A : Carriers σ) {n : nat} : forall (ss : FinSeq n (Sort σ)) (t : Sort σ), CurriedOperation A ss t -> FiniteOperation A ss t := match n with | 0 => fun ss t op _ => op | n'.+1 => fun ss t op a => A (fstail ss) t (op (a fin_zero)) (a o fsucc) end. Local Example computation_example_operation_uncurry : forall (σ : Signature) (A : Carriers σ) (n : nat) (s1 s2 t : Sort σ) (ss := (fscons s1 (fscons s2 fsnil))) (op : CurriedOperation A ss t) (a : forall i, A (ss i)), A ss t op = fun a => op (a fin_zero) (a (fsucc fin_zero)). Proof. reflexivity. Qed.
Fixpoint
Require Import
Algebra\Universal\Operation.v
operation_uncurry
1,367
{σ} (A : Carriers σ) {n : nat} : forall (ss : FinSeq n (Sort σ)) (t : Sort σ), FiniteOperation A ss t -> CurriedOperation A ss t := match n with | 0 => fun ss t op => op (Empty_ind _) | n'.+1 => fun ss t op x => A (fstail ss) t (op o cons_dom A ss x) end. Local Example computation_example_operation_curry : forall (σ : Signature) (A : Carriers σ) (n : nat) (s1 s2 t : Sort σ) (ss := (fscons s1 (fscons s2 fsnil))) (op : FiniteOperation A ss t) (x1 : A s1) (x2 : A s2), A ss t op = fun x1 x2 => op (cons_dom A ss x1 (cons_dom A _ x2 (nil_dom A _))). Proof. reflexivity. Qed.
Fixpoint
Require Import
Algebra\Universal\Operation.v
operation_curry
1,368
expand_cons_dom' {σ} (A : Carriers σ) (n : nat) : forall (i : Fin n) (ss : FinSeq n (Sort σ)) (N : n > 0) (a : forall i, A (ss i)), cons_dom' A i ss N (head_dom' A n N ss a) (tail_dom' A n ss a) = a i. Proof. intro i. induction i using fin_ind; intros ss N a. - unfold cons_dom'. rewrite fin_ind_beta_zero. reflexivity. - unfold cons_dom'. by rewrite fin_ind_beta_fsucc. Qed.
Lemma
Require Import
Algebra\Universal\Operation.v
expand_cons_dom'
1,369
`{Funext} {σ} (A : Carriers σ) {n : nat} (ss : FinSeq n.+1 (Sort σ)) (a : forall i, A (ss i)) : cons_dom A ss (head_dom A ss a) (tail_dom A ss a) = a. Proof. funext i. apply '. Defined.
Lemma
Require Import
Algebra\Universal\Operation.v
expand_cons_dom
1,370
`{Funext} {σ} (A : Carriers σ) {n : nat} (ss : FinSeq n (Sort σ)) (t : Sort σ) : operation_uncurry A ss t o operation_curry A ss t == idmap. Proof. intro a. induction n as [| n IHn]. - funext d. refine (ap a _). apply path_contr. - funext a'. refine (ap (fun x => x _) (IHn _ _) @ _). refine (ap a _). apply expand_cons_dom. Qed.
Lemma
Require Import
Algebra\Universal\Operation.v
path_operation_curry_to_cunurry
1,371
`{Funext} {σ} (A : Carriers σ) {n : nat} (ss : FinSeq n (Sort σ)) (t : Sort σ) : operation_curry A ss t o operation_uncurry A ss t == idmap. Proof. intro a. induction n; [reflexivity|]. funext x. refine (_ @ IHn (fstail ss) (a x)). refine (ap (operation_curry A (fstail ss) t) _). funext a'. simpl. unfold cons_dom, cons_dom'. rewrite fin_ind_beta_zero. refine (ap (operation_uncurry A (fstail ss) t (a x)) _). funext i'. by rewrite fin_ind_beta_fsucc. Qed.
Lemma
Require Import
Algebra\Universal\Operation.v
path_operation_uncurry_to_curry
1,372
`{Funext} {σ} (A : Carriers σ) {n : nat} (ss : FinSeq n (Sort σ)) (t : Sort σ) : FiniteOperation A ss t <~> CurriedOperation A ss t := Build_Equiv _ _ (operation_curry A ss t) _.
Definition
Require Import
Algebra\Universal\Operation.v
equiv_operation_curry
1,373
{σ} (C : Carriers σ) : Carriers σ := | var_term_algebra : forall s, C s -> C s | ops_term_algebra : forall (u : Symbol σ), DomOperation ( C) (σ u) -> C (sort_cod (σ u)).
Inductive
Require Import
Algebra\Universal\TermAlgebra.v
CarriersTermAlgebra
1,374
{σ} := @CarriersTermAlgebra_ind σ.
Definition
Require Import
Algebra\Universal\TermAlgebra.v
CarriersTermAlgebra_rect
1,375
{σ : Signature} (C : Carriers σ) (P : Sort σ -> Type) (vs : forall (s : Sort σ), C s -> P s) (os : forall (u : Symbol σ) (c : DomOperation (CarriersTermAlgebra C) (σ u)), (forall i : Arity (σ u), P (sorts_dom (σ u) i)) -> P (sort_cod (σ u))) (s : Sort σ) (T : CarriersTermAlgebra C s) : P s := CarriersTermAlgebra_ind C (fun s _ => P s) vs os s T.
Definition
Require Import
Algebra\Universal\TermAlgebra.v
CarriersTermAlgebra_rec
1,376
{σ : Signature} {C : Carriers σ} (R : forall s, Relation (C s)) {s1 s2 : Sort σ} (S : CarriersTermAlgebra C s1) (T : CarriersTermAlgebra C s2) : Type := match S, T with | var_term_algebra s1 x, var_term_algebra s2 y => {p : s1 = s2 | R s2 (p # x) y} | ops_term_algebra u1 a, ops_term_algebra u2 b => { p : u1 = u2 | forall i : Arity (σ u1), R (a i) (b (transport (fun v => Arity (σ v)) p i))} | _, _ => Empty end.
Fixpoint
Require Import
Algebra\Universal\TermAlgebra.v
ExtendDRelTermAlgebra
1,377
{σ : Signature} {C : Carriers σ} (R : forall s, Relation (C s)) {s : Sort σ} : CarriersTermAlgebra C s -> CarriersTermAlgebra C s -> Type := ExtendDRelTermAlgebra R. Section extend_rel_term_algebra. Context `{Funext} {σ : Signature} {C : Carriers σ} (R : forall s, Relation (C s)) `{!forall s, is_mere_relation (C s) (R s)}. Global Instance hprop_extend_drel_term_algebra {s1 s2 : Sort σ} (S : CarriersTermAlgebra C s1) (T : CarriersTermAlgebra C s2) : IsHProp (ExtendDRelTermAlgebra R S T). Proof. generalize dependent s2. induction S; intros s2 T; destruct T; exact _. Qed.
Definition
Require Import
Algebra\Universal\TermAlgebra.v
ExtendRelTermAlgebra
1,378
`{!forall s, Symmetric (R s)} {s1 s2 : Sort σ} (S : CarriersTermAlgebra C s1) (T : CarriersTermAlgebra C s2) (h : ExtendDRelTermAlgebra R S T) : ExtendDRelTermAlgebra R T S. Proof. generalize dependent s2. induction S as [| u c h]; intros s2 [] p. - destruct p as [p1 p2]. induction p1. exists idpath. by symmetry. - elim p. - elim p. - destruct p as [p f]. induction p. exists idpath. intro i. apply h. apply f. Qed.
Lemma
Require Import
Algebra\Universal\TermAlgebra.v
symmetric_extend_drel_term_algebra
1,379
`{!forall s, Transitive (R s)} {s1 s2 s3 : Sort σ} (S : CarriersTermAlgebra C s1) (T : CarriersTermAlgebra C s2) (U : CarriersTermAlgebra C s3) (h1 : ExtendDRelTermAlgebra R S T) (h2 : ExtendDRelTermAlgebra R T U) : ExtendDRelTermAlgebra R S U. Proof. generalize dependent s3. generalize dependent s2. induction S as [| u c h]; intros s2 [? d | ? d] h2 s3 [] h3; destruct h2 as [p2 P2], h3 as [p3 P3] || by (elim h2 || elim h3). - exists (p2 @ p3). rewrite transport_pp. induction p2, p3. by transitivity d. - exists (p2 @ p3). intro i. induction p2. apply (h i _ (d i)). + apply P2. + rewrite concat_1p. apply P3. Qed.
Lemma
Require Import
Algebra\Universal\TermAlgebra.v
transitive_extend_drel_term_algebra
1,380
{s : Sort σ} (S : CarriersTermAlgebra C s) (T : CarriersTermAlgebra C s) : Type := ExtendRelTermAlgebra (fun s => paths) S T. Global Instance reflexive_extend_path_term_algebra : forall s : Sort σ, Reflexive (@ s). Proof. by apply reflexive_extend_rel_term_algebra. Defined.
Definition
Require Import
Algebra\Universal\TermAlgebra.v
ExtendPathTermAlgebra
1,381
{s : Sort σ} {S T : CarriersTermAlgebra C s} (p : S = T) : ExtendPathTermAlgebra S T. Proof. induction p. apply reflexive_extend_path_term_algebra. Defined.
Lemma
Require Import
Algebra\Universal\TermAlgebra.v
reflexive_extend_path_term_algebra_path
1,382
{s1 s2 : Sort σ} (S : CarriersTermAlgebra C s1) (T : CarriersTermAlgebra C s2) (e : ExtendDRelTermAlgebra (fun s => paths) S T) : {p : s1 = s2 | p # S = T}. Proof. generalize dependent s2. induction S as [| u c h]; intros s2 [? d | ? d] e; solve [elim e] || destruct e as [p e]. - exists p. by induction p, e. - induction p. exists idpath. cbn. f_ap. funext a. destruct (h a _ (d a) (e a)) as [p q]. by induction (hset_path2 idpath p). Defined.
Lemma
Require Import
Algebra\Universal\TermAlgebra.v
dependent_path_extend_path_term_algebra
1,383
{s : Sort σ} (S T : CarriersTermAlgebra C s) (e : ExtendPathTermAlgebra S T) : S = T. Proof. destruct (dependent_path_extend_path_term_algebra S T e) as [p q]. by induction (hset_path2 idpath p). Defined.
Lemma
Require Import
Algebra\Universal\TermAlgebra.v
path_extend_path_term_algebra
1,384
{s : Sort σ} (S T : CarriersTermAlgebra C s) : ExtendPathTermAlgebra S T <~> (S = T) := equiv_iff_hprop (path_extend_path_term_algebra S T) reflexive_extend_path_term_algebra_path.
Definition
Require Import
Algebra\Universal\TermAlgebra.v
equiv_path_extend_path_term_algebra
1,385
`{Funext} {σ : Signature} (C : Carriers σ) `{!forall s, IsHSet (C s)} : Algebra σ := Build_Algebra (CarriersTermAlgebra C) (@ops_term_algebra _ C).
Definition
Require Import
Algebra\Universal\TermAlgebra.v
TermAlgebra
1,386
{σ} (C : Carriers σ) (s : Sort σ) (x y : C s) : var_term_algebra C s x = var_term_algebra C s y -> x = y. Proof. intro p. apply reflexive_extend_path_term_algebra_path in p. destruct p as [p1 p2]. by destruct (hset_path2 p1 idpath)^. Qed.
Lemma
Require Import
Algebra\Universal\TermAlgebra.v
isinj_var_term_algebra
1,387
`{Funext} {σ} (C : Carriers σ) (u : Symbol σ) (a b : DomOperation (CarriersTermAlgebra C) (σ u)) : ops_term_algebra C u a = ops_term_algebra C u b -> a = b. Proof. intro p. apply reflexive_extend_path_term_algebra_path in p. destruct p as [p1 p2]. destruct (hset_path2 p1 idpath)^. funext i. apply path_extend_path_term_algebra. apply p2. Qed.
Lemma
Require Import
Algebra\Universal\TermAlgebra.v
isinj_ops_term_algebra
1,388
{σ} {C : Carriers σ} (A : Algebra σ) (f : forall s, C s -> A s) (s : Sort σ) (T : CarriersTermAlgebra C s) : A s := CarriersTermAlgebra_rec C A f (fun u _ r => u.#A r) s T. Global Instance is_homomorphism_map_term_algebra : @IsHomomorphism σ (TermAlgebra C) A ( A f). Proof. intros u a. by refine (ap u.#A _). Qed.
Definition
Require Import
Algebra\Universal\TermAlgebra.v
map_term_algebra
1,389
TermAlgebra C $-> A := @Build_Homomorphism σ (TermAlgebra C) A (map_term_algebra A f) _.
Definition
Require Import
Algebra\Universal\TermAlgebra.v
hom_term_algebra
1,390
(f : TermAlgebra C $-> A) : forall s, C s -> A s := fun s x => f s (var_term_algebra C s x).
Definition
Require Import
Algebra\Universal\TermAlgebra.v
precomp_var_term_algebra
1,391
forall (f : TermAlgebra C $-> A), hom_term_algebra A (precomp_var_term_algebra f) = f. Proof. intro f. apply path_homomorphism. funext s T. induction T as [|u c h]. - reflexivity. - refine (_ @ (is_homomorphism f u c)^). refine (ap u.#A _). funext i. apply h. Defined.
Lemma
Require Import
Algebra\Universal\TermAlgebra.v
path_precomp_var_term_algebra_to_hom_term_algebra
1,392
forall (f : forall s, C s -> A s), precomp_var_term_algebra (hom_term_algebra A f) = f. Proof. intro f. by funext s a. Defined.
Lemma
Require Import
Algebra\Universal\TermAlgebra.v
path_hom_term_algebra_to_precomp_var_term_algebra
1,393
(TermAlgebra C $-> A) <~> (forall s, C s -> A s). Proof. exact (Build_Equiv _ _ precomp_var_term_algebra _). Defined.
Theorem
Require Import
Algebra\Universal\TermAlgebra.v
ump_term_algebra
1,394
Cast Q F := rationals_to_field Q F.
Instance
Require Import
Analysis\Locator.v
qinc
1,395
(x : F) := forall q r : Q, q < r -> (' q < x) + (x < ' r).
Definition
Require Import
Analysis\Locator.v
locator
1,396
locator' (x : F) :=
Record
Require Import
Analysis\Locator.v
locator'
1,397
{x : F} (l : locator' x) {q r : Q} : q < r -> DHProp := fun nu => Build_DHProp (Build_HProp (~ (locates_right l nu))) _.
Definition
Require Import
Analysis\Locator.v
locates_left
1,398
(x : F) : locator x. Proof. intros q r ltqr. case (LEM (' q < x)). - apply _. - exact inl. - intros notlt. apply inr. assert (ltqr' : ' q < ' r) by auto. exact (nlt_lt_trans notlt ltqr'). Qed.
Lemma
Require Import
Analysis\Locator.v
all_reals_locators
1,399