Skip to content

Commit

Permalink
refactor(topology/instances/ennreal): make ennreal an instance of `…
Browse files Browse the repository at this point in the history
…has_continuous_inv` (#12806)

Prior to the type class `has_continuous_inv`, `ennreal` had to have it's own hand-rolled `ennreal.continuous_inv` statement. This replaces it with a `has_continuous_inv` instance.

- [x] depends on: #12748
  • Loading branch information
j-loreaux committed Mar 27, 2022
1 parent caf6f19 commit 05ef694
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/analysis/special_functions/pow.lean
Expand Up @@ -1669,7 +1669,7 @@ begin
{ obtain ⟨z, hz⟩ : ∃ z, y = -z := ⟨-y, (neg_neg _).symm⟩,
have z_pos : 0 < z, by simpa [hz] using hy,
simp_rw [hz, rpow_neg],
exact ennreal.continuous_inv.continuous_at.comp (continuous_at_rpow_const_of_pos z_pos) }
exact continuous_inv.continuous_at.comp (continuous_at_rpow_const_of_pos z_pos) }
end

lemma tendsto_const_mul_rpow_nhds_zero_of_pos {c : ℝ≥0∞} (hc : c ≠ ∞) {y : ℝ} (hy : 0 < y) :
Expand Down
2 changes: 1 addition & 1 deletion src/measure_theory/constructions/borel_space.lean
Expand Up @@ -1603,7 +1603,7 @@ instance : has_measurable_sub₂ ℝ≥0∞ :=
by apply measurable_of_measurable_nnreal_nnreal;
simp [← with_top.coe_sub, continuous_sub.measurable.coe_nnreal_ennreal]⟩

instance : has_measurable_inv ℝ≥0∞ := ⟨ennreal.continuous_inv.measurable⟩
instance : has_measurable_inv ℝ≥0∞ := ⟨continuous_inv.measurable⟩

end ennreal

Expand Down
23 changes: 8 additions & 15 deletions src/topology/instances/ennreal.lean
Expand Up @@ -448,24 +448,17 @@ lemma inv_liminf {ι : Sort*} {x : ι → ℝ≥0∞} {l : filter ι} :
(l.liminf x)⁻¹ = l.limsup (λ i, (x i)⁻¹) :=
by simp only [limsup_eq_infi_supr, inv_map_infi, inv_map_supr, liminf_eq_supr_infi]

protected lemma continuous_inv : continuous (has_inv.inv : ℝ≥0∞ → ℝ≥0∞) :=
continuous_iff_continuous_at.2 $ λ a, tendsto_order.2
begin
assume b hb,
simp only [@ennreal.lt_inv_iff_lt_inv b],
exact gt_mem_nhds (ennreal.lt_inv_iff_lt_inv.1 hb),
end,
begin
assume b hb,
simp only [gt_iff_lt, @ennreal.inv_lt_iff_inv_lt _ b],
exact lt_mem_nhds (ennreal.inv_lt_iff_inv_lt.1 hb)
end
instance : has_continuous_inv ℝ≥0∞ :=
{ continuous_inv :=
continuous_iff_continuous_at.2 $ λ a, tendsto_order.2
⟨λ b hb, by simpa only [ennreal.lt_inv_iff_lt_inv]
using gt_mem_nhds (ennreal.lt_inv_iff_lt_inv.1 hb),
λ b hb, by simpa only [gt_iff_lt, ennreal.inv_lt_iff_inv_lt]
using lt_mem_nhds (ennreal.inv_lt_iff_inv_lt.1 hb)⟩ }

@[simp] protected lemma tendsto_inv_iff {f : filter α} {m : α → ℝ≥0∞} {a : ℝ≥0∞} :
tendsto (λ x, (m x)⁻¹) f (𝓝 a⁻¹) ↔ tendsto m f (𝓝 a) :=
⟨λ h, by simpa only [function.comp, inv_inv]
using (ennreal.continuous_inv.tendsto a⁻¹).comp h,
(ennreal.continuous_inv.tendsto a).comp⟩
⟨λ h, by simpa only [inv_inv] using tendsto.inv h, tendsto.inv⟩

protected lemma tendsto.div {f : filter α} {ma : α → ℝ≥0∞} {mb : α → ℝ≥0∞} {a b : ℝ≥0∞}
(hma : tendsto ma f (𝓝 a)) (ha : a ≠ 0 ∨ b ≠ 0) (hmb : tendsto mb f (𝓝 b)) (hb : b ≠ ⊤ ∨ a ≠ ⊤) :
Expand Down

0 comments on commit 05ef694

Please sign in to comment.