mathlib4 review helperopen PRs by @wwylele on leanprover-community/mathlib4

← queue

#39120 feat(MeasureTheory,Euclidean): area formula

please-adopt merge-conflict draft CI success merge conflict

+1957 −5 · 6 files · 16 commits · head cbe179e · updated 10 days ago · Files changed on GitHub

In plain words

The PR defines the "norm determinant" of a linear map between inner product spaces ( finite-dimensional). It is the factor by which scales -dimensional volume, and it generalises for endomorphisms. The PR then proves the area formula for maps that are injective on a measurable set and whose derivative is injective at every point of : , where is the Euclidean-normalised Hausdorff measure μHE. As an application it computes the length of the unit circle. The proof follows Evans–Gariepy (Lemma 3.3 ff.): cover by countably many pieces on which is bi-Lipschitz after a linear change of variables, then let the Lipschitz constant tend to 1. Two lemmas in MeasureTheory/Function/Jacobian.lean are generalised from to so they can be used here. Geometry/Euclidean/Volume/Area.lean is still a draft: it has helper names like lemma3_3, left and glue, "by aristotle" comments, typos in names, an empty module docstring, and large commented-out blocks containing sorry.

The new file also carries commented-out drafts (ENat/encard helpers, smasher_sublinear, exists_smasher, area_formula_injOn_singular(_le), area_sphere), some ending in sorry: dead code to remove or finish before review.

Transcriptions are drafted with an LLM from the diff and are a reading aid, not a verified statement: the Lean code is the reference.

PR description

This PR aims to prove the generalization of MeasureTheory.lintegral_abs_det_fderiv_eq_addHaar_image in inner product spaces, where the domain and the codomain are allowed to be different.

WIP. TODO:

AI usage disclosure: Aristotle were used to prove some "trivial" lemma (measurability, summability etc.)


![Open in Gitpod](gitpod.io/from-referrer/)

Conversation on GitHub 4
github-actions[bot] · comment · 2026-05-09
PR summary cbe179eeed
Import changes for modified files

No significant changes to the import graph

<details><summary>Import changes for all files</summary>

|Files|Import difference| |-|-| | Mathlib.Analysis.InnerProductSpace.NormDet (new file)|2683| | Mathlib.Geometry.Euclidean.Volume.Area (new file)|2783|

</details>


<details><summary>

Declarations diff

</summary>

+ ContinousLinearMap.adjoint_prodWithLp + ContinousLinearMap.adjoint_prodWithLp_comp_self + ContinuousLinearMap.exists_pos_lower_bound + ContinuousLinearMap.prodWithLp + ContinuousLinearMap.withLpCoprod + ContinuousLinearMap.withLpCoprod_comp_prodWithLp + ENat.hasSum + ENat.le_tsum + ENat.summable + ENat.tsum_eq_top_of_ne_zero + Eprop + LipschitzOnWith.euclideanHausdorffMeasure_image_le + Piece + Piece.mk' + Set.Infinite.iUnion_of_pairwise_disjoint + Set.encard_biUnion_finset + Set.encard_iUnion + _root_.ContinuousLinearMap.adjoint_toLinearMap + _root_.ContinuousLinearMap.normDet_sq + _root_.LinearIsometry.normDet_eq_one + approx_linear_map + area_formula_injOn_ker + area_formula_injOn_ker_measurable + area_formula_injOn_singular + area_formula_injOn_singular_le + area_left + area_right + area_sphere + circumference_circle + continuous_ENat_toENNReal + disjoint_pieceSeq + eixsts_polar_decomposition + euclideanHausdorffMeasure_image + euclideanHausdorffMeasure_image_eq_normDet_mul_volume + exists_smasher + glue + glue_j + h3left + h3right + hausdorffMeasure_image + hclaimleft + hclaimright + iUnion_pieceSeq + iUnion_pieceSeq' + image_ball + left + lemma3_3 + measurable_Eprop + measurable_Eprop.extracted_1_4 + measurable_Eprop.extracted_1_5 + measurable_Eprop.extracted_1_6 + mem_ball2 + nonempty_piece + normDet + normDet_codRestrict + normDet_comp + normDet_comp_of_finrank_eq + normDet_eq_abs_det + normDet_eq_norm_det + normDet_eq_norm_det_toMatrix + normDet_eq_norm_det_toMatrix_rangeRestrict + normDet_eq_prod_singularValues + normDet_eq_zero_iff_ker_ne_bot + normDet_eq_zero_iff_rank_range_ne + normDet_eq_zero_tfae + normDet_id + normDet_ne_zero_tfae + normDet_neg + normDet_nonneg + normDet_of_subsingleton + normDet_smul + normDet_sq + normDet_sq_eq_det_gram + normDet_subtype + normDet_zero + orthonormalBasis_range + pieceSeq + pieceSeq' + pieceSeq_subset + right + smasher_sublinear + volume_ball_ne_top + volume_ball_ne_zero + μHE_image_zero <details> <summary>You can run this locally as follows</summary>

## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

</details>

The doc-module for scripts/pr_summary/declarations_diff.sh in the undefined repository contains some details about this script.

</details>


<details><summary>No changes to strong technical debt.</summary> <details><summary>No changes to weak technical debt.</summary>

mathlib-dependent-issues[bot] · comment · 2026-07-08

This PR/issue depends on:

  • ~~leanprover-community/mathlib4#37295~~
  • ~~leanprover-community/mathlib4#39132~~
  • ~~leanprover-community/mathlib4#39160~~

By Dependent Issues (🤖). Happy coding!

mathlib-merge-conflicts[bot] · comment · 2026-07-08

This pull request has conflicts, please merge master and resolve them.

wwylele · comment · 2026-11-25

Tagged please-adopt as I might not come back to this in the short term. Feel free to open your own PR implementing this

Mathlib.lean +2 −0

public import Mathlib.Analysis.InnerProductSpace.LinearMap
1993public import Mathlib.Analysis.InnerProductSpace.LinearPMap
1994public import Mathlib.Analysis.InnerProductSpace.MeanErgodic
1995public import Mathlib.Analysis.InnerProductSpace.MulOpposite
1996public import Mathlib.Analysis.InnerProductSpace.NormDet
1997public import Mathlib.Analysis.InnerProductSpace.NormPow
1998public import Mathlib.Analysis.InnerProductSpace.OfNorm
1999public import Mathlib.Analysis.InnerProductSpace.Orientation
public import Mathlib.Geometry.Euclidean.Sphere.Ptolemy
4528public import Mathlib.Geometry.Euclidean.Sphere.SecondInter
4529public import Mathlib.Geometry.Euclidean.Sphere.Tangent
4530public import Mathlib.Geometry.Euclidean.Triangle
4531public import Mathlib.Geometry.Euclidean.Volume.Area
4532public import Mathlib.Geometry.Euclidean.Volume.Measure
4533public import Mathlib.Geometry.Group.Growth.LinearLowerBound
4534public import Mathlib.Geometry.Group.Growth.QuotientInter

Mathlib/Analysis/InnerProductSpace/Adjoint.lean +6 −0

theorem adjoint_eq_toCLM_adjoint (A : E →ₗ[𝕜] F) :
541 A.adjoint = A.toContinuousLinearMap.adjoint :=
542 rfl
theorem _root_.ContinuousLinearMap.adjoint_toLinearMap newL544–548
544theorem _root_.ContinuousLinearMap.adjoint_toLinearMap (A : E →L[𝕜] F) :
545 haveI := FiniteDimensional.complete 𝕜 E
546 haveI := FiniteDimensional.complete 𝕜 F
547 A.toLinearMap.adjoint = A.adjoint.toLinearMap :=
548 rfl
550/-- The fundamental property of the adjoint. -/
551theorem adjoint_inner_left (A : E →ₗ[𝕜] F) (x : E) (y : F) : ⟪adjoint A y, x⟫ = ⟪y, A x⟫ := by
552 have := FiniteDimensional.complete 𝕜 E

Mathlib/Analysis/InnerProductSpace/NormDet.lean +439 −0 new file

