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
locator (' s). Proof. intros q r ltqr. destruct (trichotomy _ q s) as [ltqs|[eqqs|ltsq]]. - apply inl. apply (strictly_order_preserving _); assumption. - rewrite eqqs in ltqr. apply inr, (strictly_order_preserving _); assumption. - apply inr, (strictly_order_preserving _), (transitivity ltsq ltqr); assumption. Qed.
Lemma
Require Import
Analysis\Locator.v
locator_left
1,400
locator (' s). Proof. intros q r ltqr. destruct (trichotomy _ s r) as [ltsr|[eqsr|ltrs]]. - apply inr, (strictly_order_preserving _); assumption. - rewrite <- eqsr in ltqr. apply inl, (strictly_order_preserving _); assumption. - apply inl, (strictly_order_preserving _), (transitivity ltqr ltrs). Qed.
Definition
Require Import
Analysis\Locator.v
locator_second
1,401
locator_locator' : locator x -> locator' x. Proof. intros l. refine (Build_locator' x (fun q r nu => Build_DHProp (Build_HProp (is_inl (l q r nu))) _) _ _). - intros q r nu. simpl. apply un_inl. - intros q r nu. simpl. destruct (l q r nu) as [ltqx|]. + simpl; intros f; destruct (f tt). + intros ?; assumption. Defined.
Definition
Require Import
Analysis\Locator.v
locator_locator'
1,402
locator' x -> locator x. Proof. intros l' q r nu. destruct (dec (locates_right l' nu)) as [yes|no]. - apply inl. exact (locates_right_true l' nu yes). - apply inr. exact (locates_right_false l' nu no). Defined.
Definition
Require Import
Analysis\Locator.v
locator'_locator
1,403
(l : locator x) : locator'_locator (locator_locator' l) = l. Proof. apply path_forall; intros q. apply path_forall; intros r. apply path_forall; intros nu. unfold locator'_locator, locator_locator'. simpl. destruct (l q r nu); auto. Qed.
Definition
Require Import
Analysis\Locator.v
locator_locator'_locator
1,404
locator'_locator_locator' (l' : locator' x) : locator_locator' (locator'_locator l') = l'. Proof. enough (p : locsig ^-1 (locator_locator' (locator'_locator l')) = locsig ^-1 l'). - refine (equiv_inj (locsig ^-1) p). - unfold locsig; simpl. destruct l'; unfold locator'_locator, locator_locator'; simpl. apply path_sigma_hprop; simpl. apply path_forall; intro q; apply path_forall; intro r; apply path_arrow; intro nu. apply equiv_path_dhprop; simpl. rewrite (path_dec (locates_right0 q r nu)). destruct (dec (locates_right0 q r nu)); auto. Qed.
Lemma
Require Import
Analysis\Locator.v
locator'_locator_locator'
1,405
equiv_locator_locator' : locator x <~> locator' x := equiv_adjointify locator_locator' locator'_locator locator'_locator_locator' locator_locator'_locator.
Definition
Require Import
Analysis\Locator.v
equiv_locator_locator'
1,406
{q r : Q} (l' : locator' x) (ltqr : q < r) : ~ (' q < x) -> locates_left l' ltqr. Proof. assert (f := locates_right_true l' ltqr). exact (not_contrapositive f). Qed.
Lemma
Require Import
Analysis\Locator.v
nltqx_locates_left
1,407
{q r : Q} (l' : locator' x) (ltqr : q < r) : x < ' q -> locates_left l' ltqr. Proof. intros ltxq. apply nltqx_locates_left. apply lt_flip; assumption. Qed.
Lemma
Require Import
Analysis\Locator.v
ltxq_locates_left
1,408
{q r : Q} (l' : locator' x) (ltqr : q < r) : ~ (x < ' r) -> locates_right l' ltqr. Proof. intros nltxr. apply stable. assert (f := locates_right_false l' ltqr). exact (not_contrapositive f nltxr). Qed.
Lemma
Require Import
Analysis\Locator.v
nltxr_locates_right
1,409
{q r : Q} (l' : locator' x) (ltqr : q < r) : 'r < x -> locates_right l' ltqr. Proof. intros ltrx. apply nltxr_locates_right. apply lt_flip; assumption. Qed.
Lemma
Require Import
Analysis\Locator.v
ltrx_locates_right
1,410
{k} : IsHProp (P_lower k). Proof. apply _. Qed.
Definition
Require Import
Analysis\Locator.v
P_lower_prop
1,411
{q : Q | ' q < x}. Proof. assert (qP_lower : {q : Q | P_lower q}) by refine (minimal_n_alt_type Q Q_eq P_lower _ P_lower_inhab). destruct qP_lower as [q Pq]. exists (q - 1). unfold P_lower in Pq. simpl in *. apply (un_inl _ Pq). Qed.
Definition
Require Import
Analysis\Locator.v
lower_bound
1,412
{k} : IsHProp (P_upper k). Proof. apply _. Qed.
Definition
Require Import
Analysis\Locator.v
P_upper_prop
1,413
{r : Q | x < ' r}. Proof. assert (rP_upper : {r : Q | P_upper r}) by refine (minimal_n_alt_type Q Q_eq P_upper _ P_upper_inhab). destruct rP_upper as [r Pr]. exists (r + 1). unfold P_upper in Pr. simpl in *. destruct (l r (r + 1) (lt1N r)). - simpl in Pr. destruct (Pr tt). - assumption. Qed.
Definition
Require Import
Analysis\Locator.v
upper_bound
1,414
Cast nat Q := naturals_to_semiring nat Q.
Instance
Require Import
Analysis\Locator.v
inc_N_Q
1,415
{n} : Cast (Fin n) nat := fin_to_nat.
Instance
Require Import
Analysis\Locator.v
inc_fin_N
1,416
(epsilon : Qpos Q) : {u : Q | ' u < x < ' (u + ' epsilon)}. Proof. destruct lower_bound as [q ltqx] , upper_bound as [r ltxr] , (round_up_strict Q ((3/'epsilon)*(r-q))) as [n lt3rqn]. assert (lt0 : 0 < 'epsilon / 3). { apply pos_mult. - apply epsilon. - apply pos_dec_recip_compat, lt_0_3. } assert (lt0' : 0 < 3 / ' epsilon). { apply pos_mult. - apply lt_0_3. - apply pos_dec_recip_compat, epsilon. } assert (ap30 : (3 : Q) <> 0) by apply lt_ne_flip, lt_0_3. clear - l q ltqx r ltxr n lt3rqn lt0' ap30 Qtriv Qdec_paths H cast_pres_ordering. assert (ltn3eps : r < q + ' n * ' epsilon / 3). { rewrite (commutativity q (' n * ' epsilon / 3)). apply flip_lt_minus_l. apply (pos_mult_reflect_r (3 / ' epsilon) lt0'). rewrite (commutativity (r-q) (3 / ' epsilon)). rewrite <- (associativity ('n) ('epsilon) (/3)). rewrite <- (associativity ('n) (' epsilon / 3) (3 / ' epsilon)). rewrite <- (associativity ('epsilon) (/3) (3/'epsilon)). rewrite (associativity (/3) 3 (/'epsilon)). rewrite (commutativity (/3) 3). rewrite (dec_recip_inverse 3 ap30). rewrite mult_1_l. assert (apepsilon0 : 'epsilon <> 0) by apply lt_ne_flip, epsilon. rewrite (dec_recip_inverse ('epsilon) apepsilon0). rewrite mult_1_r. assumption. } set (grid (k : Fin n.+3) := q + (' (' k) - 1)*('epsilon/3) : Q). assert (lt_grid : forall k : Fin _, grid (fin_incl k) < grid (fsucc k)). { intros k. unfold grid. change (' fin_incl k) with (fin_to_nat (fin_incl k)); rewrite path_nat_fin_incl. change (' fsucc k) with (fin_to_nat (fsucc k)); rewrite path_nat_fsucc. assert (' (S (' k)) = (' (' k) + 1)) as ->. { rewrite S_nat_plus_1. rewrite (preserves_plus (' k) 1). rewrite preserves_1. reflexivity. } assert (' (' k) + 1 - 1 = ' (' k) - 1 + 1) as ->. { rewrite <- (associativity _ 1 (-1)). rewrite (commutativity 1 (-1)). rewrite (associativity _ (-1) 1). reflexivity. } assert (lt1 : ' (' k) - 1 < ' (' k) - 1 + 1) by apply pos_plus_lt_compat_r, lt_0_1. assert (lt2 : (' (' k) - 1) * (' epsilon / 3) < (' (' k) - 1 + 1) * (' epsilon / 3)). { nrefine (pos_mult_lt_r ('epsilon/3) _ (' (' k) - 1) (' (' k) - 1 + 1) _); try apply _. apply lt1. } apply pseudo_srorder_plus. exact lt2. } set (P k := locates_right l (lt_grid k)). assert (left_true : P fin_zero). { apply ltrx_locates_right. unfold grid. change (' fsucc fin_zero) with (fin_to_nat (@fsucc (S n) fin_zero)). rewrite path_nat_fsucc, path_nat_fin_zero. rewrite (@preserves_1 nat Q _ _ _ _ _ _ _ _ _ _). rewrite plus_negate_r. rewrite mult_0_l. rewrite plus_0_r. assumption. } assert (right_false : ~ P fin_last). { apply ltxq_locates_left. unfold grid. change (' fin_incl fin_last) with (fin_to_nat (@fin_incl (S (S n)) fin_last)). rewrite path_nat_fin_incl, path_nat_fin_last. rewrite S_nat_plus_1. rewrite (preserves_plus n 1). rewrite (@preserves_1 nat Q _ _ _ _ _ _ _ _ _ _). rewrite <- (associativity (' n) 1 (-1)). rewrite plus_negate_r. rewrite plus_0_r. rewrite (associativity ('n) ('epsilon) (/3)). transitivity ('r). - exact ltxr. - apply strictly_order_preserving; try trivial. } destruct (sperners_lemma_1d P left_true right_false) as [u [Pltux Pltxueps]]. exists (grid (fin_incl (fin_incl u))). unfold P in Pltux, Pltxueps. split. - apply (locates_right_true l (lt_grid (fin_incl u)) Pltux). - clear - Pltxueps Qtriv Qdec_paths ap30 cast_pres_ordering. set (ltxbla := locates_right_false l (lt_grid (fsucc u)) Pltxueps). unfold grid in *. change (' fin_incl (fin_incl u)) with (fin_to_nat (fin_incl (fin_incl u))). rewrite path_nat_fin_incl, path_nat_fin_incl. change (' fsucc (fsucc u)) with (fin_to_nat (fsucc (fsucc u))) in ltxbla. rewrite path_nat_fsucc, path_nat_fsucc in ltxbla. rewrite S_nat_plus_1, S_nat_plus_1 in ltxbla. rewrite (preserves_plus (fin_to_nat u + 1) 1) in ltxbla. rewrite (preserves_plus (fin_to_nat u) 1) in ltxbla. rewrite preserves_1 in ltxbla. rewrite <- (associativity (' fin_to_nat u) 1 1) in ltxbla. rewrite <- (associativity (' fin_to_nat u) 2 (-1)) in ltxbla. rewrite (commutativity 2 (-1)) in ltxbla. rewrite (associativity (' fin_to_nat u) (-1) 2) in ltxbla. rewrite plus_mult_distr_r in ltxbla. rewrite (associativity q ((' fin_to_nat u - 1) * (' epsilon / 3)) (2 * (' epsilon / 3))) in ltxbla. refine (transitivity ltxbla _). apply strictly_order_preserving; try apply _. apply pseudo_srorder_plus. rewrite (associativity 2 ('epsilon) (/3)). rewrite (commutativity 2 ('epsilon)). rewrite <- (mult_1_r ('epsilon)). rewrite <- (associativity ('epsilon) 1 2). rewrite (mult_1_l 2). rewrite <- (associativity ('epsilon) 2 (/3)). apply pos_mult_lt_l. + apply epsilon. + nrefine (pos_mult_reflect_r (3 : Q) lt_0_3 _ _ _); try apply _. rewrite <- (associativity 2 (/3) 3). rewrite (commutativity (/3) 3). rewrite (dec_recip_inverse (3 : Q) ap30). rewrite (mult_1_r 2). rewrite (mult_1_l 3). exact lt_2_3. Qed.
Lemma
Require Import
Analysis\Locator.v
tight_bound
1,417
{q : Q | x < 'q < y}. Proof. assert (R : sig P). { apply minimal_n_alt_type. - apply QQpos_eq. - apply P_dec. - apply P_inhab. } unfold P in R. destruct R as [[q eps] [lleft mright]]. exists q; split. - nrefine (locates_right_false l _ lleft). - nrefine (locates_right_true m _ mright). Qed.
Definition
Require Import
Analysis\Locator.v
archimedean_structure
1,418
locator (-x). Proof. intros q r ltqr. assert (ltnrnq := snd (flip_lt_negate q r) ltqr : -r < -q). destruct (l _ _ ltnrnq) as [ltnrx|ltxnq]. - apply inr. apply char_minus_left. rewrite <- preserves_negate. assumption. - apply inl. apply char_minus_right. rewrite <- preserves_negate. assumption. Qed.
Definition
Require Import
Analysis\Locator.v
locator_minus
1,419
locator (// (x ; recip_nu)). Proof. assert (recippos : 0 < // (x ; recip_nu)) by apply pos_recip_compat. intros q r ltqr. destruct (trichotomy _ q 0) as [qneg|[qzero|qpos]]. + apply inl. refine (transitivity _ _). * apply (strictly_order_preserving _). exact qneg. * rewrite preserves_0; assumption. + apply inl. rewrite qzero, preserves_0; assumption. + assert (qap0 : q ≶ 0) by apply (pseudo_order_lt_apart_flip _ _ qpos). assert (rap0 : r ≶ 0). { refine (pseudo_order_lt_apart_flip _ _ _). apply (transitivity qpos ltqr). } assert (ltrrrq : / r < / q) by (apply flip_lt_dec_recip; assumption). destruct (l (/r) (/q) ltrrrq) as [ltrrx|ltxrq]. * apply inr. assert (rpos : 0 < r) by (transitivity q; assumption). assert (rpos' : 0 < ' r). { rewrite <- (@preserves_0 Q F _ _ _ _ _ _ _ _ _ _). apply strictly_order_preserving; try apply _; assumption. } rewrite (dec_recip_to_recip r (positive_apart_zero ('r) rpos')) in ltrrx. assert (ltxrr := flip_lt_recip_l x ('r) rpos' ltrrx). cbn in ltxrr. rewrite (recip_irrelevant x (positive_apart_zero x (transitivity (pos_recip_compat (' r) rpos') ltrrx)) recip_nu) in ltxrr. exact ltxrr. * apply inl. assert (qpos' : 0 < ' q). { rewrite <- (@preserves_0 Q F _ _ _ _ _ _ _ _ _ _). apply strictly_order_preserving; try apply _; assumption. } rewrite (dec_recip_to_recip q (positive_apart_zero ('q) qpos')) in ltxrq. assert (ltrqx := flip_lt_recip_r ('q) x qpos' xpos ltxrq). rewrite (recip_irrelevant x (positive_apart_zero x xpos) recip_nu) in ltrqx. exact ltrqx. Qed.
Definition
Require Import
Analysis\Locator.v
locator_recip_pos
1,420
locator (// (x ; recip_neg_nu)). Proof. assert (negxpos : 0 < (-x)) by (apply flip_neg_negate; assumption). assert (l' := locator_minus (locator_recip_pos (locator_minus l) negxpos)). rewrite (recip_negate (-x)) in l'. unfold negate_apart in l'. rewrite (recip_proper_alt (- - x) x (apart_negate (- x) (positive_apart_zero (- x) negxpos)) recip_neg_nu) in l'. - assumption. - apply negate_involutive. Qed.
Definition
Require Import
Analysis\Locator.v
locator_recip_neg
1,421
locator (// (x ; nu)). Proof. destruct (fst (apart_iff_total_lt x 0) nu) as [xneg|xpos]. - set (l' := locator_recip_neg l xneg). rewrite (recip_proper_alt x x (negative_apart_zero x xneg) nu) in l'; try reflexivity; exact l'. - set (l' := locator_recip_pos l xpos). rewrite (recip_proper_alt x x (positive_apart_zero x xpos) nu) in l'; try reflexivity; exact l'. Qed.
Definition
Require Import
Analysis\Locator.v
locator_recip
1,422
locator (x + y). Proof. intros q r ltqr. set (epsilon := (Qpos_diff q r ltqr) / 2). assert (q+'epsilon=r-'epsilon) by (rewrite path_avg_split_diff_l, path_avg_split_diff_r; reflexivity). destruct (tight_bound m epsilon) as [u [ltuy ltyuepsilon]]. set (s := q-u). assert (qsltx : 'q-'s<y). { unfold s. rewrite (preserves_plus q (-u)). rewrite negate_plus_distr. rewrite (associativity ('q) (-'q) (-'(-u))). rewrite plus_negate_r. rewrite plus_0_l. rewrite (preserves_negate u). rewrite negate_involutive. assumption. } assert (sltseps : s<s+' epsilon) by apply ltQposQ. destruct (l s (s+' epsilon) sltseps) as [ltsx|ltxseps]. - apply inl. apply char_plus_left. apply tr; exists s; split; try assumption. rewrite preserves_minus; assumption. - apply inr. apply char_plus_right. apply tr. set (t := s + ' epsilon); exists t. split; try assumption. assert (r-(q-u+(r-q)/2)=u+'epsilon) as ->. { change ((r - q) / 2) with ('epsilon). rewrite negate_plus_distr. rewrite <- negate_swap_l. rewrite (plus_comm (-q) u). rewrite (plus_assoc r (u-q) (-'epsilon)). rewrite (plus_assoc r u (-q)). rewrite (plus_comm r u). rewrite <- (plus_assoc u r (-q)). rewrite <- (plus_assoc u (r-q) (-'epsilon)). rewrite (plus_comm r (-q)). rewrite <- (plus_assoc (-q) r (-'epsilon)). rewrite path_avg_split_diff_r. rewrite <- path_avg_split_diff_l. rewrite (plus_assoc (-q) q ((r-q)/2)). rewrite (plus_negate_l q). rewrite (plus_0_l _). reflexivity. } assumption. Qed.
Definition
Require Import
Analysis\Locator.v
locator_plus
1,423
locator (x * y). Proof. Abort.
Lemma
Require Import
Analysis\Locator.v
locator_times
1,424
locator (meet x y). Proof. intros q r ltqr. destruct (l q r ltqr, m q r ltqr) as [[ltqx|ltxr] [ltqy|ltyr]]. - apply inl, meet_lt_l; assumption. - apply inr, meet_lt_r_r; assumption. - apply inr, meet_lt_r_l; assumption. - apply inr, meet_lt_r_r; assumption. Qed.
Lemma
Require Import
Analysis\Locator.v
locator_meet
1,425
locator (join x y). Proof. intros q r ltqr. destruct (l q r ltqr, m q r ltqr) as [[ltqx|ltxr] [ltqy|ltyr]]. - apply inl, join_lt_l_l; assumption. - apply inl, join_lt_l_l; assumption. - apply inl, join_lt_l_r; assumption. - apply inr, join_lt_r; assumption. Qed.
Lemma
Require Import
Analysis\Locator.v
locator_join
1,426
{l} : IsLimit _ _ xs l -> locator l. Proof. intros islim. intros q r ltqr. set (epsilon := (Qpos_diff q r ltqr) / 3). assert (ltqepsreps : q + ' epsilon < r - ' epsilon). { apply (strictly_order_reflecting (+'epsilon)). rewrite <- (plus_assoc r (-'epsilon) ('epsilon)). rewrite plus_negate_l. rewrite plus_0_r. rewrite <- (plus_assoc q ('epsilon) ('epsilon)). apply (strictly_order_reflecting ((-q)+)). rewrite (plus_assoc (-q) q _). rewrite plus_negate_l, plus_0_l. rewrite (plus_comm (-q) r). rewrite <- (mult_1_r ('epsilon)). rewrite <- plus_mult_distr_l. unfold epsilon, cast, Qpos_diff; cbn. rewrite <- (mult_assoc (r-q) (/3) 2). pattern (r-q) at 2. rewrite <- (mult_1_r (r-q)). assert (rqpos : 0 < r-q) by apply (Qpos_diff q r ltqr). apply (strictly_order_preserving ((r-q)*.)). apply (strictly_order_reflecting (3*.)). rewrite (mult_assoc 3 (/3) 2). rewrite (dec_recip_inverse 3). - rewrite mult_1_r, mult_1_l. exact lt_2_3. - apply apart_ne, positive_apart_zero, lt_0_3. } destruct (ls (M (epsilon / 2)) (q + ' epsilon) (r - ' epsilon) ltqepsreps) as [ltqepsxs|ltxsreps]. + apply inl. rewrite preserves_plus in ltqepsxs. assert (ltqxseps : ' q < xs (M (epsilon / 2)) - ' (' epsilon)) by (apply flip_lt_minus_r; assumption). refine (transitivity ltqxseps _). apply (modulus_close_limit _ _ _ _ _). + apply inr. rewrite (preserves_plus r (-'epsilon)) in ltxsreps. rewrite (preserves_negate ('epsilon)) in ltxsreps. assert (ltxsepsr : xs (M (epsilon / 2)) + ' (' epsilon) < ' r) by (apply flip_lt_minus_r; assumption). refine (transitivity _ ltxsepsr). apply (modulus_close_limit _ _ _ _ _). Qed.
Lemma
Require Import
Analysis\Locator.v
locator_limit
1,427
Funext.
Axiom
Require Import Basics.Overture.
Axioms\Funext.v
funext_axiom
1,428
PropResizing.
Axiom
Require Import Basics.Overture.
Axioms\PropResizing.v
propresizing_axiom
1,429
Univalence.
Axiom
Require Import Types.Universe.
Axioms\Univalence.v
univalence_axiom
1,430
{A B : Type} (f : A -> B) `{!IsInjective f} : forall x y, x <> y -> f x <> f y. Proof. intros x y np q. apply np, (injective f). exact q. Defined.
Definition
Require Import Basics.Overture Basics.Tactics.
Basics\Classes.v
neq_isinj
1,431
{A B C f g} `{IsInjective B C g} `{IsInjective A B f} : IsInjective (g o f). Proof. intros x y p. by apply (injective f), (injective g). Defined.
Definition
Require Import Basics.Overture Basics.Tactics.
Basics\Classes.v
isinj_compose
1,432
{A B C : Type} (f : A -> B) (g : B -> C) `{!IsInjective (g o f)} : IsInjective f. Proof. intros x y p. apply (injective (g o f)). exact (ap g p). Defined.
Definition
Require Import Basics.Overture Basics.Tactics.
Basics\Classes.v
isinj_cancelL
1,433
`{Contr A} (x y : A) : x = y := (contr x)^ @ (contr y). Global Instance contr_paths_contr `{Contr A} (x y : A) : Contr (x = y) | 10000. Proof. apply (Build_Contr _ ( x y)). intro r; destruct r; apply concat_Vp. Defined.
Definition
Require Import Overture PathGroupoids.
Basics\Contractible.v
path_contr
1,434
`{Contr A} {x y : A} (p q : x = y) : p = q := path_contr p q.
Definition
Require Import Overture PathGroupoids.
Basics\Contractible.v
path2_contr
1,435
{X : Type} {x y : X} (p : x = y) : (x;1) = (y;p) :> {z:X & x=z}. Proof. destruct p; reflexivity. Defined.
Definition
Require Import Overture PathGroupoids.
Basics\Contractible.v
path_basedpaths
1,436
path_basedpaths' {X : Type} {x y : X} (p : y = x) : (x;1) = (y;p) :> {z:X & z=x}. Proof. destruct p; reflexivity. Defined.
Definition
Require Import Overture PathGroupoids.
Basics\Contractible.v
path_basedpaths'
1,437
{X : Type} {x y z : X} (p : x = y) (q : x = z) : ap pr1 (path_contr ((y;p) : {y':X & x = y'}) (z;q)) = p^ @ q. Proof. destruct p, q; reflexivity. Defined.
Definition
Require Import Overture PathGroupoids.
Basics\Contractible.v
ap_pr1_path_contr_basedpaths
1,438
ap_pr1_path_contr_basedpaths' {X : Type} {x y z : X} (p : y = x) (q : z = x) : ap pr1 (path_contr ((y;p) : {y':X & y' = x}) (z;q)) = p @ q^. Proof. destruct p, q; reflexivity. Defined.
Definition
Require Import Overture PathGroupoids.
Basics\Contractible.v
ap_pr1_path_contr_basedpaths'
1,439
{X : Type} {x y : X} (p : x = y) : ap pr1 (path_basedpaths p) = p. Proof. destruct p; reflexivity. Defined.
Definition
Require Import Overture PathGroupoids.
Basics\Contractible.v
ap_pr1_path_basedpaths
1,440
ap_pr1_path_basedpaths' {X : Type} {x y : X} (p : y = x) : ap pr1 (path_basedpaths' p) = p^. Proof. destruct p; reflexivity. Defined.
Definition
Require Import Overture PathGroupoids.
Basics\Contractible.v
ap_pr1_path_basedpaths'
1,441
{A B} (f : A -> B) `{Contr A} : forall x y : A, f x = f y := fun x y => ap f ((contr x)^ @ contr y).
Definition
Require Import Overture PathGroupoids.
Basics\Contractible.v
contr_dom_equiv
1,442
{X Y : Type} `{Contr X} (r : X -> Y) (s : Y -> X) (h : forall y, r (s y) = y) : Contr Y := Build_Contr _ (r (center X)) (fun y => (ap r (contr _)) @ h _).
Definition
Require Import Overture PathGroupoids.
Basics\Contractible.v
contr_retract
1,443
{A : Type} (a : A) `{Contr A} : Contr A. Proof. apply (Build_Contr _ a). intros; apply path_contr. Defined.
Definition
Require Import Overture PathGroupoids.
Basics\Contractible.v
contr_change_center
1,444
Contr_ind@{u v|} (A : Type@{u}) (P : Contr A -> Type@{v}) (H : forall (center : A) (contr : forall y, center = y), P (Build_Contr A center contr)) (C : Contr A) : P C := match C as C0 in IsTrunc n _ return (match n as n0 return IsTrunc n0 _ -> Type@{v} with | minus_two => fun c0 => P c0 | trunc_S k => fun _ => Unit end C0) with | Build_Contr center contr => H center contr | istrunc_S _ _ => tt end.
Definition
Require Import Overture PathGroupoids.
Basics\Contractible.v
Contr_ind@
1,445
{A : Type} (a : A) (P : forall (p : Decidable A), Type) (p : forall x, P (inl x)) : forall p, P p. Proof. intros [x|n]. - apply p. - contradiction n. Defined.
Definition
Require Import
Basics\Decidable.v
decidable_true
1,446
{A : Type} (n : not A) (P : forall (p : Decidable A), Type) (p : forall n', P (inr n')) : forall p, P p. Proof. intros [x|n']. - contradiction n. - apply p. Defined.
Definition
Require Import
Basics\Decidable.v
decidable_false
1,447
P `(Stable P) : ~~P <-> P. Proof. split. - apply stable. - exact (fun x f => f x). Defined.
Definition
Require Import
Basics\Decidable.v
iff_stable
1,448
{A B} (R : A -> B -> Type) {dec : forall x y, Decidable (R x y)} (x : A) (y : B) : Decidable (R x y) := dec x y.
Definition
Require Import
Basics\Decidable.v
decide_rel
1,449
{A B} (f : A <-> B) : Decidable A -> Decidable B. Proof. intros [a|na]. - exact (inl (fst f a)). - exact (inr (fun b => na (snd f b))). Defined.
Definition
Require Import
Basics\Decidable.v
decidable_iff
1,450
decidable_equiv' (A : Type) {B : Type} (f : A <~> B) : Decidable A -> Decidable B := decidable_iff f.
Definition
Require Import
Basics\Decidable.v
decidable_equiv'
1,451
(A : Type) {B : Type} (f : A -> B) `{!IsEquiv f} : Decidable A -> Decidable B := ' _ (Build_Equiv _ _ f _).
Definition
Require Import
Basics\Decidable.v
decidable_equiv
1,452
(A : Type) {B : Type} (f : A -> B) `{IsEquiv A B f} : DecidablePaths A -> DecidablePaths B. Proof. intros d x y. destruct (d (f^-1 x) (f^-1 y)) as [e|ne]. - apply inl. exact ((eisretr f x)^ @ ap f e @ eisretr f y). - apply inr; intros p. apply ne, ap, p. Defined.
Definition
Require Import
Basics\Decidable.v
decidablepaths_equiv
1,453
decidablepaths_equiv' (A : Type) {B : Type} (f : A <~> B) : DecidablePaths A -> DecidablePaths B := decidablepaths_equiv A f.
Definition
Require Import
Basics\Decidable.v
decidablepaths_equiv'
1,454
{A B P} `{IsHProp P} (f : A -> P) (g : P -> B) : WeaklyConstant (g o f). Proof. intros x y; apply (ap g), path_ishprop. Defined.
Definition
Require Import
Basics\Decidable.v
wconst_through_hprop
1,455
(A : Type) `{IsHProp A} : Collapsible A. Proof. exists idmap. intros x y; apply path_ishprop. Defined.
Definition
Require Import
Basics\Decidable.v
collapsible_hprop
1,456
(A : Type) `{IsHSet A} : PathCollapsible A. Proof. intros x y; apply collapsible_hprop; exact _. Defined.
Definition
Require Import
Basics\Decidable.v
pathcoll_hset
1,457
(A : Type) `{DecidablePaths A} : IsHSet A. Proof. exact _. Defined.
Corollary
Require Import
Basics\Decidable.v
hset_decpaths
1,458
(A : Type) `{DecidablePaths A} (x : A) (P : forall (d : Decidable (x = x)), Type) (Px : P (inl idpath)) : forall d, P d. Proof. rapply (decidable_true idpath). intro p. assert (r : (idpath = p)) by apply path_ishprop. by destruct r. Defined.
Definition
Require Import
Basics\Decidable.v
decidable_paths_refl
1,459
A B : ~ A + ~ B -> ~ (A * B). Proof. intros [na|nb] [a b]. - exact (na a). - exact (nb b). Defined.
Definition
Require Import
Basics\Decidable.v
not_prod_sum_not
1,460
A B `{Decidable A} : ~ (A * B) <-> ~ A + ~ B. Proof. split. - intros np. destruct (dec A) as [a|na]. + exact (inr (fun b => np (a, b))). + exact (inl na). - apply not_prod_sum_not. Defined.
Definition
Require Import
Basics\Decidable.v
iff_not_prod
1,461
iff_not_prod' A B `{Decidable B} : ~ (A * B) <-> ~ A + ~ B. Proof. split. - intros np. destruct (dec B) as [b|nb]. + exact (inl (fun a => np (a, b))). + exact (inr nb). - apply not_prod_sum_not. Defined.
Definition
Require Import
Basics\Decidable.v
iff_not_prod'
1,462
(A : Type) : A <~> A := Build_Equiv A A idmap _.
Definition
Require Import
Basics\Equivalences.v
equiv_idmap
1,463
isequiv_compose' {A B : Type} (f : A -> B) (_ : IsEquiv f) {C : Type} (g : B -> C) (_ : IsEquiv g) : IsEquiv (g o f) := isequiv_compose.
Definition
Require Import
Basics\Equivalences.v
isequiv_compose'
1,464
{A B C : Type} (g : B -> C) (f : A -> B) `{IsEquiv B C g} `{IsEquiv A B f} : A <~> C := Build_Equiv A C (g o f) _.
Definition
Require Import
Basics\Equivalences.v
equiv_compose
1,465
equiv_compose' {A B C : Type} (g : B <~> C) (f : A <~> B) : A <~> C := equiv_compose g f.
Definition
Require Import
Basics\Equivalences.v
equiv_compose'
1,466
P x <~> P y := Build_Equiv _ _ (transport P p) _. End EquivTransport. Section Adjointify. Context {A B : Type} (f : A -> B) (g : B -> A). Context (isretr : f o g == idmap) (issect : g o f == idmap). Let issect' := fun x => ap g (ap f (issect x)^) @ ap g (isretr (f x)) @ issect x. Local is_adjoint' (a : A) : isretr (f a) = ap f (issect' a). Proof. unfold issect'. apply moveR_M1. repeat rewrite ap_pp, concat_p_pp; rewrite <- ap_compose. rewrite (concat_pA1 (fun b => (isretr b)^) (ap f (issect a)^)). repeat rewrite concat_pp_p; rewrite ap_V; apply moveL_Vp; rewrite concat_p1. rewrite concat_p_pp, <- ap_compose. rewrite (concat_pA1 (fun b => (isretr b)^) (isretr (f a))). rewrite concat_pV, concat_1p; reflexivity. Qed.
Definition
Require Import
Basics\Equivalences.v
equiv_transport
1,467
IsEquiv f := Build_IsEquiv A B f g isretr issect' is_adjoint'.
Definition
Require Import
Basics\Equivalences.v
isequiv_adjointify
1,468
A <~> B := Build_Equiv A B f isequiv_adjointify.
Definition
Require Import
Basics\Equivalences.v
equiv_adjointify
1,469
{A B : Type} (f : A -> B) {g : A -> B} `{IsEquiv A B f} (h : f == g) : IsEquiv g. Proof. snrapply isequiv_adjointify. - exact f^-1. - intro b. exact ((h _)^ @ eisretr f b). - intro a. exact (ap f^-1 (h a)^ @ eissect f a). Defined.
Definition
Require Import
Basics\Equivalences.v
isequiv_homotopic
1,470
isequiv_homotopic' {A B : Type} (f : A <~> B) {g : A -> B} (h : f == g) : IsEquiv g := isequiv_homotopic f h.
Definition
Require Import
Basics\Equivalences.v
isequiv_homotopic'
1,471
{A B : Type} (f : A -> B) {g : A -> B} `{IsEquiv A B f} (h : f == g) : A <~> B := Build_Equiv _ _ g (isequiv_homotopic f h).
Definition
Require Import
Basics\Equivalences.v
equiv_homotopic
1,472
{A B} (e : A <~> B) {f : A -> B} {g : B -> A} (h : f == e) (k : g == e^-1) : A <~> B. Proof. snrapply equiv_adjointify. - exact f. - exact g. - intro a. exact (ap f (k a) @ h _ @ eisretr e a). - intro b. exact (ap g (h b) @ k _ @ eissect e b). Defined.
Definition
Require Import
Basics\Equivalences.v
equiv_homotopic_inverse
1,473
{X : Type} (f : X -> X) (isinvol : f o f == idmap) : IsEquiv f := isequiv_adjointify f f isinvol isinvol.
Definition
Require Import
Basics\Equivalences.v
isequiv_involution
1,474
{X : Type} (f : X -> X) (isinvol : f o f == idmap) : X <~> X := equiv_adjointify f f isinvol isinvol.
Definition
Require Import
Basics\Equivalences.v
equiv_involution
1,475
`{IsEquiv A B f} (x : A) (y : B) (p : x = f^-1 y) : (f x = y) := ap f p @ eisretr f y.
Definition
Require Import
Basics\Equivalences.v
moveR_equiv_M
1,476
moveR_equiv_M' `(f : A <~> B) (x : A) (y : B) (p : x = f^-1 y) : (f x = y) := moveR_equiv_M x y p.
Definition
Require Import
Basics\Equivalences.v
moveR_equiv_M'
1,477
`{IsEquiv A B f} (x : A) (y : B) (p : f^-1 y = x) : (y = f x) := (eisretr f y)^ @ ap f p.
Definition
Require Import
Basics\Equivalences.v
moveL_equiv_M
1,478
moveL_equiv_M' `(f : A <~> B) (x : A) (y : B) (p : f^-1 y = x) : (y = f x) := moveL_equiv_M x y p.
Definition
Require Import
Basics\Equivalences.v
moveL_equiv_M'
1,479
`{IsEquiv A B f} (x : B) (y : A) (p : x = f y) : (f^-1 x = y) := ap (f^-1) p @ eissect f y.
Definition
Require Import
Basics\Equivalences.v
moveR_equiv_V
1,480
moveR_equiv_V' `(f : A <~> B) (x : B) (y : A) (p : x = f y) : (f^-1 x = y) := moveR_equiv_V x y p.
Definition
Require Import
Basics\Equivalences.v
moveR_equiv_V'
1,481
`{IsEquiv A B f} (x : B) (y : A) (p : f y = x) : (y = f^-1 x) := (eissect f y)^ @ ap (f^-1) p.
Definition
Require Import
Basics\Equivalences.v
moveL_equiv_V
1,482
moveL_equiv_V' `(f : A <~> B) (x : B) (y : A) (p : f y = x) : (y = f^-1 x) := moveL_equiv_V x y p.
Definition
Require Import
Basics\Equivalences.v
moveL_equiv_V'
1,483
A {B} (f : A -> B) `{IsEquiv A B f} `{Contr A} : Contr B. Proof. apply (Build_Contr _ (f (center A))). intro y. apply moveR_equiv_M. apply contr. Defined.
Lemma
Require Import
Basics\Equivalences.v
contr_equiv
1,484
contr_equiv' A {B} `(f : A <~> B) `{Contr A} : Contr B := contr_equiv A f.
Definition
Require Import
Basics\Equivalences.v
contr_equiv'
1,485
{A B : Type} `{Contr A} `{Contr B} : (A <~> B) := Build_Equiv _ _ (fun _ => center B) _. Global Instance isequiv_pr1 {A : Type} (P : A -> Type) `{forall x, Contr (P x)} : IsEquiv (@pr1 A P). Proof. apply (Build_IsEquiv _ _ (@pr1 A P) (fun x => (x ; center (P x))) (fun x => 1) (fun xy => match xy with | exist x y => ap (exist _ x) (contr _) end)). intros [x y]. rewrite <- ap_compose. symmetry; apply ap_const. Defined.
Definition
Require Import
Basics\Equivalences.v
equiv_contr_contr
1,486
{A : Type} (P : A -> Type) `{forall x, Contr (P x)} : { x : A & P x } <~> A := Build_Equiv _ _ (@pr1 A P) _.
Definition
Require Import
Basics\Equivalences.v
equiv_pr1
1,487
`(f : A -> B) `{IsEquiv A B f} (x y : A) : (x = y) <~> (f x = f y) := Build_Equiv _ _ (ap f) _.
Definition
Require Import
Basics\Equivalences.v
equiv_ap
1,488
equiv_ap' `(f : A <~> B) (x y : A) : (x = y) <~> (f x = f y) := equiv_ap f x y.
Definition
Require Import
Basics\Equivalences.v
equiv_ap'
1,489
`(f : A -> B) `{IsEquiv A B f} {x y : A} : (f x = f y) -> (x = y) := (ap f)^-1.
Definition
Require Import
Basics\Equivalences.v
equiv_inj
1,490
`{Funext} {A B C : Type} (f : A -> B) `{IsEquiv A B f} : (B -> C) <~> (A -> C) := Build_Equiv _ _ (fun (g:B->C) => g o f) _.
Definition
Require Import
Basics\Equivalences.v
equiv_precompose
1,491
equiv_precompose' `{Funext} {A B C : Type} (f : A <~> B) : (B -> C) <~> (A -> C) := Build_Equiv _ _ (fun (g:B->C) => g o f) _.
Definition
Require Import
Basics\Equivalences.v
equiv_precompose'
1,492
`{Funext} {A B C : Type} (f : B -> C) `{IsEquiv B C f} : (A -> B) <~> (A -> C) := Build_Equiv _ _ (fun (g:A->B) => f o g) _.
Definition
Require Import
Basics\Equivalences.v
equiv_postcompose
1,493
equiv_postcompose' `{Funext} {A B C : Type} (f : B <~> C) : (A -> B) <~> (A -> C) := Build_Equiv _ _ (fun (g:A->B) => f o g) _.
Definition
Require Import
Basics\Equivalences.v
equiv_postcompose'
1,494
{A B : Type} (f : A -> B) (precomp := (fun (C : Type) (h : B -> C) => h o f)) (Aeq : IsEquiv (precomp A)) (Beq : IsEquiv (precomp B)) : IsEquiv f. Proof. set (g:=(precomp A)^-1 idmap). pose proof (p:=eisretr (precomp A) idmap : g o f = idmap). refine (isequiv_adjointify f g (ap10 _) (ap10 p)). apply (equiv_inj (precomp B)). unfold precomp; cbn. exact (ap (fun k => f o k) p). Defined.
Definition
Require Import
Basics\Equivalences.v
isequiv_isequiv_precompose
1,495
{A B : Type} (f : A -> B) (postcomp := (fun (C : Type) (h : C -> A) => f o h)) (Aeq : IsEquiv (postcomp A)) (Beq : IsEquiv (postcomp B)) : IsEquiv f. Proof. set (g:=(postcomp B)^-1 idmap). pose proof (p:=eisretr (postcomp B) idmap : f o g = idmap). refine (isequiv_adjointify f g (ap10 p) (ap10 _)). apply (equiv_inj (postcomp A)). unfold postcomp; cbn. exact (ap (fun k => k o f) p). Defined.
Definition
Require Import
Basics\Equivalences.v
isequiv_isequiv_postcompose
1,496
{A B : Type} : (A <~> B) -> (B <~> A). Proof. intro e. exists (e^-1). apply isequiv_inverse. Defined.
Theorem
Require Import
Basics\Equivalences.v
equiv_inverse
1,497
{A B C} (f : A <~> B) (g : B <~> C) : (g oE f)^-1 == f^-1 oE g^-1. Proof. intros x; reflexivity. Defined.
Definition
Require Import
Basics\Equivalences.v
equiv_inverse_compose
1,498
{A B} (f g : A <~> B) (p : f == g) : g^-1 == f^-1. Proof. intros x; refine (_ @ _ @ _). 1:symmetry; apply (eissect f). 1:apply ap, p. apply ap, eisretr. Defined.
Definition
Require Import
Basics\Equivalences.v
equiv_inverse_homotopy
1,499