feat(library/theories/analysis/metric_space,real_limit): define complete metric space, make real an instance

This commit is contained in:
Jeremy Avigad 2015-12-22 13:25:38 -05:00
parent 5b3fbf1618
commit 08fbf127c6
2 changed files with 16 additions and 2 deletions
library/theories/analysis

View file

@ -211,7 +211,8 @@ exists.intro δ (and.intro
(suffices dist x x' < δ, from and.right Hδ x' (and.intro Heq this),
this)))
theorem image_seq_converges_of_converges [instance] (X : → M) [HX : converges_seq X] {f : M → N} (Hf : continuous f) :
theorem image_seq_converges_of_converges [instance] (X : → M) [HX : converges_seq X] {f : M → N}
(Hf : continuous f) :
converges_seq (λ n, f (X n)) :=
begin
cases HX with xlim Hxlim,
@ -236,3 +237,10 @@ theorem image_seq_converges_of_converges [instance] (X : → M) [HX : conver
end metric_space_M_N
end metric_space
/- complete metric spaces -/
open metric_space
structure complete_metric_space [class] (M : Type) extends metricM : metric_space M : Type :=
(complete : ∀ X, @cauchy M metricM X → @converges_seq M metricM X)

View file

@ -28,7 +28,7 @@ namespace real
local postfix ⁻¹ := pnat.inv
/- the reals form a metric space -/
protected definition to_metric_space [instance] : metric_space :=
protected definition metric_space [instance] : metric_space :=
⦃ metric_space,
dist := λ x y, abs (x - y),
dist_self := λ x, abstract by rewrite [sub_self, abs_zero] end,
@ -169,6 +169,12 @@ exists.intro l
have abs (X n - l) ≤ real.of_rat k⁻¹, by apply conv k n' Hn,
show abs (X n - l) < ε, from lt_of_le_of_lt this Hk))
protected definition complete_metric_space [reducible] [trans_instance] :
complete_metric_space :=
⦃complete_metric_space, real.metric_space,
complete := @converges_seq_of_cauchy
open set
private definition exists_is_sup {X : set } (H : (∃ x, x ∈ X) ∧ (∃ b, ∀ x, x ∈ X → x ≤ b)) :