Download data/lean/OAI/Probability/LatticeSurface/Dynamics/ShiftAnalysis.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 19.9 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LatticeSurface/Dynamics/ShiftAnalysis.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/LatticeSurface/Dynamics/ShiftAnalysis.lean
-
curl -L -o ShiftAnalysis.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LatticeSurface/Dynamics/ShiftAnalysis.lean
19.9 kB
| import Mathlib | |
| import OAI.Probability.LatticeSurface.Dynamics.ClusterShift | |
| import OAI.Probability.LatticeSurface.Dynamics.JacobianIdentity | |
| import OAI.Probability.LatticeSurface.Dynamics.LogDet | |
| import OAI.Probability.LatticeSurface.Dynamics.MatrixJacobi | |
| import OAI.Probability.LatticeSurface.Dynamics.ShiftData | |
| namespace OAI | |
| open Set MeasureTheory intervalIntegral | |
| open Matrix Polynomial | |
| open scoped Topology | |
| open Set MeasureTheory Filter | |
| open scoped Topology | |
| namespace TangentialJacobian | |
| variable {V : Type*} [Fintype V] [DecidableEq V] | |
| lemma opNorm_le_of_row_sum (A : (V β β) βL[β] (V β β)) (K : β) (hK : 0 β€ K) | |
| (hrow : β i, β j, |asMatrix A i j| β€ K) : βAβ β€ K := by | |
| apply A.opNorm_le_bound hK | |
| intro v | |
| apply (pi_norm_le_iff_of_nonneg (mul_nonneg hK (norm_nonneg v))).mpr | |
| intro i | |
| have he : A v i = β j, asMatrix A i j * v j := by | |
| exact congrFun (LinearMap.toMatrix'_mulVec A.toLinearMap v).symm i | |
| rw [Real.norm_eq_abs, he] | |
| calc | |
| _ β€ β j, |asMatrix A i j| * |v j| := by | |
| simpa only [abs_mul] using Finset.abs_sum_le_sum_abs (fun j => asMatrix A i j * v j) Finset.univ | |
| _ β€ β j, |asMatrix A i j| * βvβ := by | |
| apply Finset.sum_le_sum; intro j _ | |
| exact mul_le_mul_of_nonneg_left (norm_le_pi_norm v j) (abs_nonneg _) | |
| _ = (β j, |asMatrix A i j|) * βvβ := (Finset.sum_mul _ _ _).symm | |
| _ β€ K * βvβ := mul_le_mul_of_nonneg_right (hrow i) (norm_nonneg _) | |
| end TangentialJacobian | |
| namespace FeasibleShift | |
| open TangentialJacobian | |
| variable {V : Type*} [Fintype V] [DecidableEq V] | |
| lemma freeShift_derivative_row (G : SimpleGraph V) (ground pins : Finset V) | |
| (Ξ² f : V β β) (h : FreeSites pins β β) | |
| (sβ sβ sβ L : β) (D : β) (hs : sβ < sβ) (hss : sβ < sβ) | |
| (hL : 0 β€ L) (hfground : β x β ground, f x = 0) | |
| (hfl : β x y, G.Adj x y β |f x - f y| β€ L) | |
| (hD : β x, (neighbors G x).card β€ D) | |
| (A : (FreeSites pins β β) βL[β] (FreeSites pins β β)) | |
| (hu : HasFDerivAt (freeShift G ground pins Ξ² f sβ sβ) A h) (x : FreeSites pins) : | |
| β j, |asMatrix A x j| β€ ((sβ - sβ)β»ΒΉ * (4 * D * L)) * | |
| ((component (contactGraph G (extendHeight pins Ξ² h) sβ) x).card : β)^2 := by | |
| classical | |
| have hd : 0 < sβ - sβ := sub_pos.mpr hs | |
| let C := component (contactGraph G (extendHeight pins Ξ² h) sβ) x | |
| let F : Finset (FreeSites pins) := Finset.univ.filter fun j => (j : V) β C | |
| have hFc : F.card β€ C.card := by | |
| apply Finset.card_le_card_of_injOn (fun j : FreeSites pins => (j : V)) | |
| Β· intro j hj; exact (Finset.mem_filter.mp hj).2 | |
| Β· intro j hj k hk hjk; exact Subtype.ext hjk | |
| have hsum : β j, |asMatrix A x j| = β j β F, |asMatrix A x j| := by | |
| symm | |
| apply Finset.sum_subset (Finset.subset_univ _) | |
| intro j _ hj | |
| have hj' : (j : V) β C := by simpa [F] using hj | |
| rw [asMatrix_apply, freeShift_derivative_entry_zero G ground pins Ξ² f h sβ sβ sβ L | |
| hs hss hL hfground hfl A hu x j hj', abs_zero] | |
| rw [hsum] | |
| calc | |
| _ β€ β j β F, ((sβ - sβ)β»ΒΉ * (4 * D * L)) * C.card := by | |
| apply Finset.sum_le_sum; intro j _ | |
| exact freeShift_derivative_entry G ground pins Ξ² f h sβ sβ sβ L D hs hss hL hfground hfl hD A hu x j | |
| _ β€ C.card * (((sβ - sβ)β»ΒΉ * (4 * D * L)) * C.card) := by | |
| simp only [Finset.sum_const, nsmul_eq_mul] | |
| exact mul_le_mul_of_nonneg_right (by exact_mod_cast hFc) (by positivity) | |
| _ = _ := by dsimp [C]; ring | |
| lemma freeShift_derivative_column (G : SimpleGraph V) (ground pins : Finset V) | |
| (Ξ² f : V β β) (h : FreeSites pins β β) | |
| (sβ sβ sβ L : β) (D : β) (hs : sβ < sβ) (hss : sβ < sβ) | |
| (hL : 0 β€ L) (hfground : β x β ground, f x = 0) | |
| (hfl : β x y, G.Adj x y β |f x - f y| β€ L) | |
| (hD : β x, (neighbors G x).card β€ D) | |
| (A : (FreeSites pins β β) βL[β] (FreeSites pins β β)) | |
| (hu : HasFDerivAt (freeShift G ground pins Ξ² f sβ sβ) A h) (j : FreeSites pins) : | |
| βA (Pi.single j 1)β β€ ((sβ - sβ)β»ΒΉ * (4 * D * L)) * | |
| (component (contactGraph G (extendHeight pins Ξ² h) sβ) j).card := by | |
| have hd : 0 < sβ - sβ := sub_pos.mpr hs | |
| apply (pi_norm_le_iff_of_nonneg (by positivity)).mpr | |
| intro x | |
| rw [Real.norm_eq_abs] | |
| by_cases hj : (j : V) β component (contactGraph G (extendHeight pins Ξ² h) sβ) x | |
| Β· have he := component_eq_of_reachable ((mem_component _ _ _).mp hj) | |
| rw [β he] | |
| exact freeShift_derivative_entry G ground pins Ξ² f h sβ sβ sβ L D hs hss hL hfground hfl hD A hu x j | |
| Β· rw [freeShift_derivative_entry_zero G ground pins Ξ² f h sβ sβ sβ L | |
| hs hss hL hfground hfl A hu x j hj, abs_zero] | |
| positivity | |
| lemma freeShift_derivative_cost (G : SimpleGraph V) (ground pins : Finset V) | |
| (Ξ² f : V β β) (h : FreeSites pins β β) | |
| (sβ sβ sβ L : β) (D : β) (hs : sβ < sβ) (hss : sβ < sβ) | |
| (hL : 0 β€ L) (hfground : β x β ground, f x = 0) | |
| (hfl : β x y, G.Adj x y β |f x - f y| β€ L) | |
| (hD : β x, (neighbors G x).card β€ D) | |
| (A : (FreeSites pins β β) βL[β] (FreeSites pins β β)) | |
| (hu : HasFDerivAt (freeShift G ground pins Ξ² f sβ sβ) A h) : | |
| jacobianCost A β€ ((sβ - sβ)β»ΒΉ * (4 * D * L)) ^ 2 * | |
| β x : FreeSites pins, if (x : V) β ground then 0 else | |
| ((component (contactGraph G (extendHeight pins Ξ² h) sβ) x).card : β) ^ 3 := by | |
| classical | |
| rw [jacobianCost, Finset.mul_sum] | |
| apply Finset.sum_le_sum | |
| intro x _ | |
| have hd : 0 < sβ - sβ := sub_pos.mpr hs | |
| by_cases hx : (x : V) β ground | |
| Β· simp only [ite_eq_left hx, mul_zero, asMatrix_apply, | |
| freeShift_derivative_ground G ground pins Ξ² f h sβ sβ A hu x _ hx, | |
| abs_zero, Finset.sum_const_zero, zero_mul, le_refl] | |
| rw [ite_eq_right hx] | |
| calc | |
| _ β€ (((sβ - sβ)β»ΒΉ * (4 * D * L)) * | |
| ((component (contactGraph G (extendHeight pins Ξ² h) sβ) x).card : β)^2) * | |
| (((sβ - sβ)β»ΒΉ * (4 * D * L)) * | |
| (component (contactGraph G (extendHeight pins Ξ² h) sβ) x).card) := | |
| mul_le_mul (freeShift_derivative_row G ground pins Ξ² f h sβ sβ sβ L D hs hss hL hfground hfl hD A hu x) | |
| (freeShift_derivative_column G ground pins Ξ² f h sβ sβ sβ L D hs hss hL hfground hfl hD A hu x) | |
| (norm_nonneg _) (by positivity) | |
| _ = _ := by ring | |
| lemma freeShift_derivative_opNorm (G : SimpleGraph V) (ground pins : Finset V) | |
| (Ξ² f : V β β) (h : FreeSites pins β β) | |
| (sβ sβ sβ L B : β) (D : β) (hs : sβ < sβ) (hss : sβ < sβ) | |
| (hL : 0 β€ L) (hB : 0 β€ B) (hfground : β x β ground, f x = 0) | |
| (hfl : β x y, G.Adj x y β |f x - f y| β€ L) | |
| (hD : β x, (neighbors G x).card β€ D) | |
| (hgood : β x, ((component (contactGraph G (extendHeight pins Ξ² h) sβ) x).card : β) β€ B) | |
| (A : (FreeSites pins β β) βL[β] (FreeSites pins β β)) | |
| (hu : HasFDerivAt (freeShift G ground pins Ξ² f sβ sβ) A h) : | |
| βAβ β€ ((sβ - sβ)β»ΒΉ * (4 * D * L)) * B ^ 2 := by | |
| have hd : 0 < sβ - sβ := sub_pos.mpr hs | |
| apply opNorm_le_of_row_sum A _ (by positivity) | |
| intro x | |
| exact (freeShift_derivative_row G ground pins Ξ² f h sβ sβ sβ L D hs hss hL hfground hfl hD A hu x).trans | |
| (mul_le_mul_of_nonneg_left ((sq_le_sqβ (by positivity) hB).mpr (hgood x)) (by positivity)) | |
| end FeasibleShift | |
| namespace FeasibleShift | |
| open TangentialJacobian | |
| variable {V : Type*} [Fintype V] [DecidableEq V] | |
| lemma freeShift_det_identity (Gβ G : SimpleGraph V) (ground pins walls : Finset V) | |
| (hp : pins β ground) (hw : walls β ground) | |
| (hG : β x y, Gβ.Adj x y β G.Adj x y β¨ (x β ground β§ y β ground)) | |
| (Ξ² f : V β β) (I : V β Set β) (sβ sβ M : β) (hs : sβ < sβ) (hsβ : 0 < sβ) | |
| (hM : 0 β€ M) (hfb : β x, |f x| β€ M) | |
| (hP : MeasurableSet (heightPolytope Gβ pins walls Ξ² I)) : | |
| β Ξ΄ : β, 0 < Ξ΄ β§ β t β Set.Ioo (-Ξ΄) Ξ΄, | |
| β« h in heightPolytope Gβ pins walls Ξ² I, | |
| (1 + t β’ fderiv β (freeShift G ground pins Ξ² f sβ sβ) h).det = | |
| (volume (heightPolytope Gβ pins walls Ξ² I)).toReal := by | |
| have hdiff : 0 < sβ - sβ := sub_pos.mpr hs | |
| let K : NNReal := β¨(sβ - sβ)β»ΒΉ * (4 * M * Fintype.card (V Γ V)), by positivityβ© | |
| let Ξ΄ : β := min (sβ / (2 * M + 1)) (1 / (K + 1)) | |
| have hΞ΄ : 0 < Ξ΄ := lt_min (by positivity) (by positivity) | |
| refine β¨Ξ΄, hΞ΄, ?_β© | |
| intro t ht | |
| have ht' : |t| < Ξ΄ := abs_lt.mpr ht | |
| have htM : |t| * (2 * M) β€ sβ := by | |
| have hh := (lt_div_iffβ (show 0 < 2 * M + 1 by positivity)).mp | |
| (ht'.trans_le (min_le_left _ _)) | |
| nlinarith [abs_nonneg t] | |
| have htK : |t| * K < 1 := by | |
| have hh := (lt_div_iffβ (show 0 < (K : β) + 1 by positivity)).mp | |
| (ht'.trans_le (min_le_right _ _)) | |
| nlinarith [abs_nonneg t] | |
| have hu : LipschitzWith K (freeShift G ground pins Ξ² f sβ sβ) := | |
| freeShift_lipschitz G ground pins Ξ² f sβ sβ M hs hM hfb | |
| exact det_integral_of_invariant _ K hu _ hP t htK | |
| (identity_add_bijective _ K hu t htK).injective.injOn | |
| (freeShift_small_polytope_onto Gβ G ground pins walls hp hw hG Ξ² f I sβ sβ M t | |
| hs hsβ.le hM hfb htM htK) | |
| lemma freeShift_divergence_identities (Gβ G : SimpleGraph V) (ground pins walls : Finset V) | |
| (hp : pins β ground) (hw : walls β ground) | |
| (hG : β x y, Gβ.Adj x y β G.Adj x y β¨ (x β ground β§ y β ground)) | |
| (Ξ² f : V β β) (I : V β Set β) (sβ sβ M : β) (hs : sβ < sβ) (hsβ : 0 < sβ) | |
| (hM : 0 β€ M) (hfb : β x, |f x| β€ M) | |
| (hP : MeasurableSet (heightPolytope Gβ pins walls Ξ² I)) | |
| (hPfin : volume (heightPolytope Gβ pins walls Ξ² I) β β€) : | |
| (β« h in heightPolytope Gβ pins walls Ξ² I, | |
| (asMatrix (fderiv β (freeShift G ground pins Ξ² f sβ sβ) h)).trace) = 0 β§ | |
| (β« h in heightPolytope Gβ pins walls Ξ² I, | |
| (asMatrix (fderiv β (freeShift G ground pins Ξ² f sβ sβ) h)).trace ^ 2) = | |
| (β« h in heightPolytope Gβ pins walls Ξ² I, | |
| (asMatrix (fderiv β (freeShift G ground pins Ξ² f sβ sβ) h * | |
| fderiv β (freeShift G ground pins Ξ² f sβ sβ) h)).trace) := by | |
| let P := heightPolytope Gβ pins walls Ξ² I | |
| let u := freeShift G ground pins Ξ² f sβ sβ | |
| have hdiff : 0 < sβ - sβ := sub_pos.mpr hs | |
| let K : NNReal := β¨(sβ - sβ)β»ΒΉ * (4 * M * Fintype.card (V Γ V)), by positivityβ© | |
| have hu : LipschitzWith K u := freeShift_lipschitz G ground pins Ξ² f sβ sβ M hs hM hfb | |
| let : IsFiniteMeasure (volume.restrict P) := β¨by simpa [P] using hPfin.lt_topβ© | |
| obtain β¨Ξ΄, hΞ΄, hidβ© := freeShift_det_identity Gβ G ground pins walls hp hw hG Ξ² f I sβ sβ M | |
| hs hsβ hM hfb hP | |
| have hid' : β t β Set.Ioo (-Ξ΄) Ξ΄, β« h, (1 + t β’ fderiv β u h).det β(volume.restrict P) = | |
| ((volume.restrict P) Set.univ).toReal := by simpa [P, u] using hid | |
| refine β¨trace_integral_zero_of_det_identity (volume.restrict P) (fderiv β u) | |
| (measurable_fderiv β u) K (fun h => norm_fderiv_le_of_lipschitz β hu) Ξ΄ hΞ΄ hid', | |
| trace_square_integral_of_det_identity (volume.restrict P) (fderiv β u) | |
| (measurable_fderiv β u) K (fun h => norm_fderiv_le_of_lipschitz β hu) Ξ΄ hΞ΄ hid'β© | |
| end FeasibleShift | |
| namespace TangentialJacobian | |
| variable {V : Type*} [Fintype V] [DecidableEq V] | |
| lemma continuous_trace : Continuous (fun A : (V β β) βL[β] (V β β) => (asMatrix A).trace) := by | |
| simp_rw [β traceCLM_apply] | |
| exact (traceCLM (V := V)).continuous | |
| lemma continuous_jacobianCost : Continuous (jacobianCost : ((V β β) βL[β] (V β β)) β β) := by | |
| unfold jacobianCost | |
| apply continuous_finsetSum | |
| intro i _ | |
| apply Continuous.mul | |
| Β· apply continuous_finsetSum | |
| intro j _ | |
| simp only [asMatrix_apply] | |
| fun_prop | |
| Β· fun_prop | |
| omit [DecidableEq V] in | |
| lemma uniform_image_area (P S : Set (V β β)) (hP : MeasurableSet P) (hS : MeasurableSet S) | |
| (hSP : S β P) (T : (V β β) β (V β β)) (K : NNReal) (hT : LipschitzWith K T) | |
| (hinj : Set.InjOn T S) (hTP : T '' S β P) : | |
| (ProbabilityTheory.cond volume P).real (T '' S) = | |
| β« x in S, |(fderiv β T x).det| β(ProbabilityTheory.cond volume P) := by | |
| have harea := lipschitz_area hT hS hinj | |
| have he : P β© (T '' S) = T '' S := Set.inter_eq_right.mpr hTP | |
| rw [measureReal_def, ProbabilityTheory.cond_apply hP, he, ENNReal.toReal_mul, | |
| ProbabilityTheory.cond, Measure.restrict_smul, Measure.restrict_restrict hS, | |
| Set.inter_eq_left.mpr hSP, MeasureTheory.integral_smul_measure] | |
| congr 1 | |
| symm | |
| calc | |
| _ = (β«β» x in S, ENNReal.ofReal |(fderiv β T x).det|).toReal := | |
| integral_eq_lintegral_of_nonneg_ae (Filter.Eventually.of_forall fun x => abs_nonneg _) | |
| ((ContinuousLinearMap.continuous_det.measurable.comp (measurable_fderiv β T)).abs.aestronglyMeasurable) | |
| _ = _ := congrArg ENNReal.toReal harea | |
| omit [DecidableEq V] in | |
| lemma jacobian_integrable {Ξ© : Type*} [MeasurableSpace Ξ©] (ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] | |
| (B : Ξ© β (V β β) βL[β] (V β β)) (hB : Measurable B) (K : β) | |
| (hK : β x, βB xβ β€ K) : Integrable (fun x => |(B x).det|) ΞΌ := | |
| continuous_integrable_of_bounded ΞΌ B hB K hK _ (ContinuousLinearMap.continuous_det.abs) | |
| omit [DecidableEq V] in | |
| lemma uniform_image_lower_bound (P S : Set (V β β)) (hP : MeasurableSet P) (hS : MeasurableSet S) | |
| (hSP : S β P) (hPzero : volume P β 0) (hPfin : volume P β β€) | |
| (T : (V β β) β (V β β)) (K : NNReal) (hT : LipschitzWith K T) | |
| (hinj : Set.InjOn T S) (hTP : T '' S β P) (c : β) | |
| (hdet : βα΅ x β(volume.restrict S), c β€ |(fderiv β T x).det|) : | |
| c * (ProbabilityTheory.cond volume P).real S β€ | |
| (ProbabilityTheory.cond volume P).real (T '' S) := by | |
| let ΞΌ := ProbabilityTheory.cond volume P | |
| let : IsProbabilityMeasure ΞΌ := ProbabilityTheory.cond_isProbabilityMeasure_of_finite hPzero hPfin | |
| rw [uniform_image_area P S hP hS hSP T K hT hinj hTP] | |
| have hdet' : βα΅ x β(ΞΌ.restrict S), c β€ |(fderiv β T x).det| := by | |
| have hab : ΞΌ.restrict S βͺ volume.restrict S := | |
| (show ΞΌ βͺ volume from ProbabilityTheory.cond_absolutelyContinuous).restrict S | |
| exact hab.ae_le hdet | |
| have hi := jacobian_integrable ΞΌ (fderiv β T) (measurable_fderiv β T) K | |
| (fun x => norm_fderiv_le_of_lipschitz β hT) | |
| have hh := integral_mono_ae (integrable_const c : Integrable (fun _ : V β β => c) (ΞΌ.restrict S)) | |
| hi.integrableOn hdet' | |
| simpa only [MeasureTheory.integral_const, Measure.restrict_apply_univ, smul_eq_mul, mul_comm, | |
| measureReal_def] using hh | |
| end TangentialJacobian | |
| namespace TangentialJacobian | |
| variable {V : Type*} [Fintype V] [DecidableEq V] | |
| lemma markov_real {Ξ© : Type*} [MeasurableSpace Ξ©] (ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] | |
| (F : Ξ© β β) (hF : Integrable F ΞΌ) (hn : β x, 0 β€ F x) (K : β) (hK : 0 < K) : | |
| ΞΌ.real {x | K < F x} β€ (β« x, F x βΞΌ) / K := by | |
| apply (le_div_iffβ hK).mpr | |
| have hh := mul_meas_ge_le_integral_of_nonneg (Filter.Eventually.of_forall hn) hF K | |
| have hm : ΞΌ.real {x | K < F x} β€ ΞΌ.real {x | K β€ F x} := | |
| measureReal_mono (fun x (hx : K < F x) => le_of_lt hx) | |
| nlinarith | |
| lemma event_volume_of_moments (P G : Set (V β β)) (hP : MeasurableSet P) | |
| (hG : MeasurableSet G) (hPzero : volume P β 0) (hPfin : volume P β β€) | |
| (u : (V β β) β (V β β)) (Klip : NNReal) (hu : LipschitzWith Klip u) | |
| (hinj : Set.InjOn (fun x => x + u x) G) | |
| (hfeas : β x β P β© G, x + u x β P) | |
| (hnorm : β x β G, βfderiv β u xβ β€ 1/2) | |
| (C p K : β) (_hp : 0 < p) (hK : 1 β€ K) | |
| (hmoment : (β« x, (asMatrix (fderiv β u x)).trace ^ 2 + jacobianCost (fderiv β u x) | |
| β(ProbabilityTheory.cond volume P)) β€ C) | |
| (hCK : C / K β€ p/4) | |
| (hbad : (ProbabilityTheory.cond volume P).real GαΆ β€ p/4) | |
| (E : Set (V β β)) (hE : MeasurableSet E) | |
| (hEp : p β€ (ProbabilityTheory.cond volume P).real E) : | |
| β S : Set (V β β), MeasurableSet S β§ S β E β© P β© G β§ | |
| p/2 β€ (ProbabilityTheory.cond volume P).real S β§ | |
| Set.InjOn (fun x => x + u x) S β§ (fun x => x + u x) '' S β P β§ | |
| MeasurableSet ((fun x => x + u x) '' S) β§ | |
| Real.exp (-2*K) * p/2 β€ (ProbabilityTheory.cond volume P).real ((fun x => x + u x) '' S) := by | |
| let ΞΌ := ProbabilityTheory.cond volume P | |
| let : IsProbabilityMeasure ΞΌ := ProbabilityTheory.cond_isProbabilityMeasure_of_finite hPzero hPfin | |
| let A := fderiv β u | |
| let F := fun x => (asMatrix (A x)).trace ^ 2 + jacobianCost (A x) | |
| have hFc : Continuous (fun B : (V β β) βL[β] (V β β) => (asMatrix B).trace ^ 2 + jacobianCost B) := | |
| (continuous_trace.pow 2).add continuous_jacobianCost | |
| have hFm : Measurable F := hFc.measurable.comp (measurable_fderiv β u) | |
| have hFi : Integrable F ΞΌ := continuous_integrable_of_bounded ΞΌ A (measurable_fderiv β u) Klip | |
| (fun x => norm_fderiv_le_of_lipschitz β hu) _ hFc | |
| have hFn (x) : 0 β€ F x := add_nonneg (sq_nonneg _) (jacobianCost_nonneg _) | |
| let B := GαΆ βͺ {x | K < F x} | |
| have hBm : MeasurableSet B := hG.compl.union (measurableSet_lt measurable_const hFm) | |
| have hBm_bound : ΞΌ.real B β€ p/2 := by | |
| have hmark := markov_real ΞΌ F hFi hFn K (by linarith) | |
| have hquot : (β« x, F x βΞΌ) / K β€ C / K := div_le_div_of_nonneg_right hmoment (by linarith) | |
| have hh := measureReal_union_le (ΞΌ := ΞΌ) GαΆ {x | K < F x} | |
| dsimp [B] | |
| linarith | |
| let S := (E β© P) \ B | |
| have hSm : MeasurableSet S := (hE.inter hP).diff hBm | |
| have hSsub : S β E β© P β© G := by | |
| intro x hx | |
| exact β¨hx.1, by by_contra hg; exact hx.2 (Or.inl hg)β© | |
| have hSmass : p/2 β€ ΞΌ.real S := by | |
| have heq : ΞΌ.real (E β© P) = ΞΌ.real E := by | |
| unfold Measure.real | |
| congr 1 | |
| rw [Set.inter_comm, ProbabilityTheory.cond_inter_self hP] | |
| have hh := le_measureReal_sdiff (ΞΌ := ΞΌ) (sβ := E β© P) (sβ := B) | |
| rw [heq] at hh | |
| linarith | |
| have hSinj : Set.InjOn (fun x => x + u x) S := hinj.mono (fun x hx => (hSsub hx).2) | |
| have hSP : S β P := fun x hx => (hSsub hx).1.2 | |
| have hSTP : (fun x => x + u x) '' S β P := by | |
| rintro y β¨x, hx, rflβ© | |
| exact hfeas x β¨hSP hx, (hSsub hx).2β© | |
| have hSTm : MeasurableSet ((fun x => x + u x) '' S) := | |
| hSm.image_of_continuousOn_injOn (continuous_id.add hu.continuous).continuousOn hSinj | |
| have hdet : βα΅ x β(volume.restrict S), Real.exp (-2*K) β€ |(fderiv β (fun x => x + u x) x).det| := by | |
| filter_upwards [ae_restrict_mem hSm, ae_restrict_of_ae (ae_fderiv_id_add_smul hu 1)] with x hx hdx | |
| have hdx' : fderiv β (fun x => x + u x) x = 1 + A x := by simpa [A] using hdx | |
| rw [hdx'] | |
| have hAx := hnorm x ((hSsub hx).2) | |
| have hFK : F x β€ K := le_of_not_gt (fun h => hx.2 (Or.inr h)) | |
| have ht : |(asMatrix (A x)).trace| β€ K := by | |
| have hcost := jacobianCost_nonneg (A x) | |
| have habsq := sq_abs (asMatrix (A x)).trace | |
| have hab := abs_nonneg (asMatrix (A x)).trace | |
| dsimp [F] at hFK | |
| nlinarith | |
| have hc : jacobianCost (A x) β€ K := by | |
| dsimp [F] at hFK | |
| nlinarith [sq_nonneg (asMatrix (A x)).trace] | |
| have hlog := logdet_lower_bound (A x) hAx | |
| have hpos := det_one_add_pos (A x) (hAx.trans_lt (by norm_num)) | |
| rw [abs_of_pos hpos, β Real.exp_log hpos] | |
| apply Real.exp_le_exp.mpr | |
| have htt := (abs_le.mp ht).1 | |
| linarith | |
| have harea := uniform_image_lower_bound P S hP hSm hSP hPzero hPfin | |
| (fun x => x + u x) (1 + Klip) (by simpa using lipschitz_id_add_smul hu 1) | |
| hSinj hSTP (Real.exp (-2*K)) hdet | |
| refine β¨S, hSm, hSsub, hSmass, hSinj, hSTP, hSTm, ?_β© | |
| have hexp : 0 β€ Real.exp (-2*K) := (Real.exp_pos _).le | |
| nlinarith [mul_le_mul_of_nonneg_left hSmass hexp] | |
| end TangentialJacobian | |
| end OAI | |