Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 02a4775

Browse files
committed
refactor(analysis/normed_space): merge normed_space and semi_normed_space (#8218)
There are no theorems which are true for `[normed_group M] [normed_space R M]` but not `[normed_group M] [semi_normed_space R M]`; so there is about as much value to the `semi_normed_space` / `normed_space` distinction as there was between `module` / `semimodule`. Since we eliminated `semimodule`, we should eliminte `semi_normed_space` too. This relaxes the typeclass arguments of `normed_space` to make it a drop-in replacement for `semi_normed_space`; or viewed another way, this removes `normed_space` and renames `semi_normed_space` to replace it. This does the same thing to `normed_algebra` and `seminormed_algebra`, but these are hardly used anyway. [Zulip](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/semi_normed_space.20vs.20normed_space/near/245089933) As with any typeclass refactor, this randomly breaks elaboration in a few places; presumably, it was able to unify arguments from one particular typeclass path, but not from another. To fix this, some type ascriptions have to be added where previously none were needed. In a few rare cases, the elaborator gets so confused that we have to enter tactic mode to produce a term. This isn't really a new problem - this PR just makes these issues all visible at once, whereas normally we'd only run into one or two at a time. Optimistically Lean 4 will fix all this, but we won't really know until we try.
1 parent d60541c commit 02a4775

26 files changed

+156
-204
lines changed

docs/overview.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Topology:
243243
Analysis:
244244
Normed vector spaces/Banach spaces:
245245
normed vector space over a normed field: 'normed_space'
246-
topology on a normed vector space: 'semi_normed_space.has_bounded_smul'
246+
topology on a normed vector space: 'normed_space.has_bounded_smul'
247247
equivalence of norms in finite dimension: 'linear_equiv.to_continuous_linear_equiv'
248248
finite dimensional normed spaces over complete normed fields are complete: 'submodule.complete_of_finite_dimensional'
249249
Heine-Borel theorem (finite dimensional normed spaces are proper): 'finite_dimensional.proper'

docs/undergrad.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ Topology:
411411
complete metric spaces: 'metric.complete_of_cauchy_seq_tendsto'
412412
contraction mapping theorem: 'contracting_with.exists_fixed_point'
413413
Normed vector spaces on $\R$ and $\C$:
414-
topology on a normed vector space: 'semi_normed_space.has_bounded_smul'
414+
topology on a normed vector space: 'normed_space.has_bounded_smul'
415415
equivalent norms: ''
416416
Banach open mapping theorem: 'continuous_linear_map.is_open_map'
417417
equivalence of norms in finite dimension: 'linear_equiv.to_continuous_linear_equiv'

src/analysis/calculus/deriv.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,8 @@ lemma deriv_within_const_sub (hxs : unique_diff_within_at 𝕜 s x) (c : F) :
988988
by simp [deriv_within, fderiv_within_const_sub hxs]
989989

990990
lemma deriv_const_sub (c : F) : deriv (λ y, c - f y) x = -deriv f x :=
991-
by simp only [← deriv_within_univ, deriv_within_const_sub unique_diff_within_at_univ]
991+
by simp only [← deriv_within_univ,
992+
deriv_within_const_sub (unique_diff_within_at_univ : unique_diff_within_at 𝕜 _ _)]
992993

993994
end sub
994995

src/analysis/calculus/mean_value.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,6 @@ lemma has_strict_deriv_at_of_has_deriv_at_of_continuous_at {f f' : 𝕜 → G} {
13011301
(hder : ∀ᶠ y in 𝓝 x, has_deriv_at f (f' y) y) (hcont : continuous_at f' x) :
13021302
has_strict_deriv_at f (f' x) x :=
13031303
has_strict_fderiv_at_of_has_fderiv_at_of_continuous_at (hder.mono (λ y hy, hy.has_fderiv_at)) $
1304-
(smul_rightL 𝕜 _ _ 1).continuous.continuous_at.comp hcont
1304+
(smul_rightL 𝕜 𝕜 G 1).continuous.continuous_at.comp hcont
13051305

13061306
end is_R_or_C

src/analysis/calculus/times_cont_diff.lean

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ local notation `∞` := (⊤ : with_top ℕ)
164164
universes u v w
165165

166166
local attribute [instance, priority 1001]
167-
normed_group.to_add_comm_group normed_space.to_module add_comm_group.to_add_comm_monoid
167+
normed_group.to_add_comm_group normed_space.to_module' add_comm_group.to_add_comm_monoid
168168

169169
open set fin filter
170170
open_locale topological_space
@@ -2830,7 +2830,9 @@ begin
28302830
by { ext x, simp [deriv_within] },
28312831
simp only [this],
28322832
apply times_cont_diff.comp_times_cont_diff_on _ h,
2833-
exact (is_bounded_bilinear_map_smul_right.is_bounded_linear_map_right _).times_cont_diff }
2833+
have : is_bounded_bilinear_map 𝕜 (λ _ : (𝕜 →L[𝕜] 𝕜) × F, _) :=
2834+
is_bounded_bilinear_map_smul_right,
2835+
exact (this.is_bounded_linear_map_right _).times_cont_diff }
28342836
end
28352837

28362838
/-- A function is `C^(n + 1)` on an open domain if and only if it is

src/analysis/normed_space/add_torsor.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ end
273273

274274
section normed_space
275275

276-
variables {𝕜 : Type*} [normed_field 𝕜] [semi_normed_space 𝕜 V]
276+
variables {𝕜 : Type*} [normed_field 𝕜] [normed_space 𝕜 V]
277277

278278
open affine_map
279279

@@ -324,7 +324,7 @@ end
324324

325325
end normed_space
326326

327-
variables [semi_normed_space ℝ V] [normed_space ℝ W]
327+
variables [normed_space ℝ V] [normed_space ℝ W]
328328

329329
lemma dist_midpoint_midpoint_le (p₁ p₂ p₃ p₄ : V) :
330330
dist (midpoint ℝ p₁ p₂) (midpoint ℝ p₃ p₄) ≤ (dist p₁ p₃ + dist p₂ p₄) / 2 :=

src/analysis/normed_space/affine_isometry.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ variables (𝕜 : Type*) {V V₁ V₂ V₃ V₄ : Type*} {P₁ : Type*} (P P₂
3434
[normed_field 𝕜]
3535
[semi_normed_group V] [normed_group V₁] [semi_normed_group V₂] [semi_normed_group V₃]
3636
[semi_normed_group V₄]
37-
[semi_normed_space 𝕜 V] [normed_space 𝕜 V₁] [semi_normed_space 𝕜 V₂] [semi_normed_space 𝕜 V₃]
38-
[semi_normed_space 𝕜 V₄]
37+
[normed_space 𝕜 V] [normed_space 𝕜 V₁] [normed_space 𝕜 V₂] [normed_space 𝕜 V₃]
38+
[normed_space 𝕜 V₄]
3939
[pseudo_metric_space P] [metric_space P₁] [pseudo_metric_space P₂] [pseudo_metric_space P₃]
4040
[pseudo_metric_space P₄]
4141
[semi_normed_add_torsor V P] [normed_add_torsor V₁ P₁] [semi_normed_add_torsor V₂ P₂]
@@ -519,7 +519,7 @@ lemma point_reflection_fixed_iff [invertible (2:𝕜)] {x y : P} :
519519
point_reflection 𝕜 x y = y ↔ y = x :=
520520
affine_equiv.point_reflection_fixed_iff_of_module 𝕜
521521

522-
variables [semi_normed_space ℝ V]
522+
variables [normed_space ℝ V]
523523

524524
lemma dist_point_reflection_self_real (x y : P) :
525525
dist (point_reflection ℝ x y) y = 2 * dist x y :=

src/analysis/normed_space/banach_steinhaus.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ variables
2525
{E F 𝕜 𝕜₂ : Type*}
2626
[semi_normed_group E] [semi_normed_group F]
2727
[nondiscrete_normed_field 𝕜] [nondiscrete_normed_field 𝕜₂]
28-
[semi_normed_space 𝕜 E] [semi_normed_space 𝕜₂ F]
28+
[normed_space 𝕜 E] [normed_space 𝕜₂ F]
2929
{σ₁₂ : 𝕜 →+* 𝕜₂} [ring_hom_isometric σ₁₂]
3030

3131

0 commit comments

Comments
 (0)