1/-
2Copyright (c) 2026 Weiyi Wang. All rights reserved.
3Released under Apache 2.0 license as described in the file LICENSE.
4Authors: Weiyi Wang
5-/
6module
7
8public import Mathlib.Analysis.InnerProductSpace.Adjoint
9public import Mathlib.Analysis.InnerProductSpace.GramMatrix
10public import Mathlib.Analysis.InnerProductSpace.SingularValues
11public import Mathlib.Geometry.Euclidean.Volume.Measure
12import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
13import Mathlib.Topology.MetricSpace.HausdorffDimension
15/-!
16# Norm determinant of a linear map
18Given a rectangular matrix $T$, it is common to talk about $\sqrt{det(T^{H}T)}$, where $T^{H}$ is
19the conjugate transpose of $T$, as a generalization to the determinant of a square matrix. It is the
20$m$-dimensional volume factor for $\mathbb{R}^m \to \mathbb{R}^n$. It is given various names in
21literature:
22* "Jacobian" (definition 3.4 of [lawrenceronald2025]), in the context of volume factor
23 for non-linear map. However, we choose to reserve this name for the matrix consists of
24 derivatives.
25* "Gram determinant", which is already used by `Matrix.gram`, and it is often referring to the
26 $det(T^{H}T)$ without the square root.
27* "Nonnegative determinant" (definition 1 of [haruoyoshiohidetoki2006]).
29Without a standardized name, we give a descriptive name `LinearMap.normDet` to reflect its
30definition and show that it is a generalization of `‖(f : LinearMap 𝕜 U U).det‖`
31(See `LinearMap.normDet_eq_norm_det`). We also construct this on linear maps between inner product
32spaces instead of matrices, and allow the codomain to have infinite dimension.
34## Main definition
35* `LinearMap.normDet` : the norm determinant of a linear map.
37## Main result
38* `ContinuousLinearMap.normDet_sq` and `LinearMap.normDet_sq`: The square of `f.normDet`
39 equals to the determinant of `f.adjoint ∘ₗ f`.
40* `LinearMap.normDet_sq_eq_det_gram`: The square of `LinearMap.normDet` equals to the determinant of
41 the gram matrix formed by vectors mapped from an orthonormal basis.
42* `LinearMap.normDet_eq_prod_singularValues`: `LinearMap.normDet` equals to the product of singular
43 values.
44* `LinearMap.hausdorffMeasure_image`: `LinearMap.normDet` is the volume factor for Hausdorff
45 measure.
47-/
49public section
51open Module
53namespace LinearMap
55variable {𝕜 U V W : Type*} [RCLike 𝕜] [NormedAddCommGroup U] [InnerProductSpace 𝕜 U]
56 [FiniteDimensional 𝕜 U] [NormedAddCommGroup V] [InnerProductSpace 𝕜 V] [NormedAddCommGroup W]
57 [InnerProductSpace 𝕜 W]
59open Classical in
def normDet newL60–72
60/--
61The norm determinant of a linear map `f : U →ₗ[𝕜] V` is defined as the norm of the determinant of
62the square matrix from `U →ₗ[𝕜] f.range` using a pair of orthonormal basis of equal dimensions.
63(See `LinearMap.normDet_eq_norm_det_toMatrix_rangeRestrict` for using arbitrary orthonormal basis)
65If such basis doesn't exist (i.e. the map is not injective), the norm determinant is zero.
66(See `LinearMap.normDet_eq_zero_iff_ker_ne_bot`)
67-/
68noncomputable def normDet (f : U →ₗ[𝕜] V) : ℝ :=
69 if h : Nonempty (OrthonormalBasis (Fin (finrank 𝕜 U)) 𝕜 f.range) then
70 ‖(f.rangeRestrict.toMatrix (stdOrthonormalBasis 𝕜 U).toBasis h.some.toBasis).det‖
71 else
72 0
theorem normDet_nonneg newL74–76
74theorem normDet_nonneg (f : U →ₗ[𝕜] V) : 0 ≤ f.normDet := by
75 unfold normDet
76 split <;> simp
theorem normDet_eq_norm_det_toMatrix_rangeRestrict newL78–105
78/--
79`LinearMap.normDet` is well-defined under any pair of orthonormal basis.
80-/
81theorem normDet_eq_norm_det_toMatrix_rangeRestrict {ι : Type*} [Fintype ι] [DecidableEq ι]
82 (f : U →ₗ[𝕜] V) (bu : OrthonormalBasis ι 𝕜 U) (bv : OrthonormalBasis ι 𝕜 f.range) :
83 f.normDet = ‖(f.rangeRestrict.toMatrix bu.toBasis bv.toBasis).det‖ := by
84 have hrank : finrank 𝕜 U = finrank 𝕜 f.range := by
85 rw [finrank_eq_nat_card_basis bu.toBasis, finrank_eq_nat_card_basis bv.toBasis]
86 have h : Nonempty (OrthonormalBasis (Fin (finrank 𝕜 U)) 𝕜 f.range) := by
87 rw [hrank]
88 exact ⟨stdOrthonormalBasis 𝕜 f.range⟩
89 simp only [normDet, h, ↓reduceDIte]
90 rw [← basis_toMatrix_mul_linearMap_toMatrix_mul_basis_toMatrix (stdOrthonormalBasis 𝕜 U).toBasis
91 bu.toBasis h.some.toBasis bv.toBasis]
92 have h1 : bu.toBasis.toMatrix (stdOrthonormalBasis 𝕜 U).toBasis *
93 (stdOrthonormalBasis 𝕜 U).toBasis.toMatrix bu.toBasis = 1 :=
94 Basis.toMatrix_mul_toMatrix_flip _ _
95 have h2 : (stdOrthonormalBasis 𝕜 U).toBasis.toMatrix bu.toBasis *
96 bu.toBasis.toMatrix (stdOrthonormalBasis 𝕜 U).toBasis = 1 :=
97 Basis.toMatrix_mul_toMatrix_flip _ _
98 rw [← Matrix.det_comm' h1 h2, ← Matrix.mul_assoc, Matrix.det_mul, norm_mul]
99 suffices ‖(bu.toBasis.toMatrix (stdOrthonormalBasis 𝕜 U).toBasis *
100 h.some.toBasis.toMatrix ⇑bv.toBasis).det‖ = 1 by
101 rw [this, one_mul]
102 refine CStarRing.norm_of_mem_unitary <| Matrix.det_of_mem_unitary ?_
103 rw [Matrix.mem_unitaryGroup_iff, Matrix.star_eq_conjTranspose, Matrix.conjTranspose_mul,
104 ← Matrix.mul_assoc, Matrix.mul_assoc (bu.toBasis.toMatrix (stdOrthonormalBasis 𝕜 U).toBasis)]
105 simp
theorem normDet_eq_zero_iff_ker_ne_bot newL107–131
107/--
108`LinearMap.normDet` vanishes iff the map is not injective.
109-/
110theorem normDet_eq_zero_iff_ker_ne_bot {f : U →ₗ[𝕜] V} :
111 f.normDet = 0 ↔ f.ker ≠ ⊥ where
112 mp h := by
113 contrapose h
114 let g : U ≃ₗ[𝕜] f.range := LinearEquiv.ofBijective f.rangeRestrict
115 ⟨by simpa using ker_eq_bot.mp h, f.surjective_rangeRestrict⟩
116 let bu := stdOrthonormalBasis 𝕜 U
117 let bv := g.finrank_eq.symm ▸ stdOrthonormalBasis 𝕜 f.range
118 rw [f.normDet_eq_norm_det_toMatrix_rangeRestrict bu bv, norm_eq_zero.not]
119 suffices (f.rangeRestrict.adjoint.toMatrix bv.toBasis bu.toBasis).det *
120 (f.rangeRestrict.toMatrix bu.toBasis bv.toBasis).det ≠ 0 by
121 simpa [toMatrix_adjoint, Matrix.det_conjTranspose] using this
122 simpa [← Matrix.det_mul, ← LinearMap.toMatrix_comp, det_eq_zero_iff_ker_ne_bot,
123 LinearMap.ker_adjoint_comp_self] using h
124 mpr h := by
125 suffices ¬ Nonempty (OrthonormalBasis (Fin (finrank 𝕜 U)) 𝕜 f.range) by
126 simp [normDet, this]
127 contrapose h
128 obtain ⟨b⟩ := h
129 have hrank : finrank 𝕜 f.range = finrank 𝕜 U := by
130 simpa using finrank_eq_card_basis b.toBasis
131 simpa [hrank] using f.finrank_range_add_finrank_ker
theorem normDet_eq_zero_iff_rank_range_ne newL133–135
133theorem normDet_eq_zero_iff_rank_range_ne {f : U →ₗ[𝕜] V} :
134 f.normDet = 0 ↔ finrank 𝕜 f.range ≠ finrank 𝕜 U := by
135 simp [normDet_eq_zero_iff_ker_ne_bot, ← f.finrank_range_add_finrank_ker]
theorem normDet_ne_zero_tfae newL137–153
137theorem normDet_ne_zero_tfae (f : U →ₗ[𝕜] V) :
138 List.TFAE [f.normDet ≠ 0,
139 f.ker = ⊥,
140 finrank 𝕜 f.range = finrank 𝕜 U,
141 Nonempty (OrthonormalBasis (Fin (finrank 𝕜 U)) 𝕜 f.range),
142 Function.Injective f] := by
143 tfae_have 1 ↔ 2 := f.normDet_eq_zero_iff_ker_ne_bot.not_left
144 tfae_have 1 ↔ 3 := f.normDet_eq_zero_iff_rank_range_ne.not_left
145 tfae_have 3 → 4 := by
146 intro h
147 rw [← h]
148 exact ⟨stdOrthonormalBasis 𝕜 f.range⟩
149 tfae_have 4 → 3 := by
150 rintro ⟨b⟩
151 simpa using Module.finrank_eq_card_basis b.toBasis
152 tfae_have 2 ↔ 5 := ker_eq_bot
153 tfae_finish
def orthonormalBasis_range newL155–159
155private noncomputable def orthonormalBasis_range {ι : Type*} [Fintype ι] {f : U →ₗ[𝕜] V}
156 (hf : f.ker = ⊥) (b : OrthonormalBasis ι 𝕜 U) : OrthonormalBasis ι 𝕜 f.range :=
157 let h : Nonempty (OrthonormalBasis (Fin (finrank 𝕜 U)) 𝕜 f.range) :=
158 (f.normDet_ne_zero_tfae.out 1 3).mp hf
159 h.some.reindex (Fintype.equivFinOfCardEq <| (Module.finrank_eq_card_basis b.toBasis).symm).symm
theorem normDet_eq_zero_tfae newL161–175
161theorem normDet_eq_zero_tfae (f : U →ₗ[𝕜] V) :
162 List.TFAE [f.normDet = 0,
163 f.ker ≠ ⊥,
164 finrank 𝕜 f.range ≠ finrank 𝕜 U,
165 finrank 𝕜 f.range < finrank 𝕜 U,
166 IsEmpty (OrthonormalBasis (Fin (finrank 𝕜 U)) 𝕜 f.range),
167 ¬Function.Injective f] := by
168 tfae_have 1 ↔ 2 := f.normDet_eq_zero_iff_ker_ne_bot
169 tfae_have 1 ↔ 3 := f.normDet_eq_zero_iff_rank_range_ne
170 tfae_have 3 ↔ 4 := by simpa using finrank_range_le f
171 tfae_have 3 ↔ 5 := by
172 have h := (f.normDet_ne_zero_tfae.out 2 3).not
173 simpa using h
174 tfae_have 2 ↔ 6 := ker_eq_bot.not
175 tfae_finish
theorem normDet_eq_norm_det_toMatrix newL177–200
177/--
178`LinearMap.normDet` can be calculated with any pair of orthonormal basis if the domain and the
179codomain have equal dimension.
180-/
181theorem normDet_eq_norm_det_toMatrix {ι : Type*} [Fintype ι] [DecidableEq ι] (f : U →ₗ[𝕜] V)
182 (bu : OrthonormalBasis ι 𝕜 U) (bv : OrthonormalBasis ι 𝕜 V) :
183 f.normDet = ‖(f.toMatrix bu.toBasis bv.toBasis).det‖ := by
184 have : FiniteDimensional 𝕜 V := bv.toBasis.finiteDimensional_of_finite
185 by_cases! hrank : finrank 𝕜 U = finrank 𝕜 f.range
186 · have h : f.range = ⊤ := by
187 apply Submodule.eq_of_le_of_finrank_le le_top
188 simp [finrank_eq_card_basis bv.toBasis, ← hrank, finrank_eq_card_basis bu.toBasis]
189 let bv' : OrthonormalBasis ι 𝕜 f.range := bv.map (LinearIsometryEquiv.ofTop _ _ h).symm
190 rw [f.normDet_eq_norm_det_toMatrix_rangeRestrict bu bv']
191 rfl
192 · symm
193 rw [normDet_eq_zero_iff_rank_range_ne.mpr hrank.symm]
194 contrapose hrank with hdet
195 have h : IsUnit ((f.toMatrix bu.toBasis bv.toBasis).det) := by
196 simpa using hdet
197 let f' := LinearEquiv.ofIsUnitDet h
198 have hf : f.range = ⊤ := f'.range
199 rw [hf]
200 simpa using f'.finrank_eq
theorem normDet_eq_norm_det newL202–206
202/--
203`LinearMap.normDet` equals to the norm of `LinearMap.det` for an endomorphism.
204-/
205theorem normDet_eq_norm_det (f : U →ₗ[𝕜] U) : f.normDet = ‖f.det‖ := by
206 simp [f.normDet_eq_norm_det_toMatrix (stdOrthonormalBasis 𝕜 U) (stdOrthonormalBasis 𝕜 U)]
theorem _root_.LinearIsometry.normDet_eq_one newL208–216
208/--
209`LinearMap.normDet` of a linear isometry is 1.
210-/
211@[simp]
212theorem _root_.LinearIsometry.normDet_eq_one (f : U →ₗᵢ[𝕜] V) : f.toLinearMap.normDet = 1 := by
213 obtain ⟨b⟩ := (f.normDet_ne_zero_tfae.out 4 3).mp f.injective
214 rw [normDet_eq_norm_det_toMatrix_rangeRestrict _ (stdOrthonormalBasis 𝕜 U) b]
215 apply CStarRing.norm_of_mem_unitary
216 exact Matrix.det_of_mem_unitary <| (f.equivRange).toMatrix_mem_unitaryGroup _ _
theorem normDet_id newL218–220
218@[simp]
219theorem normDet_id : (id : U →ₗ[𝕜] U).normDet = 1 :=
220 LinearIsometry.id.normDet_eq_one
theorem normDet_subtype newL222–224
222@[simp]
223theorem normDet_subtype (p : Submodule 𝕜 U) : p.subtype.normDet = 1 :=
224 p.subtypeₗᵢ.normDet_eq_one
theorem normDet_of_subsingleton newL226–232
226@[simp]
227theorem normDet_of_subsingleton [Subsingleton U] (f : U →ₗ[𝕜] V) : f.normDet = 1 := by
228 have h : f.ker = ⊥ := Submodule.eq_bot_of_subsingleton
229 have hrank : finrank 𝕜 U = 0 := finrank_zero_iff.mpr ‹_›
230 let bu : OrthonormalBasis (Fin 0) 𝕜 U := (stdOrthonormalBasis 𝕜 U).reindex (by rw [hrank])
231 let bv := orthonormalBasis_range h bu
232 simp [normDet_eq_norm_det_toMatrix_rangeRestrict f bu bv]
theorem normDet_zero newL234–237
234@[simp]
235theorem normDet_zero : (0 : U →ₗ[𝕜] V).normDet = 0 ^ finrank 𝕜 U := by
236 nontriviality U
237 simp [zero_pow finrank_pos.ne.symm, normDet_eq_zero_iff_ker_ne_bot]
theorem normDet_smul newL239–257
239@[simp]
240theorem normDet_smul (f : U →ₗ[𝕜] V) (c : 𝕜) :
241 (c • f).normDet = ‖c‖ ^ finrank 𝕜 U * f.normDet := by
242 by_cases hc : c = 0
243 · nontriviality U
244 simp [hc, zero_pow finrank_pos.ne.symm]
245 by_cases h : f.ker = ⊥
246 · obtain ⟨bv⟩ := (f.normDet_ne_zero_tfae.out 1 3).mp h
247 let bu : OrthonormalBasis (Fin (finrank 𝕜 U)) 𝕜 U := stdOrthonormalBasis 𝕜 U
248 let bv' : OrthonormalBasis (Fin (finrank 𝕜 U)) 𝕜 (c • f).range := bv.map
249 (LinearIsometryEquiv.ofEq _ _ (LinearMap.range_smul _ _ hc).symm)
250 rw [f.normDet_eq_norm_det_toMatrix_rangeRestrict bu bv,
251 (c • f).normDet_eq_norm_det_toMatrix_rangeRestrict bu bv', ← norm_pow, ← norm_mul]
252 have : finrank 𝕜 U = Fintype.card (Fin (finrank 𝕜 U)) := by simp
253 conv in c ^ finrank 𝕜 U => rw [this]
254 rw [← Matrix.det_smul, ← map_smul]
255 rfl
256 · have h' : (c • f).ker ≠ ⊥ := by simpa [f.ker_smul _ hc] using h
257 simp [normDet_eq_zero_iff_ker_ne_bot.mpr h, normDet_eq_zero_iff_ker_ne_bot.mpr h']
theorem normDet_neg newL259–261
259@[simp]
260theorem normDet_neg (f : U →ₗ[𝕜] V) : (-f).normDet = f.normDet := by
261 simpa using f.normDet_smul (-1)
theorem _root_.ContinuousLinearMap.normDet_sq newL263–287
263/--
264The square of `f.normDet` equals to the determinant of `f.adjoint ∘L f`.
265-/
266theorem _root_.ContinuousLinearMap.normDet_sq [CompleteSpace V] (f : U →L[𝕜] V) :
267 haveI : CompleteSpace U := FiniteDimensional.complete 𝕜 U
268 ↑(f.normDet ^ 2) = (f.adjoint ∘L f).det := by
269 have : CompleteSpace U := FiniteDimensional.complete 𝕜 U
270 have : CompleteSpace f.range := FiniteDimensional.complete 𝕜 f.range
271 let bu := stdOrthonormalBasis 𝕜 U
272 by_cases h : f.ker = ⊥
273 · obtain ⟨b⟩ := (f.normDet_ne_zero_tfae.out 1 3).mp h
274 have hf : f = f.range.subtypeₗᵢ.toContinuousLinearMap ∘L f.rangeRestrict := rfl
275 conv_rhs => rw [hf]
276 rw [ContinuousLinearMap.adjoint_comp, ← ContinuousLinearMap.comp_assoc,
277 ContinuousLinearMap.comp_assoc (ContinuousLinearMap.adjoint _),
278 f.range.subtypeₗᵢ.adjoint_comp_self, ContinuousLinearMap.one_def, ContinuousLinearMap.comp_id,
279 ContinuousLinearMap.det, ContinuousLinearMap.coe_comp, ← det_toMatrix bu.toBasis,
280 toMatrix_comp bu.toBasis b.toBasis bu.toBasis, ← ContinuousLinearMap.adjoint_toLinearMap,
281 toMatrix_adjoint, f.toLinearMap.normDet_eq_norm_det_toMatrix_rangeRestrict bu b]
282 simp [RCLike.conj_mul]
283 · trans 0
284 · simp [show f.normDet = 0 from (f.normDet_eq_zero_tfae.out 1 0).mp h]
285 symm
286 rw [det_eq_zero_iff_ker_ne_bot, ContinuousLinearMap.ker_adjoint_comp_self]
287 exact h
theorem normDet_sq newL289–296
289/--
290The square of `f.normDet` equals to the determinant of `f.adjoint ∘ₗ f` when the codomain is finite
291dimensional.
292-/
293theorem normDet_sq [FiniteDimensional 𝕜 V] (f : U →ₗ[𝕜] V) :
294 ↑(f.normDet ^ 2) = (f.adjoint ∘ₗ f).det := by
295 have : CompleteSpace V := FiniteDimensional.complete 𝕜 V
296 exact f.toContinuousLinearMap.normDet_sq
theorem normDet_sq_eq_det_gram newL298–321
298/--
299The square of `f.normDet` equals to the determinant of the gram matrix formed by vectors mapped from
300an orthonormal basis.
301-/
302theorem normDet_sq_eq_det_gram {ι : Type*} [Fintype ι] [DecidableEq ι] (f : U →ₗ[𝕜] V)
303 (b : OrthonormalBasis ι 𝕜 U) :
304 ↑(f.normDet ^ 2) = (Matrix.gram 𝕜 (f <| b ·)).det := by
305 suffices ↑(f.normDet ^ 2) = (Matrix.gram 𝕜 (f.rangeRestrict <| b ·)).det by
306 simpa
307 by_cases h : f.ker = ⊥
308 · let bv := orthonormalBasis_range h b
309 rw [Matrix.gram_eq_conjTranspose_mul bv, Matrix.det_mul, Matrix.det_conjTranspose]
310 rw [RCLike.star_def, RCLike.conj_mul, f.normDet_eq_norm_det_toMatrix_rangeRestrict b bv]
311 simp only [map_pow]
312 congr
313 ext i j
314 simp [LinearMap.toMatrix_apply]
315 · trans 0
316 · simp [show f.normDet = 0 from (f.normDet_eq_zero_tfae.out 1 0).mp h]
317 have hrank := (f.normDet_eq_zero_tfae.out 1 3).mp h
318 symm
319 contrapose! hrank with h0
320 rw [finrank_eq_card_basis b.toBasis]
321 exact (Matrix.linearIndependent_of_det_gram_ne_zero h0).fintype_card_le_finrank
theorem normDet_comp newL323–345
323theorem normDet_comp (f : U →ₗ[𝕜] V) (g : V →ₗ[𝕜] W) :
324 (g ∘ₗ f).normDet = (g.domRestrict f.range).normDet * f.normDet := by
325 by_cases hf : f.ker = ⊥
326 · let bu : OrthonormalBasis (Fin (finrank 𝕜 U)) 𝕜 U := stdOrthonormalBasis 𝕜 U
327 obtain ⟨bv⟩ := (f.normDet_ne_zero_tfae.out 1 3).mp hf
328 by_cases hgf : (g ∘ₗ f).ker = ⊥
329 · obtain ⟨bw⟩ := ((g ∘ₗ f).normDet_ne_zero_tfae.out 1 3).mp hgf
330 let bw' : OrthonormalBasis (Fin (finrank 𝕜 U)) 𝕜 (g.domRestrict f.range).range :=
331 bw.map (LinearIsometryEquiv.ofEq _ _ (by simp [LinearMap.range_comp]))
332 rw [(g ∘ₗ f).normDet_eq_norm_det_toMatrix_rangeRestrict bu bw,
333 f.normDet_eq_norm_det_toMatrix_rangeRestrict bu bv,
334 (g.domRestrict f.range).normDet_eq_norm_det_toMatrix_rangeRestrict bv bw']
335 rw [← norm_mul, ← Matrix.det_mul, ← LinearMap.toMatrix_comp]
336 rfl
337 · have hg : (g.domRestrict f.range).ker ≠ ⊥ := by
338 contrapose hf with hgf'
339 rw [← LinearMap.ker_rangeRestrict, ← LinearMap.ker_comp_of_ker_eq_bot _ hgf']
340 exact hgf
341 simp [normDet_eq_zero_iff_ker_ne_bot.mpr hgf, normDet_eq_zero_iff_ker_ne_bot.mpr hg]
342 · have hgf : (g ∘ₗ f).ker ≠ ⊥ := by
343 contrapose hf with hbot
344 simpa [hbot] using ker_le_ker_comp f g
345 simp [normDet_eq_zero_iff_ker_ne_bot.mpr hf, normDet_eq_zero_iff_ker_ne_bot.mpr hgf]
theorem normDet_comp_of_finrank_eq newL347–361
347theorem normDet_comp_of_finrank_eq [FiniteDimensional 𝕜 V] (f : U →ₗ[𝕜] V) (g : V →ₗ[𝕜] W)
348 (h : finrank 𝕜 U = finrank 𝕜 V) :
349 (g ∘ₗ f).normDet = g.normDet * f.normDet := by
350 by_cases htop : f.range = ⊤
351 · rw [normDet_comp]
352 congrm ?_ * _
353 suffices (g.domRestrict f.range).normDet * (id : V →ₗ[𝕜] V).normDet = g.normDet by simpa
354 have : f.range = id.range := by simp [htop]
355 convert (normDet_comp LinearMap.id g).symm
356 · have hker : f.ker ≠ ⊥ := by
357 simpa [ker_eq_bot_iff_range_eq_top_of_finrank_eq_finrank h] using htop
358 have hker' : (g ∘ₗ f).ker ≠ ⊥ := by
359 contrapose hker with hbot
360 simpa [hbot] using ker_le_ker_comp f g
361 simp [normDet_eq_zero_iff_ker_ne_bot.mpr hker, normDet_eq_zero_iff_ker_ne_bot.mpr hker']
theorem normDet_codRestrict newL363–371
363@[simp]
364theorem normDet_codRestrict {p : Submodule 𝕜 V} {f : U →ₗ[𝕜] V} (h : ∀ c, f c ∈ p) :
365 (f.codRestrict p h).normDet = f.normDet := by
366 have : f = p.subtype ∘ₗ f.codRestrict p h := rfl
367 conv_rhs => rw [this]
368 rw [normDet_comp]
369 have : (p.subtype.domRestrict (codRestrict p f h).range).normDet = 1 :=
370 (p.subtypeₗᵢ.comp (codRestrict p f h).range.subtypeₗᵢ).normDet_eq_one
371 simp [this]
theorem normDet_eq_prod_singularValues newL373–379
373theorem normDet_eq_prod_singularValues [FiniteDimensional 𝕜 V] (f : U →ₗ[𝕜] V) :
374 f.normDet = ∏ i ∈ Finset.range (finrank 𝕜 U), f.singularValues i := by
375 rw [← sq_eq_sq₀ f.normDet_nonneg (Finset.prod_nonneg fun i _ ↦ f.singularValues_nonneg i),
376 ← RCLike.ofReal_inj (K := 𝕜), ← Finset.prod_pow, ← Fin.prod_univ_eq_prod_range, normDet_sq]
377 simp_rw [sq_singularValues_fin]
378 push_cast
379 rw [← LinearMap.IsSymmetric.det_eq_prod_eigenvalues]
381section Real
383open MeasureTheory Measure
385variable {U V : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [FiniteDimensional ℝ U]
386 [NormedAddCommGroup V] [InnerProductSpace ℝ V]
theorem normDet_eq_abs_det newL388–389
388theorem normDet_eq_abs_det (f : U →ₗ[ℝ] U) : f.normDet = |f.det| := by
389 simpa using f.normDet_eq_norm_det
theorem hausdorffMeasure_image newL391–415
391/--
392Using Hausdorff measure with the domain dimension, the volume of the image is scaled by
393`LinearMap.normDet`.
394-/
395theorem hausdorffMeasure_image [MeasurableSpace U] [BorelSpace U] [MeasurableSpace V] [BorelSpace V]
396 (f : U →ₗ[ℝ] V) (s : Set U) :
397 μH[finrank ℝ U] (f '' s) = ENNReal.ofReal f.normDet * μH[finrank ℝ U] s := by
398 by_cases h : f.ker = ⊥
399 · have hrank : finrank ℝ ↥f.range = finrank ℝ U := (f.normDet_ne_zero_tfae.out 1 2).mp h
400 obtain ⟨bv⟩ := (f.normDet_ne_zero_tfae.out 1 3).mp h
401 let g : U ≃ₗᵢ[ℝ] f.range := (stdOrthonormalBasis ℝ U).equiv bv (Equiv.refl _)
402 suffices μH[finrank ℝ U] ((f.range.subtypeₗᵢ.comp g.toLinearIsometry) ''
403 ((g.symm.toLinearIsometry.toLinearMap ∘ₗ f.rangeRestrict) '' s)) =
404 ENNReal.ofReal f.normDet * μH[finrank ℝ U] s by
405 simpa [Set.image_image]
406 rw [(LinearIsometry.isometry _).hausdorffMeasure_image (by simp),
407 addHaar_image_linearMap μH[finrank ℝ U], ← normDet_eq_abs_det,
408 normDet_comp_of_finrank_eq _ _ hrank.symm, g.symm.toLinearIsometry.normDet_eq_one]
409 simp
410 · suffices μH[finrank ℝ U] (f.range.subtypeₗᵢ '' (f.rangeRestrict '' s)) = 0 by
411 simpa [(f.normDet_eq_zero_tfae.out 1 0).mp h, Set.image_image]
412 rw [(LinearIsometry.isometry _).hausdorffMeasure_image (by simp)]
413 have h : (finrank ℝ f.range : ℝ) < finrank ℝ U := by
414 exact_mod_cast (f.normDet_eq_zero_tfae.out 1 3).mp h
415 simp [Real.hausdorffMeasure_of_finrank_lt h]
theorem euclideanHausdorffMeasure_image newL417–426
417/--
418Using Euclidean Hausdorff measure with the domain dimension, the volume of the image is scaled by
419`LinearMap.normDet`.
420-/
421theorem euclideanHausdorffMeasure_image [MeasurableSpace U] [BorelSpace U] [MeasurableSpace V]
422 [BorelSpace V] (f : U →ₗ[ℝ] V) (s : Set U) :
423 μHE[finrank ℝ U] (f '' s) = ENNReal.ofReal f.normDet * μHE[finrank ℝ U] s := by
424 simp_rw [euclideanHausdorffMeasure_def, Measure.smul_apply, nnreal_smul_coe_apply,
425 hausdorffMeasure_image]
426 exact mul_left_comm _ _ _
theorem euclideanHausdorffMeasure_image_eq_normDet_mul_volume newL428–435
428/--
429The volume of the image measured by Euclidean Hausdorff measure is equal to the Lebesgue measure
430scaled by `LinearMap.normDet`.
431-/
432theorem euclideanHausdorffMeasure_image_eq_normDet_mul_volume [MeasurableSpace U] [BorelSpace U]
433 [MeasurableSpace V] [BorelSpace V] (f : U →ₗ[ℝ] V) (s : Set U) :
434 μHE[finrank ℝ U] (f '' s) = ENNReal.ofReal f.normDet * volume s := by
435 rw [f.euclideanHausdorffMeasure_image, InnerProductSpace.euclideanHausdorffMeasure_eq_volume]
437end Real
439end LinearMap

Mathlib/Geometry/Euclidean/Volume/Area.lean +1463 −0 new file

1/-
2Copyright (c) 2026 Weiyi Wang. All rights reserved.
3Released under Apache 2.0 license as described in the file LICENSE.
4Authors: Weiyi Wang
5-/
6
7module
8
9public import Mathlib.Analysis.InnerProductSpace.NormDet
10public import Mathlib.Analysis.InnerProductSpace.Defs
11public import Mathlib.Analysis.Normed.Operator.Basic
12import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
13import Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls
14import Mathlib.Topology.Instances.ENat
15import Mathlib.MeasureTheory.MeasurableSpace.Instances
16public import Mathlib.MeasureTheory.Function.Jacobian
17public import Mathlib.Analysis.Normed.Lp.ProdLp
19/-!
20# Area formula
21-/
23open MeasureTheory RealInnerProductSpace Module LinearMap
24section random
26variable {𝕜 U V W : Type*} [RCLike 𝕜] [NormedAddCommGroup U] [InnerProductSpace 𝕜 U]
27 [FiniteDimensional 𝕜 U] [NormedAddCommGroup V] [InnerProductSpace 𝕜 V] [NormedAddCommGroup W]
28 [InnerProductSpace 𝕜 W]
theorem eixsts_polar_decomposition newL30–45
30theorem eixsts_polar_decomposition (f : U →ₗ[𝕜] V) (h : f.ker = ⊥) :
31 ∃ (u : U →ₗᵢ[𝕜] V) (p : U →ₗ[𝕜] U),
32 u.toLinearMap ∘ₗ p = f ∧ p.ker = ⊥ := by
33 have hrank : finrank 𝕜 f.range = finrank 𝕜 U := by
34 obtain hrank := f.finrank_range_add_finrank_ker
35 rw [h] at hrank
36 simpa [h] using hrank
37 let bu : OrthonormalBasis (Fin (finrank 𝕜 U)) 𝕜 U := stdOrthonormalBasis 𝕜 U
38 let bv : OrthonormalBasis (Fin (finrank 𝕜 U)) 𝕜 f.range :=
39 (stdOrthonormalBasis 𝕜 f.range).reindex (by rw [hrank])
40 let g := OrthonormalBasis.equiv bu bv (Equiv.refl _)
41 use (Submodule.subtypeₗᵢ f.range).comp g.toLinearIsometry, g.symm.toLinearMap.comp f.rangeRestrict
42 constructor
43 · change f.range.subtype ∘ₗ (g.toLinearMap ∘ₗ g.symm.toLinearMap) ∘ₗ f.rangeRestrict = f
44 simp
45 · simpa using h
47end random
50variable {U V : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [FiniteDimensional ℝ U]
51 [NormedAddCommGroup V] [InnerProductSpace ℝ V]
53omit [FiniteDimensional ℝ U] in
theorem image_ball newL54–69
54theorem image_ball {r : ℝ} (hr : 0 < r) : (r • LinearMap.id : U →ₗ[ℝ] U) '' Metric.ball 0 1 =
55 Metric.ball 0 r := by
56 ext x
57 simp only [smul_apply, id_coe, id_eq, Set.mem_image, Metric.mem_ball, dist_zero_right]
58 constructor
59 · intro ⟨y, h1, h2⟩
60 rw [← h2, norm_smul]
61 rw [Real.norm_eq_abs, abs_of_nonneg hr.le]
62 apply mul_lt_of_lt_one_right hr h1
63 · intro h
64 use r⁻¹ • x
65 constructor
66 · rw [norm_smul]
67 rw [norm_inv, Real.norm_eq_abs, abs_of_nonneg hr.le]
68 exact (inv_mul_lt_one₀ hr).mpr h
69 · simp [smul_smul, hr.ne.symm]
theorem volume_ball_ne_zero newL71–74
71theorem volume_ball_ne_zero [MeasurableSpace U] [BorelSpace U] [Nontrivial U] :
72 volume (Metric.ball 0 1 : Set U) ≠ 0 := by
73 rw [InnerProductSpace.volume_ball]
74 positivity
theorem volume_ball_ne_top newL76–80
76theorem volume_ball_ne_top [MeasurableSpace U] [BorelSpace U] :
77 volume (Metric.ball 0 1 : Set U) ≠ ⊤ := by
78 nontriviality U
79 rw [InnerProductSpace.volume_ball]
80 simp
structure Eprop newL82–88
82structure Eprop (B : Set U) (t ε : ℝ) (f : U → V) (f' : U → U →L[ℝ] V)
83 (c : U) (T : U →ₗ[ℝ] U) (i : PNat) (b : U) where
84 mem_B : b ∈ B
85 mem_ball : b ∈ Metric.ball c (1 / i : ℝ)
86 h1left : ∀ u : U, (t⁻¹ + ε) * ‖T u‖ ≤ ‖f' b u‖
87 h1right : ∀ u : U, ‖f' b u‖ ≤ (t - ε) * ‖T u‖
88 h2 : ∀ a ∈ Metric.ball c (2 / i : ℝ) ∩ B, ‖f a - f b - f' b (a - b)‖ ≤ ε * ‖T (a - b)‖
90-- by aristotle
theorem measurable_Eprop.extracted_1_4 newL91–100
91theorem measurable_Eprop.extracted_1_4 {U : Type*} {V : Type*} [NormedAddCommGroup U]
92 [InnerProductSpace ℝ U] [FiniteDimensional ℝ U] [NormedAddCommGroup V]
93 [InnerProductSpace ℝ V] [MeasurableSpace U] [BorelSpace U]
94 [CompleteSpace V]
95 (t ε : ℝ) (f' : U → U →L[ℝ] V) (hfm : Measurable f') (T : U →ₗ[ℝ] U) :
96 Measurable fun a ↦ ∀ (u : U), (t⁻¹ + ε) * ‖T u‖ ≤ ‖f' a u‖ := by
97 have h_closed : IsClosed {L : U →L[ℝ] V | ∀ u : U, (t⁻¹ + ε) * ‖T u‖ ≤ ‖L u‖} := by
98 simp only [Set.setOf_forall]
99 exact isClosed_iInter fun u => isClosed_le continuous_const (by fun_prop)
100 apply MeasurableSet.mem (h_closed.measurableSet.preimage hfm)
103-- by aristotle
theorem measurable_Eprop.extracted_1_6 newL104–113
104theorem measurable_Eprop.extracted_1_6 {U : Type*} {V : Type*} [NormedAddCommGroup U]
105 [InnerProductSpace ℝ U] [FiniteDimensional ℝ U] [NormedAddCommGroup V]
106 [InnerProductSpace ℝ V] [MeasurableSpace U] [BorelSpace U]
107 [CompleteSpace V]
108 (t ε : ℝ) (f' : U → U →L[ℝ] V) (hfm : Measurable f') (T : U →ₗ[ℝ] U) :
109 Measurable fun a ↦ ∀ (u : U), ‖f' a u‖ ≤ (t - ε) * ‖T u‖ := by
110 have h_closed : IsClosed {L : U →L[ℝ] V | ∀ u : U, ‖L u‖ ≤ (t - ε) * ‖T u‖} := by
111 simp only [Set.setOf_forall]
112 exact isClosed_iInter fun u => isClosed_le (by fun_prop) continuous_const
113 exact MeasurableSet.mem (h_closed.measurableSet.preimage hfm)
115-- by aristotle
theorem measurable_Eprop.extracted_1_5 newL116–173
116theorem measurable_Eprop.extracted_1_5 {U : Type*} {V : Type*} [NormedAddCommGroup U]
117 [InnerProductSpace ℝ U] [FiniteDimensional ℝ U] [NormedAddCommGroup V]
118 [InnerProductSpace ℝ V] [MeasurableSpace U] [BorelSpace U]
119 [CompleteSpace V] (B : Set U) (hm : MeasurableSet B)
120 (ε : ℝ) (f : U → V) (hcont : ContinuousOn f B) (f' : U → U →L[ℝ] V) (hfm : Measurable f')
121 (T : U →ₗ[ℝ] U) (c : U) (i : PNat) :
122 Measurable fun b ↦ (∀ a ∈ Metric.ball c (2 / ↑↑i) ∩ B, ‖f a - f b - f' b (a - b)‖ ≤
123 ε * ‖T (a - b)‖) ∧ b ∈ B := by
124 rw [← measurableSet_setOf]
125 set r := (2 : ℝ) / ↑↑i
126 -- Define C ⊆ (U →L[ℝ] V) × B as the "closed constraint set"
127 set C : Set ((U →L[ℝ] V) × B) :=
128 {p | ∀ a ∈ Metric.ball c r ∩ B,
129 ‖f a - f p.2.val - p.1 (a - p.2.val)‖ ≤ ε * ‖T (a - p.2.val)‖}
130 -- Auxiliary: the restriction of f to B is continuous
131 have hf_cont : Continuous (fun (b : B) => f b.val) :=
132 continuousOn_iff_continuous_restrict.mp hcont
133 -- Auxiliary: evaluation of ContinuousLinearMap is continuous
134 have heval : Continuous (fun (p : (U →L[ℝ] V) × U) => p.1 p.2) :=
135 isBoundedBilinearMap_apply.continuous
136 -- Step 1: C is closed (arbitrary intersection of closed sets)
137 have hC_closed : IsClosed C := by
138 have hC_eq : C = ⋂ (a : U) (_ : a ∈ Metric.ball c r ∩ B),
139 {p : (U →L[ℝ] V) × B |
140 ‖f a - f p.2.val - p.1 (a - p.2.val)‖ ≤ ε * ‖T (a - p.2.val)‖} := by
141 ext p; simp [C, Set.mem_iInter]
142 rw [hC_eq]
143 apply isClosed_biInter
144 intro a _
145 apply isClosed_le
146 · -- ‖f a - f p.2.val - p.1 (a - p.2.val)‖ is continuous in p
147 refine Continuous.norm ?_
148 exact (continuous_const.sub (hf_cont.comp continuous_snd)).sub
149 (heval.comp (Continuous.prodMk continuous_fst
150 (continuous_const.sub (continuous_subtype_val.comp continuous_snd))))
151 · -- ε * ‖T (a - p.2.val)‖ is continuous in p
152 exact continuous_const.mul
153 (T.toContinuousLinearMap.continuous.comp
154 (continuous_const.sub (continuous_subtype_val.comp continuous_snd))).norm
155 -- Step 2: C is measurable (since (U →L[ℝ] V) × B has OpensMeasurableSpace)
156 have hC_meas : MeasurableSet C := hC_closed.measurableSet
157 -- Step 3: ψ : B → (U →L[ℝ] V) × B is measurable
158 set ψ : B → (U →L[ℝ] V) × B := fun b => (f' b.val, b) with hψ_def
159 have hψ_meas : Measurable ψ :=
160 Measurable.prod (hfm.comp measurable_subtype_coe) measurable_id
161 -- Step 4: ψ⁻¹'(C) is measurable in B
162 have hpre : MeasurableSet (ψ ⁻¹' C) := hψ_meas hC_meas
163 -- Step 5: The image under Subtype.val is measurable in U
164 have himg : MeasurableSet (Subtype.val '' (ψ ⁻¹' C)) := hm.subtype_image hpre
165 -- Step 6: Our set equals this image
166 convert himg using 1
167 ext b
168 simp only [Set.mem_setOf_eq, Set.mem_image, Set.mem_preimage]
169 constructor
170 · rintro ⟨hball, hB⟩
171 exact ⟨⟨b, hB⟩, hball, rfl⟩
172 · rintro ⟨⟨b', hB'⟩, hball, rfl⟩
173 exact ⟨hball, hB'⟩
theorem measurable_Eprop newL175–201
175theorem measurable_Eprop [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [CompleteSpace V]
176 (B : Set U) (hm : MeasurableSet B) (t ε : ℝ) (f : U → V) (f' : U → U →L[ℝ] V)
177 (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x) (hfm : Measurable f')
178 (c : U) (T : U →ₗ[ℝ] U) (i : PNat) :
179 Measurable (Eprop B t ε f f' c T i) := by
180 have hdiff (b : U) (hb : b ∈ B) : DifferentiableWithinAt ℝ f B b :=
181 (hf' b hb).differentiableWithinAt
182 have hcont : ContinuousOn f B := by
183 intro b hb
184 apply (hdiff b hb).continuousWithinAt
185 suffices Measurable (fun b ↦ (b ∈ Metric.ball c (1 / i : ℝ))
186 ∧ (∀ u : U, (t⁻¹ + ε) * ‖T u‖ ≤ ‖f' b u‖) ∧
187 (∀ u : U, ‖f' b u‖ ≤ (t - ε) * ‖T u‖) ∧
188 (∀ a ∈ Metric.ball c (2 / i : ℝ) ∩ B, ‖f a - f b - f' b (a - b)‖ ≤ ε * ‖T (a - b)‖) ∧
189 b ∈ B) by
190 convert this
191 grind [Eprop]
192 apply Measurable.and
193 · measurability
194 apply Measurable.and
195 · apply measurable_Eprop.extracted_1_4
196 exact hfm
197 apply Measurable.and
198 · apply measurable_Eprop.extracted_1_6
199 exact hfm
200 apply measurable_Eprop.extracted_1_5 B hm _ _ hcont
201 exact hfm
203namespace Eprop
205variable {B : Set U} {t ε : ℝ} {f : U → V} {f' : U → U →L[ℝ] V}
206 {c : U} {T : U →ₗ[ℝ] U} {i : PNat} {b : U}
208omit [FiniteDimensional ℝ U] in
theorem mem_ball2 newL209–214
209theorem mem_ball2 (hb : Eprop B t ε f f' c T i b) : b ∈ Metric.ball c (2 / i : ℝ) := by
210 have hbc := hb.mem_ball
211 rw [Metric.mem_ball] at ⊢ hbc
212 apply hbc.trans_le
213 apply (div_le_div_iff₀ (by simp) (by simp)).mpr
214 grind
216omit [FiniteDimensional ℝ U] in
theorem h3left newL217–225
217theorem h3left (hb : Eprop B t ε f f' c T i b) {a : U} (ha : a ∈ Metric.ball c (2 / i : ℝ) ∩ B) :
218 t⁻¹ * ‖T (a - b)‖ ≤ ‖f a - f b‖ := by
219 obtain h := hb.h1left (a - b)
220 rw [add_mul, ← le_sub_iff_add_le] at h
221 apply h.trans
222 rw [sub_le_comm]
223 apply le_trans ?_ (hb.h2 a ha)
224 apply (norm_sub_norm_le _ _).trans
225 rw [norm_sub_rev]
227omit [FiniteDimensional ℝ U] in
theorem h3right newL228–235
228theorem h3right (hb : Eprop B t ε f f' c T i b) {a : U} (ha : a ∈ Metric.ball c (2 / i : ℝ) ∩ B) :
229 ‖f a - f b‖ ≤ t * ‖T (a - b)‖ := by
230 obtain h := hb.h1right (a - b)
231 rw [sub_mul, le_sub_iff_add_le] at h
232 apply le_trans ?_ h
233 rw [← sub_le_iff_le_add']
234 apply le_trans ?_ (hb.h2 a ha)
235 apply norm_sub_norm_le
theorem hclaimright newL237–284
237theorem hclaimright [MeasurableSpace U] [BorelSpace U] [CompleteSpace V]
238 (hb : Eprop B t ε f f' c T i b) (hεright : 1 < t - ε) :
239 (f' b).normDet ≤ (t - ε) ^ finrank ℝ U * |T.det| := by
240 nontriviality U
241 by_cases hT : T.ker = ⊥
242 · by_cases hf : (f' b).ker = ⊥
243 · let T' := LinearEquiv.ofInjectiveEndo T (LinearMap.ker_eq_bot.mp hT)
244 have h (v : U) := hb.h1right (T'.symm v)
245 have hsymm (v : U) : T (T'.symm v) = v := by
246 change T' (T'.symm v) = v
247 simp
248 simp_rw [hsymm] at h
249 obtain ⟨u, p, hu, _⟩ := eixsts_polar_decomposition (f' b) (by simpa using hf)
250 have hball : (p ∘ₗ T'.symm.toLinearMap) '' Metric.ball 0 1
251 ⊆ ((t - ε) • LinearMap.id : U →ₗ[ℝ] U) '' Metric.ball 0 1 := by
252 rw [image_ball (lt_trans (by norm_num) hεright)]
253 intro v
254 simp only [coe_comp, LinearEquiv.coe_coe, Function.comp_apply,
255 Set.mem_image, Metric.mem_ball, dist_zero_right, forall_exists_index, and_imp]
256 intro x hx rfl
257 suffices ‖f' b (T'.symm x)‖ < ↑t - ε by
258 change ‖(f' b).toLinearMap (T'.symm x)‖ < ↑t - ε at this
259 rw [← hu] at this
260 simpa using this
261 apply lt_of_le_of_lt (h x)
262 exact mul_lt_of_lt_one_right (lt_trans (by norm_num) hεright) hx
263 obtain hmeasure := MeasureTheory.measure_mono hball (μ := volume)
264 simp_rw [MeasureTheory.Measure.addHaar_image_linearMap] at hmeasure
265 rw [ENNReal.mul_le_mul_iff_left volume_ball_ne_zero volume_ball_ne_top] at hmeasure
266 rw [ENNReal.ofReal_le_ofReal_iff (by simp)] at hmeasure
267 simp only [det_comp, LinearEquiv.det_coe_symm, abs_mul, abs_inv] at hmeasure
268 rw [mul_inv_le_iff₀ (by simp [← LinearEquiv.coe_det])] at hmeasure
269 convert hmeasure
270 · rw [← hu]
271 rw [normDet_comp_of_finrank_eq _ _ (by simp)]
272 simp [u.normDet_eq_one, normDet_eq_norm_det]
273 · suffices (0 : ℝ) ≤ t - ε by simp [abs_of_nonneg this]
274 apply (lt_trans (by norm_num) hεright).le
275 · rw [LinearMap.normDet_eq_zero_iff_ker_ne_bot.mpr hf]
276 positivity
277 · suffices (f' b).normDet = 0 by
278 simp [this, LinearMap.det_eq_zero_iff_ker_ne_bot.mpr hT]
279 obtain ⟨v, hv, hv0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot hT
280 rw [LinearMap.mem_ker] at hv
281 obtain h := hb.h1right v
282 rw [normDet_eq_zero_iff_ker_ne_bot, Submodule.ne_bot_iff]
283 refine ⟨v, ?_, hv0⟩
284 simpa [hv] using h
theorem hclaimleft newL286–335
286theorem hclaimleft [MeasurableSpace U] [BorelSpace U] [CompleteSpace V]
287 (hb : Eprop B t ε f f' c T i b) (hεpos : 0 < t⁻¹ + ε) :
288 (t⁻¹ + ε) ^ finrank ℝ U * |T.det| ≤ (f' b).normDet := by
289 nontriviality U
290 by_cases hT : T.ker = ⊥
291 · by_cases hf : (f' b).ker = ⊥
292 · let T' := LinearEquiv.ofInjectiveEndo T (LinearMap.ker_eq_bot.mp hT)
293 obtain ⟨u, p, hu, hp⟩ := eixsts_polar_decomposition (f' b) (by simpa using hf)
294 have hball : ((t⁻¹ + ε) • LinearMap.id : U →ₗ[ℝ] U) '' Metric.ball 0 1 ⊆
295 (p ∘ₗ T'.symm.toLinearMap) '' Metric.ball 0 1 := by
296 rw [image_ball (hεpos)]
297 intro v
298 simp only [Metric.mem_ball, dist_zero_right, coe_comp, LinearEquiv.coe_coe,
299 Function.comp_apply, Set.mem_image]
300 intro hv
301 obtain ⟨w, hw⟩ := LinearMap.surjective_of_injective (LinearMap.ker_eq_bot.mp hp) v
302 use T' w
303 simp only [LinearEquiv.symm_apply_apply, hw, and_true]
304 obtain h : ∀ (u : U), (t⁻¹ + ε) * ‖T u‖ ≤ ‖(f' b).toLinearMap u‖ := hb.h1left
305 specialize h w
306 simp_rw [← hu] at h
307 simp only [coe_comp, LinearIsometry.coe_toLinearMap, Function.comp_apply, hw,
308 LinearIsometry.norm_map] at h
309 obtain h := h.trans_lt hv
310 rw [mul_lt_iff_lt_one_right hεpos] at h
311 exact h
312 obtain hmeasure := MeasureTheory.measure_mono hball (μ := volume)
313 simp_rw [MeasureTheory.Measure.addHaar_image_linearMap] at hmeasure
314 rw [ENNReal.mul_le_mul_iff_left volume_ball_ne_zero volume_ball_ne_top] at hmeasure
315 rw [ENNReal.ofReal_le_ofReal_iff (abs_nonneg _)] at hmeasure
316 simp only [det_smul, det_id, mul_one, abs_pow, det_comp,
317 LinearEquiv.det_coe_symm, abs_mul, abs_inv] at hmeasure
318 rw [le_mul_inv_iff₀ (by simp [← LinearEquiv.coe_det])] at hmeasure
319 convert hmeasure using 3
320 · rw [abs_of_nonneg hεpos.le]
321 · rw [← hu]
322 rw [normDet_comp_of_finrank_eq _ _ (by simp)]
323 simp [u.normDet_eq_one, normDet_eq_norm_det]
324 · suffices LinearMap.det T = 0 by
325 simp [this, LinearMap.normDet_eq_zero_iff_ker_ne_bot.mpr hf]
326 obtain ⟨v, hv, hv0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot hf
327 rw [LinearMap.mem_ker] at hv
328 obtain h := hb.h1left v
329 rw [det_eq_zero_iff_ker_ne_bot, Submodule.ne_bot_iff]
330 refine ⟨v, ?_, hv0⟩
331 rw [ContinuousLinearMap.coe_coe] at hv
332 rw [hv, norm_zero] at h
333 obtain h := le_antisymm h (mul_nonneg hεpos.le (by simp))
334 simpa [hεpos.ne.symm] using h
335 · simpa [LinearMap.det_eq_zero_iff_ker_ne_bot.mpr hT] using normDet_nonneg _
337end Eprop
structure Piece newL339–349
339structure Piece [NormedAddCommGroup U] [InnerProductSpace ℝ U]
340 [FiniteDimensional ℝ U] [MeasurableSpace U] [BorelSpace U] (t : NNReal) (f : U → V)
341 (f' : U → U →L[ℝ] V)
342 (measureProp : Prop) where
343 E : Set U
344 measurablSet : measureProp → MeasurableSet E
345 T : U ≃ₗ[ℝ] U
346 lipschitz : LipschitzOnWith t (f ∘ T.symm) (T '' E)
347 lipschitz_inv : LipschitzOnWith t (T ∘ f.invFunOn E) (f '' E)
348 det_le : ∀ x ∈ E, (↑t)⁻¹ ^ finrank ℝ U * |T.toLinearMap.det| ≤ (f' x).normDet
349 le_det : ∀ x ∈ E, (f' x).normDet ≤ t ^ finrank ℝ U * |T.toLinearMap.det|
def Piece.mk' newL351–401
351def Piece.mk' [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [CompleteSpace V]
352 (B : Set U) (t : NNReal) (ht : 1 < t) (ε : ℝ)
353 (hεpos : 0 < (↑t)⁻¹ + ε) (h0ε : 0 ≤ ε) (hεright : 1 < t - ε)
354 (f : U → V) (f' : U → U →L[ℝ] V) (hf : Set.InjOn f B)
355 (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
356 (c : U) (T : U ≃ₗ[ℝ] U) (i : PNat) :
357 Piece t f f' (MeasurableSet B ∧ Measurable f') where
358 E := {b | Eprop B t ε f f' c T i b}
359 measurablSet := by
360 rintro ⟨hB, hfm⟩
361 rw [measurableSet_setOf]
362 apply measurable_Eprop B hB _ _ _ _ hf' hfm
363 T := T
364 lipschitz := by
365 rw [lipschitzOnWith_iff_dist_le_mul]
366 intro a ha b hb
367 simp only [Set.mem_image, Set.mem_setOf_eq] at ha hb
368 obtain ⟨a, ha, rfl⟩ := ha
369 obtain ⟨b, hb, rfl⟩ := hb
370 simp only [Function.comp_apply, LinearEquiv.symm_apply_apply, dist_eq_norm, ← map_sub]
371 apply hb.h3right ⟨ha.mem_ball2, ha.mem_B⟩
372 lipschitz_inv := by
373 rw [lipschitzOnWith_iff_dist_le_mul]
374 intro a ha b hb
375 simp only [Set.mem_image, Set.mem_setOf_eq] at ha hb
376 obtain ⟨a, ha, rfl⟩ := ha
377 obtain ⟨b, hb, rfl⟩ := hb
378 simp only [Function.comp_apply, dist_eq_norm, ← map_sub]
379 have hinj : Set.InjOn f {b | Eprop B (↑t) ε f f' c (↑T) i b} := by
380 apply hf.mono
381 intro b hb
382 rw [Set.mem_setOf_eq] at hb
383 exact hb.mem_B
384 rw [Set.InjOn.leftInvOn_invFunOn hinj (by simpa using ha)]
385 rw [Set.InjOn.leftInvOn_invFunOn hinj (by simpa using hb)]
386 rw [← inv_mul_le_iff₀ (by
387 rw [NNReal.coe_pos]
388 apply lt_trans (by norm_num) ht
389 )]
390 apply hb.h3left ⟨ha.mem_ball2, ha.mem_B⟩
391 det_le x hx := by
392 refine le_trans ?_ (Eprop.hclaimleft hx hεpos)
393 refine mul_le_mul_of_nonneg_right ?_ (by simp)
394 apply pow_le_pow_left₀ (by simp)
395 simpa using h0ε
396 le_det x hx := by
397 apply (Eprop.hclaimright hx hεright).trans
398 refine mul_le_mul_of_nonneg_right ?_ (by simp)
399 have h := (show (0 : ℝ) < 1 by norm_num).trans hεright
400 apply pow_le_pow_left₀ (by simpa using h.le)
401 simpa using h0ε
403-- begin Aristotle
lemma ContinuousLinearMap.exists_pos_lower_bound newL404–419
404lemma ContinuousLinearMap.exists_pos_lower_bound
405 {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [FiniteDimensional ℝ U]
406 {f : U →L[ℝ] U} (hf : f.ker = ⊥) :
407 ∃ c : ℝ, 0 < c ∧ ∀ x : U, c * ‖x‖ ≤ ‖f x‖ := by
408 -- Use the fact that a linear map on a finite-dimensional space is injective if and only if it
409 -- is bounded below.
410 have h_inj : Function.Injective f := by
411 exact LinearMap.ker_eq_bot.mp hf;
412 obtain ⟨ K, hK ⟩ := f.toLinearMap.injective_iff_antilipschitz.mp h_inj;
413 refine ⟨ 1 / K, ?_, ?_ ⟩;
414 · exact one_div_pos.mpr ( NNReal.coe_pos.mpr hK.1 );
415 · intro x; have := hK.2.le_mul_dist x 0
416 simp only [dist_zero_right, coe_coe, map_zero] at this
417 simp only [gt_iff_lt, coe_coe] at hK
418 simp only [div_eq_inv_mul, mul_one, ge_iff_le]
419 rwa [ inv_mul_le_iff₀ ( NNReal.coe_pos.mpr hK.1 ) ]
theorem approx_linear_map newL421–465
421theorem approx_linear_map {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U]
422 [FiniteDimensional ℝ U]
423 {s : Set (U →L[ℝ] U)} (hs : Dense s) {f : U →L[ℝ] U} (hf : f.ker = ⊥)
424 {a b : ℝ} (ha : a < 1) (hb : 1 < b) :
425 ∃ g ∈ s, (∀ x, a * ‖g x‖ ≤ ‖f x‖) ∧ (∀ x, ‖f x‖ ≤ b * ‖g x‖) := by
426 -- Use `ContinuousLinearMap.exists_pos_lower_bound` to get c > 0 with c * ‖x‖ ≤ ‖f x‖ for all
427 -- x.
428 obtain ⟨c, hc⟩ : ∃ c > 0, ∀ x : U, c * ‖x‖ ≤ ‖f x‖ := by
429 exact ContinuousLinearMap.exists_pos_lower_bound hf;
430 -- Choose δ such that δ < c and δ < c*(1-a) and δ < c*(1-1/b).
431 obtain ⟨δ, hδ_pos, hδ_lt_c, hδ_lt_ca, hδ_lt_cb⟩ : ∃ δ > 0, δ < c ∧ δ < c * (1 - a) ∧
432 δ < c * (1 - 1 / b) := by
433 obtain ⟨δ, hδ_pos, hδ_lt⟩ : ∃ δ > 0, δ < min (c * (1 - a)) (c * (1 - 1 / b)) := by
434 exact exists_between ( lt_min ( mul_pos hc.1 ( sub_pos.2 ha ) ) ( mul_pos hc.1 ( sub_pos.2
435 ( by rw [ div_lt_iff₀ ] <;> linarith ) ) ) );
436 exact ⟨ Min.min δ c / 2, half_pos ( lt_min hδ_pos hc.1 ), by
437 linarith [ min_le_left δ c, min_le_right δ c ],
438 by linarith [ min_le_left δ c, min_le_right δ c,
439 min_le_left ( c * ( 1 - a ) ) ( c * ( 1 - 1 / b ) ),
440 min_le_right ( c * ( 1 - a ) ) ( c * ( 1 - 1 / b ) ) ],
441 by linarith [ min_le_left δ c, min_le_right δ c,
442 min_le_left ( c * ( 1 - a ) ) ( c * ( 1 - 1 / b ) ),
443 min_le_right ( c * ( 1 - a ) ) ( c * ( 1 - 1 / b ) ) ] ⟩;
444 -- Choose g ∈ s such that ‖g - f‖ < δ.
445 obtain ⟨g, hg_s, hg_dist⟩ : ∃ g ∈ s, ‖g - f‖ < δ := by
446 simpa [ dist_eq_norm' ] using hs.exists_dist_lt f hδ_pos;
447 refine ⟨ g, hg_s, fun x => ?_, fun x => ?_ ⟩;
448 · have := ContinuousLinearMap.le_opNorm ( g - f ) x;
449 simp_all
450 nlinarith [ norm_nonneg x, norm_nonneg ( g x - f x ), norm_nonneg ( g x ),
451 norm_nonneg ( f x ), mul_inv_cancel₀ ( ne_of_gt ( zero_lt_one.trans hb ) ),
452 hc.2 x, mul_le_mul_of_nonneg_left hg_dist.le ( norm_nonneg x ),
453 mul_le_mul_of_nonneg_left hg_dist.le ( norm_nonneg ( g x - f x ) ),
454 mul_le_mul_of_nonneg_left hg_dist.le ( norm_nonneg ( g x ) ),
455 mul_le_mul_of_nonneg_left hg_dist.le ( norm_nonneg ( f x ) ),
456 norm_sub_norm_le ( g x ) ( f x ) ];
457 · -- Using the triangle inequality and the bounds on δ, we get:
458 have h_triangle : ‖g x‖ ≥ ‖f x‖ - δ * ‖x‖ := by
459 have := ContinuousLinearMap.le_of_opNorm_le _ hg_dist.le x;
460 simpa using norm_sub_le ( g x ) ( ( g - f ) x ) |> le_trans <| by simpa using this;
461 nlinarith [ hc.2 x, norm_nonneg x, norm_nonneg ( f x ), norm_nonneg ( g x ),
462 mul_div_cancel₀ 1 ( by linarith : b ≠ 0 ),
463 mul_le_mul_of_nonneg_left hδ_lt_cb.le ( norm_nonneg x ),
464 mul_le_mul_of_nonneg_left hδ_lt_ca.le ( norm_nonneg x ),
465 mul_le_mul_of_nonneg_left hδ_lt_c.le ( norm_nonneg x ) ]
467-- end Aristotle
theorem lemma3_3 newL469–585
469theorem lemma3_3 [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [CompleteSpace V]
470 {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
471 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
472 (hker : ∀ x ∈ B, (f' x).ker = ⊥) :
473 ∃ (Es : Set (Piece t f f' (MeasurableSet B ∧ Measurable f'))),
474 Es.Countable ∧ B = ⋃ p ∈ Es, p.E := by
475 have ht' : (1 : ℝ) < t := by simpa using ht
476 let ε : ℝ := (t - 1) / (2 * t)
477 have h0ε' : 0 < ε := by
478 unfold ε
479 apply div_pos (by simpa using ht')
480 positivity
481 have h0ε : 0 ≤ ε := by
482 unfold ε
483 apply div_nonneg (by simpa using ht'.le)
484 simp
485 have hεleft : (↑t)⁻¹ + ε < 1 := by
486 unfold ε
487 refine lt_of_mul_lt_mul_left ?_ (show 0 ≤ (2 * t : ℝ) by positivity)
488 rw [mul_add, mul_assoc, mul_inv_cancel₀ (by positivity)]
489 rw [mul_div_cancel₀ _ (by positivity)]
490 linarith
491 have hεpos : 0 < (↑t)⁻¹ + ε := by
492 unfold ε
493 apply add_pos (by positivity)
494 apply div_pos (by linarith) (by positivity)
495 have hεright : 1 < t - ε := by
496 unfold ε
497 refine lt_of_mul_lt_mul_left ?_ (show 0 ≤ (2 * t : ℝ) by positivity)
498 rw [mul_sub, mul_div_cancel₀ _ (by positivity)]
499 apply lt_of_sub_pos
500 suffices (0 : ℝ) < (t - 1) * (2 * t - 1) by
501 convert this using 1
502 ring
503 apply mul_pos (by linarith) (by linarith)
504 have hU := TopologicalSpace.exists_countable_dense B
505 have hUU := TopologicalSpace.exists_countable_dense (U →L[ℝ] U)
506 let C := hU.choose
507 let S : Set (U ≃ₗ[ℝ] U) := LinearEquiv.toLinearMap ⁻¹'
508 (ContinuousLinearMap.toLinearMap '' hUU.choose)
509 use ⋃ c ∈ C, ⋃ T ∈ S, Set.range (Piece.mk' B t ht ε hεpos h0ε hεright f f' hf hf' c T)
510 constructor
511 · rw [Set.Countable.biUnion_iff (by
512 apply hU.choose_spec.1)]
513 intro _ _
514 rw [Set.Countable.biUnion_iff (by
515 refine Set.Countable.preimage ?_ (LinearEquiv.toLinearMap_injective)
516 apply hUU.choose_spec.1.image)]
517 intro _ _
518 apply Set.countable_range
519 apply subset_antisymm
520 · intro b hb
521 obtain ⟨o, s, hos, hs⟩ := eixsts_polar_decomposition (f' b).toLinearMap (hker b hb)
522 simp only [Set.mem_iUnion, Set.mem_range, exists_prop, Set.iUnion_exists, Set.biUnion_and',
523 Set.iUnion_iUnion_eq', Piece.mk', Set.mem_setOf_eq]
524 have hs' : s.toContinuousLinearMap.ker = ⊥ := hs
525 obtain ⟨T', hT', hTleft, hTright⟩ := approx_linear_map hUU.choose_spec.2 hs' hεleft hεright
526 have hTker : T'.ker = ⊥ := by
527 contrapose! hTright with hker
528 obtain ⟨x, hx, hx0⟩ := (Submodule.ne_bot_iff _).mp hker
529 use x
530 rw [mem_ker, ContinuousLinearMap.coe_coe] at hx
531 suffices x ∉ s.ker by
532 simpa [hx]
533 simpa [hs] using hx0
534 let T : U ≃ₗ[ℝ] U := LinearEquiv.ofInjectiveEndo T'.toLinearMap (LinearMap.ker_eq_bot.mp hTker)
535 have hTS : T ∈ S := by
536 simp only [Set.mem_preimage, Set.mem_image, S]
537 use T', hT'
538 rfl
539 have hT : T.symm.toLinearMap ≠ 0 := by
540 intro h
541 simpa using congr(LinearMap.ker $h)
542 have hbound : 0 < ε / ‖T.symm.toContinuousLinearMap‖ := by
543 apply div_pos h0ε'
544 simpa using hT
545 obtain ⟨r, hr0, hr⟩ := Metric.mem_nhdsWithin_iff.mp <|
546 (hf' b hb).isLittleO.bound hbound
547 let i := Nat.toPNat ⌈3 / r⌉₊ (by simpa using hr0)
548 have hi : (0 : ℝ) < 1 / i := by simp
549 obtain ⟨c, hcm, hc⟩ := Dense.exists_dist_lt hU.choose_spec.2 ⟨b, hb⟩ hi
550 have hc : dist b c < 1 / i := hc
551 use c, hcm, T, hTS, i
552 exact {
553 mem_B := hb
554 mem_ball := by
555 simpa using hc
556 h1left u := by
557 change ((↑t)⁻¹ + ε) * ‖T' u‖ ≤ ‖(f' b).toLinearMap u‖
558 rw [← hos]
559 simpa using hTleft u
560 h1right u := by
561 change ‖(f' b).toLinearMap u‖ ≤ (↑t - ε) * ‖T' u‖
562 rw [← hos]
563 simpa using hTright u
564 h2 a ha := by
565 obtain ⟨ha, haB⟩ := ha
566 have hab : a ∈ Metric.ball b r := by
567 rw [Metric.mem_ball] at ⊢ ha
568 rw [dist_comm] at hc
569 apply (dist_triangle _ c.val _).trans_lt
570 apply lt_of_lt_of_le (add_lt_add ha hc)
571 rw [← add_div]
572 norm_num
573 change 3 / ⌈3 / r⌉₊ ≤ r
574 rw [div_le_comm₀ (by simpa using hr0) hr0]
575 exact Nat.le_ceil (3 / r)
576 apply (hr ⟨hab, haB⟩).trans
577 rw [div_mul_eq_mul_div, div_le_iff₀ (by simpa using hT), mul_assoc]
578 refine mul_le_mul_of_nonneg_left ?_ h0ε
579 rw [mul_comm]
580 convert ContinuousLinearMap.le_opNorm T.symm.toContinuousLinearMap (T.toLinearMap (a - b))
581 using 1
582 simp
583 }
584 simp [Piece.mk']
585 grind [Eprop.mem_B]
theorem nonempty_piece newL588–595
588theorem nonempty_piece [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [CompleteSpace V]
589 {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
590 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
591 (hB : B.Nonempty)
592 (hker : ∀ x ∈ B, (f' x).ker = ⊥) : (lemma3_3 ht hf hf' hker).choose.Nonempty := by
593 contrapose! hB with h
594 obtain hunion := (lemma3_3 ht hf hf' hker).choose_spec.2
595 simpa [h] using hunion
def pieceSeq' newL597–603
597noncomputable def pieceSeq' [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [CompleteSpace V]
598 {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
599 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
600 (hB : B.Nonempty)
601 (hker : ∀ x ∈ B, (f' x).ker = ⊥) : ℕ → Piece t f f' (MeasurableSet B ∧ Measurable f') :=
602 (Set.Countable.exists_eq_range (lemma3_3 ht hf hf' hker).choose_spec.1
603 (nonempty_piece ht hf hf' hB hker)).choose
theorem iUnion_pieceSeq' newL606–622
606theorem iUnion_pieceSeq' [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [CompleteSpace V]
607 {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
608 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
609 (hB : B.Nonempty)
610 (hker : ∀ x ∈ B, (f' x).ker = ⊥) :
611 B = ⋃ k, (pieceSeq' ht hf hf' hB hker k).E := by
612 obtain hmem := (Set.Countable.exists_eq_range (lemma3_3 ht hf hf' hker).choose_spec.1
613 (nonempty_piece ht hf hf' hB hker)).choose_spec
614 rw [pieceSeq']
615 conv_lhs => rw [(lemma3_3 ht hf hf' hker).choose_spec.2]
616 ext i
617 constructor
618 · simp only [Set.mem_iUnion, exists_prop, forall_exists_index, and_imp]
619 grind
620 · intro h
621 simp only [Set.mem_iUnion] at h ⊢
622 grind
def pieceSeq newL624–682
624noncomputable def pieceSeq [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [CompleteSpace V]
625 {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
626 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
627 (hB : B.Nonempty)
628 (hker : ∀ x ∈ B, (f' x).ker = ⊥) (k : ℕ) : Piece t f f' (MeasurableSet B ∧ Measurable f') where
629 E := (pieceSeq' ht hf hf' hB hker k).E \ ⋃ j < k, (pieceSeq' ht hf hf' hB hker j).E
630 measurablSet hBm := by
631 apply ((pieceSeq' ht hf hf' hB hker k).measurablSet hBm).diff
632 apply MeasurableSet.iUnion
633 intro i
634 apply MeasurableSet.iUnion
635 intro _
636 exact (pieceSeq' ht hf hf' hB hker i).measurablSet hBm
637 T := (pieceSeq' ht hf hf' hB hker k).T
638 lipschitz := (pieceSeq' ht hf hf' hB hker k).lipschitz.mono (Set.image_mono Set.diff_subset)
639 lipschitz_inv := by
640 have hinj' : Set.InjOn f (pieceSeq' ht hf hf' hB hker k).E := by
641 apply hf.mono
642 conv =>
643 right
644 rw [iUnion_pieceSeq' ht hf hf' hB hker]
645 apply Set.subset_iUnion _ k
646 have hinj : Set.InjOn f
647 ((pieceSeq' ht hf hf' hB hker k).E \ ⋃ j, ⋃ (_ : j < k),
648 (pieceSeq' ht hf hf' hB hker j).E) := by
649 apply hf.mono
650 apply Set.diff_subset.trans
651 conv =>
652 right
653 rw [iUnion_pieceSeq' ht hf hf' hB hker]
654 apply Set.subset_iUnion _ k
655 obtain h := (pieceSeq' ht hf hf' hB hker k).lipschitz_inv
656 unfold LipschitzOnWith at ⊢ h
657 intro x hx y hy
658 convert h (Set.mem_of_mem_of_subset hx (Set.image_mono Set.diff_subset))
659 (Set.mem_of_mem_of_subset hy (Set.image_mono Set.diff_subset)) using 2
660 <;> simp only [Function.comp_apply, EmbeddingLike.apply_eq_iff_eq]
661 · obtain ⟨x', hx', rfl⟩ := (Set.mem_image _ _ _).mp hx
662 apply hinj
663 · apply Function.invFunOn_apply_mem hx'
664 · rw [Set.InjOn.leftInvOn_invFunOn hinj'
665 (Set.mem_of_mem_of_subset hx' Set.diff_subset)]
666 exact hx'
667 · rw [Set.InjOn.leftInvOn_invFunOn hinj hx']
668 rw [Set.InjOn.leftInvOn_invFunOn hinj'
669 (Set.mem_of_mem_of_subset hx' Set.diff_subset)]
670 · obtain ⟨x', hx', rfl⟩ := (Set.mem_image _ _ _).mp hy
671 apply hinj
672 · apply Function.invFunOn_apply_mem hx'
673 · rw [Set.InjOn.leftInvOn_invFunOn hinj'
674 (Set.mem_of_mem_of_subset hx' Set.diff_subset)]
675 exact hx'
676 · rw [Set.InjOn.leftInvOn_invFunOn hinj hx']
677 rw [Set.InjOn.leftInvOn_invFunOn hinj'
678 (Set.mem_of_mem_of_subset hx' Set.diff_subset)]
679 det_le x hx :=
680 (pieceSeq' ht hf hf' hB hker k).det_le x (Set.mem_of_mem_of_subset hx Set.diff_subset)
681 le_det x hx :=
682 (pieceSeq' ht hf hf' hB hker k).le_det x (Set.mem_of_mem_of_subset hx Set.diff_subset)
theorem iUnion_pieceSeq newL685–710
685theorem iUnion_pieceSeq [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [CompleteSpace V]
686 {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
687 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
688 (hB : B.Nonempty)
689 (hker : ∀ x ∈ B, (f' x).ker = ⊥) :
690 B = ⋃ k, (pieceSeq ht hf hf' hB hker k).E := by
691 conv_lhs => rw [iUnion_pieceSeq' ht hf hf' hB hker]
692 apply subset_antisymm
693 · intro x
694 simp only [Set.mem_iUnion]
695 intro h
696 classical
697 use Nat.find h
698 simp only [pieceSeq, Nat.lt_find_iff, Set.mem_diff, Set.mem_iUnion, exists_prop, not_exists,
699 not_and]
700 constructor
701 · exact Nat.find_spec h
702 · intro y hy
703 apply Nat.find_min h
704 rw [Nat.lt_find_iff]
705 exact hy
706 · rw [Set.iUnion_subset_iff]
707 intro k
708 simp only [pieceSeq]
709 apply subset_trans Set.diff_subset
710 apply Set.subset_iUnion _ k
theorem pieceSeq_subset newL712–719
712theorem pieceSeq_subset [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [CompleteSpace V]
713 {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
714 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
715 (hB : B.Nonempty)
716 (hker : ∀ x ∈ B, (f' x).ker = ⊥) (j : ℕ) :
717 (pieceSeq ht hf hf' hB hker j).E ⊆ B := by
718 conv_rhs => rw [iUnion_pieceSeq ht hf hf' hB hker]
719 apply Set.subset_iUnion _ j
theorem disjoint_pieceSeq newL721–738
721theorem disjoint_pieceSeq [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [CompleteSpace V]
722 {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
723 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
724 (hB : B.Nonempty)
725 (hker : ∀ x ∈ B, (f' x).ker = ⊥) {i j : ℕ} (hij : i ≠ j) :
726 Disjoint (pieceSeq ht hf hf' hB hker i).E (pieceSeq ht hf hf' hB hker j).E := by
727 wlog hlt : j < i
728 · rw [disjoint_comm]
729 apply disjoint_pieceSeq
730 exact hij.symm
731 rw [Set.disjoint_right]
732 intro x hx
733 apply Set.notMem_diff_of_mem
734 simp only [Set.mem_iUnion, exists_prop]
735 use j
736 refine ⟨hlt, ?_⟩
737 apply Set.mem_of_mem_of_subset hx
738 apply Set.diff_subset
theorem LipschitzOnWith.euclideanHausdorffMeasure_image_le newL740–748
740theorem LipschitzOnWith.euclideanHausdorffMeasure_image_le {X : Type*} {Y : Type*}
741 [EMetricSpace X] [EMetricSpace Y] [MeasurableSpace X] [BorelSpace X] [MeasurableSpace Y]
742 [BorelSpace Y] {K : NNReal} {f : X → Y} {s : Set X} (h : LipschitzOnWith K f s) {d : ℕ} :
743 μHE[d] (f '' s) ≤ ↑K ^ d * μHE[d] s := by
744 simp_rw [MeasureTheory.Measure.euclideanHausdorffMeasure_def,
745 Measure.smul_apply, Measure.nnreal_smul_coe_apply]
746 grw [h.hausdorffMeasure_image_le (by simp)]
747 rw [mul_left_comm]
748 simp
751/-theorem MeasureTheory.setLIntegral_mono_ae'₀ {α : Type*} {m : MeasurableSpace α} {μ : Measure α}
752 {s : Set α} {f g : α → ENNReal} (hs : NullMeasurableSet s μ)
753 (hfg : ∀ᵐ x ∂μ, x ∈ s → f x ≤ g x) : ∫⁻ (x : α) in s, f x ∂μ ≤ ∫⁻ (x : α) in s, g x ∂μ := by
754 rw [setLIntegral_congr hs.toMeasurable_ae_eq.symm, setLIntegral_congr hs.toMeasurable_ae_eq.symm]
755 apply MeasureTheory.setLIntegral_mono_ae' (measurableSet_toMeasurable μ s)
756 filter_upwards [hs.toMeasurable_ae_eq.mem_iff, hfg] with x hx h
757 rwa [hx]-/
theorem area_left newL759–794
759theorem area_left [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [MeasurableSpace V]
760 [BorelSpace V]
761 [CompleteSpace V] {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
762 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
763 (hBm : MeasurableSet B) (hfm : Measurable f')
764 (hB : B.Nonempty)
765 (hker : ∀ x ∈ B, (f' x).ker = ⊥) (j : ℕ) :
766 (↑t)⁻¹ ^ (2 * finrank ℝ U) * μHE[finrank ℝ U] (f '' (pieceSeq ht hf hf' hB hker j).E) ≤
767 ∫⁻ x in (pieceSeq ht hf hf' hB hker j).E, ENNReal.ofReal (f' x).normDet := by
768 have ht0 : t ≠ 0 := fun h ↦ by simp [h] at ht
769 calc
770 _ = (↑t)⁻¹ ^ finrank ℝ U * (((↑t) ^ finrank ℝ U)⁻¹ *
771 μHE[finrank ℝ U] ((f ∘ (pieceSeq ht hf hf' hB hker j).T.symm) ''
772 (pieceSeq ht hf hf' hB hker j).T.toLinearMap '' (pieceSeq ht hf hf' hB hker j).E)) := by
773 rw [← Set.image_comp]
774 simp only [LinearEquiv.coe_coe, Function.comp_apply, LinearEquiv.symm_apply_apply]
775 rw [ENNReal.inv_pow]
776 ring
777 _ ≤ (↑t)⁻¹ ^ finrank ℝ U * volume ((pieceSeq ht hf hf' hB hker j).T.toLinearMap ''
778 (pieceSeq ht hf hf' hB hker j).E) := by
779 rw [← InnerProductSpace.euclideanHausdorffMeasure_eq_volume]
780 refine mul_le_mul_of_nonneg_left ?_ (by simp)
781 rw [ENNReal.inv_mul_le_iff (by simp [ht0]) (by simp)]
782 apply (pieceSeq ht hf hf' hB hker j).lipschitz.euclideanHausdorffMeasure_image_le
783 _ = (↑t)⁻¹ ^ finrank ℝ U * ENNReal.ofReal |(pieceSeq ht hf hf' hB hker j).T.toLinearMap.det| *
784 volume (pieceSeq ht hf hf' hB hker j).E := by
785 rw [MeasureTheory.Measure.addHaar_image_linearMap, mul_assoc]
786 _ ≤ _ := by
787 rw [← MeasureTheory.setLIntegral_const]
788 -- try using MeasureTheory.setLIntegral_mono_ae ?
789 apply MeasureTheory.setLIntegral_mono_ae'
790 ((pieceSeq ht hf hf' hB hker j).measurablSet ⟨hBm, hfm⟩)
791 apply Filter.Eventually.of_forall
792 intro x hx
793 rw [← ENNReal.toReal_le_toReal (by finiteness) (by finiteness)]
794 simpa [LinearMap.normDet_nonneg] using (pieceSeq ht hf hf' hB hker j).det_le x hx
theorem area_right newL796–828
796theorem area_right [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [MeasurableSpace V]
797 [BorelSpace V]
798 [CompleteSpace V] {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
799 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
800 (hB : B.Nonempty)
801 (hker : ∀ x ∈ B, (f' x).ker = ⊥) (j : ℕ) :
802 ∫⁻ x in (pieceSeq ht hf hf' hB hker j).E, ENNReal.ofReal (f' x).normDet ≤
803 (↑t) ^ (2 * finrank ℝ U) * μHE[finrank ℝ U] (f '' (pieceSeq ht hf hf' hB hker j).E) := by
804 have ht0 : t ≠ 0 := fun h ↦ by simp [h] at ht
805 calc
806 _ ≤ (↑t) ^ finrank ℝ U * ENNReal.ofReal |(pieceSeq ht hf hf' hB hker j).T.toLinearMap.det| *
807 volume (pieceSeq ht hf hf' hB hker j).E := by
808 rw [← MeasureTheory.setLIntegral_const]
809 apply MeasureTheory.setLIntegral_mono_ae (by fun_prop)
810 apply Filter.Eventually.of_forall
811 intro x hx
812 rw [← ENNReal.toReal_le_toReal (by finiteness) (by finiteness)]
813 simpa [LinearMap.normDet_nonneg] using (pieceSeq ht hf hf' hB hker j).le_det x hx
814 _ = (↑t) ^ finrank ℝ U * volume ((pieceSeq ht hf hf' hB hker j).T.toLinearMap ''
815 (pieceSeq ht hf hf' hB hker j).E) := by
816 rw [MeasureTheory.Measure.addHaar_image_linearMap, mul_assoc]
817 _ = (↑t) ^ finrank ℝ U * μHE[finrank ℝ U] (((pieceSeq ht hf hf' hB hker j).T
818 ∘ f.invFunOn (pieceSeq ht hf hf' hB hker j).E) '' f '' (pieceSeq ht hf hf' hB hker j).E) := by
819 rw [Set.image_comp, Set.InjOn.invFunOn_image (hf.mono (by apply pieceSeq_subset))
820 (subset_refl _), InnerProductSpace.euclideanHausdorffMeasure_eq_volume]
821 simp
822 _ ≤ (↑t) ^ finrank ℝ U * ((↑t) ^ finrank ℝ U *
823 μHE[finrank ℝ U] (f '' (pieceSeq ht hf hf' hB hker j).E)) := by
824 refine mul_le_mul_of_nonneg_left ?_ (by simp)
825 apply (pieceSeq ht hf hf' hB hker j).lipschitz_inv.euclideanHausdorffMeasure_image_le
826 _ ≤ _ := by
827 apply le_of_eq
828 ring
830/-
831--Aristotle
832lemma Set.Infinite.iUnion_of_pairwise_disjoint {α ι : Type*} {s : ι → Set α}
833 (hs : Pairwise (Function.onFun Disjoint s))
834 (h : Set.Infinite {i | (s i).Nonempty}) : (⋃ i, s i).Infinite := by
835 have h_choose : ∃ f : {i : ι | (s i).Nonempty} → α,
836 ∀ i : {i : ι | (s i).Nonempty}, f i ∈ s i := by
837 exact ⟨ fun i => Classical.choose i.2, fun i => Classical.choose_spec i.2 ⟩;
838 obtain ⟨f, hf⟩ := h_choose;
839 have h_distinct : Function.Injective f := by
840 intro i j hij; have := hs;
841 simp only [coe_setOf, mem_setOf_eq, Subtype.forall] at hf
842 exact Subtype.ext ( Classical.not_not.1 fun hi => Set.disjoint_left.1
843 ( this hi ) ( hf _ i.2 ) ( hij.symm ▸ hf _ j.2 ) );
844 have h_image_infinite : Set.Infinite (Set.range f) := by
845 convert Set.infinite_range_of_injective h_distinct;
846 exact Set.infinite_coe_iff.mpr h;
847 exact h_image_infinite.mono fun x hx => by
848 obtain ⟨ i, rfl ⟩ := hx;
849 exact Set.mem_iUnion_of_mem _ ( hf i )
852--Aristotle
853lemma Set.encard_biUnion_finset {α ι : Type*} {s : ι → Set α}
854 (hs : Pairwise (Function.onFun Disjoint s))
855 (t : Finset ι) :
856 (⋃ i ∈ t, s i).encard = ∑ i ∈ t, (s i).encard := by
857 classical
858 induction t using Finset.induction with --with i t hi ih;
859 | empty => simp
860 | insert i t hi ih =>
861 simp_all only [Finset.mem_insert, iUnion_iUnion_eq_or_left, not_false_eq_true,
862 Finset.sum_insert];
863 rw [ ← ih, Set.encard_union_eq ];
864 exact Set.disjoint_iUnion₂_right.mpr fun j hj => hs ( by aesop )
866--Aristotle
867lemma ENat.tsum_eq_top_of_ne_zero {ι : Type*} {f : ι → ℕ∞}
868 (h : Set.Infinite {i | f i ≠ 0}) : ∑' i, f i = ⊤ := by
869 by_contra h_ne
870 obtain ⟨n, hn⟩ : ∃ n : ℕ, ∑' i, f i = n := by
871 cases h_val : ∑' i, f i with
872 | top => exact absurd h_val h_ne
873 | coe n => exact ⟨n, rfl⟩
874 obtain ⟨s, hs_sub, hs_card⟩ := h.exists_subset_card_eq (n + 1)
875 have h1 : (↑(n + 1) : ℕ∞) ≤ ∑ i ∈ s, f i := by
876 rw [← hs_card, Finset.card_eq_sum_ones]; push_cast
877 exact Finset.sum_le_sum fun i hi => ENat.one_le_iff_ne_zero.mpr (hs_sub hi)
878 have h_summ : Summable f := ⟨_, hasSum_of_isLUB _ isLUB_iSup⟩
879 have h2 : ∑ i ∈ s, f i ≤ ∑' i, f i :=
880 h_summ.sum_le_tsum s (fun i _ => zero_le)
881 have h3 : (↑(n + 1) : ℕ∞) ≤ ↑n := h1.trans (h2.trans hn.le)
882 exact absurd h3 (by exact_mod_cast Nat.lt_irrefl n)
884--Aristotle
885lemma ENat.le_tsum {ι : Type*} (f : ι → ℕ∞) (i : ι) : f i ≤ ∑' j, f j :=
886 Summable.le_tsum' ⟨_, hasSum_of_isLUB _ isLUB_iSup⟩ i
888--Aristotle
889theorem Set.encard_iUnion {α : Type*} {ι : Type*} {s : ι → Set α}
890 (hs : Pairwise (Function.onFun Disjoint s)) :
891 (⋃ (i : ι), s i).encard = ∑' (i : ι), (s i).encard := by
892 by_cases h_some_inf : ∃ i, (s i).Infinite
893 · -- Case 1: Some s i is infinite
894 obtain ⟨i, hi⟩ := h_some_inf
895 have h1 : (⋃ j, s j).Infinite := hi.mono (Set.subset_iUnion s i)
896 have h2 : (s i).encard = ⊤ := Set.encard_eq_top_iff.mpr hi
897 rw [Set.encard_eq_top_iff.mpr h1]
898 have : ∑' j, (s j).encard ≥ (s i).encard := ENat.le_tsum _ i
899 rw [h2] at this
900 exact (top_le_iff.mp this).symm
901 · push Not at h_some_inf
902 by_cases h_fin_support : Set.Finite {i | (s i).Nonempty}
903 · -- Case 3: finitely many nonempty sets
904 have h_zero : ∀ i, i ∉ h_fin_support.toFinset → (s i).encard = 0 := by
905 intro i hi
906 simp only [Finite.mem_toFinset, mem_setOf_eq] at hi
907 exact Set.encard_eq_zero.mpr (Set.not_nonempty_iff_eq_empty.mp hi)
908 rw [tsum_eq_sum h_zero]
909 have h_eq : (⋃ i, s i) = ⋃ i ∈ h_fin_support.toFinset, s i := by
910 ext x; simp [Set.Finite.mem_toFinset]
911 rw [h_eq]
912 exact Set.encard_biUnion_finset hs _
913 · -- Case 2: infinitely many nonempty, all finite
914 have h_inf_union : (⋃ i, s i).Infinite :=
915 Set.Infinite.iUnion_of_pairwise_disjoint hs h_fin_support
916 rw [Set.encard_eq_top_iff.mpr h_inf_union]
917 have : Set.Infinite {i | (s i).encard ≠ 0} := by
918 rwa [show {i | (s i).encard ≠ 0} = {i | (s i).Nonempty} from by
919 ext i; exact Set.encard_ne_zero]
920 exact (ENat.tsum_eq_top_of_ne_zero this).symm
922theorem ENat.hasSum {α : Type u_1} {f : α → ENat} :
923 HasSum f (⨆ (s : Finset α), ∑ a ∈ s, f a) :=
924 tendsto_atTop_iSup fun _ _ => Finset.sum_le_sum_of_subset
926theorem ENat.summable {α : Type u_1} {f : α → ENat} :
927 Summable f :=
928 ENat.hasSum.summable
930-- Aristotle
931theorem continuous_ENat_toENNReal : Continuous ENat.toENNReal := by
932 refine continuous_iff_continuousAt.2 fun x => ?_;
933 induction x using WithTop.recTopCoe with
934 | top =>
935 refine ENNReal.tendsto_nhds_top ?_;
936 intro n;
937 rw [ eventually_nhds_iff ];
938 use Set.Ioi (n : ENat);
939 simp only [Set.mem_Ioi, isOpen_iff_mem_nhds];
940 exact ⟨ fun y hy => by cases y <;> aesop,
941 fun x hx => IsOpen.mem_nhds ( isOpen_Ioi ) hx, by exact WithTop.coe_lt_top _ ⟩;
942 | coe a =>
943 simp only [ContinuousAt, ENat.some_eq_coe];
944 rw [ ENat.nhds_eq_pure ];
945 · exact pure_le_nhds _;
946 · exact ENat.coe_ne_top _-/
theorem glue_j newL948–963
948theorem glue_j [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [MeasurableSpace V]
949 [BorelSpace V]
950 [CompleteSpace V] {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
951 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
952 (hBm : MeasurableSet B) (hfm : Measurable f')
953 (hB : B.Nonempty)
954 (hker : ∀ x ∈ B, (f' x).ker = ⊥) :
955 ∫⁻ x in B, ENNReal.ofReal (f' x).normDet =
956 ∑' j, ∫⁻ x in (pieceSeq ht hf hf' hB hker j).E, ENNReal.ofReal (f' x).normDet := by
957 conv_lhs => rw [iUnion_pieceSeq ht hf hf' hB hker]
958 apply MeasureTheory.lintegral_iUnion
959 · intro i
960 apply Piece.measurablSet _ ⟨hBm, hfm⟩
961 · intro i j h
962 rw [Function.onFun]
963 exact disjoint_pieceSeq ht hf hf' hB hker h
theorem μHE_image_zero newL965–1020
965theorem μHE_image_zero [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [MeasurableSpace V]
966 [BorelSpace V] [CompleteSpace V]
967 {B : Set U} {f : U → V} {f' : U → U →L[ℝ] V}
968 (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
969 (hs : volume B = 0)
970 (hker : ∀ x ∈ B, (f' x).ker = ⊥) :
971 μHE[finrank ℝ U] (f '' B) = 0 := by
972 rcases B.eq_empty_or_nonempty with hB | hB
973 · simp [hB]
974 have hrank : 0 < finrank ℝ U := Module.finrank_pos
975 have hrank' : 0 < 2 * finrank ℝ U := by simpa using hrank
976 apply le_antisymm
977 · have ht : (1 : NNReal) < (2 : NNReal) := by norm_num
978 suffices 2⁻¹ ^ (finrank ℝ U) * μHE[finrank ℝ U] (f '' B) ≤ 0 by
979 simpa
980 calc
981 _ = 2⁻¹ ^ (finrank ℝ U) * μHE[finrank ℝ U] (f ''
982 ⋃ k, (pieceSeq ht hf hf' hB hker k).E) := by
983 rw [← iUnion_pieceSeq ht]
984 _ = 2⁻¹ ^ (finrank ℝ U) * μHE[finrank ℝ U] (
985 ⋃ k, f '' (pieceSeq ht hf hf' hB hker k).E) := by
986 rw [Set.image_iUnion]
987 _ ≤ 2⁻¹ ^ (finrank ℝ U) * ∑' k, μHE[finrank ℝ U] (
988 f '' (pieceSeq ht hf hf' hB hker k).E) := by
989 grw [MeasureTheory.measure_iUnion_le]
990 _ = ∑' k, 2⁻¹ ^ (finrank ℝ U) * μHE[finrank ℝ U] (
991 f '' (pieceSeq ht hf hf' hB hker k).E) := by
992 rw [ENNReal.tsum_mul_left]
993 _ = ∑' k, (2 ^ (finrank ℝ U))⁻¹ *
994 μHE[finrank ℝ U] ((f ∘ (pieceSeq ht hf hf' hB hker k).T.symm) ''
995 (pieceSeq ht hf hf' hB hker k).T.toLinearMap ''
996 (pieceSeq ht hf hf' hB hker k).E) := by
997 congr with k
998 rw [← Set.image_comp]
999 simp only [LinearEquiv.coe_coe, Function.comp_apply, LinearEquiv.symm_apply_apply]
1000 rw [ENNReal.inv_pow]
1001 _ ≤ ∑' k, volume ((pieceSeq ht hf hf' hB hker k).T.toLinearMap ''
1002 (pieceSeq ht hf hf' hB hker k).E) := by
1003 apply ENNReal.tsum_le_tsum
1004 intro k
1005 rw [← InnerProductSpace.euclideanHausdorffMeasure_eq_volume]
1006 rw [ENNReal.inv_mul_le_iff (by simp) (by simp)]
1007 apply (pieceSeq ht hf hf' hB hker k).lipschitz.euclideanHausdorffMeasure_image_le
1008 _ = ∑' k, ENNReal.ofReal |(pieceSeq ht hf hf' hB hker k).T.toLinearMap.det| *
1009 volume (pieceSeq ht hf hf' hB hker k).E := by
1010 congr with k
1011 rw [MeasureTheory.Measure.addHaar_image_linearMap]
1012 _ ≤ ∑' k, ENNReal.ofReal |(pieceSeq ht hf hf' hB hker k).T.toLinearMap.det| *
1013 volume B := by
1014 apply ENNReal.tsum_le_tsum
1015 intro k
1016 gcongr
1017 conv_rhs => rw [iUnion_pieceSeq ht hf hf' hB hker]
1018 apply Set.subset_iUnion _ k
1019 _ = 0 := by simp [hs]
1020 · simp
theorem glue newL1022–1045
1022theorem glue [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [MeasurableSpace V]
1023 [BorelSpace V]
1024 [CompleteSpace V] {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
1025 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
1026 (hBm : MeasurableSet B) (hfm : Measurable f')
1027 (hB : B.Nonempty)
1028 (hker : ∀ x ∈ B, (f' x).ker = ⊥) :
1029 μHE[finrank ℝ U] (f '' B) = ∑' j, μHE[finrank ℝ U] (f '' (pieceSeq ht hf hf' hB hker j).E) := by
1030 conv_lhs =>
1031 rw [iUnion_pieceSeq ht hf hf' hB hker]
1032 rw [Set.image_iUnion]
1033 apply measure_iUnion
1034 · intro j k h
1035 rw [Function.onFun]
1036 apply Disjoint.image ?_ hf (pieceSeq_subset ..) (pieceSeq_subset ..)
1037 apply disjoint_pieceSeq
1038 exact h
1039 · intro j
1040 apply MeasurableSet.image_of_continuousOn_injOn
1041 ((pieceSeq ht hf hf' hB hker j).measurablSet ⟨hBm, hfm⟩) ?_
1042 (hf.mono (pieceSeq_subset ..))
1043 intro x hx
1044 apply (hf' x (Set.mem_of_mem_of_subset hx (pieceSeq_subset ..))).continuousWithinAt.mono
1045 apply pieceSeq_subset
theorem left newL1048–1061
1048theorem left [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [MeasurableSpace V]
1049 [BorelSpace V]
1050 [CompleteSpace V] {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
1051 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
1052 (hBm : MeasurableSet B) (hfm : Measurable f')
1053 (hB : B.Nonempty)
1054 (hker : ∀ x ∈ B, (f' x).ker = ⊥) :
1055 ∫⁻ (x : U) in B, ENNReal.ofReal (f' x).normDet ≤
1056 ↑t ^ (2 * finrank ℝ U) * μHE[finrank ℝ U] (f '' B) := by
1057 rw [glue_j ht hf hf' hBm hfm hB hker, glue ht hf hf' hBm hfm hB hker]
1058 rw [← ENNReal.tsum_mul_left]
1059 apply ENNReal.tsum_le_tsum
1060 intro k
1061 apply area_right ht hf hf' hB hker
theorem right newL1063–1076
1063theorem right [Nontrivial U] [MeasurableSpace U] [BorelSpace U] [MeasurableSpace V]
1064 [BorelSpace V]
1065 [CompleteSpace V] {t : NNReal} (ht : 1 < t) {f : U → V} {f' : U → U →L[ℝ] V}
1066 {B : Set U} (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
1067 (hBm : MeasurableSet B) (hfm : Measurable f')
1068 (hB : B.Nonempty)
1069 (hker : ∀ x ∈ B, (f' x).ker = ⊥) :
1070 (↑t)⁻¹ ^ (2 * finrank ℝ U) * μHE[finrank ℝ U] (f '' B) ≤
1071 ∫⁻ (x : U) in B, ENNReal.ofReal (f' x).normDet := by
1072 rw [glue_j ht hf hf' hBm hfm hB hker, glue ht hf hf' hBm hfm hB hker]
1073 rw [← ENNReal.tsum_mul_left]
1074 apply ENNReal.tsum_le_tsum
1075 intro k
1076 apply area_left ht hf hf' hBm hfm hB hker
theorem area_formula_injOn_ker_measurable newL1078–1135
1078theorem area_formula_injOn_ker_measurable {U V : Type*}
1079 [NormedAddCommGroup U] [InnerProductSpace ℝ U] [FiniteDimensional ℝ U]
1080 [Nontrivial U] [MeasurableSpace U] [BorelSpace U]
1081 [NormedAddCommGroup V] [InnerProductSpace ℝ V]
1082 [MeasurableSpace V] [BorelSpace V] [CompleteSpace V]
1083 {f : U → V} {f' : U → U →L[ℝ] V} {B : Set U} (hBm : MeasurableSet B)
1084 (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x) (hfm : Measurable f')
1085 (hker : ∀ x ∈ B, (f' x).ker = ⊥) :
1086 ∫⁻ x in B, ENNReal.ofReal (f' x).normDet = μHE[finrank ℝ U] (f '' B) := by
1087 rcases B.eq_empty_or_nonempty with hB | hB
1088 · simp [hB]
1089 have hrank : 0 < finrank ℝ U := Module.finrank_pos
1090 have hrank' : 0 < 2 * finrank ℝ U := by simpa using hrank
1091 suffices ∫⁻ x in B, ENNReal.ofReal (f' x).normDet =
1092 1 * μHE[finrank ℝ U] (f '' B) by
1093 simpa
1094 apply le_antisymm
1095 · suffices ∀ t : ENNReal, 1 < t → ∫⁻ x in B, ENNReal.ofReal (f' x).normDet ≤
1096 t ^ (2 * finrank ℝ U) * μHE[finrank ℝ U] (f '' B) by
1097 apply ENNReal.le_mul_of_forall_lt (by simp) (by simp)
1098 intro a ha b hb
1099 refine le_trans (this (a ^ (((2 * finrank ℝ U : Nat) : Real)⁻¹)) ?_) ?_
1100 · apply ENNReal.one_lt_rpow (by simpa using ha)
1101 simpa using hrank
1102 · rw [← ENNReal.rpow_natCast, ← ENNReal.rpow_mul,
1103 inv_mul_cancel₀ (by simpa using hrank.ne'), ENNReal.rpow_one]
1104 grw [hb]
1105 intro t
1106 induction t using ENNReal.recTopCoe with
1107 | top =>
1108 intro ht
1109 by_cases h0 : μHE[finrank ℝ U] (f '' B) = 0
1110 · have h := left (show 1 < 2 by simp) hf hf' hBm hfm hB hker
1111 simp_all
1112 simp [hrank.ne', h0]
1113 | coe t =>
1114 intro ht
1115 norm_cast at ht
1116 apply left ht hf hf' hBm hfm hB hker
1117 · suffices ∀ t : ENNReal, 1 < t → t⁻¹ ^ (2 * finrank ℝ U) * μHE[finrank ℝ U] (f '' B) ≤
1118 ∫⁻ x in B, ENNReal.ofReal (f' x).normDet by
1119 apply ENNReal.mul_le_of_forall_lt
1120 intro a ha b hb
1121 refine le_trans ?_ (this (a ^ (-((2 * finrank ℝ U : Nat) : Real)⁻¹)) ?_)
1122 · rw [← ENNReal.rpow_natCast, ← ENNReal.inv_rpow, ← ENNReal.rpow_mul,
1123 neg_mul, inv_mul_cancel₀ (by simpa using hrank.ne'), ENNReal.rpow_neg_one,
1124 inv_inv]
1125 grw [hb]
1126 · rw [ENNReal.rpow_neg, ← ENNReal.inv_rpow]
1127 apply ENNReal.one_lt_rpow (by simpa using ha)
1128 simpa using hrank
1129 intro t
1130 induction t using ENNReal.recTopCoe with
1131 | top => simp [hrank.ne']
1132 | coe t =>
1133 intro ht
1134 norm_cast at ht
1135 apply right ht hf hf' hBm hfm hB hker
theorem area_formula_injOn_ker newL1138–1201
1138public theorem area_formula_injOn_ker {U V : Type*}
1139 [NormedAddCommGroup U] [InnerProductSpace ℝ U] [FiniteDimensional ℝ U]
1140 [Nontrivial U] [MeasurableSpace U] [BorelSpace U]
1141 [NormedAddCommGroup V] [InnerProductSpace ℝ V]
1142 [MeasurableSpace V] [BorelSpace V] [CompleteSpace V] [SecondCountableTopology V]
1143 {f : U → V} {f' : U → U →L[ℝ] V} {s : Set U} (hs : MeasurableSet s)
1144 (hf : Set.InjOn f s) (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x)
1145 (hker : ∀ x ∈ s, (f' x).ker = ⊥) :
1146 ∫⁻ x in s, ENNReal.ofReal (f' x).normDet = μHE[finrank ℝ U] (f '' s) := by
1147 obtain ⟨g, hgm, hfg⟩ := aemeasurable_fderivWithin volume hs hf'
1148 let t := {x | x ∈ s ∧ f' x ≠ g x}
1149 obtain hfg' := MeasureTheory.ae_iff.mp <| (MeasureTheory.ae_restrict_iff' hs).mp hfg
1150 have ht : volume t = 0 := by
1151 apply eq_zero_of_nonpos
1152 rw [← hfg']
1153 apply measure_mono
1154 simp [t]
1155 obtain ⟨u, htu, hmu, hu⟩ := MeasureTheory.exists_measurable_superset_iff_measure_eq_zero.mpr ht
1156 have hfu : μHE[finrank ℝ U] (f '' (s ∩ u)) = 0 := by
1157 apply μHE_image_zero (hf.mono Set.inter_subset_left) (fun x hx ↦
1158 (hf' x (Set.mem_of_mem_of_subset hx Set.inter_subset_left)).mono Set.inter_subset_left) ?_ ?_
1159 · apply eq_zero_of_nonpos
1160 rw [← hu]
1161 apply measure_mono
1162 exact Set.inter_subset_right
1163 · intro x hx
1164 exact hker x (Set.mem_of_mem_of_subset hx Set.inter_subset_left)
1165 calc
1166 _ = ∫⁻ x in (s \ u), ENNReal.ofReal (f' x).normDet := by
1167 apply MeasureTheory.setLIntegral_congr
1168 symm
1169 apply MeasureTheory.diff_null_ae_eq_self hu
1170 _ = ∫⁻ x in (s \ u), ENNReal.ofReal (g x).normDet := by
1171 apply MeasureTheory.setLIntegral_congr_fun_ae (hs.diff hmu)
1172 rw [← MeasureTheory.ae_restrict_iff' (hs.diff hmu)]
1173 suffices f' =ᵐ[volume.restrict (s \ u)] g by
1174 exact Filter.EventuallyEq.fun_comp this
1175 (fun x ↦ ENNReal.ofReal (LinearMap.normDet x.toLinearMap))
1176 apply Filter.EventuallyEq.filter_mono hfg
1177 apply MeasureTheory.ae_mono
1178 exact MeasureTheory.Measure.restrict_mono Set.diff_subset le_rfl
1179 _ = μHE[finrank ℝ U] (f '' (s \ u)) := by
1180 refine area_formula_injOn_ker_measurable (hs.diff hmu) (hf.mono Set.diff_subset)
1181 (fun x hx ↦ ?_) hgm (fun x hx ↦ ?_)
1182 <;> have hx' : x ∈ (s \ t) := by
1183 apply Set.mem_of_mem_of_subset hx
1184 gcongr
1185 · obtain ⟨hxs, hf'g⟩ : x ∈ s ∧ f' x = g x := by simpa [t] using hx'
1186 rw [← hf'g]
1187 exact (hf' x hxs).mono Set.diff_subset
1188 · obtain ⟨hxs, hf'g⟩ : x ∈ s ∧ f' x = g x := by simpa [t] using hx'
1189 rw [← hf'g]
1190 apply hker x hxs
1191 _ = μHE[finrank ℝ U] (f '' (s \ u)) + μHE[finrank ℝ U] (f '' (s ∩ u))
1192 - μHE[finrank ℝ U] (f '' (s ∩ u)) := by
1193 rw [ENNReal.add_sub_cancel_right (by simp [hfu])]
1194 _ = _ := by
1195 rw [← measure_union (Disjoint.image (by grind) hf Set.diff_subset Set.inter_subset_left) ?_,
1196 ← Set.image_union, Set.diff_union_inter, hfu, tsub_zero]
1197 refine MeasurableSet.image_of_continuousOn_injOn (hs.inter hmu) ?_
1198 (hf.mono Set.inter_subset_left)
1199 intro x hx
1200 apply (hf' x (Set.mem_of_mem_of_subset hx Set.inter_subset_left)).continuousWithinAt.mono
1201 Set.inter_subset_left
theorem circumference_circle newL1204–1282
1204theorem circumference_circle :
1205 μHE[1].real (Metric.sphere 0 1 : Set (EuclideanSpace ℝ (Fin 2))) = 2 * Real.pi := by
1206 let f (x : ℝ) := !₂[Real.cos x, Real.sin x]
1207 let f' (x : ℝ) := (ContinuousLinearMap.id ℝ ℝ).smulRight !₂[-Real.sin x, Real.cos x]
1208 let s : Set ℝ := Set.Ioc (-Real.pi) Real.pi
1209 have hs : MeasurableSet s := by
1210 unfold s
1211 measurability
1212 have hf : Set.InjOn f s := by
1213 intro x hx y hy h
1214 simp only [WithLp.toLp.injEq, Matrix.vecCons_inj, and_true, f] at h
1215 obtain ⟨hcos, hsin⟩ := h
1216 obtain hangle := congr(Real.Angle.toReal $(Real.Angle.cos_sin_inj hcos hsin))
1217 rw [Real.Angle.toReal_coe_eq_self_iff.mpr (by simpa [s] using hx)] at hangle
1218 rw [Real.Angle.toReal_coe_eq_self_iff.mpr (by simpa [s] using hy)] at hangle
1219 exact hangle
1220 have hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x := by
1221 intro x _
1222 apply HasFDerivAt.hasFDerivWithinAt
1223 rw [show f = WithLp.toLp 2 ∘ (fun t ↦ ![Real.cos t, Real.sin t]) by rfl]
1224 rw [show f' x =
1225 ((PiLp.continuousLinearEquiv 2 ℝ (fun (_ : Fin 2) ↦ ℝ)).symm.toContinuousLinearMap) ∘L
1226 (ContinuousLinearMap.id ℝ ℝ).smulRight ![-Real.sin x, Real.cos x] by rfl]
1227 apply (PiLp.hasFDerivAt_toLp 2 _).comp
1228 simp only [Nat.succ_eq_add_one, Nat.reduceAdd, hasFDerivAt_pi', Fin.forall_fin_two, Fin.isValue,
1229 Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val_fin_one]
1230 constructor
1231 · change HasFDerivAt (fun x ↦ Real.cos x)
1232 ((ContinuousLinearMap.id ℝ ℝ).smulRight (-Real.sin x)) x
1233 convert (hasFDerivAt_id x).cos
1234 ext
1235 simp
1236 · change HasFDerivAt (fun x ↦ Real.sin x)
1237 ((ContinuousLinearMap.id ℝ ℝ).smulRight (Real.cos x)) x
1238 convert (hasFDerivAt_id x).sin
1239 ext
1240 simp
1241 have hdet : ∀ x ∈ s, (f' x).normDet = 1 := by
1242 intro x _
1243 let f'iso := ((LinearMap.id : ℝ →ₗ[ℝ] ℝ).smulRight !₂[-Real.sin x, Real.cos x]).toLinearIsometry
1244 (by
1245 apply AddMonoidHomClass.isometry_of_norm
1246 intro y
1247 simp [norm_smul, PiLp.norm_eq_of_L2]
1249 change f'iso.toLinearMap.normDet = 1
1250 simp
1251 have hker : ∀ x ∈ s, (f' x).ker = ⊥ := by
1252 intro x hx
1253 rw [← normDet_eq_zero_iff_ker_ne_bot.not_left]
1254 simp [hdet x hx]
1255 have himage : (Metric.sphere 0 1 : Set (EuclideanSpace ℝ (Fin 2))) = f '' s := by
1256 ext x
1257 simp only [mem_sphere_iff_norm, sub_zero, Set.mem_image, f]
1258 constructor
1259 · intro h
1260 use Complex.arg (x 0 + x 1 * Complex.I)
1261 constructor
1262 · exact Complex.arg_mem_Ioc _
1263 · have hnorm : x.ofLp 0 ^ 2 + x.ofLp 1 ^ 2 = 1 := by simpa [PiLp.norm_eq_of_L2] using h
1264 have h0 : x 0 + x 1 * Complex.I ≠ 0 := by
1265 rw [← Complex.norm_eq_zero_iff.ne]
1266 simp [Complex.norm_add_mul_I, hnorm]
1267 rw [Complex.cos_arg h0, Complex.sin_arg (x 0 + x 1 * Complex.I)]
1268 ext i
1269 fin_cases i <;> simp [Complex.norm_add_mul_I, hnorm]
1270 · rintro ⟨y, hys, rfl⟩
1271 simp [PiLp.norm_eq_of_L2]
1272 rw [Measure.real, show μHE[1] = μHE[finrank ℝ ℝ] by simp, himage,
1273 ← area_formula_injOn_ker hs hf hf' hker]
1274 trans (∫⁻ (x : ℝ) in s, 1).toReal
1275 · congrm ENNReal.toReal ?_
1276 apply MeasureTheory.setLIntegral_congr_fun (by simp [s])
1277 intro x hx
1278 simp [hdet x hx]
1279 simp only [lintegral_const, MeasurableSet.univ, Measure.restrict_apply, Set.univ_inter,
1280 Real.volume_Ioc, sub_neg_eq_add, one_mul, s]
1281 rw [ENNReal.toReal_ofReal (by positivity)]
1282 ring
1284-----------------------------------------------
abbrev ContinuousLinearMap.prodWithLp newL1286–1291
1286abbrev ContinuousLinearMap.prodWithLp {R M₁ M₂ M₃ : Type*} [Semiring R]
1287 [AddCommGroup M₁] [AddCommGroup M₂] [AddCommGroup M₃]
1288 [TopologicalSpace M₁] [TopologicalSpace M₂] [TopologicalSpace M₃]
1289 [Module R M₁] [Module R M₂] [Module R M₃]
1290 (f : M₁ →L[R] M₂) (g : M₁ →L[R] M₃) (p : ENNReal) : M₁ →L[R] WithLp p (M₂ × M₃) :=
1291 (WithLp.prodContinuousLinearEquiv _ _ _ _).symm.toContinuousLinearMap ∘L (f.prod g)
abbrev ContinuousLinearMap.withLpCoprod newL1293–1298
1293abbrev ContinuousLinearMap.withLpCoprod {R M₁ M₂ M₃ : Type*} [Semiring R]
1294 [AddCommGroup M₁] [AddCommGroup M₂] [AddCommGroup M₃]
1295 [TopologicalSpace M₁] [TopologicalSpace M₂] [TopologicalSpace M₃] [ContinuousAdd M₃]
1296 [Module R M₁] [Module R M₂] [Module R M₃]
1297 (f : M₁ →L[R] M₃) (g : M₂ →L[R] M₃) (p : ENNReal) : WithLp p (M₁ × M₂) →L[R] M₃ :=
1298 (f.coprod g) ∘L (WithLp.prodContinuousLinearEquiv _ _ _ _).toContinuousLinearMap
theorem ContinuousLinearMap.withLpCoprod_comp_prodWithLp newL1300–1307
1300@[simp]
1301theorem ContinuousLinearMap.withLpCoprod_comp_prodWithLp {R M₁ M₂ M₃ M₄ : Type*} [Semiring R]
1302 [AddCommGroup M₁] [AddCommGroup M₂] [AddCommGroup M₃] [AddCommGroup M₄]
1303 [TopologicalSpace M₁] [TopologicalSpace M₂] [TopologicalSpace M₃] [TopologicalSpace M₄]
1304 [ContinuousAdd M₁] [ContinuousAdd M₂] [ContinuousAdd M₃] [ContinuousAdd M₄]
1305 [Module R M₁] [Module R M₂] [Module R M₃] [Module R M₄]
1306 (f : M₂ →L[R] M₄) (g : M₃ →L[R] M₄) (f' : M₁ →L[R] M₂) (g' : M₁ →L[R] M₃) (p : ENNReal) :
1307 f.withLpCoprod g p ∘L f'.prodWithLp g' p = f ∘L f' + g ∘L g' := rfl
theorem ContinousLinearMap.adjoint_prodWithLp newL1309–1318
1309theorem ContinousLinearMap.adjoint_prodWithLp {R M₁ M₂ M₃ : Type*} [RCLike R]
1310 [NormedAddCommGroup M₁] [NormedAddCommGroup M₂] [NormedAddCommGroup M₃]
1311 [CompleteSpace M₁] [CompleteSpace M₂] [CompleteSpace M₃]
1312 [InnerProductSpace R M₁] [InnerProductSpace R M₂] [InnerProductSpace R M₃]
1313 (f : M₁ →L[R] M₂) (g : M₁ →L[R] M₃) :
1314 (f.prodWithLp g 2).adjoint = f.adjoint.withLpCoprod g.adjoint 2 := by
1315 ext x
1316 apply ext_inner_left R
1317 intro v
1318 simp [inner_add_right, ContinuousLinearMap.adjoint_inner_right]
theorem ContinousLinearMap.adjoint_prodWithLp_comp_self newL1320–1326
1320theorem ContinousLinearMap.adjoint_prodWithLp_comp_self {R M₁ M₂ M₃ : Type*} [RCLike R]
1321 [NormedAddCommGroup M₁] [NormedAddCommGroup M₂] [NormedAddCommGroup M₃]
1322 [CompleteSpace M₁] [CompleteSpace M₂] [CompleteSpace M₃]
1323 [InnerProductSpace R M₁] [InnerProductSpace R M₂] [InnerProductSpace R M₃]
1324 (f : M₁ →L[R] M₂) (g : M₁ →L[R] M₃) :
1325 (f.prodWithLp g 2).adjoint ∘L (f.prodWithLp g 2) = f.adjoint ∘L f + g.adjoint ∘L g := by
1326 simp [ContinousLinearMap.adjoint_prodWithLp]
1329theorem smasher_sublinear {U V : Type*}
1330 [NormedAddCommGroup U] [InnerProductSpace ℝ U] [FiniteDimensional ℝ U]
1331 [NormedAddCommGroup V] [InnerProductSpace ℝ V]
1332 {f' : U →L[ℝ] V} (hker : f'.ker ≠ ⊥) {a b : ℝ} (ha : 0 ≤ a) (ha1 : a ≤ 1) (hb : 0 < b) :
1333 (f'.prodWithLp ((a * b) • 1 : U →L[ℝ] U) 2).normDet ≤
1334 a * (f'.prodWithLp (b • 1 : U →L[ℝ] U) 2).normDet := sorry
1336theorem exists_smasher {U V : Type*}
1337 [NormedAddCommGroup U] [InnerProductSpace ℝ U] [FiniteDimensional ℝ U]
1338 [NormedAddCommGroup V] [InnerProductSpace ℝ V]
1339 {f' : U →L[ℝ] V} (hker : f'.ker ≠ ⊥) {e : ℝ} (he : 0 < e) :
1340 ∃ l : ℝ, 0 < l ∧ (f'.prodWithLp (l • 1 : U →L[ℝ] U) 2).normDet < e := sorry
1342theorem area_formula_injOn_singular_le {U V : Type*}
1343 [NormedAddCommGroup U] [InnerProductSpace ℝ U] [FiniteDimensional ℝ U]
1344 [Nontrivial U] [MeasurableSpace U] [BorelSpace U]
1345 [NormedAddCommGroup V] [InnerProductSpace ℝ V] [SecondCountableTopology V]
1346 [MeasurableSpace V] [BorelSpace V] [CompleteSpace V]
1347 {f : U → V} {f' : U → U →L[ℝ] V} {B : Set U} (hBm : MeasurableSet B)
1348 (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
1349 (hker : ∀ x ∈ B, (f' x).ker ≠ ⊥) {e : ℝ} (he : 0 < e) :
1350 μHE[finrank ℝ U] (f '' B) ≤ sorry := by
1351 have h (x : U) (hx : x ∈ B) :
1352 ∃ l : ℝ, 0 < l ∧ ((f' x).prodWithLp (l • 1 : U →L[ℝ] U) 2).normDet < e := by
1353 apply exists_smasher (hker x hx) he
1354 choose! l hl0 hle using h
1355 let Bi (i : ℕ) : Set U := {u : U | u ∈ B ∧ (i + 1 : ℝ)⁻¹ < l u ∧ ‖u‖ < i}
1356 let gi (i : ℕ) (x : U) : WithLp 2 (V × U) := WithLp.toLp 2 (f x, (i + 1 : ℝ)⁻¹ ^ 2 • x)
1357 let gi' (i : ℕ) (x : U) : U →L[ℝ] WithLp 2 (V × U) :=
1358 (f' x).prodWithLp ((i + 1 : ℝ)⁻¹ ^ 2 • 1 : U →L[ℝ] U) 2
1359 have hBi : B = ⋃ i, Bi i := sorry
1360 calc
1361 _ = μHE[finrank ℝ U] (⋃ i, f '' Bi i) := by
1362 rw [hBi, Set.image_iUnion]
1363 _ ≤ ∑' i, μHE[finrank ℝ U] (f '' Bi i) := by
1364 apply MeasureTheory.measure_iUnion_le
1365 _ ≤ ∑' i, μHE[finrank ℝ U] (gi i '' Bi i) :=
1366 sorry
1367 _ = ∑' i, ∫⁻ x in Bi i, ENNReal.ofReal (gi' i x).normDet := by
1368 congr with i
1369 symm
1370 apply area_formula_injOn_ker
1371 · sorry
1372 · sorry
1373 · sorry
1374 · sorry
1375 _ = _ := sorry
1376theorem area_formula_injOn_singular {U V : Type*}
1377 [NormedAddCommGroup U] [InnerProductSpace ℝ U] [FiniteDimensional ℝ U]
1378 [Nontrivial U] [MeasurableSpace U] [BorelSpace U]
1379 [NormedAddCommGroup V] [InnerProductSpace ℝ V]
1380 [MeasurableSpace V] [BorelSpace V] [CompleteSpace V]
1381 {f : U → V} {f' : U → U →L[ℝ] V} {B : Set U} (hBm : MeasurableSet B)
1382 (hf : Set.InjOn f B) (hf' : ∀ x ∈ B, HasFDerivWithinAt f (f' x) B x)
1383 (hker : ∀ x ∈ B, (f' x).ker ≠ ⊥) :
1384 ∫⁻ x in B, ENNReal.ofReal (f' x).normDet = μHE[finrank ℝ U] (f '' B) := by
1386 sorry
1390/-public theorem area_formula_injOn_ker {U V : Type*}
1391 [NormedAddCommGroup U] [InnerProductSpace ℝ U] [FiniteDimensional ℝ U]
1392 [Nontrivial U] [MeasurableSpace U] [BorelSpace U]
1393 [NormedAddCommGroup V] [InnerProductSpace ℝ V]
1394 [MeasurableSpace V] [BorelSpace V] [CompleteSpace V]
1395 {f : U → V} {f' : U → U →L[ℝ] V} {s : Set U} (hs : MeasurableSet s)
1396 (hf : Set.InjOn f s) (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x)
1397 (hker : ∀ x ∈ s, (f' x).ker = ⊥) :
1398 ∫⁻ x in s, ENNReal.ofReal (f' x).normDet = μHE[finrank ℝ U] (f '' s) := by
1399 classical
1400 have : TopologicalSpace.IsSeparable ((⨆ x ∈ s, (f' x).range) : Set V) := sorry
1401 let V' := (Submodule.span ℝ (f '' s) ⊔ (⨆ x ∈ s, (f' x).range)).topologicalClosure
1402 have : SecondCountableTopology V' := by
1403 apply TopologicalSpace.IsSeparable.secondCountableTopology
1404 apply TopologicalSpace.IsSeparable.closure
1405 rw [Submodule.coe_toAddSubmonoid, Submodule.span_sup]
1406 apply TopologicalSpace.IsSeparable.span
1407 apply TopologicalSpace.IsSeparable.union
1408 · apply ContinuousOn.isSeparable_image (fun x hx ↦ (hf' x hx).continuousWithinAt)
1409 exact TopologicalSpace.IsSeparable.of_subtype s
1411 sorry
1412 let g (x : U) : V' :=
1413 if x ∈ s then ⟨f x, sorry⟩ else 0
1414 let g' (x : U) : U →L[ℝ] V' :=
1415 if x ∈ s then (f' x).codRestrict V' sorry else 0
1416 have hg' : ∀ x ∈ s, HasFDerivWithinAt g (g' x) s x := sorry
1417 have hc : IsClosed (V' : Set V) := sorry
1418 obtain h := area_formula_injOn_ker_secondCountable hs sorry hg' sorry
1419 convert h
1420 · sorry
1421 · sorry-/
1424theorem area_sphere : μHE[2] (Metric.sphere 0 1 : Set (EuclideanSpace ℝ (Fin 3))) = sorry := by
1425 let s := (Metric.sphere 0 1 : Set (EuclideanSpace ℝ (Fin 3))) \
1426 ({!₂[0, 0, 1], !₂[0, 0, -1]})
1427 have hremove_points : μHE[2] (Metric.sphere 0 1 : Set (EuclideanSpace ℝ (Fin 3))) =
1428 μHE[finrank ℝ (EuclideanSpace ℝ (Fin 2))] s := by
1429 simp only [finrank_euclideanSpace, Fintype.card_fin]
1430 apply (MeasureTheory.measure_diff_null ?_).symm
1431 rw [MeasureTheory.Measure.euclideanHausdorffMeasure_def]
1432 simp only [Nat.cast_ofNat, Measure.smul_apply, Measure.nnreal_smul_coe_apply, mul_eq_zero,
1433 ENNReal.coe_eq_zero]
1434 right
1435 suffices μH[(2 : NNReal)] ({!₂[0, 0, 1], !₂[0, 0, -1]} : Set (EuclideanSpace ℝ (Fin 3))) = 0 by
1436 simpa
1437 apply hausdorffMeasure_of_dimH_lt
1438 rw [dimH_countable (by simp)]
1439 simp
1440 let f (p : EuclideanSpace ℝ (Fin 2)) : EuclideanSpace ℝ (Fin 3) :=
1441 !₂[Real.cos (p 0) * Real.cos (p 1), Real.cos (p 0) * Real.sin (p 1), Real.sin (p 0)]
1442 have hfderiv (p : EuclideanSpace ℝ (Fin 2)) :
1443 fderiv ℝ f p = (Matrix.toEuclideanLin
1444 !![-Real.sin (p 0) * Real.cos (p 1), -Real.cos (p 0) * Real.sin (p 1);
1445 -Real.sin (p 0) * Real.sin (p 1), Real.cos (p 0) * Real.cos (p 1);
1446 Real.cos (p 0), 0]
1447 ).toContinuousLinearMap := by
1448 ext v i
1449 fin_cases i
1450 · simp [f]
1451 sorry
1452 · sorry
1453 · sorry
1455 let t : Set (EuclideanSpace ℝ (Fin 2)) := WithLp.toLp 2 ''
1456 (Set.univ.pi ![Set.Ioo (-Real.pi / 2) (Real.pi / 2), Set.Ico 0 (2 * Real.pi)])
1458 have hmap : s = f '' t := sorry
1459 have hinj : Set.InjOn f t := sorry
1460 rw [hremove_points, hmap, area_formula_injective sorry sorry hinj]
1462 sorry

Mathlib/MeasureTheory/Function/Jacobian.lean +13 −5

theorem mul_le_addHaar_image_of_lt_det (A : E →L[ℝ] E) {m : ℝ≥0}
theorem _root_.ApproximatesLinearOn.norm_fderiv_sub_le changedL464–474
464/-- If a differentiable function `f` is approximated by a linear map `A` on a set `s`, up to `δ`,
465then at almost every `x` in `s` one has `‖f' x - A‖ ≤ δ`. -/
−theorem _root_.ApproximatesLinearOn.norm_fderiv_sub_le {A : E →L[ℝ] E} {δ : ℝ≥0}
− (hf : ApproximatesLinearOn f A s δ) (hs : MeasurableSet s) (f' : E → E →L[ℝ] E)
466theorem _root_.ApproximatesLinearOn.norm_fderiv_sub_le {E F : Type*} [NormedAddCommGroup E]
467 [NormedSpace ℝ E]
468 [FiniteDimensional ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F]
469 {s : Set E} {f : E → F} [MeasurableSpace E] [BorelSpace E]
470 {A : E →L[ℝ] F} {δ : ℝ≥0} (μ : Measure E) [IsAddHaarMeasure μ]
471 (hf : ApproximatesLinearOn f A s δ) (hs : MeasurableSet s) (f' : E → E →L[ℝ] F)
472 (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) : ∀ᵐ x ∂μ.restrict s, ‖f' x - A‖₊ ≤ δ := by
473 /- The conclusion will hold at the Lebesgue density points of `s` (which have full measure).
474 At such a point `x`, for any `z` and any `ε > 0` one has for small `r`
Lusin-Souslin theorem.
theorem aemeasurable_fderivWithin changedL690–700
690/-- The derivative of a function on a measurable set is almost everywhere measurable on this set
691with respect to Lebesgue measure. Note that, in general, it is not genuinely measurable there,
692as `f'` is not unique (but only on a set of measure `0`, as the argument shows). -/
−theorem aemeasurable_fderivWithin (hs : MeasurableSet s)
693theorem aemeasurable_fderivWithin {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
694 [FiniteDimensional ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [SecondCountableTopology F]
695 {s : Set E} {f : E → F} {f' : E → E →L[ℝ] F} [MeasurableSpace E] [BorelSpace E]
696 (μ : Measure E) [μ.IsAddHaarMeasure]
697 (hs : MeasurableSet s)
698 (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) : AEMeasurable f' (μ.restrict s) := by
699 /- It suffices to show that `f'` can be uniformly approximated by a measurable function.
700 Fix `ε > 0`. Thanks to `exists_partition_approximatesLinearOn_of_hasFDerivWithinAt`, one
theorem aemeasurable_fderivWithin (hs : MeasurableSet s)
708 have δpos : 0 < δ := εpos
709 -- partition `s` into sets `s ∩ t n` on which `f` is approximated by linear maps `A n`.
710 obtain ⟨t, A, t_disj, t_meas, t_cover, ht, _⟩ :
− ∃ (t : ℕ → Set E) (A : ℕ → E →L[ℝ] E),
711 ∃ (t : ℕ → Set E) (A : ℕ → E →L[ℝ] F),
712 Pairwise (Disjoint on t) ∧
713 (∀ n : ℕ, MeasurableSet (t n)) ∧
714 (s ⊆ ⋃ n : ℕ, t n) ∧
theorem aemeasurable_fderivWithin (hs : MeasurableSet s)
718 δpos.ne'
719 -- define a measurable function `g` which coincides with `A n` on `t n`.
720 obtain ⟨g, g_meas, hg⟩ :
− ∃ g : E → E →L[ℝ] E, Measurable g ∧ ∀ (n : ℕ) (x : E), x ∈ t n → g x = A n :=
721 ∃ g : E → E →L[ℝ] F, Measurable g ∧ ∀ (n : ℕ) (x : E), x ∈ t n → g x = A n :=
722 exists_measurable_piecewise t t_meas (fun n _ => A n) (fun n => measurable_const) <|
723 t_disj.mono fun i j h => by simp only [h.inter_eq, eqOn_empty]
724 refine ⟨g, g_meas.aemeasurable, ?_⟩

docs/references.bib +34 −0

@Book{ hartshorne61
2804 mrreviewer = {F. Oort}
2807@Article{ haruoyoshiohidetoki2006,
2808 author = {Yanai, Haruo and Takane, Yoshio and Ishii, Hidetoki},
2809 title = {Nonnegative determinant of a rectangular matrix: {Its}
2810 definition and applications to multivariate analysis},
2811 fjournal = {Linear Algebra and its Applications},
2812 journal = {Linear Algebra Appl.},
2813 issn = {0024-3795},
2814 volume = {417},
2815 number = {1},
2816 pages = {259--274},
2817 year = {2006},
2818 language = {English},
2819 doi = {10.1016/j.laa.2005.10.022},
2820 keywords = {15A15,62H20},
2821 zbmath = {5044090},
2822 zbl = {1105.15008}
2825@Book{ hatcher02,
2826 author = {Hatcher, Allen},
2827 title = {Algebraic topology},
@Book{ laumon-morel-bailly-2000
3683 mrnumber = {1771927}
3686@Book{ lawrenceronald2025,
3687 author = {Evans, Lawrence Craig and Gariepy, Ronald F.},
3688 title = {Measure theory and fine properties of functions},
3689 edition = {2nd edition},
3690 fseries = {Textbooks in Mathematics},
3691 series = {Textb. Math.},
3692 isbn = {978-1-032-94644-3; 978-1-003-58300-4},
3693 year = {2025},
3694 publisher = {Boca Raton, FL: CRC Press},
3695 language = {English},
3696 doi = {10.1201/9781003583004},
3697 keywords = {28-01,28A75,28A78,26B15,26B20,26B25},
3698 zbmath = {8010281},
3699 zbl = {1569.28001}
3702@Article{ lazarus1973,
3703 author = {Michel Lazarus},
3704 title = {Les familles libres maximales d'un module ont-elles le
0/73 declarations checked

Your review, as Markdown

Paste it as a comment or a review on the PR. Line links to the head commit unfold into code snippets on GitHub.