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
Qabs_le_raw@{} : forall x : Q, x <= abs x. Proof. intros x;destruct (total_abs_either x) as [[E1 E2]|[E1 E2]]. - rewrite E2;reflexivity. - transitivity (0:Q);trivial. rewrite E2. apply flip_nonpos_negate. trivial. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qabs_le_raw@
3,400
Qabs_neg@{} : forall x : Q, abs (- x) = abs x. Proof. intros x. destruct (total_abs_either x) as [[E1 E2]|[E1 E2]]. - rewrite E2. path_via (- - x);[|rewrite involutive;trivial]. apply ((abs_sig (- x)).2). apply flip_nonneg_negate;trivial. - rewrite E2. apply ((abs_sig (- x)).2). apply flip_nonpos_negate;trivial. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qabs_neg@
3,401
forall x : Q, - x <= abs x. Proof. intros x. rewrite <-Qabs_neg. apply Qabs_le_raw. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qabs_le_neg_raw
3,402
Q_abs_le_pr@{} : forall x y : Q, abs x <= y <-> - y <= x /\ x <= y. Proof. intros x y;split. - intros E. split. + apply flip_le_negate. rewrite involutive. transitivity (abs x);trivial. apply Qabs_le_neg_raw. + transitivity (abs x);trivial. apply Qabs_le_raw. - intros [E1 E2]. destruct (total_abs_either x) as [[E3 E4]|[E3 E4]];rewrite E4. + trivial. + apply flip_le_negate;rewrite involutive;trivial. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Q_abs_le_pr@
3,403
Qabs_is_join@{} : forall q : Q, abs q = join (- q) q. Proof. intros q. symmetry. destruct (total_abs_either q) as [[E1 E2]|[E1 E2]];rewrite E2. - apply join_r. transitivity (0:Q);trivial. apply flip_nonneg_negate;trivial. - apply join_l. transitivity (0:Q);trivial. apply flip_nonpos_negate;trivial. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qabs_is_join@
3,404
forall a b c : Q, a < c -> b < c -> join a b < c. Proof. intros a b c E1 E2. destruct (total le a b) as [E3|E3];rewrite ?(join_r _ _ E3),?(join_l _ _ E3); trivial. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qlt_join
3,405
Q_average_between@{} : forall q r : Q, q < r -> q < (q + r) / 2 < r. Proof. intros q r E. split. - apply flip_pos_minus. assert (Hrw : (q + r) / 2 - q = (r - q) / 2);[|rewrite Hrw;clear Hrw]. { path_via ((q + r) / 2 - 2 / 2 * q). { rewrite dec_recip_inverse;[|solve_propholds]. rewrite mult_1_l;trivial. } ring_tac.ring_with_integers (NatPair.Z nat). } apply pos_mult_compat;[|apply _]. red. apply (snd (flip_pos_minus _ _)). trivial. - apply flip_pos_minus. assert (Hrw : r - (q + r) / 2 = (r - q) / 2);[|rewrite Hrw;clear Hrw]. { path_via (2 / 2 * r - (q + r) / 2). { rewrite dec_recip_inverse;[|solve_propholds]. rewrite mult_1_l;trivial. } ring_tac.ring_with_integers (NatPair.Z nat). } apply pos_mult_compat;[|apply _]. red. apply (snd (flip_pos_minus _ _)). trivial. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Q_average_between@
3,406
(q r : Q) : q + ((r - q) / 2) = (r + q) / 2. Proof. pattern q at 1. rewrite <- (mult_1_r q). pattern (1 : Q) at 1. rewrite <- (dec_recip_inverse 2) by solve_propholds. rewrite (associativity q 2 (/2)). rewrite <- (distribute_r (q*2) (r-q) (/2)). rewrite (distribute_l q 1 1). rewrite (mult_1_r q). rewrite (commutativity (q+q) (r-q)). rewrite <- (associativity r (-q) (q+q)). rewrite (associativity (-q) q q). rewrite (plus_negate_l q). rewrite (plus_0_l q). reflexivity. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
path_avg_split_diff_l
3,407
(q r : Q) : r - ((r - q) / 2) = (r + q) / 2. Proof. pattern r at 1. rewrite <- (mult_1_r r). pattern (1 : Q) at 1. rewrite <- (dec_recip_inverse 2) by solve_propholds. rewrite (associativity r 2 (/2)). rewrite negate_mult_distr_l. rewrite <- (distribute_r (r*2) (-(r-q)) (/2)). rewrite (distribute_l r 1 1). rewrite (mult_1_r r). rewrite (commutativity (r+r) (-(r-q))). rewrite <- negate_swap_r. rewrite <- (associativity q (-r) (r+r)). rewrite (associativity (-r) r r). rewrite (plus_negate_l r). rewrite (plus_0_l r). rewrite (plus_comm q r). reflexivity. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
path_avg_split_diff_r
3,408
forall a b : Q, forall e, a < ' e -> b < ' e -> exists d d', a < ' d /\ b < ' d /\ e = d + d'. Proof. assert (Haux : forall a b : Q, a <= b -> forall e, a < ' e -> b < ' e -> exists d d', a < ' d /\ b < ' d /\ e = d + d'). { intros a b E e E1 E2. pose proof (Q_average_between _ _ (Qlt_join _ 0 _ E2 prop_holds)) as [E3 E4]. exists (mkQpos _ (le_lt_trans _ _ _ (join_ub_r _ _) E3)). unfold cast at 1 4;simpl. exists (Qpos_diff _ _ E4). repeat split. - apply le_lt_trans with b;trivial. apply le_lt_trans with (join b 0);trivial. apply join_ub_l. - apply le_lt_trans with (join b 0);trivial. apply join_ub_l. - apply pos_eq. unfold cast at 2;simpl. unfold cast at 2;simpl. unfold cast at 3;simpl. abstract ring_tac.ring_with_integers (NatPair.Z nat). } intros a b e E1 E2. destruct (total le a b) as [E|E];auto. destruct (Haux _ _ E e) as [d [d' [E3 [E4 E5]]]];trivial. eauto. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
pos_gt_both
3,409
two_fourth_is_one_half@{} : 2/4 = 1/2 :> Q+. Proof. assert (Hrw : 4 = 2 * 2 :> Q) by ring_tac.ring_with_nat. apply pos_eq. repeat (unfold cast;simpl). rewrite Hrw;clear Hrw. rewrite dec_recip_distr. rewrite mult_assoc. rewrite dec_recip_inverse;[|solve_propholds]. reflexivity. Unshelve. exact (fun _ => 1). Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
two_fourth_is_one_half@
3,410
forall q r : Q, abs (q + r) <= abs q + abs r. Proof. intros. rewrite (Qabs_is_join (q + r)). apply join_le. - rewrite negate_plus_distr. apply plus_le_compat;apply Qabs_le_neg_raw. - apply plus_le_compat;apply Qabs_le_raw. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Q_triangle_le
3,411
forall x y : Q, abs x - abs y <= abs (x - y). Proof. intros q r. apply (order_reflecting (+ (abs r))). assert (Hrw : abs q - abs r + abs r = abs q) by ring_tac.ring_with_integers (NatPair.Z nat); rewrite Hrw;clear Hrw. etransitivity;[|apply Q_triangle_le]. assert (Hrw : q - r + r = q) by ring_tac.ring_with_integers (NatPair.Z nat); rewrite Hrw;clear Hrw. reflexivity. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qabs_triangle_alt_aux
3,412
forall x y : Q, abs (abs x - abs y) <= abs (x - y). Proof. intros q r. rewrite (Qabs_is_join (abs q - abs r)). apply join_le. - rewrite <-(Qabs_neg (q - r)),<-!negate_swap_r. apply Qabs_triangle_alt_aux. - apply Qabs_triangle_alt_aux. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qabs_triangle_alt
3,413
Q_dense@{} : forall q r : Q, q < r -> exists s, q < s < r. Proof. intros q r E;econstructor;apply Q_average_between,E. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Q_dense@
3,414
Qabs_neg_flip@{} : forall a b : Q, abs (a - b) = abs (b - a). Proof. intros a b. rewrite <-Qabs_neg. rewrite <-negate_swap_r. trivial. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qabs_neg_flip@
3,415
Q -> Q+ := fun q => {| pos := abs q + 1; is_pos := le_lt_trans _ _ _ (Qabs_nonneg q) (fst (pos_plus_lt_compat_r _ _) lt_0_1) |}.
Definition
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
pos_of_Q
3,416
Q_abs_plus_1_bounds@{} : forall q : Q, - ' (pos_of_Q q) ≤ q ≤ ' (pos_of_Q q). Proof. intros. change (- (abs q + 1) ≤ q ≤ (abs q + 1)). split. - apply flip_le_negate. rewrite involutive. transitivity (abs q). + apply Qabs_le_neg_raw. + apply nonneg_plus_le_compat_r. solve_propholds. - transitivity (abs q). + apply Qabs_le_raw. + apply nonneg_plus_le_compat_r. solve_propholds. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Q_abs_plus_1_bounds@
3,417
Qabs_mult@{} : forall a b : Q, abs (a * b) = abs a * abs b. Proof. intros a b. destruct (total_abs_either a) as [Ea|Ea];destruct Ea as [Ea1 Ea2];rewrite Ea2; destruct (total_abs_either b) as [Eb|Eb];destruct Eb as [Eb1 Eb2];rewrite Eb2. - apply ((abs_sig (a*b)).2). apply nonneg_mult_compat;trivial. - rewrite <-negate_mult_distr_r. apply ((abs_sig (a*b)).2). apply nonneg_nonpos_mult;trivial. - rewrite <-negate_mult_distr_l. apply ((abs_sig (a*b)).2). apply nonpos_nonneg_mult;trivial. - rewrite negate_mult_negate. apply ((abs_sig (a*b)).2). apply nonpos_mult;trivial. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qabs_mult@
3,418
Qpos_neg_le@{} : forall a : Q+, - ' a <= ' a. Proof. intros a;apply between_nonneg;solve_propholds. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qpos_neg_le@
3,419
(e : Q+) := exists x : Q, ' e <= x.
Definition
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qpos_upper
3,420
e : Q -> Qpos_upper e. Proof. intros x. exists (join x (' e)). apply join_ub_r. Defined.
Definition
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qpos_upper_inject
3,421
nat -> Q+. Proof. intros n. destruct (le_or_lt (enumerator Q n) 0) as [E|E]. - exact 1. - exists (enumerator Q n);trivial. Defined.
Definition
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qpos_enumerator
3,422
IsSurjection@{UQ} Qpos_enumerator. Proof. apply BuildIsSurjection. unfold hfiber. intros e;generalize (@center _ (enumerator_issurj Q (' e))). apply (Trunc_ind _). intros [n E]. apply tr;exists n. unfold Qpos_enumerator. destruct (le_or_lt (enumerator Q n) 0) as [E1|E1]. - destruct (irreflexivity lt 0). apply lt_le_trans with (enumerator Q n);trivial. rewrite E;solve_propholds. - apply pos_eq,E. Qed.
Lemma
Require Import Import Quoting.Instances. Import NatPair.Instances.
Classes\theory\rationals.v
Qpos_is_enumerator
3,423
`(x : R) `{Zero R} `{p : PropHolds (x <> 0)} : x <> 0 := p.
Definition
Require Import Require Import
Classes\theory\rings.v
is_ne_0
3,424
`(x : R) `{Le R} `{Zero R} `{p : PropHolds (0 ≤ x)} : 0 ≤ x := p.
Definition
Require Import Require Import
Classes\theory\rings.v
is_nonneg
3,425
`(x : R) `{Lt R} `{Zero R} `{p : PropHolds (0 < x)} : 0 < x := p. (* Lemma stdlib_semiring_theory R `{SemiRing R} : Ring_theory.semi_ring_theory 0 1 (+) (.*.) (=). Proof. Qed.
Definition
Require Import Require Import
Classes\theory\rings.v
is_pos
3,426
`{forall z, PropHolds (z <> 0) -> LeftCancellation op z} z : z <> 0 -> LeftCancellation op z. Proof. auto. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
left_cancellation_ne_0
3,427
`{forall z, PropHolds (z <> 0) -> RightCancellation op z} z : z <> 0 -> RightCancellation op z. Proof. auto. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
right_cancellation_ne_0
3,428
`{!Commutative op} `{!LeftCancellation op z} : RightCancellation op z. Proof. intros x y E. apply (left_cancellation op z). rewrite 2!(commutativity (f:=op) z _). assumption. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
right_cancel_from_left
3,429
`{!Commutative op} `{!StrongLeftCancellation op z} : StrongRightCancellation op z. Proof. intros x y E. rewrite 2!(commutativity _ z). apply (strong_left_cancellation op z);trivial. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
strong_right_cancel_from_left
3,430
`{!NoZeroDivisors R} x y : PropHolds (x <> 0) -> PropHolds (y <> 0) -> PropHolds (x * y <> 0). Proof. intros Ex Ey Exy. unfold PropHolds in *. apply (no_zero_divisors x); split; eauto. Qed.
Instance
Require Import Require Import
Classes\theory\rings.v
mult_ne_0
3,431
LeftDistribute (.*.) (+). Proof. apply _. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
plus_mult_distr_l
3,432
f 0 = 0. Proof. apply preserves_mon_unit. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
preserves_0
3,433
f 1 = 1. Proof. apply preserves_mon_unit. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
preserves_1
3,434
forall x y, f (x * y) = f x * f y. Proof. intros. apply preserves_sg_op. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
preserves_mult
3,435
forall x y, f (x + y) = f x + f y. Proof. intros. apply preserves_sg_op. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
preserves_plus
3,436
f 2 = 2. Proof. rewrite preserves_plus. rewrite preserves_1. reflexivity. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
preserves_2
3,437
f 3 = 3. Proof. rewrite ?preserves_plus, ?preserves_1. reflexivity. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
preserves_3
3,438
f 4 = 4. Proof. rewrite ?preserves_plus, ?preserves_1. reflexivity. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
preserves_4
3,439
x : PropHolds (x <> 0) -> PropHolds (f x <> 0). Proof. intros. rewrite <-preserves_0. apply (neq_isinj f). assumption. Qed.
Instance
Require Import Require Import
Classes\theory\rings.v
isinjective_ne_0
3,440
x : x <> 1 -> f x <> 1. Proof. intros. rewrite <-preserves_1. apply (neq_isinj f). assumption. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
injective_ne_1
3,441
x : - - x = x := groups.
Definition
Require Import Require Import
Classes\theory\rings.v
negate_involutive
3,442
forall x, x + -x = 0. Proof. exact right_inverse. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
plus_negate_r
3,443
forall x, -x + x = 0. Proof. exact left_inverse. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
plus_negate_l
3,444
forall x y, x - y = -(y - x). Proof. intros. rewrite groups.negate_sg_op. rewrite involutive. reflexivity. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
negate_swap_r
3,445
x y : -x + y = -(x - y). Proof. rewrite groups.negate_sg_op_distr,involutive. reflexivity. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
negate_swap_l
3,446
forall x y, -(x + y) = -x + -y. Proof. exact groups.negate_sg_op_distr. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
negate_plus_distr
3,447
x : -x = - 1 * x. Proof. apply (left_cancellation (+) x). path_via 0. - apply right_inverse. - path_via (1 * x + (- 1) * x). + apply symmetry. rewrite <-distribute_r. rewrite right_inverse. apply left_absorb. + apply ap011;try reflexivity. apply left_identity. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
negate_mult_l
3,448
x : -x = x * -1. Proof. apply (right_cancellation (+) x). transitivity (x * -1 + x * 1). - lhs apply left_inverse. rhs_V rapply simple_distribute_l. lhs_V rapply (right_absorb x). apply (ap (x *.)). symmetry. apply left_inverse. - f_ap. apply right_identity. Defined.
Lemma
Require Import Require Import
Classes\theory\rings.v
negate_mult_r
3,449
x y : -(x * y) = -x * y. Proof. lhs nrapply negate_mult_l. lhs rapply (simple_associativity (f := (.*.)) (-1) x y). apply (ap (.* y)). symmetry. apply negate_mult_l. Defined.
Lemma
Require Import Require Import
Classes\theory\rings.v
negate_mult_distr_l
3,450
x y : -(x * y) = x * -y. Proof. lhs nrapply negate_mult_r. lhs_V rapply (simple_associativity (f := (.*.)) x y). apply (ap (x *.)). symmetry. apply negate_mult_r. Defined.
Lemma
Require Import Require Import
Classes\theory\rings.v
negate_mult_distr_r
3,451
x y : -x * -y = x * y. Proof. rewrite <-negate_mult_distr_l, <-negate_mult_distr_r. apply involutive. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
negate_mult_negate
3,452
-0 = 0. Proof. exact groups.negate_mon_unit. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
negate_0
3,453
x y : x - y = 0 <-> x = y. Proof. split; intros E. - rewrite <- (left_identity y). change (sg_op ?x ?y) with (0 + y). rewrite <- E. rewrite <-simple_associativity. rewrite left_inverse. apply symmetry,right_identity. - rewrite E. apply right_inverse. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
equal_by_zero_sum
3,454
x y : -x = y <-> x = -y. Proof. split; intros E. - rewrite <-E, involutive. trivial. - rewrite E, involutive. trivial. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
flip_negate
3,455
x : -x = 0 <-> x = 0. Proof. etransitivity. - apply flip_negate. - rewrite negate_0. apply reflexivity. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
flip_negate_0
3,456
x : -x <> 0 <-> x <> 0. Proof. split; intros E ?; apply E; apply flip_negate_0;trivial. path_via x. apply involutive. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
flip_negate_ne_0
3,457
x y : -x * y = 0 <-> x * y = 0. Proof. split; intros E. - apply (injective (-)). rewrite negate_mult_distr_l, negate_0. trivial. - apply (injective (-)). rewrite negate_mult_distr_l, negate_involutive, negate_0. trivial. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
negate_zero_prod_l
3,458
x y : x * -y = 0 <-> x * y = 0. Proof. etransitivity. 2: apply negate_zero_prod_l. split. - intros E. lhs_V nrapply negate_mult_distr_l. lhs nrapply negate_mult_distr_r. exact E. - intros E. lhs_V nrapply negate_mult_distr_r. lhs nrapply negate_mult_distr_l. exact E. Defined.
Lemma
Require Import Require Import
Classes\theory\rings.v
negate_zero_prod_r
3,459
mult_ne_0' `{!NoZeroDivisors R} x y : PropHolds (x <> 0) -> PropHolds (y <> 0) -> PropHolds (x * y <> 0). Proof. intros Ex Ey Exy. unfold PropHolds in *. apply (no_zero_divisors x); split; eauto. Qed.
Instance
Require Import Require Import
Classes\theory\rings.v
mult_ne_0'
3,460
x y : x = y + x - y. Proof. rewrite (commutativity (f := (+)) y x), <- (simple_associativity (f := (+)) x y (-y)), right_inverse, right_identity. reflexivity. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
plus_conjugate
3,461
x y : x = y + (x - y). Proof. rewrite (simple_associativity (f := (+))). apply plus_conjugate. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
plus_conjugate_alt
3,462
`{Apart R} `{!TrivialApart R} : PropHolds (1 ≶ 0). Proof. apply apartness.ne_apart. solve_propholds. Qed.
Instance
Require Import Require Import
Classes\theory\rings.v
intdom_nontrivial_apart
3,463
x : f (-x) = -f x := groups.
Definition
Require Import Require Import
Classes\theory\rings.v
preserves_negate
3,464
x y : f (x - y) = f x - f y. Proof. rewrite <-preserves_negate. apply preserves_plus. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
preserves_minus
3,465
(forall x, f x = 0 -> x = 0) -> IsInjective f. Proof. intros E1 x y E. apply equal_by_zero_sum. apply E1. rewrite preserves_minus, E. apply right_inverse. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
injective_preserves_0
3,466
IsCRing B. Proof. split. - apply (groups.projected_ab_group f);assumption. - apply (groups.projected_com_monoid f mult_correct one_correct);assumption. - repeat intro; apply (injective f). rewrite plus_correct, !mult_correct, plus_correct. apply distribute_l. Qed.
Lemma
Require Import Require Import
Classes\theory\rings.v
projected_ring
3,467
@SemiRing R Re Rplus Rmult Rzero Rone. Proof. 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, zero, mult, plus; ring. Qed.
Definition
Require Import Require Import
Classes\theory\rings.v
from_stdlib_semiring_theory
3,468
@Ring R Re Rplus Rmult Rzero Rone Rnegate. Proof. 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, mult, plus, negate; ring. Qed.
Definition
Require Import Require Import
Classes\theory\rings.v
from_stdlib_ring_theory
3,469
IsSemiRingPreserving f -> IsSemiRingPreserving g -> IsSemiRingPreserving (g ∘ f). Proof. split; apply _. Qed.
Instance
Require Import Require Import
Classes\theory\rings.v
compose_sr_morphism
3,470
forall `{!IsEquiv f}, IsSemiRingPreserving f -> IsSemiRingPreserving (f^-1). Proof. split; apply _. Qed.
Instance
Require Import Require Import
Classes\theory\rings.v
invert_sr_morphism
3,471
(s : Sort σ) : Relation (A s) := λ (x y : A s), f s x = f s y. Global Instance equiv_rel_ker (s : Sort σ) : EquivRel ( s). Proof. repeat constructor. - intros x y. exact inverse. - intros x y z. exact concat. Qed.
Definition
Require Import Import
Classes\theory\ua_first_isomorphism.v
cong_ker
3,472
{w : SymbolType σ} (β : Operation B w) (a b : FamilyProd A (dom_symboltype w)) (R : for_all_2_family_prod A A cong_ker a b) : ap_operation β (map_family_prod f a) = ap_operation β (map_family_prod f b). Proof. induction w. - reflexivity. - destruct a as [x a], b as [y b], R as [r R]. cbn. destruct r. by apply IHw. Qed.
Lemma
Require Import Import
Classes\theory\ua_first_isomorphism.v
path_ap_operation_ker_related
3,473
(s : Sort σ) (y : B s) : HProp := merely (hfiber (f s) y).
Definition
Require Import Import
Classes\theory\ua_first_isomorphism.v
in_image_hom
3,474
{w : SymbolType σ} (α : Operation A w) (β : Operation B w) (P : OpPreserving f α β) : ClosedUnderOp B in_image_hom β. Proof. induction w. - exact (tr (α; P)). - intro y. refine (Trunc_rec _). intros [x p]. apply (IHw (α x)). by destruct p. Qed.
Lemma
Require Import Import
Classes\theory\ua_first_isomorphism.v
closed_under_op_in_image_hom
3,475
IsClosedUnderOps B in_image_hom. Proof. intro u. eapply closed_under_op_in_image_hom, hom. Qed.
Lemma
Require Import Import
Classes\theory\ua_first_isomorphism.v
is_closed_under_ops_in_image_hom
3,476
(s : Sort σ) : (A / cong_ker f) s → (B && in_image_hom f) s. Proof. refine (Quotient_rec (cong_ker f s) _ (λ x, (f s x; tr (x; idpath))) _). intros x y p. by apply path_sigma_hprop. Defined.
Definition
Require Import Import
Classes\theory\ua_first_isomorphism.v
def_first_isomorphism
3,477
{w : SymbolType σ} (α : Operation A w) (β : Operation B w) (γ : Operation (A / cong_ker f) w) (C : ClosedUnderOp B (in_image_hom f) β) (P : OpPreserving f α β) (G : ComputeOpQuotient A (cong_ker f) α γ) : OpPreserving def_first_isomorphism γ (op_subalgebra B (in_image_hom f) β C). Proof. induction w. - apply path_sigma_hprop. generalize dependent γ. refine (Quotient_ind_hprop (cong_ker f t) _ _). intros x G. destruct P. apply (related_quotient_paths (cong_ker f t) _ _ (G tt)). - refine (Quotient_ind_hprop (cong_ker f t) _ _). intro x. apply (IHw (α x) (β (f t x)) (γ (class_of _ x))). + exact (P x). + intro a. exact (G (x,a)). Qed.
Lemma
Require Import Import
Classes\theory\ua_first_isomorphism.v
oppreserving_first_isomorphism
3,478
Homomorphism (A / cong_ker f) (B && in_image_hom f) := BuildHomomorphism def_first_isomorphism. Global Instance embedding_first_isomorphism (s : Sort σ) : IsEmbedding ( s). Proof. apply isembedding_isinj_hset. refine (Quotient_ind_hprop (cong_ker f s) _ _). intro x. refine (Quotient_ind_hprop (cong_ker f s) _ _). intros y p. apply qglue. exact (p..1). Qed.
Definition
Require Import Import
Classes\theory\ua_first_isomorphism.v
hom_first_isomorphism
3,479
A / cong_ker f ≅ B && in_image_hom f. Proof. exact (BuildIsomorphic def_first_isomorphism). Defined.
Theorem
Require Import Import
Classes\theory\ua_first_isomorphism.v
isomorphic_first_isomorphism
3,480
A / cong_ker f = B && in_image_hom f. Proof. exact (id_isomorphic isomorphic_first_isomorphism). Qed.
Corollary
Require Import Import
Classes\theory\ua_first_isomorphism.v
id_first_isomorphism
3,481
Homomorphism (A / cong_ker f) B := hom_compose (hom_inc_subalgebra B (in_image_hom f)) (hom_first_isomorphism f).
Definition
Require Import Import
Classes\theory\ua_first_isomorphism.v
hom_first_isomorphism_surjection
3,482
A / cong_ker f ≅ B. Proof. exact (BuildIsomorphic hom_first_isomorphism_surjection). Defined.
Theorem
Require Import Import
Classes\theory\ua_first_isomorphism.v
isomorphic_first_isomorphism_surjection
3,483
(A / cong_ker f) = B. Proof. exact (id_isomorphic isomorphic_first_isomorphism_surjection). Qed.
Corollary
Require Import Import
Classes\theory\ua_first_isomorphism.v
id_first_isomorphism_surjection
3,484
Homomorphism A (B && in_image_hom f) := hom_compose (hom_first_isomorphism f) (hom_quotient (cong_ker f)).
Definition
Require Import Import
Classes\theory\ua_first_isomorphism.v
hom_first_isomorphism_inj
3,485
A ≅ B && in_image_hom f := BuildIsomorphic hom_first_isomorphism_inj.
Definition
Require Import Import
Classes\theory\ua_first_isomorphism.v
isomorphic_first_isomorphism_inj
3,486
A = B && in_image_hom f := id_isomorphic isomorphic_first_isomorphism_inj.
Definition
Require Import Import
Classes\theory\ua_first_isomorphism.v
id_first_isomorphism_inj
3,487
{w : SymbolType σ} : Operation A w → Operation B w → Type := match w with | [:s:] => λ α β, f s α = β | s ::: y => λ α β, ∀ (x : A s), (α x) (β (f s x)) end. Global Instance trunc_oppreserving `{Funext} {n : trunc_index} `{!IsTruncAlgebra n.+1 B} {w : SymbolType σ} (α : Operation A w) (β : Operation B w) : IsTrunc n ( α β). Proof. induction w; exact _. Qed.
Fixpoint
Require Import Import algebra_notations ne_list.notations.
Classes\theory\ua_homomorphism.v
OpPreserving
3,488
{σ} {A B : Algebra σ} : Type := BuildHomomorphism
Record
Require Import Import algebra_notations ne_list.notations.
Classes\theory\ua_homomorphism.v
Homomorphism
3,489
{σ} {A B : Algebra σ} {f g : Homomorphism A B} : f = g → ∀ s, f s == g s. Proof. intro p. by destruct p. Defined.
Lemma
Require Import Import algebra_notations ne_list.notations.
Classes\theory\ua_homomorphism.v
apD10_homomorphism
3,490
{σ} (A B : Algebra σ) : Type := { def_hom : ∀ s, A s → B s | IsHomomorphism def_hom }.
Definition
Require Import Import algebra_notations ne_list.notations.
Classes\theory\ua_homomorphism.v
SigHomomorphism
3,491
{σ} (A B : Algebra σ) : SigHomomorphism A B <~> Homomorphism A B. Proof. issig. Defined.
Lemma
Require Import Import algebra_notations ne_list.notations.
Classes\theory\ua_homomorphism.v
issig_homomorphism
3,492
{σ} {A B : Algebra σ} (f g : Homomorphism A B) (p : def_hom f = def_hom g) (q : p#(is_homomorphism_hom f) = is_homomorphism_hom g) : f = g. Proof. destruct f, g. simpl in *. by path_induction. Defined.
Lemma
Require Import Import algebra_notations ne_list.notations.
Classes\theory\ua_homomorphism.v
path_homomorphism
3,493
`{Funext} {σ} {A B : Algebra σ} `{!IsHSetAlgebra B} (f g : Homomorphism A B) (p : def_hom f = def_hom g) : f = g. Proof. apply (path_homomorphism f g p). apply path_ishprop. Defined.
Lemma
Require Import Import algebra_notations ne_list.notations.
Classes\theory\ua_homomorphism.v
path_hset_homomorphism
3,494
{σ : Signature} {A B : Algebra σ} (f : ∀ s, A s → B s) `{IsIsomorphism σ A B f} : ∀ (s : Sort σ), A s <~> B s. Proof. intro s. rapply (Build_Equiv _ _ (f s)). Defined.
Definition
Require Import Import algebra_notations ne_list.notations.
Classes\theory\ua_homomorphism.v
equiv_isomorphism
3,495
(f : ∀ s, A s → B s) {w : SymbolType σ} (a : FamilyProd A (dom_symboltype w)) (α : Operation A w) (β : Operation B w) (P : OpPreserving f α β) : f (cod_symboltype w) (ap_operation α a) = ap_operation β (map_family_prod f a). Proof. induction w. - assumption. - destruct a as [x a]. apply IHw. apply P. Defined.
Lemma
Require Import Import algebra_notations ne_list.notations.
Classes\theory\ua_homomorphism.v
path_oppreserving_ap_operation
3,496
(f : ∀ s, A s → B s) `{!IsHomomorphism f} : ∀ (u : Symbol σ) (a : FamilyProd A (dom_symboltype (σ u))), f (cod_symboltype (σ u)) (ap_operation u.#A a) = ap_operation u.#B (map_family_prod f a). Proof. intros u a. by apply path_oppreserving_ap_operation. Defined.
Lemma
Require Import Import algebra_notations ne_list.notations.
Classes\theory\ua_homomorphism.v
path_homomorphism_ap_operation
3,497
Homomorphism A A := BuildHomomorphism (λ s x, x). End . Section hom_inv. Context {σ} {A B : Algebra σ} (f : ∀ s, A s → B s) `{IsIsomorphism σ A B f}. Global Instance is_homomorphism_inv : IsHomomorphism (λ s, (f s)^-1). Proof. intro u. generalize u.#A u.#B (oppreserving_hom f u). intros a b P. induction (σ u). - destruct P. apply (eissect (f t)). - intro. apply IHs. exact (transport (λ y, OpPreserving f _ (b y)) (eisretr (f t) x) (P (_^-1 x))). Defined.
Definition
Require Import Import algebra_notations ne_list.notations.
Classes\theory\ua_homomorphism.v
hom_id
3,498
Homomorphism B A := BuildHomomorphism (λ s, (f s)^-1).
Definition
Require Import Import algebra_notations ne_list.notations.
Classes\theory\ua_homomorphism.v
hom_inv
3,499