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
|
---|---|---|---|---|---|
F_ind2@{i j} (P : F -> F -> Type@{i}) {sP : forall x y, IsHProp (P x y)} (dclass : forall x y : Frac R, P (' x) (' y)) : forall x y, P x y. Proof. apply (@F_ind (fun x => forall y, _)). - intros;apply istrunc_forall@{UR i j}. - intros x. apply (F_ind _);intros y. apply dclass. Qed. | Definition | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | F_ind2@ | 2,600 |
F_ind3@{i j} (P : F -> F -> F -> Type@{i}) {sP : forall x y z, IsHProp (P x y z)} (dclass : forall x y z : Frac R, P (' x) (' y) (' z)) : forall x y z, P x y z. Proof. apply (@F_ind (fun x => forall y z, _)). - intros;apply istrunc_forall@{UR j j}. - intros x. apply (F_ind2@{i j} _). auto. Qed. | Definition | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | F_ind3@ | 2,601 |
F_rec@{i} {T : Type@{i} } {sT : IsHSet T} : forall (dclass : Frac R -> T) (dequiv : forall x y, equiv x y -> dclass x = dclass y), F -> T := quotient_rec equiv. | Definition | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | F_rec@ | 2,602 |
T sT dclass dequiv x : @F_rec T sT dclass dequiv (' x) = dclass x := 1. | Definition | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | F_rec_compute | 2,603 |
F_rec2@{i j} {T:Type@{i} } {sT : IsHSet T} : forall (dclass : Frac R -> Frac R -> T) (dequiv : forall x1 x2, equiv x1 x2 -> forall y1 y2, equiv y1 y2 -> dclass x1 y1 = dclass x2 y2), F -> F -> T := @quotient_rec2@{UR UR UR j i} _ _ _ _ _ (Build_HSet _). | Definition | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | F_rec2@ | 2,604 |
{T sT} dclass dequiv x y : @F_rec2 T sT dclass dequiv (' x) (' y) = dclass x y := 1. Global Instance F0@{} : Zero F := ('0 : F). Global Instance F1@{} : One F := ('1 : F). Global Instance Fplus@{} : Plus F. Proof. refine (F_rec2 (fun x y => ' (Frac.pl _ x y)) _). intros. apply path. apply Frac.pl_respect;trivial. Defined. | Definition | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | F_rec2_compute | 2,605 |
Fplus_compute@{} q r : (' q) + (' r) = ' (Frac.pl _ q r) := 1. Global Instance Fneg@{} : Negate F. Proof. refine (F_rec (fun x => ' (Frac.neg _ x)) _). intros;apply path; eapply Frac.neg_respect;try apply _. trivial. Defined. | Definition | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | Fplus_compute@ | 2,606 |
Fneg_compute@{} q : - (' q) = ' (Frac.neg _ q) := 1. Global Instance Fmult@{} : Mult F. Proof. refine (F_rec2 (fun x y => ' (Frac.ml _ x y)) _). intros. apply path. apply Frac.ml_respect;trivial. Defined. | Definition | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | Fneg_compute@ | 2,607 |
Fmult_compute@{} q r : (' q) * (' r) = ' (Frac. | Definition | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | Fmult_compute@ | 2,608 |
Fmult_comm@{} : Commutative Fplus. Proof. hnf. apply (F_ind2 _). intros;apply path, Frac.pl_comm. Qed. | Instance | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | Fmult_comm@ | 2,609 |
F_ring@{} : IsCRing F. Proof. repeat split; first [change sg_op with mult; change mon_unit with 1| change sg_op with plus; change mon_unit with 0]. - apply _. - hnf. apply (F_ind3 _). intros;apply path. apply Frac.pl_assoc. - hnf. apply (F_ind _). intros;apply path, Frac.pl_0_l. - hnf. apply (F_ind _). intros;apply path, Frac.pl_0_r. - hnf. apply (F_ind _). intros;apply path, Frac.pl_neg_l. - hnf;intros. rewrite (commutativity (f:=plus)). revert x;apply (F_ind _). intros;apply path, Frac.pl_neg_l. - apply _. - apply _. - hnf; apply (F_ind3 _). intros;apply path, Frac.ml_assoc. - hnf. apply (F_ind _). intros;apply path. red;simpl. rewrite 2!mult_1_l. reflexivity. - hnf. apply (F_ind _). intros;apply path. red;simpl. rewrite 2!mult_1_r. reflexivity. - hnf; apply (F_ind2 _). intros;apply path. red;simpl. rewrite (mult_comm (num y)), (mult_comm (den y)). reflexivity. - hnf. apply (F_ind3 _). intros a b c;apply path. red;simpl. rewrite <-!(mult_assoc (num a)). rewrite <-plus_mult_distr_l. rewrite <-(mult_assoc (num a)). apply ap. rewrite (mult_comm (den a) (den c)), (mult_comm (den a) (den b)). rewrite (mult_assoc (num b)), (mult_assoc (num c)). rewrite <-plus_mult_distr_r. rewrite <-(mult_assoc _ (den a) (den a * _)). apply ap. rewrite (mult_comm (den b)), <-mult_assoc. apply ap. rewrite (mult_comm (den a)). apply associativity. Qed. | Instance | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | F_ring@ | 2,610 |
classes_eq_related@{} : forall q r, ' q = ' r -> equiv q r. Proof. apply classes_eq_related@{UR UR Ularge UR Ularge};apply _. Qed. | Lemma | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | classes_eq_related@ | 2,611 |
class_neq@{} : forall q r, ~ (equiv q r) -> ' q <> ' r. Proof. intros q r E1 E2;apply E1;apply classes_eq_related, E2. Qed. | Lemma | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | class_neq@ | 2,612 |
classes_neq_related@{} : forall q r, ' q <> ' r -> ~ (equiv q r). Proof. intros q r E1 E2;apply E1,path,E2. Qed. | Lemma | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | classes_neq_related@ | 2,613 |
dec_recip_0@{} : / 0 = 0. Proof. unfold dec_recip. simpl. unfold Frac.dec_rec;simpl. destruct (decide_rel paths 0 0) as [_|E]. - reflexivity. - destruct E;reflexivity. Qed. | Lemma | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | dec_recip_0@ | 2,614 |
dec_recip_nonzero_aux@{} : forall q, ' q <> 0 -> num q <> 0. Proof. intros q E;apply classes_neq_related in E. apply Frac.nonzero_num in E. trivial. Qed. | Lemma | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | dec_recip_nonzero_aux@ | 2,615 |
dec_recip_nonzero@{} : forall q (E : ' q <> 0), / (' q) = ' (frac (den q) (num q) (dec_recip_nonzero_aux q E)). Proof. intros. apply path. red;simpl. unfold Frac.dec_rec. apply classes_neq_related, Frac.nonzero_num in E. destruct (decide_rel paths (num q) 0) as [E'|?];[destruct E;apply E'|]. simpl. reflexivity. Qed. | Lemma | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | dec_recip_nonzero@ | 2,616 |
dec_class@{} : forall q r, Decidable (class q = class r). Proof. intros q r. destruct (dec (equiv q r)) as [E|E]. - left. apply path,E. - right. intros E'. apply E. apply (classes_eq_related _ _ E'). Defined. | Lemma | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | dec_class@ | 2,617 |
mult_num_den@{} q : ' q = (' num q) / ' den q. Proof. apply path. red. simpl. rewrite mult_1_l. unfold Frac.dec_rec. simpl. destruct (decide_rel paths (den q) 0) as [E|E];simpl. - destruct (den_ne_0 q E). - rewrite mult_1_r. reflexivity. Qed. | Lemma | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | mult_num_den@ | 2,618 |
recip_den_num@{} q : / ' q = (' den q) / 'num q. Proof. apply path;red;simpl. unfold Frac.dec_rec;simpl. destruct (decide_rel paths (num q) 0) as [E|E];simpl. - rewrite (mult_0_r (Azero:=Azero)), 2!mult_0_l. reflexivity. - rewrite mult_1_l,mult_1_r. reflexivity. Qed. | Lemma | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | recip_den_num@ | 2,619 |
lift@{} : F R1 -> F R2. Proof. apply (F_rec (fun x => class (Frac.lift f x))). intros;apply path,Frac.lift_respects;trivial. Defined. | Definition | Require Import HoTT.HIT.quotient. Require Import Import Frac. | Classes\implementations\field_of_fractions.v | lift@ | 2,620 |
(X Y : HProp) : HProp := Build_HProp (X * Y). | Definition | Require Import | Classes\implementations\hprop_lattice.v | hand | 2,621 |
Commutative lor. Proof. intros ??. apply path_iff_hprop; hor_intros; apply tr; auto. Defined. | Instance | Require Import | Classes\implementations\hprop_lattice.v | commutative_hor | 2,622 |
Commutative hand. Proof. intros ??. apply path_hprop. apply equiv_prod_symm. Defined. | Instance | Require Import | Classes\implementations\hprop_lattice.v | commutative_hand | 2,623 |
Associative lor. Proof. intros ???. apply path_iff_hprop; hor_intros; apply tr; ((by auto) || (left; apply tr) || (right; apply tr)); auto. Defined. | Instance | Require Import | Classes\implementations\hprop_lattice.v | associative_hor | 2,624 |
Associative hand. Proof. intros ???. apply path_hprop. apply equiv_prod_assoc. Defined. | Instance | Require Import | Classes\implementations\hprop_lattice.v | associative_hand | 2,625 |
BinaryIdempotent lor. Proof. intros ?. compute. apply path_iff_hprop; hor_intros; auto. by apply tr, inl. Defined. | Instance | Require Import | Classes\implementations\hprop_lattice.v | idempotent_hor | 2,626 |
BinaryIdempotent hand. Proof. intros ?. apply path_iff_hprop. - intros [a _] ; apply a. - intros a; apply (pair a a). Defined. | Instance | Require Import | Classes\implementations\hprop_lattice.v | idempotent_hand | 2,627 |
LeftIdentity lor False_hp. Proof. intros ?. apply path_iff_hprop; hor_intros; try contradiction || assumption. by apply tr, inr. Defined. | Instance | Require Import | Classes\implementations\hprop_lattice.v | leftidentity_hor | 2,628 |
RightIdentity lor False_hp. Proof. intros ?. apply path_iff_hprop; hor_intros; try contradiction || assumption. by apply tr, inl. Defined. | Instance | Require Import | Classes\implementations\hprop_lattice.v | rightidentity_hor | 2,629 |
LeftIdentity hand Unit_hp. Proof. intros ?. apply path_trunctype, prod_unit_l. Defined. | Instance | Require Import | Classes\implementations\hprop_lattice.v | leftidentity_hand | 2,630 |
RightIdentity hand Unit_hp. Proof. intros ?. apply path_trunctype, prod_unit_r. Defined. | Instance | Require Import | Classes\implementations\hprop_lattice.v | rightidentity_hand | 2,631 |
Absorption lor hand. Proof. intros ??. apply path_iff_hprop. - intros X; strip_truncations. destruct X as [? | [? _]]; assumption. - intros ?. by apply tr, inl. Defined. | Instance | Require Import | Classes\implementations\hprop_lattice.v | absorption_hor_hand | 2,632 |
Absorption hand lor. Proof. intros ??. apply path_iff_hprop. - intros [? _]; assumption. - intros ?. split. * assumption. * by apply tr, inl. Defined. | Instance | Require Import | Classes\implementations\hprop_lattice.v | absorption_hand_hor | 2,633 |
(N : Type) := C { pos : N ; neg : N }. | Record | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | T | 2,634 |
fun x y => pos x + neg y = pos y + neg x. Global Instance equiv_is_equiv_rel@{} : EquivRel . Proof. split. - hnf. reflexivity. - hnf. unfold . intros ??;apply symmetry. - hnf. unfold . intros a b c E1 E2. apply (left_cancellation (+) (neg b)). rewrite (plus_assoc (neg b) (pos a)). rewrite (plus_comm (neg b) (pos a)), E1. rewrite (plus_comm (pos b)). rewrite <-plus_assoc. rewrite E2. rewrite (plus_comm (pos c) (neg b)). rewrite plus_assoc. rewrite (plus_comm (neg a)). rewrite <-plus_assoc. rewrite (plus_comm (neg a)). reflexivity. Qed. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | equiv | 2,635 |
Plus (T N) := fun x y => C (pos x + pos y) (neg x + neg y). | Instance | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | pl | 2,636 |
Mult (T N) := fun x y => C (pos x * pos y + neg x * neg y) (pos x * neg y + neg x * pos y). | Instance | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | ml | 2,637 |
Negate (T N) := fun x => C (neg x) (pos x). | Instance | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | opp | 2,638 |
Zero (T N) := C 0 0. | Instance | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | SR0 | 2,639 |
One (T N) := C 1 0. | Instance | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | SR1 | 2,640 |
forall q1 q2, equiv q1 q2 -> forall r1 r2, equiv r1 r2 -> equiv (q1 + r1) (q2 + r2). Proof. unfold equiv;simpl. intros q1 q2 Eq r1 r2 Er. rewrite (plus_assoc _ (neg q2)). rewrite <-(plus_assoc (pos q1)). rewrite (plus_comm (pos r1)). rewrite (plus_assoc (pos q1)). rewrite Eq. rewrite <-(plus_assoc _ (pos r1)). rewrite Er. rewrite plus_assoc. rewrite <-(plus_assoc (pos q2)). rewrite (plus_comm (neg q1)). rewrite !plus_assoc. reflexivity. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | pl_respects | 2,641 |
forall q1 q2, equiv q1 q2 -> forall r1 r2, equiv r1 r2 -> equiv (q1 * r1) (q2 * r2). Proof. intros q1 q2 Eq r1 r2 Er. transitivity (q1 * r2);unfold equiv in *;simpl. - transitivity (pos q1 * (pos r1 + neg r2) + neg q1 * (neg r1 + pos r2)). + rewrite 2!plus_mult_distr_l. rewrite <-2!plus_assoc. apply ap. rewrite 2!plus_assoc. rewrite (plus_comm (neg q1 * neg r1)). reflexivity. + rewrite Er. rewrite plus_mult_distr_l. rewrite (plus_comm (neg r1)). rewrite <-Er. rewrite plus_mult_distr_l. rewrite <-2!plus_assoc. apply ap. rewrite (plus_comm (neg q1 * pos r1)). rewrite 2!plus_assoc. rewrite (plus_comm (pos q1 * neg r1)). reflexivity. - transitivity ((pos q1 + neg q2) * pos r2 + (neg q1 + pos q2) * neg r2). + rewrite 2!plus_mult_distr_r. rewrite <-2!plus_assoc;apply ap. rewrite (plus_comm (pos q2 * neg r2)). rewrite 2!plus_assoc. rewrite (plus_comm (neg q1 * neg r2)). reflexivity. + rewrite Eq,plus_mult_distr_r. rewrite (plus_comm (neg q1)),<-Eq,plus_mult_distr_r. rewrite <-2!plus_assoc. apply ap. rewrite plus_assoc,(plus_comm (neg q1 * pos r2)). apply plus_comm. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | ml_respects | 2,642 |
forall q1 q2, equiv q1 q2 -> equiv (opp q1) (opp q2). Proof. unfold equiv;simpl. intros q1 q2 E. rewrite !(plus_comm (neg _)). symmetry. apply E. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | opp_respects | 2,643 |
Le (T N) := fun a b => pos a + neg b <= pos b + neg a. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Tle | 2,644 |
Lt (T N) := fun a b => pos a + neg b < pos b + neg a. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Tlt | 2,645 |
Apart (T N) := fun a b => apart (pos a + neg b) (pos b + neg a). Global Instance Tle_hprop@{} : is_mere_relation (T N) Tle. Proof. intros;unfold Tle. apply full_pseudo_srorder_le_hprop. Qed. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Tapart | 2,646 |
le_respects_aux@{} : forall q1 q2, equiv q1 q2 -> forall r1 r2, equiv r1 r2 -> Tle q1 r1 -> Tle q2 r2. Proof. unfold equiv,Tle;intros [pa na] [pb nb] Eq [pc nc] [pd nd] Er E;simpl in *. apply (order_reflecting (+ (pc + na))). assert (Erw : pb + nd + (pc + na) = (pb + na) + (pc + nd)) by ring_with_nat. rewrite Erw,<-Eq,Er;clear Erw. assert (Erw : pa + nb + (pd + nc) = pd + nb + (pa + nc)) by ring_with_nat. rewrite Erw. apply (order_preserving _), E. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | le_respects_aux@ | 2,647 |
le_respects@{} : forall q1 q2, equiv q1 q2 -> forall r1 r2, equiv r1 r2 -> Tle q1 r1 <~> Tle q2 r2. Proof. intros. apply equiv_iff_hprop_uncurried. split;apply le_respects_aux; trivial;apply symmetry;trivial. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | le_respects@ | 2,648 |
lt_respects_aux@{} : forall q1 q2, equiv q1 q2 -> forall r1 r2, equiv r1 r2 -> Tlt q1 r1 -> Tlt q2 r2. Proof. unfold equiv,Tlt;intros [pa na] [pb nb] Eq [pc nc] [pd nd] Er E;simpl in *. apply (strictly_order_reflecting (+ (pc + na))). assert (Erw : pb + nd + (pc + na) = (pb + na) + (pc + nd)) by ring_with_nat. rewrite Erw,<-Eq,Er;clear Erw. assert (Erw : pa + nb + (pd + nc) = pd + nb + (pa + nc)) by ring_with_nat. rewrite Erw. apply (strictly_order_preserving _), E. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | lt_respects_aux@ | 2,649 |
lt_respects@{} : forall q1 q2, equiv q1 q2 -> forall r1 r2, equiv r1 r2 -> Tlt q1 r1 <~> Tlt q2 r2. Proof. intros. apply equiv_iff_hprop_uncurried. split;apply lt_respects_aux; trivial;apply symmetry;trivial. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | lt_respects@ | 2,650 |
apart_cotrans@{} : CoTransitive Tapart. Proof. hnf. unfold Tapart. intros q1 q2 Eq r. apply (strong_left_cancellation (+) (neg r)) in Eq. apply (merely_destruct (cotransitive Eq (pos r + neg q1 + neg q2))); intros [E|E];apply tr. - left. apply (strong_extensionality (+ (neg q2))). assert (Hrw : pos q1 + neg r + neg q2 = neg r + (pos q1 + neg q2)) by ring_with_nat. rewrite Hrw;clear Hrw. trivial. - right. apply (strong_extensionality (+ (neg q1))). assert (Hrw : pos r + neg q2 + neg q1 = pos r + neg q1 + neg q2) by ring_with_nat. rewrite Hrw;clear Hrw. assert (Hrw : pos q2 + neg r + neg q1 = neg r + (pos q2 + neg q1)) by ring_with_nat. rewrite Hrw;clear Hrw. trivial. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | apart_cotrans@ | 2,651 |
apart_respects_aux@{} : forall q1 q2, equiv q1 q2 -> forall r1 r2, equiv r1 r2 -> Tapart q1 r1 -> Tapart q2 r2. Proof. assert (forall q1 q2, equiv q1 q2 -> forall r, Tapart q1 r -> Tapart q2 r) as E. - intros q1 q2 Eq r Er. unfold Tapart,equiv in *. apply (strong_extensionality (+ (neg q1))). assert (Hrw : pos q2 + neg r + neg q1 = (pos q2 + neg q1) + neg r) by ring_with_nat. rewrite Hrw;clear Hrw. rewrite <-Eq. assert (Hrw : pos q1 + neg q2 + neg r = neg q2 + (pos q1 + neg r)) by ring_with_nat. rewrite Hrw;clear Hrw. assert (Hrw : pos r + neg q2 + neg q1 = neg q2 + (pos r + neg q1)) by ring_with_nat;rewrite Hrw;clear Hrw. apply (strong_left_cancellation _ _),Er. - intros ?? Eq ?? Er E'. apply E with q1;trivial. apply symmetry;apply E with r1;apply symmetry;trivial. apply symmetry;trivial. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | apart_respects_aux@ | 2,652 |
forall q1 q2, equiv q1 q2 -> forall r1 r2, equiv r1 r2 -> Tapart q1 r1 <~> Tapart q2 r2. Proof. intros ?? Eq ?? Er. apply equiv_iff_hprop_uncurried. split;apply apart_respects_aux; trivial;apply symmetry;trivial. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | apart_respects | 2,653 |
to_ring@{} : T N -> B. Proof. intros p. exact (naturals_to_semiring N B (pos p) - naturals_to_semiring N B (neg p)). Defined. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | to_ring@ | 2,654 |
to_ring_respects@{} : forall a b, equiv a b -> to_ring a = to_ring b. Proof. unfold equiv;intros [pa na] [pb nb] E. unfold to_ring;simpl in *. apply (left_cancellation (+) (naturals_to_semiring N B na + naturals_to_semiring N B nb)). path_via (naturals_to_semiring N B pa + naturals_to_semiring N B nb + 0); [rewrite <-(plus_negate_r (naturals_to_semiring N B na));ring_with_nat |rewrite plus_0_r]. path_via (naturals_to_semiring N B pb + naturals_to_semiring N B na + 0); [rewrite plus_0_r| rewrite <-(plus_negate_r (naturals_to_semiring N B nb));ring_with_nat]. rewrite <-2!preserves_plus. apply ap,E. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | to_ring_respects@ | 2,655 |
FullPartialOrder Ale Alt := fullpseudo_fullpartial@{UN UN UN UN UN UN UN Ularge}. | Instance | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | N_fullpartial | 2,656 |
Z@{} : Type@{UN} := @quotient _ PairT. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z@ | 2,657 |
{x y} : PairT. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_path | 2,658 |
{x y} : Z_of_pair x = Z_of_pair y -> PairT. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | related_path | 2,659 |
Z_rect@{i} (P : Z -> Type@{i}) {sP : forall x, IsHSet (P x)} (dclass : forall x : PairT. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_rect@ | 2,660 |
P {sP} dclass dequiv x : @Z_rect P sP dclass dequiv (Z_of_pair x) = dclass x := 1. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_compute | 2,661 |
P {sP} dclass dequiv q r (E : PairT. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_compute_path | 2,662 |
Z_ind@{i} (P : Z -> Type@{i}) {sP : forall x : Z, IsHProp (P x)} (dclass : forall x : PairT.T N, P (cast (PairT.T N) Z x)) : forall x : Z, P x. Proof. apply (Z_rect@{i} P dclass). intros;apply path_ishprop@{i}. Defined. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_ind@ | 2,663 |
(P : Z -> Z -> Type) {sP : forall x y, IsHProp (P x y)} (dclass : forall x y : PairT.T N, P (' x) (' y)) : forall x y, P x y. Proof. apply (Z_ind (fun x => forall y, _));intros x. apply (Z_ind _);intros y. apply dclass. Defined. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_ind2 | 2,664 |
Z_ind3@{i j} (P : Z -> Z -> Z -> Type@{i}) {sP : forall x y z : Z, IsHProp (P x y z)} (dclass : forall x y z : PairT.T N, P (' x) (' y) (' z)) : forall x y z : Z, P x y z. Proof. apply (@Z_ind (fun x => forall y z, _));intros x. 2:apply (Z_ind2@{i j} _);auto. apply (@istrunc_forall@{UN j j} _). intros. apply istrunc_forall@{UN i j}. Defined. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_ind3@ | 2,665 |
Z_rec@{i} {T : Type@{i} } {sT : IsHSet T} : forall (dclass : PairT. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_rec@ | 2,666 |
T sT dclass dequiv x : @Z_rec T sT dclass dequiv (' x) = dclass x := 1. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_rec_compute | 2,667 |
Z_rec2@{i j} {T:Type@{i} } {sT : IsHSet T} : forall (dclass : PairT. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_rec2@ | 2,668 |
{T sT} dclass dequiv x y : @Z_rec2 T sT dclass dequiv (' x) (' y) = dclass x y := 1. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_rec2_compute | 2,669 |
`{DecidablePaths N} : forall q r : PairT.T N, Decidable (' q = ' r). Proof. intros q r. destruct (dec (PairT.equiv q r)) as [E|E]. - left. apply Z_path,E. - right. intros E'. apply E. apply (related_path E'). Defined. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | dec_Z_of_pair | 2,670 |
q r : (' q) + (' r) = ' (PairT.pl _ q r) := 1. Global Instance Z_mult@{} : Mult Z. Proof. refine (Z_rec2 (fun x y => ' (PairT.ml@{UN UNalt} _ x y)) _). intros;apply Z_path;eapply PairT.ml_respects;trivial. Defined. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_plus_compute | 2,671 |
q r : (' q) * (' r) = ' (PairT.ml _ q r) := 1. Global Instance Z_negate@{} : Negate Z. Proof. red. apply (Z_rec (fun x => ' (PairT.opp@{UN UNalt} _ x))). intros;apply Z_path;eapply PairT.opp_respects;trivial. Defined. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_mult_compute | 2,672 |
q : - (' q) = ' (PairT. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_negate_compute | 2,673 |
Z_ring@{} : IsCRing Z. Proof. repeat split. 1,8: exact _. all: first [change sg_op with mult; change mon_unit with 1 | change sg_op with plus; change mon_unit with 0]; hnf. - apply (Z_ind3 _). intros a b c;apply Z_path;red;simpl. rewrite !plus_assoc. reflexivity. - apply (Z_ind _). intros a;apply Z_path;red;simpl. rewrite !plus_0_l. reflexivity. - apply (Z_ind _). intros a;apply Z_path;red;simpl. rewrite !plus_0_r. reflexivity. - apply (Z_ind _). intros a;apply Z_path;red;simpl. rewrite plus_0_l,plus_0_r. apply plus_comm. - apply (Z_ind _). intros a;apply Z_path;red;simpl. rewrite plus_0_l,plus_0_r. apply plus_comm. - apply (Z_ind2 _). intros a b;apply Z_path;red;simpl. apply ap011;apply plus_comm. - apply (Z_ind3 _). intros [pa na] [pb nb] [pc nc];apply Z_path;red;simpl. ring_with_nat. - apply (Z_ind _). intros;apply Z_path;red;simpl. ring_with_nat. - apply (Z_ind _). intros;apply Z_path;red;simpl. ring_with_nat. - apply (Z_ind2 _). intros;apply Z_path;red;simpl. ring_with_nat. - apply (Z_ind3 _). intros [pa na] [pb nb] [pc nc];apply Z_path;red;simpl. ring_with_nat. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_ring@ | 2,674 |
Z_of_N_morphism@{} : IsSemiRingPreserving (cast N Z). Proof. repeat (constructor; try apply _). - intros x y. apply Z_path. red. simpl. ring_with_nat. - intros x y. apply Z_path. red;simpl. ring_with_nat. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_of_N_morphism@ | 2,675 |
Npair_splits@{} : forall n m : N, ' (PairT.C n m) = ' n + - ' m. Proof. intros. apply Z_path;red;simpl. ring_with_nat. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Npair_splits@ | 2,676 |
Zle_HProp@{} : Z -> Z -> HProp@{UN}. Proof. apply (@Z_rec2@{Ularge Ularge} _ (@trunctype_istrunc@{Ularge} _ _) (fun q r => Build_HProp (PairT.Tle q r))). intros. apply path_hprop. simpl. apply (PairT.le_respects _);trivial. Defined. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zle_HProp@ | 2,677 |
Zle_def@{} : forall a b : PairT.T N, @paths@{Uhuge} Type@{UN} (' a <= ' b) (PairT.Tle@{UN UNalt} a b). Proof. intros; exact idpath. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zle_def@ | 2,678 |
Z_partial_order' : PartialOrder Zle. Proof. split;[apply _|apply _|split|]. - hnf. apply (Z_ind _). intros. change (PairT.Tle x x). red. reflexivity. - hnf. apply (Z_ind3 (fun _ _ _ => _ -> _ -> _)). intros [pa na] [pb nb] [pc nc]. rewrite !Zle_def;unfold PairT.Tle;simpl. intros E1 E2. apply (order_reflecting (+ (nb + pb))). assert (Hrw : pa + nc + (nb + pb) = (pa + nb) + (pb + nc)) by abstract ring_with_nat. rewrite Hrw;clear Hrw. assert (Hrw : pc + na + (nb + pb) = (pb + na) + (pc + nb)) by abstract ring_with_nat. rewrite Hrw;clear Hrw. apply plus_le_compat;trivial. - hnf. apply (Z_ind2 (fun _ _ => _ -> _ -> _)). intros [pa na] [pb nb];rewrite !Zle_def;unfold PairT.Tle;simpl. intros E1 E2;apply Z_path;red;simpl. apply (antisymmetry le);trivial. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_partial_order' | 2,679 |
Z_partial_order@{} : PartialOrder Zle := ltac:(first [exact Z_partial_order'@{Ularge Ularge Ularge Ularge Ularge}| exact Z_partial_order']). | Instance | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_partial_order@ | 2,680 |
Zle_cast_embedding' : OrderEmbedding (cast N Z). Proof. split;red. - intros. rewrite Zle_def. unfold PairT.Tle. simpl. rewrite 2!plus_0_r;trivial. - intros ??. rewrite Zle_def. unfold PairT.Tle. simpl. rewrite 2!plus_0_r;trivial. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zle_cast_embedding' | 2,681 |
Zle_plus_preserving_l' : forall z : Z, OrderPreserving ((+) z). Proof. red. apply (Z_ind3 (fun _ _ _ => _ -> _)). intros [pc nc] [pa na] [pb nb]. rewrite !Zle_def;unfold PairT.Tle;simpl. intros E. assert (Hrw : pc + pa + (nc + nb) = (pc + nc) + (pa + nb)) by ring_with_nat. rewrite Hrw;clear Hrw. assert (Hrw : pc + pb + (nc + na) = (pc + nc) + (pb + na)) by ring_with_nat. rewrite Hrw;clear Hrw. apply (order_preserving _),E. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zle_plus_preserving_l' | 2,682 |
Zle_plus_preserving_l@{} : forall z : Z, OrderPreserving ((+) z) := ltac:(first [exact Zle_plus_preserving_l'@{Ularge Ularge}| exact Zle_plus_preserving_l']). | Instance | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zle_plus_preserving_l@ | 2,683 |
Zmult_nonneg' : forall x y : Z, PropHolds (0 ≤ x) -> PropHolds (0 ≤ y) -> PropHolds (0 ≤ x * y). Proof. unfold PropHolds. apply (Z_ind2 (fun _ _ => _ -> _ -> _)). intros [pa na] [pb nb]. rewrite !Zle_def;unfold PairT.Tle;simpl. rewrite !plus_0_l,!plus_0_r. intros E1 E2. destruct (decompose_le E1) as [a [Ea1 Ea2]], (decompose_le E2) as [b [Eb1 Eb2]]. rewrite Ea2, Eb2. apply compose_le with (a * b). - apply nonneg_mult_compat;trivial. - ring_with_nat. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zmult_nonneg' | 2,684 |
Zmult_nonneg@{} : forall x y : Z, PropHolds (0 ≤ x) -> PropHolds (0 ≤ y) -> PropHolds (0 ≤ x * y) := ltac:(first [exact Zmult_nonneg'@{Ularge Ularge Ularge}| exact Zmult_nonneg']). Global Z_order@{} : SemiRingOrder Zle. Proof. pose proof Z_ring; apply rings.from_ring_order; apply _. Qed. | Instance | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zmult_nonneg@ | 2,685 |
Zlt_HProp@{} : Z -> Z -> HProp@{UN}. Proof. apply (@Z_rec2@{Ularge Ularge} _ (@trunctype_istrunc@{Ularge} _ _) (fun q r => Build_HProp (PairT.Tlt q r))). intros. apply path_hprop. simpl. apply (PairT.lt_respects _);trivial. Defined. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zlt_HProp@ | 2,686 |
Zlt_def' : forall a b, ' a < ' b = PairT.Tlt a b. Proof. reflexivity. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zlt_def' | 2,687 |
Zlt_def@{i} := ltac:(first [exact Zlt_def'@{Uhuge i}|exact Zlt_def'@{i}]). | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zlt_def@ | 2,688 |
Zlt_strict' : StrictOrder Zlt. Proof. split. - apply _. - change (forall x, x < x -> Empty). apply (Z_ind (fun _ => _ -> _)). intros [pa na];rewrite Zlt_def;unfold PairT.Tlt;simpl. apply irreflexivity,_. - hnf. apply (Z_ind3 (fun _ _ _ => _ -> _ -> _)). intros [pa na] [pb nb] [pc nc];rewrite !Zlt_def;unfold PairT.Tlt;simpl. intros E1 E2. apply (strictly_order_reflecting (+ (nb + pb))). assert (Hrw : pa + nc + (nb + pb) = (pa + nb) + (pb + nc)) by ring_with_nat. rewrite Hrw;clear Hrw. assert (Hrw : pc + na + (nb + pb) = (pb + na) + (pc + nb)) by ring_with_nat. rewrite Hrw;clear Hrw. apply plus_lt_compat;trivial. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zlt_strict' | 2,689 |
Zlt_strict@{} : StrictOrder Zlt := ltac:(first [exact Zlt_strict'@{Ularge Ularge Ularge Ularge Ularge}| exact Zlt_strict'@{}]). | Instance | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zlt_strict@ | 2,690 |
plus_strict_order_preserving_l' : forall z : Z, StrictlyOrderPreserving ((+) z). Proof. red; apply (Z_ind3 (fun _ _ _ => _ -> _)). intros [pa na] [pb nb] [pc nc]. rewrite !Zlt_def;unfold PairT.Tlt;simpl. intros E. assert (Hrw : pa + pb + (na + nc) = (pa + na) + (pb + nc)) by ring_with_nat. rewrite Hrw;clear Hrw. assert (Hrw : pa + pc + (na + nb) = (pa + na) + (pc + nb)) by ring_with_nat. rewrite Hrw;clear Hrw. apply (strictly_order_preserving _),E. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | plus_strict_order_preserving_l' | 2,691 |
Zplus_strict_order_preserving_l@{} : forall z : Z, StrictlyOrderPreserving ((+) z) := ltac:(first [exact plus_strict_order_preserving_l'@{Ularge Ularge}| exact plus_strict_order_preserving_l'@{}]). | Instance | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zplus_strict_order_preserving_l@ | 2,692 |
Zmult_pos' : forall x y : Z, PropHolds (0 < x) -> PropHolds (0 < y) -> PropHolds (0 < x * y). Proof. unfold PropHolds. apply (Z_ind2 (fun _ _ => _ -> _ -> _)). intros [pa na] [pb nb]. rewrite !Zlt_def;unfold PairT.Tlt;simpl. rewrite !plus_0_l,!plus_0_r. intros E1 E2. destruct (decompose_lt E1) as [a [Ea1 Ea2]], (decompose_lt E2) as [b [Eb1 Eb2]]. rewrite Ea2, Eb2. apply compose_lt with (a * b). - apply pos_mult_compat;trivial. - ring_with_nat. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zmult_pos' | 2,693 |
Zmult_pos@{} : forall x y : Z, PropHolds (0 < x) -> PropHolds (0 < y) -> PropHolds (0 < x * y) := ltac:(first [exact Zmult_pos'@{Ularge Ularge Ularge}| exact Zmult_pos'@{}]). Global Z_strict_srorder : StrictSemiRingOrder Zlt. Proof. pose proof Z_ring; apply from_strict_ring_order; apply _. Qed. | Instance | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zmult_pos@ | 2,694 |
Zapart_HProp@{} : Z -> Z -> HProp@{UN}. Proof. apply (@Z_rec2@{Ularge Ularge} _ _ (fun q r => Build_HProp (PairT.Tapart q r))). intros. apply path_hprop. simpl. apply (PairT.apart_respects _);trivial. Defined. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zapart_HProp@ | 2,695 |
Zapart_def' : forall a b, apart (' a) (' b) = PairT.Tapart a b. Proof. reflexivity. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zapart_def' | 2,696 |
Zapart_def@{i} := ltac:(first [exact Zapart_def'@{Uhuge i}| exact Zapart_def'@{i}]). Global Instance ishprop_Zapart : is_mere_relation _ Zapart. Proof. unfold Zapart;exact _. Qed. | Definition | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Zapart_def@ | 2,697 |
Z_trivial_apart' `{!TrivialApart N} : TrivialApart Z. Proof. split;[exact _|idtac]. apply (Z_ind2 _). intros [pa na] [pb nb];rewrite Zapart_def;unfold PairT.Tapart;simpl. split;intros E1. - intros E2. apply related_path in E2. red in E2;simpl in E2. apply trivial_apart in E1. auto. - apply trivial_apart. intros E2. apply E1,Z_path. red;simpl. trivial. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_trivial_apart' | 2,698 |
Z_is_apart' : IsApart Z. Proof. split. - apply _. - apply _. - hnf. apply (Z_ind2 (fun _ _ => _ -> _)). intros [pa na] [pb nb];rewrite !Zapart_def;unfold PairT.Tapart;simpl. apply symmetry. - hnf. intros x y E z;revert x y z E. apply (Z_ind3 (fun _ _ _ => _ -> _)). intros a b c;rewrite !Zapart_def;unfold PairT.Tapart;simpl. intros E1. apply (strong_left_cancellation (+) (PairT.neg c)) in E1. eapply (merely_destruct (cotransitive E1 _));intros [E2|E2];apply tr. + left. apply (strong_extensionality (+ (PairT.neg b))). assert (Hrw : PairT.pos a + PairT.neg c + PairT.neg b = PairT.neg c + (PairT.pos a + PairT.neg b)) by ring_with_nat;rewrite Hrw;exact E2. + right. apply (strong_extensionality (+ (PairT.neg a))). assert (Hrw : PairT.pos c + PairT.neg b + PairT.neg a = PairT.pos c + PairT.neg a + PairT.neg b) by ring_with_nat;rewrite Hrw;clear Hrw. assert (Hrw : PairT.pos b + PairT.neg c + PairT.neg a = PairT.neg c + (PairT.pos b + PairT.neg a)) by ring_with_nat;rewrite Hrw;clear Hrw. trivial. - apply (Z_ind2 _). intros a b;rewrite Zapart_def;unfold PairT.Tapart. split;intros E. + apply Z_path;red. apply tight_apart,E. + apply related_path in E. apply tight_apart,E. Qed. | Lemma | Require Import HoTT.HIT.quotient Require Import Import ring_quote.Quoting.Instances. Module Import PairT. | Classes\implementations\natpair_integers.v | Z_is_apart' | 2,699 |