Skip to content

Commit fb969e7

Browse files
committed
chore(ProperSpace): rename constructors (#10138)
Rename `properSpace_of_*` to `ProperSpace.of_*`, restore old names as deprecated aliases. This affects: - `properSpace_of_locallyCompactSpace` -> `ProperSpace.of_locallyCompactSpace`, also golf using new `ProperSpace.of_seq_closedBall`; - `properSpace_of_locallyCompact_module` -> `ProperSpace.of_locallyCompact_module`; - `properSpace_of_compact_closedBall_of_le` -> `ProperSpace.of_isCompact_closedBall_of_le`, also changed `compact` -> `isCompact` in the name.
1 parent 7e1799b commit fb969e7

File tree

4 files changed

+43
-36
lines changed

4 files changed

+43
-36
lines changed

Mathlib/Analysis/Calculus/FDeriv/Measurable.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ open Uniformity
849849

850850
lemma isOpen_A_with_param {r s : ℝ} (hf : Continuous f.uncurry) (L : E →L[𝕜] F) :
851851
IsOpen {p : α × E | p.2 ∈ A (f p.1) L r s} := by
852-
have : ProperSpace E := properSpace_of_locallyCompactSpace 𝕜
852+
have : ProperSpace E := .of_locallyCompactSpace 𝕜
853853
simp only [A, half_lt_self_iff, not_lt, mem_Ioc, mem_ball, map_sub, mem_setOf_eq]
854854
apply isOpen_iff_mem_nhds.2
855855
rintro ⟨a, x⟩ ⟨r', ⟨Irr', Ir'r⟩, hr⟩
@@ -945,7 +945,7 @@ theorem measurableSet_of_differentiableAt_of_isComplete_with_param
945945
refine MeasurableSet.iInter (fun _ ↦ ?_)
946946
refine MeasurableSet.iInter (fun _ ↦ ?_)
947947
refine MeasurableSet.iInter (fun _ ↦ ?_)
948-
have : ProperSpace E := properSpace_of_locallyCompactSpace 𝕜
948+
have : ProperSpace E := .of_locallyCompactSpace 𝕜
949949
exact (isOpen_B_with_param hf K).measurableSet
950950

951951
variable (𝕜)
@@ -991,7 +991,7 @@ theorem stronglyMeasurable_deriv_with_param [LocallyCompactSpace 𝕜] [Measurab
991991
StronglyMeasurable (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2) := by
992992
borelize F
993993
rcases h.out with hα|hF
994-
· have : ProperSpace 𝕜 := properSpace_of_locallyCompactSpace 𝕜
994+
· have : ProperSpace 𝕜 := .of_locallyCompactSpace 𝕜
995995
apply stronglyMeasurable_iff_measurable_separable.2 ⟨measurable_deriv_with_param hf, ?_⟩
996996
have : range (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2)
997997
⊆ closure (Submodule.span 𝕜 (range f.uncurry)) := by

Mathlib/Analysis/NormedSpace/FiniteDimension.lean

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Mathlib.Analysis.NormedSpace.AddTorsor
88
import Mathlib.Analysis.NormedSpace.AffineIsometry
99
import Mathlib.Analysis.NormedSpace.OperatorNorm
1010
import Mathlib.Analysis.NormedSpace.RieszLemma
11+
import Mathlib.Analysis.NormedSpace.Pointwise
1112
import Mathlib.Topology.Algebra.Module.FiniteDimension
1213
import Mathlib.Topology.Algebra.InfiniteSum.Module
1314
import Mathlib.Topology.Instances.Matrix
@@ -494,39 +495,33 @@ theorem HasCompactMulSupport.eq_one_or_finiteDimensional {X : Type*} [Topologica
494495
#align has_compact_support.eq_zero_or_finite_dimensional HasCompactSupport.eq_zero_or_finiteDimensional
495496

496497
/-- A locally compact normed vector space is proper. -/
497-
lemma properSpace_of_locallyCompactSpace (𝕜 : Type*) [NontriviallyNormedField 𝕜]
498-
{E : Type*} [SeminormedAddCommGroup E] [NormedSpace 𝕜 E]
499-
[LocallyCompactSpace E] : ProperSpace E := by
498+
lemma ProperSpace.of_locallyCompactSpace (𝕜 : Type*) [NontriviallyNormedField 𝕜]
499+
{E : Type*} [SeminormedAddCommGroup E] [NormedSpace 𝕜 E] [LocallyCompactSpace E] :
500+
ProperSpace E := by
500501
rcases exists_isCompact_closedBall (0 : E) with ⟨r, rpos, hr⟩
501502
rcases NormedField.exists_one_lt_norm 𝕜 with ⟨c, hc⟩
502-
have M : ∀ n (x : E), IsCompact (closedBall x (‖c‖^n * r)) := by
503-
intro n x
504-
let f : E → E := fun y ↦ c^n • y + x
505-
have Cf : Continuous f := (continuous_id.const_smul _).add continuous_const
506-
have A : closedBall x (‖c‖^n * r) ⊆ f '' (closedBall 0 r) := by
507-
rintro y hy
508-
refine ⟨(c^n)⁻¹ • (y - x), ?_, ?_⟩
509-
· simpa [dist_eq_norm, norm_smul, inv_mul_le_iff (pow_pos (zero_lt_one.trans hc) _)] using hy
510-
· have : c^n ≠ 0 := pow_ne_zero _ (norm_pos_iff.1 (zero_lt_one.trans hc))
511-
simp [smul_smul, mul_inv_cancel this]
512-
exact (hr.image Cf).of_isClosed_subset isClosed_ball A
513-
refine ⟨fun x s ↦ ?_⟩
514-
have L : ∀ᶠ n in (atTop : Filter ℕ), s ≤ ‖c‖^n * r := by
515-
have : Tendsto (fun n ↦ ‖c‖^n * r) atTop atTop :=
516-
Tendsto.atTop_mul_const rpos (tendsto_pow_atTop_atTop_of_one_lt hc)
517-
exact Tendsto.eventually_ge_atTop this s
518-
rcases L.exists with ⟨n, hn⟩
519-
exact (M n x).of_isClosed_subset isClosed_ball (closedBall_subset_closedBall hn)
503+
have hC : ∀ n, IsCompact (closedBall (0 : E) (‖c‖^n * r)) := fun n ↦ by
504+
have : c ^ n ≠ 0 := pow_ne_zero _ <| fun h ↦ by simp [h, zero_le_one.not_lt] at hc
505+
simpa [_root_.smul_closedBall' this] using hr.smul (c ^ n)
506+
have hTop : Tendsto (fun n ↦ ‖c‖^n * r) atTop atTop :=
507+
Tendsto.atTop_mul_const rpos (tendsto_pow_atTop_atTop_of_one_lt hc)
508+
exact .of_seq_closedBall hTop (eventually_of_forall hC)
509+
510+
@[deprecated] -- Since 2024/01/31
511+
alias properSpace_of_locallyCompactSpace := ProperSpace.of_locallyCompactSpace
520512

521513
variable (E)
522-
lemma properSpace_of_locallyCompact_module [Nontrivial E] [LocallyCompactSpace E] :
523-
ProperSpace 𝕜 := by
514+
lemma ProperSpace.of_locallyCompact_module [Nontrivial E] [LocallyCompactSpace E] :
515+
ProperSpace 𝕜 :=
524516
have : LocallyCompactSpace 𝕜 := by
525517
obtain ⟨v, hv⟩ : ∃ v : E, v ≠ 0 := exists_ne 0
526518
let L : 𝕜 → E := fun t ↦ t • v
527519
have : ClosedEmbedding L := closedEmbedding_smul_left hv
528520
apply ClosedEmbedding.locallyCompactSpace this
529-
exact properSpace_of_locallyCompactSpace 𝕜
521+
.of_locallyCompactSpace 𝕜
522+
523+
@[deprecated] -- Since 2024/01/31
524+
alias properSpace_of_locallyCompact_module := ProperSpace.of_locallyCompact_module
530525

531526
end Riesz
532527

@@ -589,7 +584,7 @@ We do not register this as an instance to avoid an instance loop when trying to
589584
properness of `𝕜`, and the search for `𝕜` as an unknown metavariable. Declare the instance
590585
explicitly when needed. -/
591586
theorem FiniteDimensional.proper [FiniteDimensional 𝕜 E] : ProperSpace E := by
592-
have : ProperSpace 𝕜 := properSpace_of_locallyCompactSpace 𝕜
587+
have : ProperSpace 𝕜 := .of_locallyCompactSpace 𝕜
593588
set e := ContinuousLinearEquiv.ofFinrankEq (@finrank_fin_fun 𝕜 _ _ (finrank 𝕜 E)).symm
594589
exact e.symm.antilipschitz.properSpace e.symm.continuous e.symm.surjective
595590
#align finite_dimensional.proper FiniteDimensional.proper
@@ -609,7 +604,7 @@ instance {𝕜 E : Type*} [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜]
609604
[NormedAddCommGroup E] [NormedSpace 𝕜 E] [LocallyCompactSpace E] (S : Submodule 𝕜 E) :
610605
ProperSpace S := by
611606
nontriviality E
612-
have : ProperSpace 𝕜 := properSpace_of_locallyCompact_module 𝕜 E
607+
have : ProperSpace 𝕜 := .of_locallyCompact_module 𝕜 E
613608
have : FiniteDimensional 𝕜 E := finiteDimensional_of_locallyCompactSpace 𝕜
614609
exact FiniteDimensional.proper 𝕜 S
615610

Mathlib/MeasureTheory/Measure/Haar/Disintegration.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ theorem LinearMap.exists_map_addHaar_eq_smul_addHaar' (h : Function.Surjective L
4747
is also true for linear equivalences, as they map Haar measure to Haar measure. The general case
4848
follows from these two and linear algebra, as `L` can be interpreted as the composition of the
4949
projection `P` on a complement `T` to its kernel `S`, together with a linear equivalence. -/
50-
have : ProperSpace E := properSpace_of_locallyCompactSpace 𝕜
50+
have : ProperSpace E := .of_locallyCompactSpace 𝕜
5151
have : FiniteDimensional 𝕜 E := finiteDimensional_of_locallyCompactSpace 𝕜
5252
have : ProperSpace F := by
5353
rcases subsingleton_or_nontrivial E with hE|hE
5454
· have : Subsingleton F := Function.Surjective.subsingleton h
5555
infer_instance
56-
· have : ProperSpace 𝕜 := properSpace_of_locallyCompact_module 𝕜 E
56+
· have : ProperSpace 𝕜 := .of_locallyCompact_module 𝕜 E
5757
have : FiniteDimensional 𝕜 F := Module.Finite.of_surjective L h
5858
exact FiniteDimensional.proper 𝕜 F
5959
let S : Submodule 𝕜 E := LinearMap.ker L
@@ -129,8 +129,8 @@ lemma ae_ae_add_linearMap_mem_iff [LocallyCompactSpace F] {s : Set F} (hs : Meas
129129
(∀ᵐ y ∂ν, ∀ᵐ x ∂μ, y + L x ∈ s) ↔ ∀ᵐ y ∂ν, y ∈ s := by
130130
have : FiniteDimensional 𝕜 E := finiteDimensional_of_locallyCompactSpace 𝕜
131131
have : FiniteDimensional 𝕜 F := finiteDimensional_of_locallyCompactSpace 𝕜
132-
have : ProperSpace E := properSpace_of_locallyCompactSpace 𝕜
133-
have : ProperSpace F := properSpace_of_locallyCompactSpace 𝕜
132+
have : ProperSpace E := .of_locallyCompactSpace 𝕜
133+
have : ProperSpace F := .of_locallyCompactSpace 𝕜
134134
let M : F × E →ₗ[𝕜] F := LinearMap.id.coprod L
135135
have M_cont : Continuous M := M.continuous_of_finiteDimensional
136136
have hM : Function.Surjective M := by simp [← LinearMap.range_eq_top, LinearMap.range_coprod]

Mathlib/Topology/MetricSpace/ProperSpace.lean

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,23 @@ instance (priority := 100) secondCountable_of_proper [ProperSpace α] :
6262

6363
/-- If all closed balls of large enough radius are compact, then the space is proper. Especially
6464
useful when the lower bound for the radius is 0. -/
65-
theorem properSpace_of_compact_closedBall_of_le (R : ℝ)
65+
theorem ProperSpace.of_isCompact_closedBall_of_le (R : ℝ)
6666
(h : ∀ x : α, ∀ r, R ≤ r → IsCompact (closedBall x r)) : ProperSpace α :=
6767
fun x r => IsCompact.of_isClosed_subset (h x (max r R) (le_max_right _ _)) isClosed_ball
6868
(closedBall_subset_closedBall <| le_max_left _ _)⟩
69-
#align proper_space_of_compact_closed_ball_of_le properSpace_of_compact_closedBall_of_le
69+
#align proper_space_of_compact_closed_ball_of_le ProperSpace.of_isCompact_closedBall_of_le
70+
71+
@[deprecated] -- Since 2024/01/31
72+
alias properSpace_of_compact_closedBall_of_le := ProperSpace.of_isCompact_closedBall_of_le
73+
74+
/-- If there exists a sequence of compact closed balls with the same center
75+
such that the radii tend to infinity, then the space is proper. -/
76+
theorem ProperSpace.of_seq_closedBall {β : Type*} {l : Filter β} [NeBot l] {x : α} {r : β → ℝ}
77+
(hr : Tendsto r l atTop) (hc : ∀ᶠ i in l, IsCompact (closedBall x (r i))) :
78+
ProperSpace α where
79+
isCompact_closedBall a r :=
80+
let ⟨_i, hci, hir⟩ := (hc.and <| hr.eventually_ge_atTop <| r + dist a x).exists
81+
hci.of_isClosed_subset isClosed_ball <| closedBall_subset_closedBall' hir
7082

7183
-- A compact pseudometric space is proper
7284
-- see Note [lower instance priority]
@@ -109,7 +121,7 @@ instance prod_properSpace {α : Type*} {β : Type*} [PseudoMetricSpace α] [Pseu
109121
/-- A finite product of proper spaces is proper. -/
110122
instance pi_properSpace {π : β → Type*} [Fintype β] [∀ b, PseudoMetricSpace (π b)]
111123
[h : ∀ b, ProperSpace (π b)] : ProperSpace (∀ b, π b) := by
112-
refine' properSpace_of_compact_closedBall_of_le 0 fun x r hr => _
124+
refine .of_isCompact_closedBall_of_le 0 fun x r hr => ?_
113125
rw [closedBall_pi _ hr]
114126
exact isCompact_univ_pi fun _ => isCompact_closedBall _ _
115127
#align pi_proper_space pi_properSpace

0 commit comments

Comments
 (0)