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
EQ <> GT. Proof. intros E. change ((fun r => match r with EQ => Unit | _ => Empty end) GT). rewrite <-E. split. Qed.
Lemma
Require Import HoTT.Classes.interfaces.canonical_names.
Classes\theory\additional_operations.v
EQ_GT
3,200
GT <> EQ. Proof. apply symmetric_neq, EQ_GT. Qed.
Lemma
Require Import HoTT.Classes.interfaces.canonical_names.
Classes\theory\additional_operations.v
GT_EQ
3,201
`{Compare A} : forall a b : A, a =? b = true -> a ?= b = EQ. Proof. unfold eqb,compare_eqb;simpl. intros a b. destruct (a ?= b);trivial;intros E;destruct (false_ne_true E). Qed.
Lemma
Require Import HoTT.Classes.interfaces.canonical_names.
Classes\theory\additional_operations.v
compare_eqb_eq
3,202
`{Trichotomy A R} : forall a b : A, compare a b = EQ -> a = b. Proof. unfold compare,tricho_compare. intros a b;destruct (trichotomy R a b) as [E|[E|E]];auto. - intros E1;destruct (LT_EQ E1). - intros E1;destruct (GT_EQ E1). Qed.
Lemma
Require Import HoTT.Classes.interfaces.canonical_names.
Classes\theory\additional_operations.v
tricho_compare_eq
3,203
`{Trichotomy A R} `{Irreflexive A R} : forall a b : A, compare a b = EQ <-> a = b. Proof. unfold compare,tricho_compare. intros a b;destruct (trichotomy R a b) as [E1|[E1|E1]];split;auto. - intros E2;destruct (LT_EQ E2). - intros E2;rewrite E2 in E1. destruct (irreflexivity R _ E1). - intros E2;destruct (GT_EQ E2). - intros E2;rewrite E2 in E1. destruct (irreflexivity R _ E1). Qed.
Lemma
Require Import HoTT.Classes.interfaces.canonical_names.
Classes\theory\additional_operations.v
tricho_compare_ok
3,204
`{Abs A} `{!TotalRelation le} : forall x : A, (0 <= x /\ abs x = x) |_| (x <= 0 /\ abs x = - x). Proof. intros x. destruct (total le 0 x) as [E|E]. - left. split;trivial. apply ((abs_sig x).2);trivial. - right. split;trivial. apply ((abs_sig x).2);trivial. Qed.
Lemma
Require Import HoTT.Classes.interfaces.canonical_names.
Classes\theory\additional_operations.v
total_abs_either
3,205
x y : PropHolds (x β‰Ά y) -> PropHolds (x <> y). Proof. unfold PropHolds. intros ap e;revert ap. apply tight_apart. assumption. Qed.
Lemma
Require Import HoTT.Classes.interfaces.abstract_algebra.
Classes\theory\apartness.v
apart_ne
3,206
`{IsApart B} `{Apart A} `{IsHSet A} `{is_mere_relation A apart} (f: A -> B) (eq_correct : forall x y, x = y <-> f x = f y) (apart_correct : forall x y, x β‰Ά y <-> f x β‰Ά f y) : IsApart A. Proof. split. - apply _. - apply _. - intros x y ap. apply apart_correct, symmetry, apart_correct. assumption. - intros x y ap z. apply apart_correct in ap. apply (merely_destruct (cotransitive ap (f z))). intros [?|?];apply tr;[left|right];apply apart_correct;assumption. - intros x y;split. + intros nap. apply eq_correct. apply tight_apart. intros ap. apply nap. apply apart_correct;assumption. + intros e ap. apply apart_correct in ap;revert ap. apply tight_apart. apply eq_correct;assumption. Qed.
Lemma
Require Import HoTT.Classes.interfaces.abstract_algebra.
Classes\theory\apartness.v
projected_strong_setoid
3,207
`{!IsApart A} `{!IsApart B} `{!IsApart C} {f : A -> B -> C} `{forall z, StrongExtensionality (f z)} `{forall z, StrongExtensionality (fun x => f x z)} : StrongBinaryExtensionality f. Proof. intros x₁ y₁ xβ‚‚ yβ‚‚ E. apply (merely_destruct (cotransitive E (f xβ‚‚ y₁))). intros [?|?];apply tr. - left. apply (strong_extensionality (fun x => f x y₁));trivial. - right. apply (strong_extensionality (f xβ‚‚));trivial. Qed.
Lemma
Require Import HoTT.Classes.interfaces.abstract_algebra.
Classes\theory\apartness.v
strong_binary_setoid_morphism_both_coordinates
3,208
{f : A -> A -> B} `{!Commutative f} `{forall z, StrongExtensionality (f z)} : StrongBinaryExtensionality f. Proof. apply @strong_binary_setoid_morphism_both_coordinates;try apply _. intros z x y. rewrite !(commutativity _ z). apply (strong_extensionality (f z)). Qed.
Lemma
Require Import HoTT.Classes.interfaces.abstract_algebra.
Classes\theory\apartness.v
strong_binary_setoid_morphism_commutative
3,209
Apart A | 20 := fun x y => match dec (x = y) with | inl _ => false | inr _ => true end = true.
Instance
Require Import HoTT.Classes.interfaces.abstract_algebra.
Classes\theory\apartness.v
default_apart
3,210
TrivialApart A (Aap:=default_apart). Proof. split. - unfold apart,default_apart. apply _. - intros x y;unfold apart,default_apart;split. + intros E. destruct (dec (x=y)). * destruct (false_ne_true E). * trivial. + intros E;destruct (dec (x=y)) as [e|_]. * destruct (E e). * split. Qed.
Instance
Require Import HoTT.Classes.interfaces.abstract_algebra.
Classes\theory\apartness.v
default_apart_trivial
3,211
x y : PropHolds (x <> y) -> PropHolds (x β‰Ά y). Proof. intros ap. apply trivial_apart. assumption. Qed.
Instance
Require Import HoTT.Classes.interfaces.abstract_algebra.
Classes\theory\apartness.v
ne_apart
3,212
(f : A -> B) : StrongExtensionality f. Proof. intros x y E. apply trivial_apart. intros e. apply tight_apart in E;auto. Qed.
Instance
Require Import HoTT.Classes.interfaces.abstract_algebra.
Classes\theory\apartness.v
dec_strong_morphism
3,213
(f : A -> B) `{!IsInjective f} : IsStrongInjective f. Proof. split; try apply _. intros x y. intros ap. apply trivial_apart in ap. apply trivial_apart. intros e. apply ap. apply (injective f). assumption. Qed.
Instance
Require Import HoTT.Classes.interfaces.abstract_algebra.
Classes\theory\apartness.v
dec_strong_injective
3,214
(f : A -> B -> C) : StrongBinaryExtensionality f. Proof. intros x1 y1 x2 y2 hap. apply (merely_destruct (cotransitive hap (f x2 y1)));intros [h|h];apply tr. - left. apply trivial_apart. intros e. apply tight_apart in h;auto. exact (ap (fun x => f x y1) e). - right. apply trivial_apart. intros e. apply tight_apart in h;auto. Qed.
Instance
Require Import HoTT.Classes.interfaces.abstract_algebra.
Classes\theory\apartness.v
dec_strong_binary_morphism
3,215
/ 1 = 1. Proof. rewrite <-(rings.mult_1_l (/1)). apply dec_recip_inverse. solve_propholds. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
dec_recip_1
3,216
(x y: F): / (x * y) = / x * / y. Proof. destruct (dec (x = 0)) as [Ex|Ex]. - rewrite Ex, left_absorb, dec_recip_0. apply symmetry,mult_0_l. - destruct (dec (y = 0)) as [Ey|Ey]. + rewrite Ey, dec_recip_0, !mult_0_r. apply dec_recip_0. + assert (x * y <> 0) as Exy by (apply mult_ne_0;trivial). apply (left_cancellation_ne_0 (.*.) (x * y)); trivial. transitivity (x / x * (y / y)). * rewrite !dec_recip_inverse by assumption. rewrite mult_1_l;apply reflexivity. * rewrite !dec_recip_inverse by assumption. rewrite mult_assoc, (mult_comm x), <-(mult_assoc y). rewrite dec_recip_inverse by assumption. rewrite (mult_comm y), <-mult_assoc. rewrite dec_recip_inverse by assumption. reflexivity. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
dec_recip_distr
3,217
x : / x = 0 <-> x = 0. Proof. split; intros E. - apply stable. intros Ex. destruct (is_ne_0 1). rewrite <-(dec_recip_inverse x), E by assumption. apply mult_0_r. - rewrite E. apply dec_recip_0. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
dec_recip_zero
3,218
x : / x <> 0 <-> x <> 0. Proof. split; intros E1 E2; destruct E1; apply dec_recip_zero;trivial. do 2 apply (snd (dec_recip_zero _)). trivial. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
dec_recip_ne_0_iff
3,219
x : PropHolds (x <> 0) -> PropHolds (/x <> 0). Proof. intro. apply (snd (dec_recip_ne_0_iff _)). trivial. Qed.
Instance
Require Import
Classes\theory\dec_fields.v
dec_recip_ne_0
3,220
(x y : F) : x / y = 1 -> x = y. Proof. intro Exy. destruct (dec (y = 0)) as [Ey|Ey]. - destruct (is_ne_0 1). rewrite <- Exy, Ey, dec_recip_0. apply mult_0_r. - apply (right_cancellation_ne_0 (.*.) (/y)). + apply dec_recip_ne_0. trivial. + rewrite dec_recip_inverse;trivial. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
equal_by_one_quotient
3,221
(a b c d : F) : b <> 0 -> d <> 0 -> (a * d = c * b <-> a / b = c / d). Proof. split; intro E. - apply (right_cancellation_ne_0 (.*.) b);trivial. apply (right_cancellation_ne_0 (.*.) d);trivial. transitivity (a * d * (b * /b));[| transitivity (c * b * (d * /d))]. + rewrite <-!(mult_assoc a). apply ap. rewrite (mult_comm d), (mult_comm _ b). reflexivity. + rewrite E, dec_recip_inverse, dec_recip_inverse;trivial. + rewrite <-!(mult_assoc c). apply ap. rewrite (mult_comm d), mult_assoc, (mult_comm b). reflexivity. - transitivity (a * d * 1);[rewrite mult_1_r;reflexivity|]. rewrite <-(dec_recip_inverse b);trivial. transitivity (c * b * 1);[|rewrite mult_1_r;reflexivity]. rewrite <-(dec_recip_inverse d);trivial. rewrite mult_comm, <-mult_assoc, (mult_assoc _ a), (mult_comm _ a), E. rewrite <-mult_assoc. rewrite (mult_comm _ d). rewrite mult_assoc, (mult_comm c). reflexivity. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
equal_dec_quotients
3,222
(a c b d : F) : b <> 0 -> d <> 0 -> a / b + c / d = (a * d + c * b) / (b * d). Proof. intros A B. assert (a / b = (a * d) / (b * d)) as E1. - apply equal_dec_quotients;auto. + solve_propholds. + rewrite (mult_comm b);apply associativity. - assert (c / d = (b * c) / (b * d)) as E2. + apply equal_dec_quotients;trivial. * solve_propholds. * rewrite mult_assoc, (mult_comm c). reflexivity. + rewrite E1, E2. rewrite (mult_comm c b). apply symmetry, simple_distribute_r. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
dec_quotients
3,223
x y: x / y = / (/ x * y). Proof. rewrite dec_recip_distr, involutive. reflexivity. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
dec_recip_swap_l
3,224
x y: / x * y = / (x / y). Proof. rewrite dec_recip_distr, involutive. reflexivity. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
dec_recip_swap_r
3,225
x : -(/ x) = / (-x). Proof. destruct (dec (x = 0)) as [Ex|Ex]. - rewrite Ex, negate_0, dec_recip_0, negate_0. reflexivity. - apply (left_cancellation_ne_0 (.*.) (-x)). + apply (snd (flip_negate_ne_0 _)). trivial. + rewrite dec_recip_inverse. * rewrite negate_mult_negate. apply dec_recip_inverse. trivial. * apply (snd (flip_negate_ne_0 _)). trivial. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
dec_recip_negate
3,226
(x : F) Px : / x = // (x;Px). Proof. apply (left_cancellation_ne_0 (.*.) x). - apply trivial_apart. trivial. - rewrite dec_recip_inverse, reciperse_alt by (apply trivial_apart;trivial). reflexivity. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
dec_recip_correct
3,227
@DecField F Fe Fplus Fmult Fzero Fone Fnegate Frecip. Proof with auto. destruct ftheory. repeat (constructor; try assumption); repeat intro ; unfold equiv, mon_unit, sg_op, zero_is_mon_unit, plus_is_sg_op, one_is_mon_unit, mult_is_sg_op, plus, mult, recip, negate; try field. unfold recip, mult. simpl. assert (Fe (Fmult x (Frecip x)) (Fmult (Frecip x) x)) as E by ring. rewrite E. Qed.
Definition
Require Import
Classes\theory\dec_fields.v
from_stdlib_field_theory
3,228
`{IsDecField F2} `{forall x y: F2, Decidable (x = y)} `{!IsSemiRingPreserving (f : F -> F2)} x : f (/ x) = / f x. Proof. case (dec (x = 0)) as [E | E]. - rewrite E, dec_recip_0, preserves_0, dec_recip_0. reflexivity. - intros. apply (left_cancellation_ne_0 (.*.) (f x)). + apply isinjective_ne_0. trivial. + rewrite <-preserves_mult, 2!dec_recip_inverse. * apply preserves_1. * apply isinjective_ne_0. trivial. * trivial. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
preserves_dec_recip
3,229
`{IsField F2} `{!IsSemiRingStrongPreserving (f : F -> F2)} x Pfx : f (/ x) = // (f x;Pfx). Proof. assert (x <> 0). - intros Ex. destruct (apart_ne (f x) 0 Pfx). rewrite Ex, (preserves_0 (f:=f)). reflexivity. - apply (left_cancellation_ne_0 (.*.) (f x)). + apply isinjective_ne_0. trivial. + rewrite <-preserves_mult, dec_recip_inverse, reciperse_alt by assumption. apply preserves_1. Qed.
Lemma
Require Import
Classes\theory\dec_fields.v
dec_recip_to_recip
3,230
recip' (x : F) (apx : x β‰Ά 0) : F := //(x;apx).
Definition
Require Import
Classes\theory\fields.v
recip'
3,231
recip_inverse' (x : F) (Px : x β‰Ά 0) : x // (x; Px) = 1. Proof. apply (recip_inverse (x;Px)). Qed.
Lemma
Require Import
Classes\theory\fields.v
recip_inverse'
3,232
(x : F) Px : x // (x;Px) = 1. Proof. rewrite <-(recip_inverse (x;Px)). trivial. Qed.
Lemma
Require Import
Classes\theory\fields.v
reciperse_alt
3,233
x y Px Py : x = y -> // (x;Px) = // (y;Py). Proof. intro E. apply ap. apply Sigma.path_sigma with E. apply path_ishprop. Qed.
Lemma
Require Import
Classes\theory\fields.v
recip_proper_alt
3,234
x y Py : x // (y;Py) = 1 -> x = y. Proof. intros eqxy. rewrite <- (mult_1_r y). rewrite <- eqxy. rewrite (mult_assoc y x (//(y;Py))). rewrite (mult_comm y x). rewrite <- (mult_assoc x y (//(y;Py))). rewrite (recip_inverse (y;Py)). rewrite (mult_1_r x). reflexivity. Qed.
Lemma
Require Import
Classes\theory\fields.v
recip_proper
3,235
x Px1 Px2 : // (x;Px1) = // (x;Px2). Proof. apply recip_proper_alt. reflexivity. Qed.
Lemma
Require Import
Classes\theory\fields.v
recip_irrelevant
3,236
{x y} : x β‰Ά 0 -> x = y -> y β‰Ά 0. Proof. intros ? E. rewrite <-E. trivial. Qed.
Lemma
Require Import
Classes\theory\fields.v
apart_0_proper
3,237
x y : x * y β‰Ά 0 -> x β‰Ά 0. Proof. intros. apply (strong_extensionality (.* y)). rewrite mult_0_l. trivial. Qed.
Lemma
Require Import
Classes\theory\fields.v
mult_apart_zero_l
3,238
x y : x * y β‰Ά 0 -> y β‰Ά 0. Proof. intros. apply (strong_extensionality (x *.)). rewrite mult_0_r. trivial. Qed.
Lemma
Require Import
Classes\theory\fields.v
mult_apart_zero_r
3,239
x y : PropHolds (x β‰Ά 0) -> PropHolds (y β‰Ά 0) -> PropHolds (x * y β‰Ά 0). Proof. intros Ex Ey. apply (strong_extensionality (.* // (y;(Ey : (β‰Ά0) y)))). rewrite <-simple_associativity, reciperse_alt, mult_1_r, mult_0_l. trivial. Qed.
Instance
Require Import
Classes\theory\fields.v
mult_apart_zero
3,240
x : PropHolds (// x β‰Ά 0). Proof. red. apply mult_apart_zero_r with (x.1). rewrite recip_inverse. solve_propholds. Qed.
Instance
Require Import
Classes\theory\fields.v
recip_apart_zero
3,241
x y : x = 0 -> x // y = 0. Proof. intros E. rewrite E. apply left_absorb. Qed.
Lemma
Require Import
Classes\theory\fields.v
field_div_0_l
3,242
x y : x = y.1 -> x // y = 1. Proof. intros E. rewrite E. apply recip_inverse. Qed.
Lemma
Require Import
Classes\theory\fields.v
field_div_diag
3,243
(a c: F) b d : a * d.1 = c * b.1 <-> a // b = c // d. Proof. split; intro E. - rewrite <-(mult_1_l (a // b)), <- (recip_inverse d), (commutativity (f:=mult) d.1 (// d)), <-simple_associativity, (simple_associativity d.1), (commutativity (f:=mult) d.1 a), E, <-simple_associativity, simple_associativity, recip_inverse, mult_1_r. apply commutativity. - rewrite <-(mult_1_r (a * d.1)), <- (recip_inverse b), <-simple_associativity, (commutativity (f:=mult) b.1 (// b)), (simple_associativity d.1), (commutativity (f:=mult) d.1), !simple_associativity, E, <-(simple_associativity c), (commutativity (f:=mult) (// d)), recip_inverse, mult_1_r. reflexivity. Qed.
Lemma
Require Import
Classes\theory\fields.v
equal_quotients
3,244
(x y : F) Px Py Pxy : // (x * y ; Pxy) = // (x;Px) * // (y;Py). Proof. apply (left_cancellation_ne_0 (.*.) (x * y)). - apply apart_ne;trivial. - transitivity ((x // (x;Px)) * (y // (y;Py))). + rewrite 3!reciperse_alt,mult_1_r. reflexivity. + rewrite <-simple_associativity,<-simple_associativity. apply ap. rewrite simple_associativity. rewrite (commutativity (f:=mult) _ y). rewrite <-simple_associativity. reflexivity. Qed.
Lemma
Require Import
Classes\theory\fields.v
recip_distr_alt
3,245
(x : F) (Px : x β‰Ά 0) : (-x) β‰Ά 0. Proof. assert (ap : x + 0 β‰Ά x - x). { rewrite (plus_0_r x). rewrite (plus_negate_r x). assumption. } refine (Trunc_rec _ (field_plus_ext F x 0 x (-x) ap)). intros [apxx|ap0x]. - destruct (apart_ne x x apxx); reflexivity. - symmetry; assumption. Qed.
Lemma
Require Import
Classes\theory\fields.v
apart_negate
3,246
ApartZero F -> ApartZero F. Proof. intros [x Px]. exists (-x). exact ((apart_negate x Px)). Defined.
Definition
Require Import
Classes\theory\fields.v
negate_apart
3,247
(x : F) (Px : x β‰Ά 0) : (-//(x;Px))=//(negate_apart(x;Px)). Proof. apply (left_cancellation (.*.) x). rewrite <- negate_mult_distr_r. rewrite reciperse_alt. apply flip_negate. rewrite negate_mult_distr_l. refine (_^). apply reciperse_alt. Qed.
Lemma
Require Import
Classes\theory\fields.v
recip_negate
3,248
(x : F) (Px : x β‰Ά 0) : // (x;Px) β‰Ά 0. Proof. apply (strong_extensionality (x*.) (// (x; Px)) 0). rewrite (recip_inverse (x;Px)). rewrite mult_0_r. solve_propholds. Qed.
Lemma
Require Import
Classes\theory\fields.v
recip_apart
3,249
(x : ApartZero F) : ApartZero F. Proof. exists (//x). apply recip_apart. Defined.
Definition
Require Import
Classes\theory\fields.v
recip_on_apart
3,250
(forall x, x β‰Ά 0 -> f x β‰Ά 0) -> IsStrongInjective f. Proof. intros E1. split; try apply _. intros x y E2. apply (strong_extensionality (+ -f y)). rewrite plus_negate_r, <-preserves_minus. apply E1. apply (strong_extensionality (+ y)). rewrite <-simple_associativity,left_inverse,plus_0_l,plus_0_r. trivial. Qed.
Lemma
Require Import
Classes\theory\fields.v
strong_injective_preserves_0
3,251
x Px Pfx : f (// (x;Px)) = // (f x;Pfx). Proof. apply (left_cancellation_ne_0 (.*.) (f x)). - apply apart_ne;trivial. - rewrite <-rings.preserves_mult. rewrite !reciperse_alt. apply preserves_1. Qed.
Lemma
Require Import
Classes\theory\fields.v
preserves_recip
3,252
- mon_unit = mon_unit. Proof. change ((fun x => - mon_unit = x) mon_unit). apply (transport _ (left_inverse mon_unit)). apply symmetry, right_identity. Qed.
Lemma
Require Import
Classes\theory\groups.v
negate_mon_unit
3,253
x y : - (x * y) = -y * -x. Proof. rewrite <- (left_identity (-y * -x)). rewrite <- (left_inverse (unit:=mon_unit) (x * y)). rewrite <- simple_associativity. rewrite <- simple_associativity. rewrite (associativity y). rewrite right_inverse. rewrite (left_identity (-x)). rewrite right_inverse. apply symmetry, right_identity. Qed.
Lemma
Require Import
Classes\theory\groups.v
negate_sg_op
3,254
`{IsAbGroup G} x y : -(x * y) = -x * -y. Proof. path_via (-y * -x). - apply negate_sg_op. - apply commutativity. Qed.
Lemma
Require Import
Classes\theory\groups.v
negate_sg_op_distr
3,255
x : f (-x) = -f x. Proof. apply (left_cancellation (.*.) (f x)). rewrite <-preserves_sg_op. rewrite 2!right_inverse. apply preserves_mon_unit. Qed.
Lemma
Require Import
Classes\theory\groups.v
preserves_negate
3,256
IsSemiGroup B. Proof. split. - apply _. - repeat intro; apply (injective f). rewrite !op_correct. apply associativity. Qed.
Lemma
Require Import
Classes\theory\groups.v
projected_sg
3,257
Commutative (A:=B) sg_op. Proof. intros x y. apply (injective f). rewrite 2!op_correct. apply commutativity. Qed.
Lemma
Require Import
Classes\theory\groups.v
projected_comm
3,258
IsCommutativeSemiGroup B. Proof. split. - apply (projected_sg f);assumption. - apply (projected_comm f);assumption. Qed.
Lemma
Require Import
Classes\theory\groups.v
projected_com_sg
3,259
IsMonoid B. Proof. split. - apply (projected_sg f). assumption. - repeat intro; apply (injective f). rewrite op_correct, unit_correct, left_identity. reflexivity. - repeat intro; apply (injective f). rewrite op_correct, unit_correct, right_identity. reflexivity. Qed.
Lemma
Require Import
Classes\theory\groups.v
projected_monoid
3,260
IsCommutativeMonoid B. Proof. split. - apply (projected_monoid f);assumption. - apply (projected_comm f);assumption. Qed.
Lemma
Require Import
Classes\theory\groups.v
projected_com_monoid
3,261
IsGroup B. Proof. split. - apply (projected_monoid f);assumption. - repeat intro; apply (injective f). rewrite op_correct, negate_correct, unit_correct, left_inverse. apply reflexivity. - repeat intro; apply (injective f). rewrite op_correct, negate_correct, unit_correct, right_inverse. reflexivity. Qed.
Lemma
Require Import
Classes\theory\groups.v
projected_group
3,262
IsAbGroup B. Proof. split. - apply (projected_group f);assumption. - apply (projected_comm f);assumption. Qed.
Lemma
Require Import
Classes\theory\groups.v
projected_ab_group
3,263
`{Integers Z} `{IsCRing R} (f: Z -> R) {h: IsSemiRingPreserving f} x : f x = integers_to_ring Z R x. Proof. symmetry. apply integers_initial. Qed.
Lemma
Require Import Require Import Import NatPair.Instances.
Classes\theory\integers.v
to_ring_unique
3,264
`{Integers Z} `{IsCRing R} (f g: Z -> R) `{!IsSemiRingPreserving f} `{!IsSemiRingPreserving g} x : f x = g x. Proof. rewrite (to_ring_unique f), (to_ring_unique g);reflexivity. Qed.
Lemma
Require Import Require Import Import NatPair.Instances.
Classes\theory\integers.v
to_ring_unique_alt
3,265
Z `{Integers Z} Z2 `{Integers Z2} x : integers_to_ring Z2 Z (integers_to_ring Z Z2 x) = x. Proof. change (Compose (integers_to_ring Z2 Z) (integers_to_ring Z Z2) x = id x). apply to_ring_unique_alt;apply _. Qed.
Lemma
Require Import Require Import Import NatPair.Instances.
Classes\theory\integers.v
to_ring_involutive
3,266
`{Integers Z} `{IsCRing R} (f: R -> Z) (g: Z -> R) `{!IsSemiRingPreserving f} `{!IsSemiRingPreserving g} x : f (g x) = x. Proof. exact (to_ring_unique_alt (f ∘ g) id _). Qed.
Lemma
Require Import Require Import Import NatPair.Instances.
Classes\theory\integers.v
morphisms_involutive
3,267
`{Integers Z} `{IsCRing R1} `{IsCRing R2} (f : R1 -> R2) (g : Z -> R1) (h : Z -> R2) `{!IsSemiRingPreserving f} `{!IsSemiRingPreserving g} `{!IsSemiRingPreserving h} x : f (g x) = h x. Proof. exact (to_ring_unique_alt (f ∘ g) h _). Qed.
Lemma
Require Import Require Import Import NatPair.Instances.
Classes\theory\integers.v
to_ring_twice
3,268
`{Integers Z} (f : Z -> Z) `{!IsSemiRingPreserving f} x : f x = x. Proof. exact (to_ring_unique_alt f id _). Qed.
Lemma
Require Import Require Import Import NatPair.Instances.
Classes\theory\integers.v
to_ring_self
3,269
`{Integers Z} `{IsCRing R} (f: R -> Z) (g: Z -> R) `{!IsSemiRingPreserving f} `{!IsSemiRingPreserving g} : IsInjective g. Proof. intros x y E. change (id x = id y). rewrite <-(to_ring_twice f g id x), <-(to_ring_twice f g id y). apply ap,E. Qed.
Lemma
Require Import Require Import Import NatPair.Instances.
Classes\theory\integers.v
to_ring_injective
3,270
IntegersToRing Z2 := fun Z2 _ _ _ _ _ _ => integers_to_ring Z Z2 ∘ f^-1.
Definition
Require Import Require Import Import NatPair.Instances.
Classes\theory\integers.v
retract_is_int_to_ring
3,271
x : (integers_to_ring Z R ∘ f^-1) x = h x. Proof. transitivity ((h ∘ (f ∘ f^-1)) x). - symmetry. apply (to_ring_unique (h ∘ f)). - unfold Compose. apply ap. apply eisretr. Qed.
Lemma
Require Import Require Import Import NatPair.Instances.
Classes\theory\integers.v
same_morphism
3,272
Integers Z2 (U:=retract_is_int_to_ring). Proof. split;try apply _. - unfold integers_to_ring, retract_is_int_to_ring. apply _. - intros;apply same_morphism;apply _. Qed.
Lemma
Require Import Require Import Import NatPair.Instances.
Classes\theory\integers.v
retract_is_int
3,273
(Z':Type@{U}) `{Integers@{U U U U U U U U} Z'} : forall (P : Rings.Operations -> Type), P (Rings.BuildOperations Z') -> P (Rings.BuildOperations Z). Proof. apply Rings.iso_leibnitz with (integers_to_ring Z' Z);apply _. Qed.
Lemma
Require Import Require Import Import NatPair.Instances.
Classes\theory\integers.v
from_int_stmt
3,274
PropHolds ((1:Z) <>0). Proof. intros E. apply (rings.is_ne_0 (1:nat)). apply (injective (naturals_to_semiring nat Z)). exact E. Qed.
Instance
Require Import Require Import Import NatPair.Instances.
Classes\theory\integers.v
int_nontrivial
3,275
(a b : IntAbs Z N) (z : Z) : int_abs Z N (ia:=a) z = int_abs Z N (ia:=b) z. Proof. unfold int_abs. destruct (int_abs_sig Z N (IntAbs:=a) z) as [[n1 E1]|[n1 E1]]; destruct (int_abs_sig Z N (IntAbs:=b) z) as [[n2 E2]|[n2 E2]]. - apply (injective (naturals_to_semiring N Z)). path_via z. - assert (E : n1 + n2 = 0);[|path_via 0;[|symmetry]; apply (naturals.zero_sum _ _ E)]. apply (injective (naturals_to_semiring N Z)). rewrite preserves_0,preserves_plus. rewrite E1,E2. apply plus_negate_r. - assert (E : n1 + n2 = 0);[|path_via 0;[|symmetry]; apply (naturals.zero_sum _ _ E)]. apply (injective (naturals_to_semiring N Z)). rewrite preserves_0,preserves_plus. rewrite E1,E2. apply plus_negate_l. - apply (injective (naturals_to_semiring N Z)). path_via (- z). Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_unique
3,276
x : (0 ≀ x /\ f (int_abs Z N x) = x) |_| (x ≀ 0 /\ f (int_abs Z N x) = -x). Proof. unfold int_abs. destruct (int_abs_sig Z N x) as [[n E]|[n E]]. - left. rewrite <-E. split. + eapply @to_semiring_nonneg;apply _. + apply (naturals.to_semiring_unique_alt _ _). - right. split. + apply flip_nonpos_negate. rewrite <-E. eapply @to_semiring_nonneg;apply _. + rewrite <-E. apply (naturals.to_semiring_unique_alt _ _). Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_spec
3,277
x : (sig (fun n : N => f n = x)) |_| (sig (fun n : N => f n = - x)). Proof. destruct (int_abs_spec x) as [[??]|[??]]; eauto. Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_sig_alt
3,278
n : int_abs Z N (f n) = n. Proof. apply (injective f). destruct (int_abs_spec (f n)) as [[? E]|[? E]];trivial. apply naturals.negate_to_ring. rewrite E, involutive. trivial. Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_nat
3,279
n : int_abs Z N (-f n) = n. Proof. apply (injective f). destruct (int_abs_spec (-f n)) as [[? E]|[? E]]. - symmetry. apply naturals.negate_to_ring. apply symmetry; trivial. - rewrite involutive in E. trivial. Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_negate_nat
3,280
x : int_abs Z N (-x) = int_abs Z N x. Proof. destruct (int_abs_spec x) as [[_ E]|[_ E]]. - path_via (int_abs Z N (- f (int_abs Z N x))). apply int_abs_negate_nat. - rewrite <-E. apply int_abs_nat. Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_negate
3,281
x : int_abs Z N x = 0 <-> x = 0. Proof. split; intros E1. - destruct (int_abs_spec x) as [[_ E2]|[_ E2]];[|apply flip_negate_0]; rewrite <-E2, E1, (preserves_0 (f:=f)); trivial. - rewrite E1, <-(preserves_0 (f:=f)). apply int_abs_nat. Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_0_alt
3,282
x : int_abs Z N x <> 0 <-> x <> 0. Proof. destruct (int_abs_0_alt x). split;intros E1 E2;auto. Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_ne_0
3,283
int_abs Z N 0 = 0. Proof. apply int_abs_0_alt;trivial. Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_0
3,284
x : 0 ≀ x -> f (int_abs Z N x) = x. Proof. intros E1. destruct (int_abs_spec x) as [[n E2]|[n E2]];trivial. assert (Hrw : x = 0). - apply (antisymmetry (<=));trivial. - rewrite Hrw,int_abs_0, (preserves_0 (f:=f)). trivial. Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_nonneg
3,285
x : x ≀ 0 -> f (int_abs Z N x) = -x. Proof. intros E. rewrite <-int_abs_negate, int_abs_nonneg; auto. apply flip_nonpos_negate. trivial. Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_nonpos
3,286
int_abs Z N 1 = 1. Proof. apply (injective f). rewrite (preserves_1 (f:=f)). apply int_abs_nonneg; solve_propholds. Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_1
3,287
x y : 0 ≀ x -> 0 ≀ y -> int_abs Z N (x + y) = int_abs Z N x + int_abs Z N y. Proof. intros. apply (injective f). rewrite (preserves_plus (f:=f)), !int_abs_nonneg;auto. apply nonneg_plus_compat;trivial. Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_nonneg_plus
3,288
x y : int_abs Z N (x * y) = int_abs Z N x * int_abs Z N y. Proof. apply (injective f). rewrite (preserves_mult (f:=f)). destruct (int_abs_spec x) as [[? Ex]|[? Ex]], (int_abs_spec y) as [[? Ey]|[? Ey]]; rewrite Ex, Ey. - rewrite int_abs_nonneg;trivial. apply nonneg_mult_compat;trivial. - rewrite int_abs_nonpos. + apply negate_mult_distr_r. + apply nonneg_nonpos_mult;trivial. - rewrite int_abs_nonpos. + apply negate_mult_distr_l. + apply nonpos_nonneg_mult;trivial. - rewrite int_abs_nonneg. + symmetry;apply negate_mult_negate. + apply nonpos_mult;trivial. Qed.
Lemma
Require Import
Classes\theory\int_abs.v
int_abs_mult
3,289
`{IsJoinPreserving L K f} x y : f (x βŠ” y) = f x βŠ” f y. Proof. apply preserves_sg_op. Qed.
Lemma
Require Import
Classes\theory\lattices.v
preserves_join
3,290
`{IsBoundedJoinPreserving L K f} : f βŠ₯ = βŠ₯. Proof. apply preserves_mon_unit. Qed.
Lemma
Require Import
Classes\theory\lattices.v
preserves_bottom
3,291
`{IsMeetPreserving L K f} x y : f (x βŠ“ y) = f x βŠ“ f y. Proof. apply preserves_sg_op. Qed.
Lemma
Require Import
Classes\theory\lattices.v
preserves_meet
3,292
LeftIdentity (βŠ”) βŠ₯ := _.
Instance
Require Import
Classes\theory\lattices.v
join_bottom_l
3,293
RightIdentity (βŠ”) βŠ₯ := _.
Instance
Require Import
Classes\theory\lattices.v
join_bottom_r
3,294
x y : x βŠ“ (x βŠ” y) = x := absorption x y.
Definition
Require Import
Classes\theory\lattices.v
meet_join_absorption
3,295
x y : x βŠ” (x βŠ“ y) = x := absorption x y.
Definition
Require Import
Classes\theory\lattices.v
join_meet_absorption
3,296
LeftDistribute (βŠ”) (βŠ“). Proof. exact ( _). Qed.
Instance
Require Import
Classes\theory\lattices.v
join_meet_distr_l
3,297
x y z : (x βŠ“ y) βŠ” (x βŠ“ z) βŠ” (y βŠ“ z) = (x βŠ” y) βŠ“ (x βŠ” z) βŠ“ (y βŠ” z). Proof. rewrite (distribute_r x y (x βŠ“ z)), join_meet_absorption. rewrite (distribute_r _ _ (y βŠ“ z)). rewrite (distribute_l x y z). rewrite (commutativity y (x βŠ“ z)), <-(simple_associativity _ y). rewrite join_meet_absorption. rewrite (distribute_r x z y). rewrite (commutativity (f:=join) z y). rewrite (commutativity (x βŠ” y) (x βŠ” z)). rewrite simple_associativity, <-(simple_associativity (x βŠ” z)). rewrite (idempotency _ _). rewrite (commutativity (x βŠ” z) (x βŠ” y)). reflexivity. Qed.
Lemma
Require Import
Classes\theory\lattices.v
distribute_alt
3,298
IsSemiLattice B. Proof. split. - apply (projected_com_sg f). assumption. - repeat intro; apply (injective f). rewrite !op_correct, (idempotency (+) _). reflexivity. Qed.
Lemma
Require Import
Classes\theory\lattices.v
projected_sl
3,299