Skip to content

Commit 544fb26

Browse files
committed
Merge branch 'master' into feature/graph-walk-getvert-range
2 parents 14153e7 + 698d306 commit 544fb26

38 files changed

Lines changed: 870 additions & 86 deletions

File tree

β€ŽMathlib.leanβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,6 +1679,7 @@ import Mathlib.Analysis.Convex.Uniform
16791679
import Mathlib.Analysis.Convex.Visible
16801680
import Mathlib.Analysis.Convolution
16811681
import Mathlib.Analysis.Distribution.AEEqOfIntegralContDiff
1682+
import Mathlib.Analysis.Distribution.ContDiffMapSupportedIn
16821683
import Mathlib.Analysis.Distribution.FourierSchwartz
16831684
import Mathlib.Analysis.Distribution.SchwartzSpace
16841685
import Mathlib.Analysis.Fourier.AddCircle
@@ -1706,6 +1707,7 @@ import Mathlib.Analysis.InnerProductSpace.Convex
17061707
import Mathlib.Analysis.InnerProductSpace.Defs
17071708
import Mathlib.Analysis.InnerProductSpace.Dual
17081709
import Mathlib.Analysis.InnerProductSpace.EuclideanDist
1710+
import Mathlib.Analysis.InnerProductSpace.GramMatrix
17091711
import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho
17101712
import Mathlib.Analysis.InnerProductSpace.Harmonic.Basic
17111713
import Mathlib.Analysis.InnerProductSpace.Harmonic.Constructions
@@ -2884,6 +2886,7 @@ import Mathlib.CategoryTheory.Triangulated.TriangleShift
28842886
import Mathlib.CategoryTheory.Triangulated.Triangulated
28852887
import Mathlib.CategoryTheory.Triangulated.Yoneda
28862888
import Mathlib.CategoryTheory.Types.Basic
2889+
import Mathlib.CategoryTheory.Types.Monomorphisms
28872890
import Mathlib.CategoryTheory.Types.Set
28882891
import Mathlib.CategoryTheory.UnivLE
28892892
import Mathlib.CategoryTheory.Whiskering
@@ -5585,6 +5588,7 @@ import Mathlib.RingTheory.Grassmannian
55855588
import Mathlib.RingTheory.HahnSeries.Addition
55865589
import Mathlib.RingTheory.HahnSeries.Basic
55875590
import Mathlib.RingTheory.HahnSeries.HEval
5591+
import Mathlib.RingTheory.HahnSeries.HahnEmbedding
55885592
import Mathlib.RingTheory.HahnSeries.Lex
55895593
import Mathlib.RingTheory.HahnSeries.Multiplication
55905594
import Mathlib.RingTheory.HahnSeries.PowerSeries

