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
{A:Type} (R : Relation A) : Type := {_ : Reflexive R | { _ : Symmetric R | Transitive R}}. Global Instance trunc_sig_equiv_rel `{Funext} {A : Type} (R : Relation A) {n} `{!forall (x y : A), IsTrunc n (R x y)} : IsTrunc n ( R). Proof. apply @istrunc_sigma. - apply istrunc_forall. - intros. apply @istrunc_sigma; intros; apply istrunc_forall. Defined.
Definition
null
Classes\interfaces\canonical_names.v
SigEquivRel
2,800
{A:Type} (R : Relation A) : SigEquivRel R <~> EquivRel R. Proof. issig. Defined.
Lemma
null
Classes\interfaces\canonical_names.v
issig_equiv_rel
2,801
Set := LT | EQ | GT.
Inductive
null
Classes\interfaces\canonical_names.v
comparison
2,802
{l} (islim : IsLimit x l) (epsilon : Qpos Q) : x (M (epsilon / 2)) - ' (' epsilon) < l < x (M (epsilon / 2)) + ' (' epsilon). Proof. assert (lim_close := is_limit x (epsilon / 2)); strip_truncations. destruct lim_close as [N isclose']. set (n := Nat.Core.nat_max (M (epsilon / 2)) N). assert (leNn := le_nat_max_r (M (epsilon / 2)) N : N ≀ n). assert (isclose := isclose' n leNn). clear isclose'. assert (leMn := le_nat_max_l (M (epsilon / 2)) N : M (epsilon / 2) ≀ n). assert (leMM : M (epsilon / 2) ≀ M (epsilon / 2) ) by apply (Nat.Core.leq_refl). assert (x_close := cauchy_convergence x (epsilon/2) n (M (epsilon / 2)) leMn leMM). cbn in isclose, x_close. rewrite (@preserves_mult Q F _ _ _ _ _ _ _ _ _ _ _ _) in isclose, x_close. assert (eq22 : ' 2 = 2). { rewrite (@preserves_plus Q F _ _ _ _ _ _ _ _ _ _ _ _). rewrite (@preserves_1 Q F _ _ _ _ _ _ _ _ _ _). reflexivity. } set (ap20 := positive_apart_zero 2 lt_0_2 : 2 β‰Ά 0). assert (ap20' : ' 2 β‰Ά 0). { rewrite eq22; exact ap20. } rewrite (dec_recip_to_recip 2 ap20') in isclose, x_close. assert (eq_recip_22 : recip' (' 2) ap20' = recip' 2 ap20). { apply recip_proper_alt. exact eq22. } unfold recip' in eq_recip_22. rewrite eq_recip_22 in isclose, x_close. clear eq22 ap20' eq_recip_22. rewrite <- (field_split2 (' (' epsilon))). set (eps_recip_2 := (' (' epsilon) * recip' 2 ap20)). fold ap20. change (' (' epsilon) * recip' 2 ap20) with eps_recip_2. unfold recip' in eps_recip_2. set (xMeps2 := x (M (epsilon / 2))). fold xMeps2 in x_close. rewrite negate_plus_distr. split. - apply (strictly_order_reflecting (+ (- x n))). refine (transitivity _ (fst isclose)). clear isclose. fold eps_recip_2. fold eps_recip_2 in x_close. apply fst, flip_lt_minus_r in x_close. rewrite plus_comm in x_close. apply flip_lt_minus_l in x_close. rewrite plus_comm in x_close. apply flip_lt_minus_l in x_close. rewrite <-(plus_assoc xMeps2 _ (- x n)). rewrite (plus_comm _ (- x n)). rewrite (plus_assoc xMeps2 (- x n) _). apply (strictly_order_reflecting (+ eps_recip_2)). apply (strictly_order_reflecting (+ eps_recip_2)). rewrite plus_negate_l, plus_0_l. rewrite <- (plus_assoc (xMeps2 - x n) _ _). rewrite <- (plus_assoc (-eps_recip_2) _ _). rewrite plus_negate_l, plus_0_r. rewrite <- (plus_assoc (xMeps2 - x n) _ _). rewrite plus_negate_l, plus_0_r. assumption. - apply (strictly_order_reflecting (+ (- x n))). refine (transitivity (snd isclose) _). clear isclose. fold eps_recip_2. fold eps_recip_2 in x_close. apply snd in x_close. apply flip_lt_minus_l in x_close. rewrite plus_comm in x_close. apply (strictly_order_reflecting (+ x n)). rewrite <- (plus_assoc _ (-x n) (x n)). rewrite plus_negate_l, plus_0_r. rewrite (plus_comm eps_recip_2 (x n)). rewrite (plus_assoc xMeps2 _ _). apply (strictly_order_preserving (+ eps_recip_2)). assumption. Qed.
Lemma
From HoTT.Classes Require Import
Classes\interfaces\cauchy.v
modulus_close_limit
2,803
`{ia : IntAbs} (x : Z) : N := match int_abs_sig x with | inl (n;_) => n | inr (n;_) => n end.
Definition
Require Import
Classes\interfaces\integers.v
int_abs
2,804
`{Zero N} `{ia : IntAbs} (x : Z) : N := match int_abs_sig x with | inl (n;_) => n | inr (n;_) => 0 end.
Definition
Require Import
Classes\interfaces\integers.v
int_to_nat
2,805
{N} `{nd : NatDistance N} (x y : N) := match nat_distance_sig x y with | inl (n;_) => n | inr (n;_) => n end.
Definition
Require Import
Classes\interfaces\naturals.v
nat_distance
2,806
Type β†’ Type := ne_list.
Definition
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
SymbolType_internal
2,807
Type := BuildSignature
Record
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
Signature
2,808
(sym : Type) (arities : sym β†’ nat) : Signature := BuildSignature Unit sym (ne_list.
Definition
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
BuildSingleSortedSignature
2,809
(Οƒ : Signature) : Type := ne_list (Sort Οƒ).
Definition
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
SymbolType
2,810
{Οƒ} : SymbolType Οƒ β†’ Sort Οƒ := ne_list.
Definition
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
cod_symboltype
2,811
{Οƒ} : SymbolType Οƒ β†’ list (Sort Οƒ) := ne_list.
Definition
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
dom_symboltype
2,812
{Οƒ} : SymbolType Οƒ β†’ nat := length o dom_symboltype.
Definition
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
arity_symboltype
2,813
{Οƒ} (A : Carriers Οƒ) (w : SymbolType Οƒ) : Type := match w with | [:s:] => A s | s ::: w' => A s β†’ A w' end. Global Instance trunc_operation `{Funext} {Οƒ : Signature} (A : Carriers Οƒ) {n} `{!βˆ€ s, IsTrunc n (A s)} (w : SymbolType Οƒ) : IsTrunc n ( A w). Proof. induction w; exact _. Defined.
Fixpoint
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
Operation
2,814
{Οƒ} {A : Carriers Οƒ} {w : SymbolType Οƒ} : Operation A w β†’ FamilyProd A (dom_symboltype w) β†’ A (cod_symboltype w) := match w with | [:s:] => Ξ» f _, f | s ::: w' => Ξ» f '(x, l), (f x) l end.
Fixpoint
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
ap_operation
2,815
`{Funext} {Οƒ : Signature} {A : Carriers Οƒ} {w : SymbolType Οƒ} : βˆ€ (f g : Operation A w), (βˆ€ a : FamilyProd A (dom_symboltype w), ap_operation f a = ap_operation g a) -> f = g := match w with | [:s:] => Ξ» (f g : A s) p, p tt | s ::: w' => Ξ» (f g : A s β†’ Operation A w') p, path_forall f g (Ξ» x, (f x) (g x) (Ξ» a, p (x,a))) end.
Fixpoint
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
path_forall_ap_operation
2,816
{Οƒ : Signature} : Type := BuildAlgebra
Record
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
Algebra
2,817
(Οƒ : Signature) : Type := {c : Carriers Οƒ | βˆ€ (u : Symbol Οƒ), Operation c (Οƒ u) }.
Definition
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
SigAlgebra
2,818
(Οƒ : Signature) : SigAlgebra Οƒ <~> Algebra Οƒ. Proof. issig. Defined.
Lemma
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
issig_algebra
2,819
{Οƒ : Signature} (A B : Algebra Οƒ) (p : carriers A = carriers B) (q : transport (Ξ» X, βˆ€ u, Operation X (Οƒ u)) p (operations A) = operations B) : A = B. Proof. destruct A,B. cbn in *. by path_induction. Defined.
Lemma
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
path_algebra
2,820
{Οƒ} (A B : Algebra Οƒ) (p : carriers A = carriers B) (q : transport (Ξ» X, βˆ€ u, Operation X (Οƒ u)) p (operations A) = operations B) : ap carriers (path_algebra A B p q) = p. Proof. destruct A as [A a], B as [B b]. cbn in *. by destruct p,q. Defined.
Lemma
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
path_ap_carriers_path_algebra
2,821
{Οƒ : Signature} {A B : Algebra Οƒ} (p q : A = B) (r : ap (issig_algebra Οƒ)^-1 p = ap (issig_algebra Οƒ)^-1 q) : p = q. Proof. set (e := (equiv_ap (issig_algebra Οƒ)^-1 A B)). by apply (@equiv_inv _ _ (ap e) (Equivalences.isequiv_ap _ _)). Defined.
Lemma
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
path_path_algebra
2,822
`{Funext} {Οƒ : Signature} {A B : Algebra Οƒ} `{IsHSetAlgebra B} (p q : A = B) (r : ap carriers p = ap carriers q) : p = q. Proof. apply path_path_algebra. unshelve eapply path_path_sigma. - transitivity (ap carriers p); [by destruct p |]. transitivity (ap carriers q); [exact r | by destruct q]. - apply path_ishprop. Defined.
Lemma
Require Import Import ne_list.notations.
Classes\interfaces\ua_algebra.v
path_path_hset_algebra
2,823
{w : SymbolType Οƒ} (f : Operation A w) : Type := βˆ€ (a b : FamilyProd A (dom_symboltype w)), for_all_2_family_prod A A Ξ¦ a b -> Ξ¦ (cod_symboltype w) (ap_operation f a) (ap_operation f b). Class OpsCompatible : Type := ops_compatible : βˆ€ (u : Symbol Οƒ), u.#A. Global Instance trunc_ops_compatible `{Funext} {n : trunc_index} `{!βˆ€ s x y, IsTrunc n (Ξ¦ s x y)} : IsTrunc n OpsCompatible. Proof. apply istrunc_forall. Qed.
Definition
Require Import Import algebra_notations ne_list.notations.
Classes\interfaces\ua_congruence.v
OpCompatible
2,824
{Οƒ : Signature} {A : Algebra Οƒ} (Ξ¦ : βˆ€ s, Relation (A s)) `{!IsCongruence A Ξ¦} (s : Sort Οƒ) (w : SymbolType Οƒ) (f : Operation A (s ::: w)) (x : A s) (P : OpCompatible A Ξ¦ f) : OpCompatible A Ξ¦ (f x). Proof. intros a b R. exact (P (x,a) (x,b) (EquivRel_Reflexive x, R)). Defined.
Lemma
Require Import Import algebra_notations ne_list.notations.
Classes\interfaces\ua_congruence.v
op_compatible_cons
2,825
{Οƒ : Signature} : Type := BuildSetAlgebra
Record
null
Classes\interfaces\ua_setalgebra.v
SetAlgebra
2,826
`{Funext} {Οƒ} (A B : SetAlgebra Οƒ) (p : algebra_setalgebra A = algebra_setalgebra B) : A = B. Proof. destruct A as [A AH], B as [B BH]. cbn in *. transparent assert (a : (p#AH = BH)) by apply path_ishprop. by path_induction. Defined.
Lemma
null
Classes\interfaces\ua_setalgebra.v
path_setalgebra
2,827
`{Funext} {Οƒ} (A : SetAlgebra Οƒ) : path_setalgebra A A idpath = idpath. Proof. transparent assert (p : (βˆ€ I : IsHSetAlgebra A, path_ishprop I I = idpath)). - intros. apply path_ishprop. - unfold path_setalgebra. by rewrite p. Qed.
Lemma
null
Classes\interfaces\ua_setalgebra.v
path_setalgebra_1
2,828
(T : Type) `{Plus T} `{Mult T} `{Zero T} `{One T} : Operations := exist _ T (plus,mult,zero,one).
Definition
Require Import Require Import HoTT.Classes.theory.rings.
Classes\isomorphisms\rings.v
BuildOperations
2,829
A = B. Proof. apply path_sigma_uncurried. destruct A as [TA [[[plA mlA] zA] uA]], B as [TB [[[plB mlB] zB] uB]];simpl in *. change plA with (@plus TA plA);change plB with (@plus TB plB); change mlA with (@mult TA mlA);change mlB with (@mult TB mlB); change zA with (@zero TA zA);change zB with (@zero TB zB); change uA with (@one TA uA);change uB with (@one TB uB). exists (path_universe f). rewrite !transport_prod;simpl. unfold Plus,Mult,Zero,One. repeat apply path_prod;simpl;try ( apply path_forall;intros x;rewrite transport_arrow; apply path_forall;intros y;rewrite transport_arrow); rewrite transport_path_universe, ?transport_path_universe_V. - rewrite (preserves_plus (f:=f)). apply ap011;apply eisretr. - rewrite (preserves_mult (f:=f)). apply ap011;apply eisretr. - apply preserves_0. - apply preserves_1. Qed.
Lemma
Require Import Require Import HoTT.Classes.theory.rings.
Classes\isomorphisms\rings.v
iso_same_semirings
2,830
forall P : Operations -> Type, P A -> P B. Proof. intros P;apply transport. first [exact iso_same_semirings|exact iso_same_semirings@{V V}]. Qed.
Lemma
Require Import Require Import HoTT.Classes.theory.rings.
Classes\isomorphisms\rings.v
iso_leibnitz
2,831
(T : Type) `{Plus T} `{Mult T} `{Zero T} `{One T} `{Negate T} : Operations := exist _ T (plus,mult,zero,one,negate).
Definition
Require Import Require Import HoTT.Classes.theory.rings.
Classes\isomorphisms\rings.v
BuildOperations
2,832
A = B. Proof. apply path_sigma_uncurried. destruct A as [TA [[[[plA mlA] zA] uA] nA]], B as [TB [[[[plB mlB] zB] uB] nB]];simpl in *. change plA with (@plus TA plA);change plB with (@plus TB plB); change mlA with (@mult TA mlA);change mlB with (@mult TB mlB); change zA with (@zero TA zA);change zB with (@zero TB zB); change uA with (@one TA uA);change uB with (@one TB uB); change nA with (@negate TA nA);change nB with (@negate TB nB). exists (path_universe f). rewrite !transport_prod;simpl. unfold Plus,Mult,Zero,One,Negate. repeat apply path_prod;simpl;try ( apply path_forall;intros x;rewrite transport_arrow; try (apply path_forall;intros y;rewrite transport_arrow)); rewrite transport_path_universe, ?transport_path_universe_V. - rewrite (preserves_plus (f:=f)). apply ap011;apply eisretr. - rewrite (preserves_mult (f:=f)). apply ap011;apply eisretr. - apply preserves_0. - apply preserves_1. - rewrite (preserves_negate (f:=f)). apply ap,eisretr. Qed.
Lemma
Require Import Require Import HoTT.Classes.theory.rings.
Classes\isomorphisms\rings.v
iso_same_rings
2,833
forall P : Operations -> Type, P A -> P B. Proof. intros P;apply transport. first [exact iso_same_rings|exact iso_same_rings@{V V}]. Qed.
Lemma
Require Import Require Import HoTT.Classes.theory.rings.
Classes\isomorphisms\rings.v
iso_leibnitz
2,834
Cast Q F := rationals_to_field Q F.
Definition
Require Import
Classes\orders\archimedean.v
qinc
2,835
x y : - x < y -> - y < x. Proof. intros ltnxy. rewrite <- (negate_involutive x). apply (snd (flip_lt_negate _ _)). assumption. Qed.
Lemma
Require Import
Classes\orders\archimedean.v
char_minus_left
2,836
x y : x < - y -> y < - x. Proof. intros ltnxy. rewrite <- (negate_involutive y). apply (snd (flip_lt_negate _ _)). assumption. Qed.
Lemma
Require Import
Classes\orders\archimedean.v
char_minus_right
2,837
forall (q : Q) (x y : F), ' q < x + y <-> hexists (fun s : Q => (' s < x) /\ (' (q - s) < y)). Proof. Abort.
Lemma
Require Import
Classes\orders\archimedean.v
char_plus_left
2,838
forall (r : Q) (x y : F), x + y < ' r <-> hexists (fun t : Q => (x < ' t) /\ (y < ' (r - t))). Proof. Abort.
Lemma
Require Import
Classes\orders\archimedean.v
char_plus_right
2,839
{X Y Z W} (f : X -> Y -> Z -> W -> Type) : HProp := hexists (fun xyzw => match xyzw with | ((x , y) , (z , w)) => f x y z w end).
Definition
Require Import
Classes\orders\archimedean.v
hexists4
2,840
forall (q : Q) (x y : F), ' q < x * y <-> hexists4 (fun a b c d : Q => (q < meet (meet a b) (meet c d)) /\ ((' a < x < ' b) /\ (' c < y < ' d) ) ). Proof. Abort.
Lemma
Require Import
Classes\orders\archimedean.v
char_times_left
2,841
forall (r : Q) (x y : F), x * y < ' r <-> hexists4 (fun a b c d : Q => and (join (join a b) (join c d) < r) (and (' a < x < ' b) (' c < y < ' d) ) ). Proof. Abort.
Lemma
Require Import
Classes\orders\archimedean.v
char_times_right
2,842
forall (q : Q) (z : F) (nu : 0 < z), 'q < recip' z (positive_apart_zero z nu) <-> ' q * z < 1. Proof. Abort.
Lemma
Require Import
Classes\orders\archimedean.v
char_recip_pos_left
2,843
forall (r : Q) (z : F) (nu : 0 < z), recip' z (positive_apart_zero z nu) < ' r <-> 1 < ' r * z. Proof. Abort.
Lemma
Require Import
Classes\orders\archimedean.v
char_recip_pos_right
2,844
forall (q : Q) (w : F) (nu : w < 0), 'q < recip' w (negative_apart_zero w nu) <-> ' q * w < 1. Proof. Abort.
Lemma
Require Import
Classes\orders\archimedean.v
char_recip_neg_left
2,845
forall (r : Q) (w : F) (nu : w < 0), recip' w (negative_apart_zero w nu) < ' r <-> ' r * w < 1. Proof. Abort.
Lemma
Require Import
Classes\orders\archimedean.v
char_recip_neg_right
2,846
forall (q : Q) (x y : F), ' q < meet x y <-> ' q < x /\ ' q < y. Proof. Abort.
Lemma
Require Import
Classes\orders\archimedean.v
char_meet_left
2,847
forall (r : Q) (x y : F), meet x y < 'r <-> hor (x < 'r) (y < 'r). Proof. Abort.
Lemma
Require Import
Classes\orders\archimedean.v
char_meet_right
2,848
forall (q : Q) (x y : F), ' q < join x y <-> hor ('q < x) ('q < y). Proof. Abort.
Lemma
Require Import
Classes\orders\archimedean.v
char_join_left
2,849
forall (r : Q) (x y : F), join x y < ' r <-> x < ' r /\ y < ' r. Proof. Abort. End strict_field_order.
Lemma
Require Import
Classes\orders\archimedean.v
char_join_right
2,850
x : PropHolds (0 < x) -> PropHolds (0 < /x). Proof. intros E. apply (strictly_order_reflecting (x *.)). rewrite dec_recip_inverse by (apply orders.lt_ne_flip;trivial). rewrite mult_0_r. solve_propholds. Qed.
Instance
Require Import
Classes\orders\dec_fields.v
pos_dec_recip_compat
2,851
x : PropHolds (0 ≀ x) -> PropHolds (0 ≀ /x). Proof. intros E. red. destruct (dec (x = 0)) as [E2 | E2]. - rewrite E2, dec_recip_0. rewrite E2 in E;trivial. - apply lt_le. apply pos_dec_recip_compat. apply lt_iff_le_ne. split;trivial. apply symmetric_neq;trivial. Qed.
Instance
Require Import
Classes\orders\dec_fields.v
nonneg_dec_recip_compat
2,852
x : x < 0 -> /x < 0. Proof. intros. apply flip_neg_negate. rewrite dec_recip_negate. apply pos_dec_recip_compat. apply flip_neg_negate. trivial. Qed.
Lemma
Require Import
Classes\orders\dec_fields.v
neg_dec_recip_compat
2,853
x : x ≀ 0 -> /x ≀ 0. Proof. intros. apply flip_nonpos_negate. rewrite dec_recip_negate. apply nonneg_dec_recip_compat. apply flip_nonpos_negate;trivial. Qed.
Lemma
Require Import
Classes\orders\dec_fields.v
nonpos_dec_recip_compat
2,854
x y : 0 < y -> y ≀ x -> /x ≀ /y. Proof. intros E1 E2. apply (order_reflecting_pos (.*.) x). - apply lt_le_trans with y;trivial. - rewrite dec_recip_inverse. + apply (order_reflecting_pos (.*.) y);trivial. rewrite (commutativity x), simple_associativity, dec_recip_inverse. * rewrite mult_1_l,mult_1_r. trivial. * apply lt_ne_flip;trivial. + apply lt_ne_flip. apply lt_le_trans with y;trivial. Qed.
Lemma
Require Import
Classes\orders\dec_fields.v
flip_le_dec_recip
2,855
x y : 0 < y -> /y ≀ x -> /x ≀ y. Proof. intros E1 E2. rewrite <-(dec_recip_involutive y). apply flip_le_dec_recip;trivial. apply pos_dec_recip_compat;trivial. Qed.
Lemma
Require Import
Classes\orders\dec_fields.v
flip_le_dec_recip_l
2,856
x y : 0 < y -> y ≀ /x -> x ≀ /y. Proof. intros E1 E2. rewrite <-(dec_recip_involutive x). apply flip_le_dec_recip;trivial. Qed.
Lemma
Require Import
Classes\orders\dec_fields.v
flip_le_dec_recip_r
2,857
x y : 0 < y -> y < x -> /x < /y. Proof. intros E1 E2. assert (0 < x) by (transitivity y;trivial). apply (strictly_order_reflecting (x *.)). rewrite dec_recip_inverse. - apply (strictly_order_reflecting (y *.)). rewrite (commutativity x), simple_associativity, dec_recip_inverse. + rewrite mult_1_l,mult_1_r. trivial. + apply lt_ne_flip. trivial. - apply lt_ne_flip;trivial. Qed.
Lemma
Require Import
Classes\orders\dec_fields.v
flip_lt_dec_recip
2,858
x y : 0 < y -> /y < x -> /x < y. Proof. intros E1 E2. rewrite <-(dec_recip_involutive y). apply flip_lt_dec_recip; trivial. apply pos_dec_recip_compat. trivial. Qed.
Lemma
Require Import
Classes\orders\dec_fields.v
flip_lt_dec_recip_l
2,859
x y : 0 < y -> y < /x -> x < /y. Proof. intros E1 E2. rewrite <-(dec_recip_involutive x). apply flip_lt_dec_recip;trivial. Qed.
Lemma
Require Import
Classes\orders\dec_fields.v
flip_lt_dec_recip_r
2,860
(x : F) (Px : 0 < x) : 0 < //(x;positive_apart_zero x Px). Proof. apply (strictly_order_reflecting (x *.)). rewrite mult_0_r. rewrite (recip_inverse' x). apply lt_0_1. Qed.
Lemma
Require Import
Classes\orders\fields.v
pos_recip_compat
2,861
(x : F) (Px : x < 0) : //(x;negative_apart_zero x Px) < 0. Proof. set (negxpos := fst (flip_neg_negate x) Px). apply (strictly_order_reflecting ((-x) *.)). rewrite mult_0_r. rewrite <- negate_mult_distr_l. rewrite (recip_inverse' x). apply flip_pos_negate, lt_0_1. Qed.
Lemma
Require Import
Classes\orders\fields.v
neg_recip_compat
2,862
x y (Py : 0 < y) (ltyx : y < x) : let apy0 := positive_apart_zero y Py in let apx0 := positive_apart_zero x (transitivity Py ltyx) in //(x;apx0) < //(y;apy0). Proof. assert (0 < x) by (transitivity y;trivial). apply (strictly_order_reflecting (x *.)). rewrite (recip_inverse' x ). rewrite mult_comm. apply (strictly_order_reflecting (y *.)). rewrite mult_assoc, mult_1_r. rewrite (recip_inverse' y), mult_1_l; assumption. Qed.
Lemma
Require Import
Classes\orders\fields.v
flip_lt_recip
2,863
x y (Py : 0 < y) (ltyx : //(y;positive_apart_zero y Py) < x) : let apx0 := positive_apart_zero x (transitivity (pos_recip_compat y Py) ltyx) in //(x;apx0) < y. Proof. set (apy0 := positive_apart_zero y Py). set (eq := recip_involutive (y;apy0)). set (eq' := ap pr1 eq). cbn in eq'. rewrite <- eq'. unfold recip_on_apart. set (ltyx2 := ltyx). unfold ltyx2. rewrite (recip_irrelevant y (positive_apart_zero y Py) apy0) in ltyx2. set (ltyx_recips := flip_lt_recip x (// (y; apy0)) (pos_recip_compat y Py) ltyx2). cbn in ltyx_recips. rewrite (recip_irrelevant x _ (positive_apart_zero x (transitivity (pos_recip_compat y Py) ltyx))) in ltyx_recips. cbn. rewrite (recip_irrelevant (//(y;apy0)) _ (recip_apart y apy0)) in ltyx_recips. assumption. Qed.
Lemma
Require Import
Classes\orders\fields.v
flip_lt_recip_l
2,864
(x y : F) (Px : 0 < x) (Py : 0 < y) (ltyx : y < //(x;positive_apart_zero x Px)) : x < //(y;positive_apart_zero y Py). Proof. set (apx0 := positive_apart_zero x Px). set (apy0 := positive_apart_zero y Py). change x with ((x;apx0) : ApartZero F).1. rewrite <- (recip_involutive (x;apx0)). unfold recip_on_apart; cbn. assert (ltry := pos_recip_compat y Py). rewrite (recip_irrelevant y (positive_apart_zero y Py) apy0) in ltry. change y with ((y;apy0) : ApartZero F).1 in ltyx. rewrite <- (recip_involutive (y;apy0)) in ltyx. unfold recip_on_apart in ltyx; cbn in ltyx. rewrite (recip_irrelevant (//(y;apy0)) (recip_apart y apy0) (positive_apart_zero (// (y; apy0)) ltry)) in ltyx. assert (ltxy := flip_lt_recip_l (// (x; apx0)) (// (y; apy0)) ltry ltyx). cbn in ltxy. rewrite (recip_irrelevant (//(x;apx0)) (positive_apart_zero (// (x; apx0)) (transitivity (pos_recip_compat (// (y; apy0)) ltry) ltyx)) (recip_apart x apx0)) in ltxy. assumption. Qed.
Lemma
Require Import
Classes\orders\fields.v
flip_lt_recip_r
2,865
(x : F) : (x * recip' 2 (positive_apart_zero 2 lt_0_2)) + (x * recip' 2 (positive_apart_zero 2 lt_0_2)) = x. Proof. rewrite <- plus_mult_distr_l. rewrite <- (mult_1_l (recip' 2 (positive_apart_zero 2 lt_0_2))). rewrite <- plus_mult_distr_r. rewrite (recip_inverse' 2 (positive_apart_zero 2 lt_0_2)). rewrite mult_1_r. reflexivity. Qed.
Lemma
Require Import
Classes\orders\fields.v
field_split2
2,866
(P: Z -> Type): P 0 -> (forall n, 0 ≀ n -> P n -> P (1 + n)) -> (forall n, n ≀ 0 -> P n -> P (n - 1)) -> forall n, P n. Proof. intros P0 Psuc1 Psuc2 n. destruct (int_abs_sig Z nat n) as [[a A]|[a A]]. - rewrite <-A. clear A. revert a. apply naturals.. + rewrite rings.preserves_0. trivial. + intros m E. rewrite rings.preserves_plus, rings.preserves_1. apply Psuc1. * apply to_semiring_nonneg. * trivial. - rewrite <-(groups.negate_involutive n), <-A. clear A. revert a. apply naturals.. + rewrite rings.preserves_0, rings.negate_0. trivial. + intros m E. rewrite rings.preserves_plus, rings.preserves_1. rewrite rings.negate_plus_distr, commutativity. apply Psuc2. * apply naturals.negate_to_ring_nonpos. * trivial. Qed.
Lemma
Require Import Import NatPair.Instances.
Classes\orders\integers.v
induction
2,867
(P: Z -> Type): P 0 -> (forall n, 0 ≀ n -> P n -> P (1 + n)) -> forall n, 0 ≀ n -> P n. Proof. intros P0 PS. refine (induction _ _ _ _); auto. intros n E1 ? E2. destruct (rings.is_ne_0 1). apply (antisymmetry (≀)). - apply (order_reflecting ((n - 1) +)). rewrite <-plus_assoc,plus_negate_l,2!plus_0_r. transitivity 0;trivial. - transitivity (n - 1);trivial. apply (order_reflecting (1 +)). rewrite plus_comm,<-plus_assoc,plus_negate_l,plus_0_r. transitivity 0. + trivial. + apply le_0_2. Qed.
Lemma
Require Import Import NatPair.Instances.
Classes\orders\integers.v
induction_nonneg
2,868
x y z : z ≀ x βŠ” y βŠ” z. Proof. apply join_ub_r. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_ub_3_r
2,869
x y z : y ≀ x βŠ” y βŠ” z. Proof. transitivity (x βŠ” y). - apply join_ub_r. - apply join_ub_l. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_ub_3_m
2,870
x y z : x ≀ x βŠ” y βŠ” z. Proof. transitivity (x βŠ” y); apply join_ub_l. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_ub_3_l
2,871
x y z : x ≀ x βŠ” (y βŠ” z). Proof. apply join_ub_l. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_ub_3_assoc_l
2,872
x y z : y ≀ x βŠ” (y βŠ” z). Proof. transitivity (y βŠ” z). - apply join_ub_l. - apply join_ub_r. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_ub_3_assoc_m
2,873
x y z : z ≀ x βŠ” (y βŠ” z). Proof. transitivity (y βŠ” z); apply join_ub_r. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_ub_3_assoc_r
2,874
IsJoinSemiLattice L. Proof. repeat split. - apply _. - intros x y z. apply (antisymmetry (≀)). + apply join_lub. * apply join_ub_3_l. * apply join_lub. ** apply join_ub_3_m. ** apply join_ub_3_r. + apply join_lub. * apply join_lub. ** apply join_ub_3_assoc_l. ** apply join_ub_3_assoc_m. * apply join_ub_3_assoc_r. - intros x y. apply (antisymmetry (≀)); apply join_lub; first [apply join_ub_l | apply join_ub_r]. - intros x. red. apply (antisymmetry (≀)). + apply join_lub; apply reflexivity. + apply join_ub_l. Qed.
Instance
Require Import
Classes\orders\lattices.v
join_sl_order_join_sl
2,875
x y z : z ≀ x -> z ≀ x βŠ” y. Proof. intros E. transitivity x. - trivial. - apply join_ub_l. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_le_compat_r
2,876
x y z : z ≀ y -> z ≀ x βŠ” y. Proof. intros E. rewrite (commutativity (f:=join)). apply join_le_compat_r. trivial. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_le_compat_l
2,877
x y : y ≀ x -> x βŠ” y = x. Proof. intros E. apply (antisymmetry (≀)). - apply join_lub;trivial. apply reflexivity. - apply join_ub_l. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_l
2,878
x y : x ≀ y -> x βŠ” y = y. Proof. intros E. rewrite (commutativity (f:=join)). apply join_l. trivial. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_r
2,879
x y : x ≀ y <-> x βŠ” y = y. Proof. split; intros E. - apply join_r. trivial. - rewrite <-E. apply join_ub_l. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_sl_le_spec
2,880
x₁ xβ‚‚ y₁ yβ‚‚ : x₁ ≀ xβ‚‚ -> y₁ ≀ yβ‚‚ -> x₁ βŠ” y₁ ≀ xβ‚‚ βŠ” yβ‚‚. Proof. intros E1 E2. transitivity (x₁ βŠ” yβ‚‚). - apply (order_preserving (x₁ βŠ”)). trivial. - apply (order_preserving (βŠ” yβ‚‚));trivial. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_le_compat
2,881
x y z : x ≀ z -> y ≀ z -> x βŠ” y ≀ z. Proof. apply join_lub. Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_le
2,882
`{!TotalRelation le} x y : join x y = x |_| join x y = y. Proof. destruct (total le x y) as [E|E]. - right. apply join_r,E. - left. apply join_l,E. Qed.
Lemma
Require Import
Classes\orders\lattices.v
total_join_either
2,883
x y := match total le x y with | inl _ => y | inr _ => x end.
Definition
Require Import
Classes\orders\lattices.v
max
2,884
x y : join x y = max x y. Proof. unfold max;destruct (total le x y) as [E|E]. - apply join_r,E. - apply join_l,E. Qed.
Lemma
Require Import
Classes\orders\lattices.v
total_join_max
2,885
x : x βŠ” x = x. Proof. assert (le1 : x βŠ” x ≀ x). { refine (join_lub _ _ _ _ _); apply reflexivity. } assert (le2 : x ≀ x βŠ” x). { refine (join_ub_l _ _). } refine (antisymmetry _ _ _ le1 le2). Qed.
Lemma
Require Import
Classes\orders\lattices.v
join_idempotent
2,886
x : βŠ₯ ≀ x. Proof. apply join_sl_le_spec. rewrite left_identity. reflexivity. Qed.
Lemma
Require Import
Classes\orders\lattices.v
above_bottom
2,887
x : x ≀ βŠ₯ -> x = βŠ₯. Proof. intros E. apply join_sl_le_spec in E. rewrite right_identity in E. trivial. Qed.
Lemma
Require Import
Classes\orders\lattices.v
below_bottom
2,888
x y z : x βŠ“ y βŠ“ z ≀ z. Proof. apply meet_lb_r. Qed.
Lemma
Require Import
Classes\orders\lattices.v
meet_lb_3_r
2,889
x y z : x βŠ“ y βŠ“ z ≀ y. Proof. transitivity (x βŠ“ y). - apply meet_lb_l. - apply meet_lb_r. Qed.
Lemma
Require Import
Classes\orders\lattices.v
meet_lb_3_m
2,890
x y z : x βŠ“ y βŠ“ z ≀ x. Proof. transitivity (x βŠ“ y); apply meet_lb_l. Qed.
Lemma
Require Import
Classes\orders\lattices.v
meet_lb_3_l
2,891
x y z : x βŠ“ (y βŠ“ z) ≀ x. Proof. apply meet_lb_l. Qed.
Lemma
Require Import
Classes\orders\lattices.v
meet_lb_3_assoc_l
2,892
x y z : x βŠ“ (y βŠ“ z) ≀ y. Proof. transitivity (y βŠ“ z). - apply meet_lb_r. - apply meet_lb_l. Qed.
Lemma
Require Import
Classes\orders\lattices.v
meet_lb_3_assoc_m
2,893
x y z : x βŠ“ (y βŠ“ z) ≀ z. Proof. transitivity (y βŠ“ z); apply meet_lb_r. Qed.
Lemma
Require Import
Classes\orders\lattices.v
meet_lb_3_assoc_r
2,894
IsMeetSemiLattice L. Proof. repeat split. - apply _. - intros x y z. apply (antisymmetry (≀)). + apply meet_glb. * apply meet_glb. ** apply meet_lb_3_assoc_l. ** apply meet_lb_3_assoc_m. * apply meet_lb_3_assoc_r. + apply meet_glb. ** apply meet_lb_3_l. ** apply meet_glb. *** apply meet_lb_3_m. *** apply meet_lb_3_r. - intros x y. apply (antisymmetry (≀)); apply meet_glb; first [apply meet_lb_l | try apply meet_lb_r]. - intros x. red. apply (antisymmetry (≀)). + apply meet_lb_l. + apply meet_glb;apply reflexivity. Qed.
Instance
Require Import
Classes\orders\lattices.v
meet_sl_order_meet_sl
2,895
x y z : x ≀ z -> x βŠ“ y ≀ z. Proof. intros E. transitivity x. - apply meet_lb_l. - trivial. Qed.
Lemma
Require Import
Classes\orders\lattices.v
meet_le_compat_r
2,896
x y z : y ≀ z -> x βŠ“ y ≀ z. Proof. intros E. rewrite (commutativity (f:=meet)). apply meet_le_compat_r. trivial. Qed.
Lemma
Require Import
Classes\orders\lattices.v
meet_le_compat_l
2,897
x y : x ≀ y -> x βŠ“ y = x. Proof. intros E. apply (antisymmetry (≀)). - apply meet_lb_l. - apply meet_glb; trivial. apply reflexivity. Qed.
Lemma
Require Import
Classes\orders\lattices.v
meet_l
2,898
x y : y ≀ x -> x βŠ“ y = y. Proof. intros E. rewrite (commutativity (f:=meet)). apply meet_l. trivial. Qed.
Lemma
Require Import
Classes\orders\lattices.v
meet_r
2,899