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
|
---|---|---|---|---|---|
IsBoundedSemiLattice B. Proof. split. - apply (projected_com_monoid f);trivial. - repeat intro; apply (injective f). rewrite op_correct, (idempotency (+) _). trivial. Qed. | Lemma | Require Import | Classes\theory\lattices.v | projected_bounded_sl | 3,300 |
IsJoinPreserving f -> IsJoinPreserving g -> IsJoinPreserving (g ∘ f). Proof. red; apply _. Qed. | Instance | Require Import | Classes\theory\lattices.v | compose_join_sl_morphism | 3,301 |
IsMeetPreserving f -> IsMeetPreserving g -> IsMeetPreserving (g ∘ f). Proof. red;apply _. Qed. | Instance | Require Import | Classes\theory\lattices.v | compose_meet_sl_morphism | 3,302 |
IsBoundedJoinPreserving f -> IsBoundedJoinPreserving g -> IsBoundedJoinPreserving (g ∘ f). Proof. red; apply _. Qed. | Instance | Require Import | Classes\theory\lattices.v | compose_bounded_join_sl_morphism | 3,303 |
IsLatticePreserving f -> IsLatticePreserving g -> IsLatticePreserving (g ∘ f). Proof. split; apply _. Qed. | Instance | Require Import | Classes\theory\lattices.v | compose_lattice_morphism | 3,304 |
forall `{!IsEquiv f}, IsJoinPreserving f -> IsJoinPreserving (f^-1). Proof. red; apply _. Qed. | Instance | Require Import | Classes\theory\lattices.v | invert_join_sl_morphism | 3,305 |
forall `{!IsEquiv f}, IsMeetPreserving f -> IsMeetPreserving (f^-1). Proof. red; apply _. Qed. | Instance | Require Import | Classes\theory\lattices.v | invert_meet_sl_morphism | 3,306 |
forall `{!IsEquiv f}, IsBoundedJoinPreserving f -> IsBoundedJoinPreserving (f^-1). Proof. red; apply _. Qed. | Instance | Require Import | Classes\theory\lattices.v | invert_bounded_join_sl_morphism | 3,307 |
forall `{!IsEquiv f}, IsLatticePreserving f -> IsLatticePreserving (f^-1). Proof. split; apply _. Qed. | Instance | Require Import | Classes\theory\lattices.v | invert_lattice_morphism | 3,308 |
`{Naturals N} `{IsSemiCRing SR} (f: N -> SR) `{!IsSemiRingPreserving f} x : f x = naturals_to_semiring N SR x. Proof. symmetry. apply naturals_initial. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | to_semiring_unique | 3,309 |
`{Naturals N} `{IsSemiCRing SR} (f g: N -> SR) `{!IsSemiRingPreserving f} `{!IsSemiRingPreserving g} x : f x = g x. Proof. rewrite (to_semiring_unique f), (to_semiring_unique g);reflexivity. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | to_semiring_unique_alt | 3,310 |
N `{Naturals N} N2 `{Naturals N2} x : naturals_to_semiring N2 N (naturals_to_semiring N N2 x) = x. Proof. change (Compose (naturals_to_semiring N2 N) (naturals_to_semiring N N2) x = id x). apply to_semiring_unique_alt;apply _. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | to_semiring_involutive | 3,311 |
`{Naturals N} `{IsSemiCRing R} (f : R -> N) (g : N -> R) `{!IsSemiRingPreserving f} `{!IsSemiRingPreserving g} x : f (g x) = x. Proof. exact (to_semiring_unique_alt (f ∘ g) id _). Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | morphisms_involutive | 3,312 |
`{Naturals N} `{IsSemiCRing R1} `{IsSemiCRing R2} (f : R1 -> R2) (g : N -> R1) (h : N -> R2) `{!IsSemiRingPreserving f} `{!IsSemiRingPreserving g} `{!IsSemiRingPreserving h} x : f (g x) = h x. Proof. exact (to_semiring_unique_alt (f ∘ g) h _). Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | to_semiring_twice | 3,313 |
`{Naturals N} (f : N -> N) `{!IsSemiRingPreserving f} x : f x = x. Proof. exact (to_semiring_unique_alt f id _). Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | to_semiring_self | 3,314 |
`{Naturals N} `{IsSemiCRing A} (f: A -> N) (g: N -> A) `{!IsSemiRingPreserving f} `{!IsSemiRingPreserving g} : IsInjective g. Proof. intros x y E. change (id x = id y). rewrite <-(to_semiring_twice f g id x), <-(to_semiring_twice f g id y). apply ap,E. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | to_semiring_injective | 3,315 |
NaturalsToSemiRing SR := fun R _ _ _ _ _ => naturals_to_semiring N R ∘ f^-1. | Definition | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | retract_is_nat_to_sr | 3,316 |
x : (naturals_to_semiring N R ∘ f^-1) x = h x. Proof. transitivity ((h ∘ (f ∘ f^-1)) x). - symmetry. apply (to_semiring_unique (h ∘ f)). - unfold Compose. apply ap, eisretr. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | same_morphism | 3,317 |
Naturals SR (U:=retract_is_nat_to_sr). Proof. split;try apply _. - unfold naturals_to_semiring, retract_is_nat_to_sr. apply _. - intros;apply same_morphism;apply _. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | retract_is_nat | 3,318 |
(N':Type@{U}) `{Naturals@{U U U U U U U U} N'} : forall (P : SemiRings.Operations -> Type), P (SemiRings.BuildOperations N') -> P (SemiRings.BuildOperations N). Proof. apply SemiRings.iso_leibnitz with (naturals_to_semiring N' N);apply _. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | from_nat_stmt | 3,319 |
forall (P: N -> Type), P 0 -> (forall n, P n -> P (1 + n)) -> forall n, P n. Proof. pose (Q := fun s : SemiRings.Operations => forall P : s -> Type, P 0 -> (forall n, P n -> P (1 + n)) -> forall n, P n). change (Q (SemiRings.BuildOperations N)). apply (from_nat_stmt nat). unfold Q;clear Q. simpl. exact nat_induction. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | induction | 3,320 |
forall x : N, x = 0 |_| exists y : N, (x = 1 + y)%mc. Proof. refine (from_nat_stmt nat (fun s => forall x : s, x = 0 |_| exists y : s, (x = 1 + y)%mc) _). simpl. intros [|x];eauto. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | case | 3,321 |
PropHolds ((1:N) <> 0). Proof. refine (from_nat_stmt nat (fun s => PropHolds ((1:s) <> 0)) _). apply _. Qed. | Instance | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | nat_nontrivial | 3,322 |
`{Apart N} `{!TrivialApart N} : PropHolds ((1:N) ≶ 0). Proof. apply apartness.ne_apart. solve_propholds. Qed. | Instance | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | nat_nontrivial_apart | 3,323 |
forall (x y : N), x + y = 0 -> x = 0 /\ y = 0. Proof. refine (from_nat_stmt nat (fun s => forall x y : s, x + y = 0 -> x = 0 /\ y = 0) _). simpl. apply plus_eq_zero. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | zero_sum | 3,324 |
forall (x y : N), x + y = 1 -> (x = 1 /\ y = 0) |_| (x = 0 /\ y = 1). Proof. refine (from_nat_stmt nat (fun s => forall (x y : s), x + y = 1 -> (x = 1 /\ y = 0) |_| (x = 0 /\ y = 1)) _). simpl. intros [|x] [|y];auto. - intros E. rewrite add_S_l,add_0_r in E. apply S_inj in E. rewrite E. auto. - intros E. rewrite add_S_l,add_S_r in E. apply S_inj in E. destruct (S_neq_0 _ E). Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | one_sum | 3,325 |
x : 1 + x <> 0. Proof. intro E. destruct (zero_sum 1 x E). apply nat_nontrivial. trivial. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | nat_1_plus_ne_0 | 3,326 |
x y : -f x = f y -> x = 0 /\ y = 0. Proof. intros E. apply zero_sum, (injective f). rewrite rings.preserves_0, rings.preserves_plus, <-E. apply plus_negate_r. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | to_ring_zero_sum | 3,327 |
x y : -f x = f y -> f x = f y. Proof. intros E. destruct (to_ring_zero_sum x y E) as [E2 E3]. rewrite E2, E3. reflexivity. Qed. | Lemma | Require Import Require Import Import SemiRings. | Classes\theory\naturals.v | negate_to_ring | 3,328 |
{a b : NatDistance N} : forall x y, @nat_distance _ _ a x y = @nat_distance _ _ b x y. Proof. intros. unfold nat_distance. destruct (@nat_distance_sig _ _ a x y) as [[z1 E1]|[z1 E1]], (@nat_distance_sig _ _ b x y) as [[z2 E2]|[z2 E2]];simpl. - apply (left_cancellation plus x). path_via y. - rewrite <-(rings.plus_0_r y),<-E2,<-rings.plus_assoc in E1. apply (left_cancellation plus y) in E1. apply naturals.zero_sum in E1. destruct E1;path_via 0. - rewrite <-(rings.plus_0_r x),<-E2,<-rings.plus_assoc in E1. apply (left_cancellation plus x) in E1. apply naturals.zero_sum in E1. destruct E1;path_via 0. - apply (left_cancellation plus y);path_via x. Qed. | Lemma | Require Import Require Import | Classes\theory\nat_distance.v | nat_distance_unique | 3,329 |
Approximation@{i} (A:Type@{i}) {Aclose : Closeness A} := | Record | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Approximation@ | 3,330 |
`{Funext} `{Closeness A} `{forall e x y, IsHProp (close e x y)} : forall x y : Approximation A, approximate _ x = approximate _ y -> x = y. Proof. intros [x Ex] [y Ey];simpl;intros E. destruct E. apply ap. apply path_ishprop. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | approx_eq | 3,331 |
IsLimit@{i} {A:Type@{i} } {Aclose : Closeness A} (x : Approximation A) (l : A) := forall e d : Q+, close (e+d) (x d) l. | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | IsLimit@ | 3,332 |
`{Rounded A} : forall d d' u v, close d u v -> close (d+d') u v. Proof. intros d d' u v xi;apply rounded. apply tr;exists d,d';auto. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | rounded_plus | 3,333 |
rounded_le' `{Rounded A} : forall e u v, close e u v -> forall d, ' e <= ' d -> close d u v. Proof. intros e u v xi d E. apply le_equiv_lt in E. destruct E as [E|E]. - apply pos_eq in E. rewrite <-E;trivial. - pose proof (pos_eq _ (_ + _) (Qpos_diff_pr _ _ E)) as E'. rewrite E'. apply rounded_plus. trivial. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | rounded_le' | 3,334 |
rounded_le@{i j} := ltac:(first [exact @rounded_le'@{j i Ularge}| exact @rounded_le'@{j i Ularge j}| exact @rounded_le'@{i j}]). Arguments rounded_le {A _ _} e u v _ d _. Section close_prod. Universe UA UB i. Context (A:Type@{UA}) (B:Type@{UB}) `{Closeness A} `{Closeness B} `{forall e, is_mere_relation A (close e)} `{forall e, is_mere_relation B (close e)}. Global Instance close_prod@{} : Closeness@{i} (A /\ B) := fun e x y => close e (fst x) (fst y) /\ close e (snd x) (snd y). Global Instance close_prod_refl@{} `{forall e, Reflexive (close (A:=A) e)} `{forall e, Reflexive (close (A:=B) e)} : forall e, Reflexive (close (A:=A /\ B) e). Proof. intros e;split;reflexivity. Qed. | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | rounded_le@ | 3,335 |
close_prod_rounded' `{!Rounded A} `{!Rounded B} : Rounded (A /\ B). Proof. intros e u v. split. - intros [E0 E0'];apply rounded in E0;apply rounded in E0'. revert E0;apply (Trunc_ind _);intros [d1 [d1' [E1 E2]]]. revert E0';apply (Trunc_ind _);intros [d2 [d2' [E3 E4]]]. apply tr;exists (join d1 d2), (meet d1' d2');split. + rewrite E1. apply Qpos_sum_eq_join_meet. rewrite <-E1;trivial. + split. * apply rounded_le with d1;trivial. apply join_ub_l. * apply rounded_le with d2;trivial. apply join_ub_r. - apply (Trunc_ind _);intros [d [d' [E1 E2]]]. rewrite E1;split;apply rounded_plus,E2. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | close_prod_rounded' | 3,336 |
close_prod_rounded@{j} := ltac:(first [exact @close_prod_rounded'@{j j j j j}| exact @close_prod_rounded'@{j j}| exact @close_prod_rounded'@{j j j}]). | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | close_prod_rounded@ | 3,337 |
prod_premetric@{j} `{!PreMetric@{UA j} A} `{!PreMetric@{UB j} B} : PreMetric@{i j} (A /\ B). Proof. split;try apply _. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | prod_premetric@ | 3,338 |
forall e (f g : A -> B), close e f g -> forall x, close e (f x) (g x). Proof. intros e f g E x;revert E;apply (Trunc_ind _);intros [d [d' [E1 E2]]]. rewrite E1;apply rounded_plus;trivial. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | close_arrow_apply | 3,339 |
BinaryDup@{i} {A : Type@{i} } : A -> A /\ A := fun x => (x, x). | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | BinaryDup@ | 3,340 |
{A B C D} (f : A -> C) (g : B -> D) : A /\ B -> C /\ D := fun x => (f (fst x), g (snd x)). Section closeness. Universe UA. Context {A:Type@{UA} } `{Closeness A}. Global Instance id_nonexpanding : NonExpanding (@id A). Proof. hnf;trivial. Qed. | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | map2 | 3,341 |
nonexpanding_lipschitz' `{!NonExpanding f} : Lipschitz f 1. Proof. red. intro;rewrite left_identity;apply non_expanding,_. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | nonexpanding_lipschitz' | 3,342 |
nonexpanding_lipschitz@{} `{!NonExpanding f} : Lipschitz f 1 := ltac:(first [exact nonexpanding_lipschitz'@{Ularge}| exact nonexpanding_lipschitz'@{}]). | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | nonexpanding_lipschitz@ | 3,343 |
lipschitz_nonexpanding@{} `{!Lipschitz f 1} : NonExpanding f. Proof. red. intros e x y E;rewrite <-(left_identity e). apply (lipschitz f 1 E). Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | lipschitz_nonexpanding@ | 3,344 |
uniform_continuous@{} mu `{!Uniform@{UA UB} f mu} : Continuous f. Proof. hnf. intros u e;apply tr;exists (mu e). apply (uniform f mu). Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | uniform_continuous@ | 3,345 |
lipschitz_continuous@{} (L:Q+) `{!Lipschitz f L} : Continuous f := _. | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | lipschitz_continuous@ | 3,346 |
nonexpanding_continuous@{} `{!NonExpanding f} : Continuous f := _. End closeness. Section compositions. Universe UA. Context {A:Type@{UA} } `{Closeness A}. Universe UB. Context {B:Type@{UB} } `{Closeness B}. Universe UC. Context {C:Type@{UC} } `{Closeness C} (g : B -> C) (f : A -> B). Global Instance nonexpanding_compose@{} {Eg : NonExpanding g} {Ef : NonExpanding f} : NonExpanding (Compose g f). Proof. hnf. intros e x y xi;exact (non_expanding g (non_expanding f xi)). Qed. | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | nonexpanding_continuous@ | 3,347 |
lipschitz_compose_nonexpanding_r' L {Eg : Lipschitz g L} {Ef : NonExpanding f} : Lipschitz (Compose g f) L. Proof. rewrite <-(left_identity L),commutativity. apply _. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | lipschitz_compose_nonexpanding_r' | 3,348 |
lipschitz_compose_nonexpanding_l' L {Eg : NonExpanding g} {Ef : Lipschitz f L} : Lipschitz (Compose g f) L. Proof. rewrite <-(left_identity L). apply _. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | lipschitz_compose_nonexpanding_l' | 3,349 |
uniform_compose@{} mu {Eg : Uniform g mu} mu' {Ef : Uniform f mu'} : Uniform (Compose g f) (Compose mu' mu). Proof. intros e u v xi. unfold Compose. apply (uniform g _),(uniform f _),xi. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | uniform_compose@ | 3,350 |
`{!Rounded A} `{!Rounded B} (f : A -> B -> C) mu mu' `{!forall x, Uniform (f x) mu} `{!forall y, Uniform (fun x => f x y) mu'} : Uniform (uncurry f) (fun e => meet (mu (e/2)) (mu' (e/2))). Proof. intros e [u1 u2] [v1 v2] [xi1 xi2]. simpl in *. rewrite (pos_split2 e). apply (triangular _ (f u1 v2)). - apply (uniform (f u1) _). eapply rounded_le. + exact xi2. + apply meet_lb_l. - apply (uniform (fun v => f v v2) _). eapply rounded_le. + exact xi1. + apply meet_lb_r. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | uncurry_uniform | 3,351 |
map2_nonexpanding' `{!NonExpanding f} `{!NonExpanding g} : NonExpanding (map2 f g). Proof. intros e u v xi;split;simpl; apply (non_expanding _),xi. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | map2_nonexpanding' | 3,352 |
map2_nonexpanding@{i} := @map2_nonexpanding'@{i i}. | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | map2_nonexpanding@ | 3,353 |
map2_lipschitz' `{!Rounded C} `{!Rounded D} Lf Lg `{!Lipschitz f Lf} `{!Lipschitz g Lg} : Lipschitz (map2 f g) (join Lf Lg). Proof. intros e u v xi. split;simpl. - apply rounded_le with (Lf * e). + apply (lipschitz _ _),xi. + apply (order_preserving (.* ' e)). apply join_ub_l. - apply rounded_le with (Lg * e). + apply (lipschitz _ _),xi. + apply (order_preserving (.* ' e)). apply join_ub_r. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | map2_lipschitz' | 3,354 |
map2_lipschitz@{i} := ltac:(first [exact @map2_lipschitz'@{i i i}|exact @map2_lipschitz'@{i i i i}]). | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | map2_lipschitz@ | 3,355 |
map2_continuous' `{!Rounded A} `{!Rounded B} `{!Continuous f} `{!Continuous g} : Continuous (map2 f g). Proof. intros u e. apply (merely_destruct (continuous f (fst u) e));intros [d1 E1]. apply (merely_destruct (continuous g (snd u) e));intros [d2 E2]. apply tr;exists (meet d1 d2). intros v xi. split;simpl. - apply E1. apply rounded_le with (meet d1 d2). + apply xi. + apply meet_lb_l. - apply E2. apply rounded_le with (meet d1 d2). + apply xi. + apply meet_lb_r. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | map2_continuous' | 3,356 |
map2_continuous@{i} := ltac:(first [exact @map2_continuous'@{i i i}|exact @map2_continuous'@{i i i i}]). | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | map2_continuous@ | 3,357 |
a b := sig (fun x : A => a <= x /\ x <= b). | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Interval | 3,358 |
a b : Interval a b -> A := pr1. | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | interval_proj | 3,359 |
Interval_restrict@{} (a b : A) (E : a <= b) : A -> Interval a b. Proof. intros x. exists (join a (meet x b)). split. - apply join_ub_l. - apply join_le. + exact E. + apply meet_lb_r. Defined. | Definition | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Interval_restrict@ | 3,360 |
forall a b E x (E': a <= x /\ x <= b), Interval_restrict a b E x = exist _ x E'. Proof. intros a b E x E'. unfold Interval_restrict. apply Sigma.path_sigma_hprop. simpl. rewrite meet_l;[apply join_r|];apply E'. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Interval_restrict_pr | 3,361 |
Interval_premetric@{i} `{!PreMetric@{UA i} A} a b : PreMetric@{UA i} (Interval a b). Proof. split. - unfold close;simpl. apply _. - intros e u. red;red. reflexivity. - intros e u v xi;red;red;symmetry;apply xi. - intros u v E. apply Sigma.path_sigma_hprop. apply separated,E. - intros u v w e d xi1 xi2. red;red. apply (triangular _ (interval_proj a b v)). + exact xi1. + exact xi2. - intros e u v. split. + intros xi. do 2 red in xi. apply (fst (rounded _ _ _)) in xi. exact xi. + intros E. unfold close,Interval_close in E. apply (snd (rounded _ _ _)) in E. exact E. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Interval_premetric@ | 3,362 |
forall e (q r : Q), close e q r <-> abs (q - r) < ' e. Proof. intros e q r;split. - intros [E1 E2]. destruct (total le 0 (q - r)) as [E|E]. + rewrite (Qabs_of_nonneg _ E). trivial. + rewrite (Qabs_of_nonpos _ E). apply flip_lt_negate. rewrite involutive. trivial. - intros E. split;[apply flip_lt_negate;rewrite involutive|]; apply le_lt_trans with (abs (q - r));trivial. + apply Qabs_le_neg_raw. + apply Qabs_le_raw. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Qclose_alt | 3,363 |
Qclose_neg@{} : forall e (x y : Q), close e x y <-> close e (- x) (- y). Proof. intros e x y;split;intros E;apply Qclose_alt in E;apply Qclose_alt. - rewrite <-(negate_plus_distr),Qabs_neg. trivial. - rewrite <-(negate_plus_distr),Qabs_neg in E. trivial. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Qclose_neg@ | 3,364 |
Q_close_symm@{} : forall e, Symmetric (@close Q _ e). Proof. red;unfold close;simpl. intros e x y [E1 E2];split. - apply flip_lt_negate. rewrite <-negate_swap_r,involutive. trivial. - apply flip_lt_negate. rewrite negate_swap_r,involutive. trivial. Qed. | Instance | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Q_close_symm@ | 3,365 |
Q_triangular_one@{} : forall (q r : Q) (e : Q+) (Hqr : close e q r) (q0 : Q) (n : Q+), (close n q q0 -> close (e + n) r q0). Proof. unfold close;simpl. intros q r e [E1 E1'] s n [E2 E2']. split. - apply flip_lt_negate. rewrite negate_swap_r,!involutive. apply flip_lt_negate in E2. rewrite negate_swap_r,!involutive in E2. pose proof (plus_lt_compat _ _ _ _ E1' E2) as E. assert (Hrw : s - r = q - r + (s - q)) by abstract ring_tac.ring_with_integers (NatPair.Z nat). rewrite Hrw;trivial. - apply flip_lt_negate in E1. rewrite negate_swap_r,!involutive in E1. pose proof (plus_lt_compat _ _ _ _ E1 E2') as E. assert (Hrw : r - s = r - q + (q - s)) by abstract ring_tac.ring_with_integers (NatPair.Z nat). rewrite Hrw;trivial. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Q_triangular_one@ | 3,366 |
Q_triangular@{} : Triangular Q. Proof. hnf. intros u v w e d E1 E2. apply Q_triangular_one with v. - symmetry;trivial. - trivial. Qed. | Instance | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Q_triangular@ | 3,367 |
forall q r : Q, (forall e, close e q r) -> ~ (q < r). Proof. intros q r E1 E2. pose proof (E1 (Qpos_diff _ _ E2)) as E3. apply symmetry in E3;apply Qclose_alt in E3. unfold cast in E3;simpl in E3. apply (irreflexivity lt (r - q)). apply le_lt_trans with (abs (r - q));trivial. apply Qabs_le_raw. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Qclose_separating_not_lt | 3,368 |
Separated Q. Proof. hnf. intros q r E1. apply tight_apart. intros E2. apply apart_iff_total_lt in E2. destruct E2 as [E2|E2]. - exact (Qclose_separating_not_lt _ _ E1 E2). - refine (Qclose_separating_not_lt _ _ _ E2). intros;symmetry;trivial. Qed. | Instance | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Qclose_separating | 3,369 |
Qclose_rounded@{} : Rounded Q. Proof. intros e q r;split. - intros E;apply Qclose_alt in E. pose proof (Q_average_between _ _ E) as [E1 E2]. apply tr;simple refine (exist _ (mkQpos ((abs (q - r) + ' e) / 2) _) _). { apply pos_mult_compat;[|solve_propholds]. red. apply pos_plus_le_lt_compat_r;[solve_propholds|apply Qabs_nonneg]. } simpl. exists (Qpos_diff _ _ E2). split. + apply pos_eq. exact (Qpos_diff_pr _ _ E2). + apply Qclose_alt. exact E1. - apply (Trunc_ind _). intros [d [d' [He xi]]]. apply Qclose_alt;rewrite He. apply Qclose_alt in xi. apply lt_le_trans with (' d);trivial. apply nonneg_plus_le_compat_r. solve_propholds. Qed. | Instance | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | Qclose_rounded@ | 3,370 |
forall x l1 l2, IsLimit x l1 -> IsLimit x l2 -> l1 = l2. Proof. intros x l1 l2 E1 E2. apply separated. intros e. rewrite (pos_split2 e),(pos_split2 (e/2)). apply triangular with (x (e / 2 / 2));[symmetry;apply E1|apply E2]. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | limit_unique | 3,371 |
forall (y : Approximation A) ly, IsLimit y ly -> forall u e d, close e u (y d) -> close (e+d) u ly. Proof. intros y ly E1 u e d xi. apply (merely_destruct ((fst (rounded _ _ _) xi))). intros [d0 [d' [He E2]]]. pose proof (triangular _ _ _ _ _ E2 (E1 d' _)) as E3. assert (Hrw : e + d = d0 + (d' + d));[|rewrite Hrw;trivial]. rewrite He. symmetry. apply Qpos_plus_assoc. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | equiv_through_approx0 | 3,372 |
forall u (y : Approximation A) e d, close e u (y d) -> close (e+d) u (lim y). Proof. intros u y;apply equiv_through_approx0. apply cauchy_complete. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | equiv_through_approx | 3,373 |
(x y : Approximation A) (e d n e' : Q+) : e = d + n + e' -> close e' (x d) (y n) -> close e (lim x) (lim y). Proof. intros He xi. rewrite He. assert (Hrw : d + n + e' = e' + d + n) by (apply pos_eq;ring_tac.ring_with_nat); rewrite Hrw;clear Hrw. apply equiv_through_approx. symmetry. apply equiv_through_approx. symmetry;trivial. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | equiv_lim_lim | 3,374 |
lim_same_distance@{} : forall (x y : Approximation A) e, (forall d n, close (e+d) (x n) (y n)) -> forall d, close (e+d) (lim x) (lim y). Proof. intros x y e E d. apply equiv_lim_lim with (d/3) (d/3) (e + d/3);[|apply E]. path_via (e + 3 / 3 * d). - rewrite pos_recip_r,Qpos_mult_1_l;trivial. - apply pos_eq;ring_tac.ring_with_nat. Qed. | Lemma | Require Import Import NatPair.Instances. Import Quoting.Instances. | Classes\theory\premetric.v | lim_same_distance@ | 3,375 |
Qpos@{} : Type@{UQ} := mkQpos { pos : Q; is_pos : 0 < pos }. | Record | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qpos@ | 3,376 |
Qpos_plus_pr@{} : forall a b : Qpos, 0 < 'a + 'b. Proof. intros. apply semirings.pos_plus_compat;apply is_pos. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qpos_plus_pr@ | 3,377 |
pos_eq@{} : forall a b : Q+, @paths Q (' a) (' b) -> a = b. Proof. intros [a Ea] [b Eb] E. change (a = b) in E. destruct E;apply ap;apply path_ishprop. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | pos_eq@ | 3,378 |
pos_recip_r@{} : forall e : Q+, e / e = 1. Proof. intros;apply pos_eq. unfold dec_recip,cast,pos_recip;simpl. change (' e / ' e = 1). apply dec_recip_inverse. apply lt_ne_flip. solve_propholds. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | pos_recip_r@ | 3,379 |
pos_recip_r'@{} : forall e : Q+, @paths Q (' e / ' e) 1. Proof. intros. change (' (e / e) = 1). rewrite pos_recip_r. reflexivity. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | pos_recip_r'@ | 3,380 |
pos_mult_1_r@{} : forall e : Q+, e * 1 = e. Proof. intros;apply pos_eq. apply mult_1_r. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | pos_mult_1_r@ | 3,381 |
pos_split2@{} : forall e : Q+, e = e / 2 + e / 2. Proof. intros. path_via (e * (2 / 2)). - rewrite pos_recip_r,pos_mult_1_r;reflexivity. - apply pos_eq. change (' e * (2 / 2) = ' e / 2 + ' e / 2). ring_tac.ring_with_nat. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | pos_split2@ | 3,382 |
pos_split3@{} : forall e : Q+, e = e / 3 + e / 3 + e / 3. Proof. intros. path_via (e * (3 / 3)). - rewrite pos_recip_r,pos_mult_1_r;reflexivity. - apply pos_eq. change (' e * (3 / 3) = ' e / 3 + ' e / 3 + ' e / 3). ring_tac.ring_with_nat. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | pos_split3@ | 3,383 |
pos_recip_through_plus@{} : forall a b c : Q+, a + b = c * (a / c + b / c). Proof. intros. path_via ((a + b) * (c / c)). - rewrite pos_recip_r;apply pos_eq,symmetry,mult_1_r. - apply pos_eq;ring_tac.ring_with_nat. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | pos_recip_through_plus@ | 3,384 |
pos_unconjugate@{} : forall a b : Q+, a * b / a = b. Proof. intros. path_via (a / a * b). - apply pos_eq;ring_tac.ring_with_nat. - rewrite pos_recip_r;apply Qpos_mult_1_l. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | pos_unconjugate@ | 3,385 |
/ 1 = 1 :> Q+. Proof. apply pos_eq. exact dec_recip_1. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qpos_recip_1 | 3,386 |
@LeftDistribute Q+ mult plus. Proof. hnf. intros;apply pos_eq,plus_mult_distr_l. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qpos_plus_mult_distr_l | 3,387 |
Q_sum_eq_join_meet@{} : forall a b c d : Q, a + b = c + d -> a + b = join a c + meet b d. Proof. intros ???? E. destruct (total le a c) as [E1|E1]. - rewrite (join_r _ _ E1). rewrite meet_r;trivial. apply (order_preserving (+ b)) in E1. rewrite E in E1. apply (order_reflecting (c +)). trivial. - rewrite (join_l _ _ E1). rewrite meet_l;trivial. apply (order_reflecting (a +)). rewrite E. apply (order_preserving (+ d)). trivial. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Q_sum_eq_join_meet@ | 3,388 |
Qpos_sum_eq_join_meet@{} : forall a b c d : Q+, a + b = c + d -> a + b = join a c + meet b d. Proof. intros ???? E. apply pos_eq;apply Q_sum_eq_join_meet. change (' a + ' b) with (' (a + b)). rewrite E;reflexivity. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qpos_sum_eq_join_meet@ | 3,389 |
forall a b : Q+, ' a <= ' b -> exists c ca cb, a = c + ca /\ b = c + cb. Proof. intros a b E. exists (a/2),(a/2). simple refine (exist _ _ _);simpl. - exists (' (a / 2) + (' b - ' a)). apply nonneg_plus_lt_compat_r. + apply (snd (flip_nonneg_minus _ _)). trivial. + solve_propholds. - split. + apply pos_split2. + apply pos_eq. unfold cast at 2;simpl. unfold cast at 3;simpl. set (a':=a/2);rewrite (pos_split2 a);unfold a';clear a'. ring_tac.ring_with_integers (NatPair.Z nat). Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qpos_le_lt_min | 3,390 |
Qpos_lt_min@{} : forall a b : Q+, exists c ca cb : Q+, a = c + ca /\ b = c + cb. Proof. intros. destruct (total le (' a) (' b)) as [E|E]. - apply Qpos_le_lt_min;trivial. - apply Qpos_le_lt_min in E. destruct E as [c [cb [ca [E1 E2]]]]. exists c,ca,cb;auto. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qpos_lt_min@ | 3,391 |
forall q r : Q, q < r -> Q+. Proof. intros q r E;exists (r-q). apply (snd (flip_pos_minus _ _) E). Defined. | Definition | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qpos_diff | 3,392 |
Qpos_diff_pr@{} : forall q r E, r = q + ' (Qpos_diff q r E). Proof. intros q r E. change (r = q + (r - q)). abstract ring_tac.ring_with_integers (NatPair.Z nat). Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qpos_diff_pr@ | 3,393 |
forall a b c : Q, meet (a + b) (a + c) = a + meet b c. Proof. intros. destruct (total le b c) as [E|E]. - rewrite (meet_l _ _ E). apply meet_l. apply (order_preserving (a +)),E. - rewrite (meet_r _ _ E). apply meet_r. apply (order_preserving (a +)),E. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qmeet_plus_l | 3,394 |
Qabs_nonneg@{} : forall q : Q, 0 <= abs q. Proof. intros q;destruct (total_abs_either q) as [E|E];destruct E as [E1 E2];rewrite E2. - trivial. - apply flip_nonneg_negate. rewrite involutive;trivial. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qabs_nonneg@ | 3,395 |
Qabs_nonpos_0@{} : forall q : Q, abs q <= 0 -> q = 0. Proof. intros q E. pose proof (antisymmetry le _ _ E (Qabs_nonneg _)) as E1. destruct (total_abs_either q) as [[E2 E3]|[E2 E3]];rewrite E3 in E1. - trivial. - apply (injective (-)). rewrite negate_0. trivial. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qabs_nonpos_0@ | 3,396 |
forall q : Q, q = 0 |_| 0 < abs q. Proof. intros q. destruct (le_or_lt (abs q) 0) as [E|E]. - left. apply Qabs_nonpos_0. trivial. - right. trivial. Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qabs_0_or_pos | 3,397 |
Qabs_of_nonneg@{} : forall q : Q, 0 <= q -> abs q = q. Proof. intro;apply ((abs_sig _).2). Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qabs_of_nonneg@ | 3,398 |
forall q : Q, q <= 0 -> abs q = - q. Proof. intro;apply ((abs_sig _).2). Qed. | Lemma | Require Import Import Quoting.Instances. Import NatPair.Instances. | Classes\theory\rationals.v | Qabs_of_nonpos | 3,399 |