β€ŽMathlib/Algebra/Algebra/Equiv.leanβ€Ž

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,3 +817,25 @@ def ULift.algEquiv {R : Type u} {A : Type v} [CommSemiring R] [Semiring A] [Alge
817817
ULift.{w} A ≃ₐ[R] A where
818818
__ := ULift.ringEquiv
819819
commutes' _ := rfl
820+
821+
/-- If an `R`-algebra `A` is isomorphic to `R` as `R`-module, then the canonical map `R β†’ A` is an
822+
equivalence of `R`-algebras.
823+
824+
Note that if `e : R ≃ₗ[R] A` is the linear equivalence, then this is not the same as the equivalence
825+
of algebras provided here unless `e 1 = 1`. -/
826+
@[simps] def LinearEquiv.algEquivOfRing
827+
{R A : Type*} [CommSemiring R] [CommSemiring A] [Algebra R A]
828+
(e : R ≃ₗ[R] A) : R ≃ₐ[R] A where
829+
__ := Algebra.ofId R A
830+
invFun x := e.symm (e 1 * x)
831+
left_inv x := calc
832+
e.symm (e 1 * (algebraMap R A) x)
833+
= e.symm (x β€’ e 1) := by rw [Algebra.smul_def, mul_comm]
834+
_ = x := by rw [map_smul, e.symm_apply_apply, smul_eq_mul, mul_one]
835+
right_inv x := calc
836+
(algebraMap R A) (e.symm (e 1 * x))
837+
= (algebraMap R A) (e.symm (e 1 * x)) * e (e.symm 1 β€’ 1) := by
838+
rw [smul_eq_mul, mul_one, e.apply_symm_apply, mul_one]
839+
_ = x := by rw [map_smul, Algebra.smul_def, mul_left_comm, ← Algebra.smul_def _ (e 1),
840+
← map_smul, smul_eq_mul, mul_one, e.apply_symm_apply, ← mul_assoc, ← Algebra.smul_def,
841+
← map_smul, smul_eq_mul, mul_one, e.apply_symm_apply, one_mul]

β€ŽMathlib/Algebra/Category/Ring/Instances.leanβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ instance localization_unit_isIso' (R : CommRingCat) :
2626

2727
theorem IsLocalization.epi {R : Type*} [CommRing R] (M : Submonoid R) (S : Type _) [CommRing S]
2828
[Algebra R S] [IsLocalization M S] : Epi (CommRingCat.ofHom <| algebraMap R S) :=
29-
⟨fun {T} _ _ h => CommRingCat.hom_ext <|
30-
@IsLocalization.ringHom_ext R _ M S _ _ T _ _ _ _ (congrArg CommRingCat.Hom.hom h)⟩
29+
⟨fun _ _ h => CommRingCat.hom_ext <| ringHom_ext M congr(($h).hom)⟩
3130

3231
instance Localization.epi {R : Type*} [CommRing R] (M : Submonoid R) :
3332
Epi (CommRingCat.ofHom <| algebraMap R <| Localization M) :=

β€ŽMathlib/Algebra/Order/Module/HahnEmbedding.leanβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ under `ArchimedeanClass.closedBall K c`. The embeddings from these submodules ar
2828
`HahnEmbedding.Seed K M R`.
2929
3030
By setting `K = β„š` and `R = ℝ`, the condition can be trivially satisfied, leading
31-
to a proof of the classic Hahn embedding theorem. (TODO: implement this)
31+
to a proof of the classic Hahn embedding theorem. (See `hahnEmbedding_isOrderedAddMonoid`)
3232
3333
## Main theorem
3434

β€ŽMathlib/AlgebraicGeometry/StructureSheaf.leanβ€Ž

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -523,14 +523,11 @@ def stalkIso (x : PrimeSpectrum.Top R) :
523523
rw [← this, ← hs, const_apply, localizationToStalk_mk']
524524
refine (structureSheaf R).presheaf.germ_ext V hxV (homOfLE hg) iVU ?_
525525
rw [← hs, res_const']
526-
inv_hom_id := CommRingCat.hom_ext <|
527-
@IsLocalization.ringHom_ext R _ x.asIdeal.primeCompl (Localization.AtPrime x.asIdeal) _ _
528-
(Localization.AtPrime x.asIdeal) _ _
529-
(RingHom.comp (stalkToFiberRingHom R x).hom (localizationToStalk R x).hom)
530-
(RingHom.id (Localization.AtPrime _)) <| by
531-
ext f
532-
rw [RingHom.comp_apply, RingHom.comp_apply, localizationToStalk_of,
533-
stalkToFiberRingHom_toStalk, RingHom.comp_apply, RingHom.id_apply]
526+
inv_hom_id := CommRingCat.hom_ext <| IsLocalization.ringHom_ext x.asIdeal.primeCompl <| by
527+
ext f
528+
rw [CommRingCat.hom_comp, CommRingCat.hom_id,
529+
RingHom.comp_apply, RingHom.comp_apply, localizationToStalk_of,
530+
stalkToFiberRingHom_toStalk, RingHom.comp_apply, RingHom.id_apply]
534531

535532
instance (x : PrimeSpectrum R) : IsIso (stalkToFiberRingHom R x) :=
536533
(stalkIso R x).isIso_hom

β€ŽMathlib/Analysis/Analytic/IsolatedZeros.leanβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ theorem AnalyticAt.map_nhdsNE {x : π•œ} {f : π•œ β†’ E} (hfx : AnalyticAt π•œ
342342
Preimages of codiscrete sets: if `f` is analytic on a neighbourhood of `U` and not locally constant,
343343
then the preimage of any subset codiscrete within `f '' U` is codiscrete within `U`.
344344
345-
See `AnalyticOnNhd.preimage_zero_codiscreteWithin` for the special case that `s` is the complement
346-
of zero. Applications might want to use the theorem `Filter.codiscreteWithin.mono`.
345+
See `AnalyticOnNhd.preimage_zero_mem_codiscreteWithin` for the special case that `s` is the
346+
complement of zero. Applications might want to use the theorem `Filter.codiscreteWithin.mono`.
347347
-/
348348
theorem AnalyticOnNhd.preimage_mem_codiscreteWithin {U : Set π•œ} {s : Set E} {f : π•œ β†’ E}
349349
(hfU : AnalyticOnNhd π•œ f U) (hβ‚‚f : βˆ€ x ∈ U, Β¬EventuallyConst f (𝓝 x))

β€ŽMathlib/Analysis/Calculus/TangentCone.leanβ€Ž

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -591,22 +591,25 @@ end Normed
591591
section RealNormed
592592
variable [NormedAddCommGroup G] [NormedSpace ℝ G]
593593

594-
/-- In a real vector space, a convex set with nonempty interior is a set of unique
595-
differentiability at every point of its closure. -/
596-
theorem uniqueDiffWithinAt_convex {s : Set G} (conv : Convex ℝ s) (hs : (interior s).Nonempty)
597-
{x : G} (hx : x ∈ closure s) : UniqueDiffWithinAt ℝ s x := by
594+
theorem Convex.span_tangentConeAt {s : Set G} (conv : Convex ℝ s) (hs : (interior s).Nonempty)
595+
{x : G} (hx : x ∈ closure s) : Submodule.span ℝ (tangentConeAt ℝ s x) = ⊀ := by
598596
rcases hs with ⟨y, hy⟩
599597
suffices y - x ∈ interior (tangentConeAt ℝ s x) by
600-
refine ⟨Dense.of_closure ?_, hx⟩
601-
simp [(Submodule.span ℝ (tangentConeAt ℝ s x)).eq_top_of_nonempty_interior'
602-
⟨y - x, interior_mono Submodule.subset_span this⟩]
598+
apply (Submodule.span ℝ (tangentConeAt ℝ s x)).eq_top_of_nonempty_interior'
599+
exact ⟨y - x, interior_mono Submodule.subset_span this⟩
603600
rw [mem_interior_iff_mem_nhds]
604601
replace hy : interior s ∈ 𝓝 y := IsOpen.mem_nhds isOpen_interior hy
605602
apply mem_of_superset ((isOpenMap_sub_right x).image_mem_nhds hy)
606603
rintro _ ⟨z, zs, rfl⟩
607604
refine mem_tangentConeAt_of_openSegment_subset (Subset.trans ?_ interior_subset)
608605
exact conv.openSegment_closure_interior_subset_interior hx zs
609606

607+
/-- In a real vector space, a convex set with nonempty interior is a set of unique
608+
differentiability at every point of its closure. -/
609+
theorem uniqueDiffWithinAt_convex {s : Set G} (conv : Convex ℝ s) (hs : (interior s).Nonempty)
610+
{x : G} (hx : x ∈ closure s) : UniqueDiffWithinAt ℝ s x := by
611+
simp [uniqueDiffWithinAt_iff, conv.span_tangentConeAt hs hx, hx]
612+
610613
/-- In a real vector space, a convex set with nonempty interior is a set of unique
611614
differentiability. -/
612615
theorem uniqueDiffOn_convex {s : Set G} (conv : Convex ℝ s) (hs : (interior s).Nonempty) :
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/-
2+
Copyright (c) 2023 Anatole Dedecker. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Anatole Dedecker, Luigi Massacci
5+
-/
6+
7+
import Mathlib.Analysis.Calculus.ContDiff.Defs
8+
import Mathlib.Topology.ContinuousMap.Bounded.Normed
9+
import Mathlib.Topology.Sets.Compacts
10+
11+
/-!
12+
# Continuously differentiable functions supported in a given compact set
13+
14+
This file develops the basic theory of bundled `n`-times continuously differentiable functions
15+
with support contained in a given compact set.
16+
17+
Given `n : β„•βˆž` and a compact subset `K` of a normed space `E`, we consider the type of bundled
18+
functions `f : E β†’ F` (where `F` is a normed vector space) such that:
19+
20+
- `f` is `n`-times continuously differentiable: `ContDiff ℝ n f`.
21+
- `f` vanishes outside of a compact set: `EqOn f 0 Kᢜ`.
22+
23+
The main reason this exists as a bundled type is to be endowed with its natural locally convex
24+
topology (namely, uniform convergence of `f` and its derivative up to order `n`).
25+
Taking the locally convex inductive limit of these as `K` varies yields the natural topology on test
26+
functions, used to define distributions. While most of distribution theory cares only about `C^∞`
27+
functions, we also want to endow the space of `C^n` test functions with its natural topology.
28+
Indeed, distributions of order less than `n` are precisely those which extend continuously to this
29+
larger space of test functions.
30+
31+
## Main definitions
32+
33+
- `ContDiffMapSupportedIn E F n K`: the type of bundled `n`-times continuously differentiable
34+
functions `E β†’ F` which vanish outside of `K`.
35+
- `ContDiffMapSupportedIn.iteratedFDerivβ‚—'`: wraps `iteratedFDeriv` into a `π•œ`-linear map on
36+
`ContDiffMapSupportedIn E F n K`, as a map into
37+
`ContDiffMapSupportedIn E (E [Γ—i]β†’L[ℝ] F) (n-i) K`.
38+
39+
## Main statements
40+
41+
TODO:
42+
- `ContDiffMapSupportedIn.instIsUniformAddGroup` and
43+
`ContDiffMapSupportedIn.instLocallyConvexSpace`: `ContDiffMapSupportedIn` is a locally convex
44+
topological vector space.
45+
46+
## Notation
47+
48+
- `𝓓^{n}_{K}(E, F)`: the space of `n`-times continuously differentiable functions `E β†’ F`
49+
which vanish outside of `K`.
50+
- `𝓓_{K}(E, F)`: the space of smooth (infinitely differentiable) functions `E β†’ F`
51+
which vanish outside of `K`, i.e. `𝓓^{⊀}_{K}(E, F)`.
52+
53+
## Implementation details
54+
55+
The technical choice of spelling `EqOn f 0 Kᢜ` in the definition, as opposed to `tsupport f βŠ† K`
56+
is to make rewriting `f x` to `0` easier when `x βˆ‰ K`.
57+
58+
## Tags
59+
60+
distributions
61+
-/
62+
63+
open TopologicalSpace SeminormFamily Set Function Seminorm UniformSpace
64+
open scoped BoundedContinuousFunction Topology NNReal
65+
66+
variable (π•œ E F : Type*) [NontriviallyNormedField π•œ]
67+
[NormedAddCommGroup E] [NormedSpace ℝ E]
68+
[NormedAddCommGroup F] [NormedSpace ℝ F] [NormedSpace π•œ F] [SMulCommClass ℝ π•œ F]
69+
{n : β„•βˆž} {K : Compacts E}
70+
71+
/-- The type of bundled `n`-times continuously differentiable maps which vanish outside of a fixed
72+
compact set `K`. -/
73+
structure ContDiffMapSupportedIn (n : β„•βˆž) (K : Compacts E) : Type _ where
74+
/-- The underlying function. Use coercion instead. -/
75+
protected toFun : E β†’ F
76+
protected contDiff' : ContDiff ℝ n toFun
77+
protected zero_on_compl' : EqOn toFun 0 Kᢜ
78+
79+
/-- Notation for the space of bundled `n`-times continuously differentiable
80+
functions with support in a compact set `K`. -/
81+
scoped[Distributions] notation "𝓓^{" n "}_{"K"}(" E ", " F ")" =>
82+
ContDiffMapSupportedIn E F n K
83+
84+
/-- Notation for the space of bundled smooth (inifinitely differentiable)
85+
functions with support in a compact set `K`. -/
86+
scoped[Distributions] notation "𝓓_{"K"}(" E ", " F ")" =>
87+
ContDiffMapSupportedIn E F ⊀ K
88+
89+
open Distributions
90+
91+
/-- `ContDiffMapSupportedInClass B E F n K` states that `B` is a type of bundled `n`-times
92+
continously differentiable functions with support in the compact set `K`. -/
93+
class ContDiffMapSupportedInClass (B : Type*) (E F : outParam <| Type*)
94+
[NormedAddCommGroup E] [NormedAddCommGroup F] [NormedSpace ℝ E] [NormedSpace ℝ F]
95+
(n : outParam β„•βˆž) (K : outParam <| Compacts E)
96+
extends FunLike B E F where
97+
map_contDiff (f : B) : ContDiff ℝ n f
98+
map_zero_on_compl (f : B) : EqOn f 0 Kᢜ
99+
100+
open ContDiffMapSupportedInClass
101+
102+
instance (B : Type*) (E F : outParam <| Type*)
103+
[NormedAddCommGroup E] [NormedAddCommGroup F] [NormedSpace ℝ E] [NormedSpace ℝ F]
104+
(n : outParam β„•βˆž) (K : outParam <| Compacts E)
105+
[ContDiffMapSupportedInClass B E F n K] :
106+
ContinuousMapClass B E F where
107+
map_continuous f := (map_contDiff f).continuous
108+
109+
instance (B : Type*) (E F : outParam <| Type*)
110+
[NormedAddCommGroup E] [NormedAddCommGroup F] [NormedSpace ℝ E] [NormedSpace ℝ F]
111+
(n : outParam β„•βˆž) (K : outParam <| Compacts E)
112+
[ContDiffMapSupportedInClass B E F n K] :
113+
BoundedContinuousMapClass B E F where
114+
map_bounded f := by
115+
have := HasCompactSupport.intro K.isCompact (map_zero_on_compl f)
116+
rcases (map_continuous f).bounded_above_of_compact_support this with ⟨C, hC⟩
117+
exact map_bounded (BoundedContinuousFunction.ofNormedAddCommGroup f (map_continuous f) C hC)
118+
119+
namespace ContDiffMapSupportedIn
120+
121+
instance toContDiffMapSupportedInClass :
122+
ContDiffMapSupportedInClass 𝓓^{n}_{K}(E, F) E F n K where
123+
coe f := f.toFun
124+
coe_injective' f g h := by cases f; cases g; congr
125+
map_contDiff f := f.contDiff'
126+
map_zero_on_compl f := f.zero_on_compl'
127+
128+
variable {E F}
129+
130+
protected theorem contDiff (f : 𝓓^{n}_{K}(E, F)) : ContDiff ℝ n f := map_contDiff f
131+
protected theorem zero_on_compl (f : 𝓓^{n}_{K}(E, F)) : EqOn f 0 Kᢜ := map_zero_on_compl f
132+
protected theorem compact_supp (f : 𝓓^{n}_{K}(E, F)) : HasCompactSupport f :=
133+
.intro K.isCompact (map_zero_on_compl f)
134+
135+
@[simp]
136+
theorem toFun_eq_coe {f : 𝓓^{n}_{K}(E, F)} : f.toFun = (f : E β†’ F) :=
137+
rfl
138+
139+
/-- See note [custom simps projection]. -/
140+
def Simps.apply (f : 𝓓^{n}_{K}(E, F)) : E β†’ F := f
141+
142+
initialize_simps_projections ContDiffMapSupportedIn (toFun β†’ apply)
143+
144+
@[ext]
145+
theorem ext {f g : 𝓓^{n}_{K}(E, F)} (h : βˆ€ a, f a = g a) : f = g :=
146+
DFunLike.ext _ _ h
147+
148+
/-- Copy of a `ContDiffMapSupportedIn` with a new `toFun` equal to the old one. Useful to fix
149+
definitional equalities. -/
150+
protected def copy (f : 𝓓^{n}_{K}(E, F)) (f' : E β†’ F) (h : f' = f) : 𝓓^{n}_{K}(E, F) where
151+
toFun := f'
152+
contDiff' := h.symm β–Έ f.contDiff
153+
zero_on_compl' := h.symm β–Έ f.zero_on_compl
154+
155+
@[simp]
156+
theorem coe_copy (f : 𝓓^{n}_{K}(E, F)) (f' : E β†’ F) (h : f' = f) : ⇑(f.copy f' h) = f' :=
157+
rfl
158+
159+
theorem copy_eq (f : 𝓓^{n}_{K}(E, F)) (f' : E β†’ F) (h : f' = f) : f.copy f' h = f :=
160+
DFunLike.ext' h
161+
162+
end ContDiffMapSupportedIn

0 commit comments

Comments
Β (0)