diff --git a/LeanPool/OSforGFF/Bochner/FejerPD.lean b/LeanPool/OSforGFF/Bochner/FejerPD.lean index db132ad1eb..a2687d351c 100644 --- a/LeanPool/OSforGFF/Bochner/FejerPD.lean +++ b/LeanPool/OSforGFF/Bochner/FejerPD.lean @@ -315,11 +315,11 @@ private lemma closedBall_sub_norm_subset (v : V) (R : ℝ) : intro x hx simp only [Metric.mem_closedBall, dist_zero_right] at hx constructor - · exact Metric.mem_closedBall.mpr (by rw [dist_zero_right]; linarith [norm_nonneg v]) + · exact Metric.mem_closedBall.mpr (by rw [dist_zero_right]; linarith only [hx, norm_nonneg v]) · refine Metric.mem_closedBall.mpr ?_ have h1 : dist x v ≤ dist x 0 + dist 0 v := dist_triangle x 0 v simp only [dist_zero_right, dist_zero_left] at h1 - linarith + linarith only [hx, h1] /-- The real volume of a centered closed ball as a power of the radius. -/ private lemma volume_closedBall_toReal_eq (r : ℝ) (hr : 0 ≤ r) : @@ -355,8 +355,8 @@ private lemma overlapRatio_tendsto_one (v : V) : (by filter_upwards [Filter.eventually_gt_atTop (⌈‖v‖⌉₊)] with n hn have hn_gt : ‖v‖ < (n : ℝ) := lt_of_le_of_lt (Nat.le_ceil _) (Nat.cast_lt.mpr hn) - have hn_pos : (0 : ℝ) < n := by linarith [norm_nonneg v] - have hsub_nn : (0 : ℝ) ≤ ↑n - ‖v‖ := by linarith + have hn_pos : (0 : ℝ) < n := by linarith only [hn_gt, norm_nonneg v] + have hsub_nn : (0 : ℝ) ≤ ↑n - ‖v‖ := by linarith only [hn_gt] have hvol_pos := Metric.measure_closedBall_pos (volume : Measure V) 0 hn_pos have hvol_ne_top : volume (Metric.closedBall (0 : V) (↑n)) ≠ ⊤ := ne_of_lt measure_closedBall_lt_top @@ -403,7 +403,7 @@ private lemma inner_integral_sub (ψ : V → ℂ) (x : V) (R : ℝ) : (Metric.closedBall x R).indicator ψ (x - y) := by intro y simp only [Set.indicator, Metric.mem_closedBall] - simp_all + simp_all only [dist_zero_right, dist_self_sub_left] simp_rw [hind] simp_rw [sub_eq_add_neg] have h1 : ∫ y : V, (Metric.closedBall x R).indicator ψ (x + -y) = @@ -455,10 +455,10 @@ private lemma integrable_indicator_prod (ψ : V → ℂ) (hcont : Continuous ψ) simp only [Metric.mem_closedBall, Prod.dist_eq] at hdist ⊢ simp only [Prod.fst_zero, Prod.snd_zero, dist_zero_right] apply max_le - · linarith [le_abs_self R, abs_nonneg R] + · linarith only [hx, le_abs_self R, abs_nonneg R] · have hv : ‖v‖ ≤ ‖x‖ + ‖v - x‖ := norm_le_insert' v x rw [← dist_eq_norm, dist_comm] at hv - linarith [le_abs_self R] + linarith only [hdist, hx, hv, le_abs_self R] exact ((hcont.comp continuous_snd).continuousOn.integrableOn_compact (Metric.isCompact_of_isClosed_isBounded hS_closed hS_bdd)).integrable_indicator hS_closed.measurableSet @@ -495,7 +495,8 @@ private lemma fejer_avg_eq_integral (ψ : V → ℂ) (hcont : Continuous ψ) by_cases hx : x ∈ B · rw [Set.indicator_of_mem hx]; congr 1; funext v rw [← indicator_closedBall_inter ψ R x v, Set.indicator_of_mem hx] - · simp_all + · simp_all only [ne_eq, not_false_eq_true, Set.indicator_of_notMem, Set.mem_inter_iff, + Metric.mem_closedBall, false_and, integral_zero] -- Suffices: prove the unscaled Fubini identity, then handle scaling suffices h_fubini : ∫ x in B, ∫ v in Metric.closedBall x R, ψ v = ∫ v, (volume (B ∩ Metric.closedBall v R)).toReal • ψ v by @@ -592,7 +593,7 @@ theorem pd_l1_fourier_re_nonneg_theorem change ∫ v, 𝐞 (-(innerSL ℝ v ξ)) • φ v = _ congr 1; ext v rw [Circle.smul_def, Real.fourierChar_apply, smul_eq_mul, mul_comm] - simp_all + simp_all only [coe_innerSL_apply, mul_neg, ofReal_neg, ofReal_mul, ofReal_ofNat, neg_mul] rw [hF] -- Step 2: The integrand is ψ(v) where ψ = φ · exp(2πi⟨·,-ξ⟩) is PD have hψ_eq : (fun v => φ v * cexp (-(2 * ↑π * ↑⟪v, ξ⟫_ℝ * I))) = diff --git a/LeanPool/OSforGFF/Bochner/Main.lean b/LeanPool/OSforGFF/Bochner/Main.lean index 5a3b9f002f..6820cceaf6 100644 --- a/LeanPool/OSforGFF/Bochner/Main.lean +++ b/LeanPool/OSforGFF/Bochner/Main.lean @@ -104,7 +104,7 @@ private lemma gaussian_cexp_integrable (t : ℝ) (ht : 0 < t) : Integrable (fun x : V => cexp (-(t : ℂ) * ↑(‖x‖ ^ 2))) := by have := GaussianFourier.integrable_cexp_neg_mul_sq_norm_add (V := V) (b := (t : ℂ)) (show 0 < ((t : ℂ)).re from by simp [ht]) 0 (0 : V) - simp_all + simp_all only [neg_mul, inner_zero_left, ofReal_zero, mul_zero, add_zero, ofReal_pow] /-- The double sum ∑ᵢ ∑ⱼ conj(aᵢ) * aⱼ equals normSq(∑ₖ aₖ). -/ private lemma sum_star_mul_eq_normSq {m : ℕ} (a : Fin m → ℂ) : @@ -133,7 +133,7 @@ omit [FiniteDimensional ℝ V] in lemma isPositiveDefinite_charFun (μ : Measure V) [IsFiniteMeasure μ] : IsPositiveDefinite (fun t : V => charFun μ t) where hermitian t := by - simp_all + simp_all only [charFun_neg] nonneg m t c := by -- Step 1: Unfold charFun simp only [charFun_apply] @@ -212,7 +212,7 @@ lemma isPositiveDefinite_charFun (μ : Measure V) [IsFiniteMeasure μ] : -- hre_swap : ∫ reCLM ↑(normSq ...) = reCLM (∫ ↑(normSq ...)) -- LHS simplifies: reCLM ↑r = r, so LHS = ∫ normSq ... -- RHS is reCLM applied to integral, which = (integral).re - simp_all + simp_all only [ofReal_neg, neg_mul, reCLM_apply, ofReal_re] omit [FiniteDimensional ℝ V] in /-- Pointwise product of a PD function and the characteristic function of a @@ -226,7 +226,7 @@ lemma isPositiveDefinite_mul_charFun {φ : V → ℂ} (hpd : IsPositiveDefinite hermitian t := by change φ (-t) * charFun μ (-t) = (starRingEnd ℂ) (φ t * charFun μ t) rw [map_mul, ← hpd.hermitian t] - simp_all + simp_all only [charFun_neg] nonneg m t c := by simp only [charFun_apply] -- Integrability of exponentials on a finite measure (norm ≤ 1) @@ -425,7 +425,7 @@ lemma gaussianRegularize_pd (φ : V → ℂ) (hpd : IsPositiveDefinite φ) hermitian x := by simp only [gaussianRegularize, norm_neg] rw [hpd.hermitian x, starRingEnd_apply, star_def, map_mul, ← Complex.exp_conj] - simp_all + simp_all only [ofReal_pow, neg_mul, map_neg, map_mul, conj_ofReal, map_pow] nonneg m x c := by -- gaussianRegularize φ ε = fun t => φ t * cexp(...) -- By gaussian_eq_charFun, cexp(-ε‖t‖²) = charFun μ t for some Gaussian μ @@ -534,7 +534,7 @@ lemma pd_l1_fourier_nonneg (φ : V → ℂ) (hpd : IsPositiveDefinite φ) -- Change variables: v → -v have hsub := integral_neg_eq_self (fun v => (↑(𝐞 (⟪v, ξ⟫_ℝ)) : ℂ) * φ (-v)) (volume : Measure V) - simp_all + simp_all only [inner_neg_left, neg_neg] have him : (𝓕 φ ξ).im = 0 := by have := congr_arg Complex.im hft_conj simp only [Complex.conj_im] at this @@ -770,7 +770,8 @@ private lemma integral_norm_ft_gaussian_eq_one (t : ℝ) (ht : 0 < t) : have hnorm_eq_re : ∀ w : V, ‖𝓕 g w‖ = (𝓕 g w).re := by intro w; have ⟨hre, him⟩ := hft_nonneg w rw [← RCLike.sqrt_normSq_eq_norm, RCLike.normSq_apply] - simp_all + simp_all only [RCLike.re_to_complex, RCLike.im_to_complex, mul_zero, add_zero, + Real.sqrt_mul_self] -- ∫ ‖𝓕 g‖ = ∫ (𝓕 g).re = Re(∫ 𝓕 g) = Re(1) = 1 simp_rw [hnorm_eq_re, show ∀ x : V, (𝓕 g x).re = RCLike.re (𝓕 g x) from fun _ => rfl] rw [integral_re hft_int] @@ -937,7 +938,7 @@ theorem gaussianRegularize_ft_integrable (φ : V → ℂ) /-- 1 - exp(-x) ≤ x for x ≥ 0. From Mathlib: 1 - x ≤ exp(-x) rearranged. -/ private lemma one_sub_exp_neg_le {x : ℝ} (_hx : 0 ≤ x) : 1 - Real.exp (-x) ≤ x := by - linarith [Real.one_sub_le_exp_neg x] + linarith only [Real.one_sub_le_exp_neg x] omit [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] [MeasurableSpace V] [BorelSpace V] in /-- Bound on ‖1 - gaussianRegularize φ ε v‖ in terms of ‖1 - φ v‖ and ‖v‖². @@ -1004,12 +1005,12 @@ private lemma charFun_measure_inner_bound (φ : V → ℂ) _ = C + t ^ 2 * ‖y‖ ^ 2 := by rw [norm_smul, Real.norm_eq_abs, mul_pow, sq_abs] _ ≤ C + (2 * r⁻¹) ^ 2 * ‖y‖ ^ 2 := by - have hle : -(2 * r⁻¹) ≤ 2 * r⁻¹ := by linarith [inv_pos.mpr hr] + have hle : -(2 * r⁻¹) ≤ 2 * r⁻¹ := by linarith only [hr, inv_pos.mpr hr] rw [Set.uIoc_of_le hle] at ht - have h_abs : |t| ≤ 2 * r⁻¹ := abs_le.mpr ⟨by linarith [ht.1.le], ht.2⟩ + have h_abs : |t| ≤ 2 * r⁻¹ := abs_le.mpr ⟨by linarith only [ht, ht.1.le], ht.2⟩ have h_sq : t ^ 2 ≤ (2 * r⁻¹) ^ 2 := by rw [← sq_abs t]; exact pow_le_pow_left₀ (abs_nonneg t) h_abs 2 - nlinarith [sq_nonneg ‖y‖] + nlinarith only [h_sq, sq_nonneg ‖y‖] _ = C + 4 * ‖y‖ ^ 2 * r⁻¹ ^ 2 := by ring have hnorm_bound := intervalIntegral.norm_integral_le_of_norm_le_const hdeviation_bound -- Combine: μ.real ≤ 2⁻¹ * r * ‖∫...‖ ≤ 2⁻¹ * r * ((C + 4‖y‖²/r²) * (4/r)) @@ -1084,15 +1085,15 @@ theorem gaussianRegularize_measures_tight (φ : V → ℂ) have hR1 : 2 * ‖y‖ / η + 1 ≤ r := (le_max_left _ _).trans hr -- 2‖y‖ < η * r since 2‖y‖/η + 1 ≤ r and η > 0 have h1 : 2 * ‖y‖ < η * r := by - have h2 : 2 * ‖y‖ / η < r := by linarith - rw [div_lt_iff₀ hη] at h2; linarith + have h2 : 2 * ‖y‖ / η < r := by linarith only [hR1] + rw [div_lt_iff₀ hη] at h2; linarith only [h2] rwa [mul_inv_lt_iff₀ hr_pos] -- For r ≥ R: 8‖y‖²/r² < δ/2 have hsmall2 : 8 * ‖y‖ ^ 2 * r⁻¹ ^ 2 < δ / 2 := by have hR2 : Real.sqrt (16 * ‖y‖ ^ 2 / δ) + 1 ≤ r := (le_max_left _ _ |>.trans (le_max_right _ _)).trans hr -- r² > 16‖y‖²/δ since r > sqrt(16‖y‖²/δ) - have hsqrt_le : Real.sqrt (16 * ‖y‖ ^ 2 / δ) < r := by linarith + have hsqrt_le : Real.sqrt (16 * ‖y‖ ^ 2 / δ) < r := by linarith only [hR2] have hr_sq : 16 * ‖y‖ ^ 2 / δ < r ^ 2 := by calc 16 * ‖y‖ ^ 2 / δ ≤ Real.sqrt (16 * ‖y‖ ^ 2 / δ) ^ 2 := @@ -1101,7 +1102,7 @@ theorem gaussianRegularize_measures_tight (φ : V → ℂ) rw [inv_pow, mul_inv_lt_iff₀ (sq_pos_of_pos hr_pos)] -- hr_sq: 16 * ‖y‖² / δ < r², i.e. 16 * ‖y‖² < δ * r² rw [div_lt_iff₀ hδ_pos] at hr_sq - linarith + linarith only [hr_sq] -- Bound for each μ ∈ S have hmu_bound : ∀ μ ∈ S, μ {x | r < ‖⟪y, x⟫_ℝ‖} ≤ ENNReal.ofReal δ := by intro μ hμS @@ -1121,9 +1122,9 @@ theorem gaussianRegularize_measures_tight (φ : V → ℂ) calc |t| * ‖y‖ ≤ 2 * r⁻¹ * ‖y‖ := by gcongr -- t ∈ uIoc (-(2*r⁻¹)) (2*r⁻¹) implies |t| ≤ 2*r⁻¹ - have hle : -(2 * r⁻¹) ≤ 2 * r⁻¹ := by linarith [inv_pos.mpr hr_pos] + have hle : -(2 * r⁻¹) ≤ 2 * r⁻¹ := by linarith only [hr_pos, inv_pos.mpr hr_pos] rw [Set.uIoc_of_le hle] at ht - exact abs_le.mpr ⟨by linarith [ht.1.le], ht.2⟩ + exact abs_le.mpr ⟨by linarith only [ht, ht.1.le], ht.2⟩ _ = 2 * ‖y‖ * r⁻¹ := by ring _ < η := hsmall have hreal_bound := charFun_measure_inner_bound φ hpd hnorm hε hε1 hcf hr_pos @@ -1131,9 +1132,10 @@ theorem gaussianRegularize_measures_tight (φ : V → ℂ) -- μ.real {r < |⟪y,x⟫|} ≤ 2*(δ/4) + 8‖y‖²/r² = δ/2 + 8‖y‖²/r² < δ -- Convert from μ.real to μ (ENNReal) rw [show μ {x | r < |⟪y, x⟫_ℝ|} = ENNReal.ofReal (μ.real {x | r < |⟪y, x⟫_ℝ|}) from by - simp_all] + simp_all only [gt_iff_lt, inv_pow, Real.norm_eq_abs, ne_eq, measure_ne_top, + not_false_eq_true, ofReal_measureReal]] apply ENNReal.ofReal_le_ofReal - linarith + linarith only [hsmall2, hreal_bound] -- Step 5: Conclude iSup ≤ ENNReal.ofReal δ < a calc ⨆ μ ∈ S, μ {x | r < ‖⟪y, x⟫_ℝ‖} ≤ ENNReal.ofReal δ := iSup₂_le hmu_bound @@ -1174,7 +1176,7 @@ private theorem bochner_charFun_eq (φ : V → ℂ) {μ : ProbabilityMeasure V} -- So charFun(μ_seq (f n))(ξ) → charFun(μ)(ξ) have hcharfun_conv : Tendsto (fun n => charFun (μ_seq (f n) : Measure V) ξ) atTop (𝓝 (charFun (μ : Measure V) ξ)) := by - simp_all + simp_all only [one_div, BoundedContinuousFunction.coe_ofNormedAddCommGroup] -- Also charFun(μ_seq (f n))(ξ) = gaussianRegularize φ (1/(f n + 1)) ξ → φ ξ have hcharfun_vals : ∀ n, charFun (μ_seq (f n) : Measure V) ξ = gaussianRegularize φ (1 / (↑(f n) + 1)) ξ := @@ -1193,7 +1195,7 @@ private theorem bochner_charFun_eq (φ : V → ℂ) {μ : ProbabilityMeasure V} (gaussianRegularize_tendsto φ ξ).comp heps_tendsto -- The same sequence also → charFun(μ)(ξ) by weak convergence have hgr_conv' : Tendsto (fun n => charFun (μ_seq (f n) : Measure V) ξ) atTop (𝓝 (φ ξ)) := by - simp_all + simp_all only [one_div, BoundedContinuousFunction.coe_ofNormedAddCommGroup, implies_true] -- By uniqueness of limits: charFun μ ξ = φ ξ exact tendsto_nhds_unique hcharfun_conv hgr_conv' @@ -1234,7 +1236,7 @@ private theorem bochner_mem_tight (φ : V → ℂ) {μ_seq : ℕ → Probability · positivity · have h1 : (0 : ℝ) < (n : ℝ) + 1 := by positivity rw [div_le_one₀ h1] - linarith [n.cast_nonneg (α := ℝ)] + linarith only [n.cast_nonneg (α := ℝ)] · exact (μ_seq n).prop · exact hμ_seq n diff --git a/LeanPool/OSforGFF/Bochner/PositiveDefinite.lean b/LeanPool/OSforGFF/Bochner/PositiveDefinite.lean index e9cc928d23..6e43261d2d 100644 --- a/LeanPool/OSforGFF/Bochner/PositiveDefinite.lean +++ b/LeanPool/OSforGFF/Bochner/PositiveDefinite.lean @@ -110,7 +110,7 @@ lemma eval_zero_real (hpd : IsPositiveDefinite φ) : (φ 0).im = 0 := by -- This means Im(φ 0) = 0 have := congr_arg Complex.im h simp [Complex.conj_im] at this - linarith + linarith only [this] /-- Helper: expand the PD condition for m=2. -/ private lemma pd_two (hpd : IsPositiveDefinite φ) (a b : α) (c₀ c₁ : ℂ) : @@ -125,7 +125,7 @@ lemma bounded_by_zero (hpd : IsPositiveDefinite φ) (x : α) : -- Handle the case φ x = 0 by_cases hφx : φ x = 0 · have : ‖φ x‖ = 0 := by rw [hφx]; simp - linarith [hpd.eval_zero_nonneg] + linarith only [hpd, this, hpd.eval_zero_nonneg] -- Use the 2×2 PD condition with c = ![1, -φ(x)/‖φ(x)‖] -- which gives φ(0).re - ‖φ(x)‖ ≥ 0 set t : ℂ := -(φ x / (‖φ x‖ : ℂ)) @@ -163,7 +163,7 @@ lemma bounded_by_zero (hpd : IsPositiveDefinite φ) (x : α) : -- = 2 * (φ 0).re - 2 * ‖φ x‖ simp only [Complex.add_re, Complex.neg_re, Complex.ofReal_re] at h have him : (φ 0).im = 0 := hpd.eval_zero_real - linarith + linarith only [h] /-- Pointwise product of PD functions is PD (Schur product theorem for functions). This is the key fact used in Phase 2 (Gaussian regularization). @@ -177,16 +177,10 @@ lemma mul (hpd : IsPositiveDefinite φ) {ψ : α → ℂ} (hψ : IsPositiveDefin · intro x rw [map_mul, hpd.hermitian x, hψ.hermitian x] · intro m x c - let A : Matrix (Fin m) (Fin m) ℂ := Matrix.of fun i j => φ (x i - x j) - let B : Matrix (Fin m) (Fin m) ℂ := Matrix.of fun i j => ψ (x i - x j) - let e : Fin m → Fin m × Fin m := fun i => (i, i) - have hA : A.PosSemidef := by simpa [A] using kernelMatrix_posSemidef hpd x - have hB : B.PosSemidef := by simpa [B] using kernelMatrix_posSemidef hψ x - have hK : (A ⊗ₖ B).PosSemidef := hA.kronecker hB - have hSub : ((A ⊗ₖ B).submatrix e e).PosSemidef := hK.submatrix e - have hnonneg := hSub.dotProduct_mulVec_nonneg c + have hnonneg := ((kernelMatrix_posSemidef hpd x).hadamard + (kernelMatrix_posSemidef hψ x)).dotProduct_mulVec_nonneg c exact (RCLike.nonneg_iff.mp hnonneg).1.trans_eq <| by - simp [A, B, e, dotProduct, Matrix.mulVec, + simp [Matrix.hadamard, dotProduct, Matrix.mulVec, Finset.mul_sum, mul_assoc, mul_left_comm, mul_comm] end IsPositiveDefinite diff --git a/LeanPool/OSforGFF/Bochner/Sazonov.lean b/LeanPool/OSforGFF/Bochner/Sazonov.lean index 930499ed6b..5ca6d84448 100644 --- a/LeanPool/OSforGFF/Bochner/Sazonov.lean +++ b/LeanPool/OSforGFF/Bochner/Sazonov.lean @@ -90,7 +90,7 @@ lemma quadForm_add (hS : S.IsPositive) (x y : H) : simp only [quadForm, map_add, inner_add_left, inner_add_right] have : @inner ℝ H _ y (S x) = @inner ℝ H _ x (S y) := by rw [← hS.inner_left_eq_inner_right x y, real_inner_comm] - linarith + linarith only [this] /-- Cauchy-Schwarz inequality for the semi-inner product ⟪·, S·⟫: ⟪x, Sy⟫² ≤ ⟪x, Sx⟫ · ⟪y, Sy⟫ when S is positive. @@ -107,7 +107,7 @@ lemma inner_sq_le_quadForm_mul (hS : S.IsPositive) (x y : H) : intro t have := quadForm_nonneg hS (x + t • y) rw [quadForm_add hS, inner_S_smul_right, quadForm_smul, hy] at this - linarith + linarith only [this] have hpos := h0 (-(quadForm S x + 1) / (2 * @inner ℝ H _ x (S y))) have hneg := h0 (-(quadForm S x - 1) / (2 * @inner ℝ H _ x (S y))) have hne2 : (2 : ℝ) * @inner ℝ H _ x (S y) ≠ 0 := by positivity @@ -117,14 +117,14 @@ lemma inner_sq_le_quadForm_mul (hS : S.IsPositive) (x y : H) : have e2 : 2 * @inner ℝ H _ x (S y) * (-(quadForm S x - 1) / (2 * @inner ℝ H _ x (S y))) = -(quadForm S x - 1) := by field_simp - linarith + linarith only [hpos, e1] · have hcpos : 0 < quadForm S y := lt_of_le_of_ne (quadForm_nonneg hS y) (Ne.symm hy) have h0 : ∀ t : ℝ, 0 ≤ quadForm S x + 2 * @inner ℝ H _ x (S y) * t + quadForm S y * t ^ 2 := by intro t have := quadForm_nonneg hS (x + t • y) rw [quadForm_add hS, inner_S_smul_right, quadForm_smul] at this - linarith + linarith only [this] have key := h0 (-@inner ℝ H _ x (S y) / quadForm S y) have hc : quadForm S y ≠ 0 := ne_of_gt hcpos have : quadForm S x + 2 * @inner ℝ H _ x (S y) * @@ -133,7 +133,7 @@ lemma inner_sq_le_quadForm_mul (hS : S.IsPositive) (x y : H) : quadForm S x - (@inner ℝ H _ x (S y)) ^ 2 / quadForm S y := by field_simp; ring rw [this] at key - have h1 : (@inner ℝ H _ x (S y)) ^ 2 / quadForm S y ≤ quadForm S x := by linarith + have h1 : (@inner ℝ H _ x (S y)) ^ 2 / quadForm S y ≤ quadForm S x := by linarith only [key] calc (@inner ℝ H _ x (S y)) ^ 2 = (@inner ℝ H _ x (S y)) ^ 2 / quadForm S y * quadForm S y := by field_simp _ ≤ quadForm S x * quadForm S y := mul_le_mul_of_nonneg_right h1 (le_of_lt hcpos) @@ -157,7 +157,7 @@ lemma sqrt_quadForm_add_le (hS : S.IsPositive) (x y : H) : · push Not at hb rw [← Real.sqrt_mul ha] exact Real.le_sqrt_of_sq_le h_cs - nlinarith [Real.sq_sqrt ha, Real.sq_sqrt hc] + linarith only [ha, hc, h_bound, Real.sq_sqrt ha, Real.sq_sqrt hc] end QuadFormLemmas diff --git a/LeanPool/OSforGFF/Covariance/Momentum.lean b/LeanPool/OSforGFF/Covariance/Momentum.lean index 0fd659f4c6..d534b3b6f4 100644 --- a/LeanPool/OSforGFF/Covariance/Momentum.lean +++ b/LeanPool/OSforGFF/Covariance/Momentum.lean @@ -198,7 +198,7 @@ lemma integral_exp_neg_mul_Ioi_eq_inv (a : ℝ) (ha : 0 < a) : -- Use integral_exp_mul_Ioi with -a < 0 and c = 0 have hna : -a < 0 := neg_neg_of_pos ha have h := integral_exp_mul_Ioi hna 0 - simp_all + simp_all only [Left.neg_neg_iff, neg_mul, mul_zero, Real.exp_zero, neg_div_neg_eq, one_div] /-- The Schwinger representation: ∫₀^∞ exp(-t(k² + m²)) dt = 1/(k² + m²). This is valid when k² + m² > 0. @@ -334,7 +334,7 @@ lemma heatKernelPositionSpace_bounded (r : ℝ) (hr : 0 < r) : _ ≤ (16 * Real.pi^2)⁻¹ * (64 / r^4) := by apply mul_le_mul_of_nonneg_left h_div; positivity _ = 4 / (Real.pi^2 * r^4) := by field_simp; ring - _ ≤ 4 / (Real.pi^2 * r^4) + 1 := by linarith + _ ≤ 4 / (Real.pi^2 * r^4) + 1 := by linarith only [] /-- **Heat kernel L¹ normalization**: The heat kernel integrates to 1 over all space. ∫ H(t, ‖z‖) dz = 1 for all t > 0. @@ -572,7 +572,9 @@ lemma gaussianFT_eq_heatKernel_times_norm (s : ℝ) (hs : 0 < s) (z : SpaceTime) -- Simplify the exponential arguments have h_exp_eq : Complex.exp (-1 * ↑‖z‖ ^ 2 / (4 * ↑s)) = ↑(Real.exp (-‖z‖^2 / (4 * s))) := by - simp_all + simp_all only [ofReal_re, neg_mul, Nat.cast_ofNat, one_mul, even_two, Even.neg_pow, I_sq, + finrank_euclideanSpace, Fintype.card_fin, ne_eq, pi_ne_zero, not_false_eq_true, ofReal_exp, + ofReal_div, ofReal_neg, ofReal_pow, ofReal_mul, ofReal_ofNat] rw [h_exp_eq] -- Goal: (π/s)^(4/2) * exp(-‖z‖²/(4s)) = (2π)^4 * (1/(16π²s²) * exp(-‖z‖²/(4s))) -- First simplify ↑4/2 = 2 @@ -600,7 +602,10 @@ lemma gaussianFT_eq_heatKernel_times_norm (s : ℝ) (hs : 0 < s) (z : SpaceTime) -- Combine: LHS = ↑(real) = ↑(a*b) = ↑a * ↑b = RHS -- Note: the exponent is (2:ℂ) after rewriting h_exp_four_two -- Convert cpow to npow: x^(2:ℂ) = x^(2:ℕ) for x ∈ ℂ - simp_all + simp_all only [ofReal_re, neg_mul, Nat.cast_ofNat, one_mul, even_two, Even.neg_pow, I_sq, + finrank_euclideanSpace, Fintype.card_fin, ne_eq, pi_ne_zero, not_false_eq_true, ofReal_exp, + ofReal_div, ofReal_neg, ofReal_pow, ofReal_mul, ofReal_ofNat, one_div, mul_inv_rev, + ofReal_inv, cpow_ofNat] /-- **THEOREM**: The integrand for fubini_schwinger_fourier is integrable on SpaceTime × (0,∞). This justifies using Tonelli's theorem. @@ -842,7 +847,7 @@ theorem fubini_schwinger_fourier (α : ℝ) (hα : 0 < α) (m : ℝ) (hm : 0 < m Complex.exp (-Complex.I * ⟪k, r⟫_ℝ) = (normalisation : ℂ) * (heatKernelPositionSpace (α + t) ‖r‖ : ℂ) := by intro t ht - have hαt : 0 < α + t := by linarith + have hαt : 0 < α + t := by linarith only [hα, ht] rw [hnorm_def] exact gaussianFT_eq_heatKernel_times_norm (α + t) hαt r -- Key identity: heat kernel equals k-integral (inverse of gaussFT) @@ -872,7 +877,7 @@ theorem fubini_schwinger_fourier (α : ℝ) (hα : 0 < α) (m : ℝ) (hm : 0 < m Complex.exp (-Complex.I * ⟪k, x - y⟫_ℝ)) = Complex.ofReal (Real.exp (-t * m^2) * heatKernelPositionSpace (α + t) ‖x - y‖) := by intro t ht - have hαt : 0 < α + t := by linarith + have hαt : 0 < α + t := by linarith only [hα, ht] -- Factor out the constant exp(-tm²)/norm calc ∫ k : SpaceTime, ↑(Real.exp (-(α + t) * ‖k‖^2) * Real.exp (-t * m^2) / normalisation) * Complex.exp (-Complex.I * ⟪k, x - y⟫_ℝ) @@ -917,7 +922,7 @@ theorem fubini_schwinger_fourier (α : ℝ) (hα : 0 < α) (m : ℝ) (hm : 0 < m · exact (Real.continuous_exp.comp (continuous_neg.mul continuous_const)).continuousOn · intro t ht have ht_pos : 0 < t := Set.mem_Ioi.mp ht - have hαt : 0 < α + t := by linarith + have hαt : 0 < α + t := by linarith only [hα, ht_pos] have h_add_cont : ContinuousAt (fun s => α + s) t := continuousAt_const.add continuousAt_id exact (heatKernelPositionSpace_continuous_at (α + t) hαt ‖x - y‖).comp h_add_cont @@ -928,7 +933,7 @@ theorem fubini_schwinger_fourier (α : ℝ) (hα : 0 < α) (m : ℝ) (hm : 0 < m intro t ht rw [Real.norm_eq_abs, Real.norm_eq_abs] have ht_pos : t > 0 := Set.mem_Ioi.mp ht - have hαt : α + t > 0 := by linarith + have hαt : α + t > 0 := by linarith only [hα, ht_pos] have h_heat_nonneg : 0 ≤ heatKernelPositionSpace (α + t) ‖x - y‖ := heatKernelPositionSpace_nonneg (α + t) hαt ‖x - y‖ have h_exp_nonneg : 0 ≤ Real.exp (-t * m^2) := Real.exp_nonneg _ @@ -999,7 +1004,7 @@ theorem fubini_schwinger_fourier (α : ℝ) (hα : 0 < α) (m : ℝ) (hm : 0 < m refine MeasureTheory.setIntegral_congr_fun measurableSet_Ioi ?_ intro t ht have ht_pos : 0 < t := Set.mem_Ioi.mp ht - have hαt : 0 < α + t := by linarith + have hαt : 0 < α + t := by linarith only [hα, ht_pos] -- Use h_gaussFT to get the k-integral equals normalisation * H have h_gaussft := h_gaussFT t ht_pos -- ∫_k exp(-(α+t)‖k‖²) * phase = norm * H(α+t, r) @@ -1024,7 +1029,7 @@ theorem fubini_schwinger_fourier (α : ℝ) (hα : 0 < α) (m : ℝ) (hm : 0 < m := by rw [h] field_simp at h1 - linarith + linarith only [h1] · intro h rw [h, mul_comm] rw [h_norm_factor] @@ -1074,7 +1079,7 @@ lemma covarianceSchwingerRegulated_tendsto (m : ℝ) (hm : 0 < m) (r : ℝ) (hr rw [MeasureTheory.ae_restrict_iff' measurableSet_Ioi] filter_upwards with t ht have htpos : 0 < t := Set.mem_Ioi.mp ht - have hαtpos : 0 < α + t := by linarith + have hαtpos : 0 < α + t := by linarith only [hαpos, htpos] rw [Real.norm_eq_abs, abs_mul, abs_of_nonneg (Real.exp_nonneg _)] rw [abs_of_nonneg (heatKernelPositionSpace_nonneg (α + t) hαtpos r)] exact mul_le_mul_of_nonneg_left (hCbound (α + t) hαtpos) (Real.exp_nonneg _) @@ -1233,7 +1238,7 @@ lemma covarianceSchwingerRegulated_le_const_mul (m : ℝ) (hm : 0 < m) (r : ℝ) exact Set.mem_Ioi.mpr (lt_of_lt_of_le hα (le_of_lt hs)) -- Step 3: Bound the exponential prefactor have h_exp : Real.exp (α * m^2) ≤ Real.exp (m^2) := by - simp_all + simp_all only [neg_mul, exp_le_exp, pow_succ_pos, mul_le_iff_le_one_left] -- Step 4: Nonneg of the integral (for multiplication bound) have h_int_nonneg : 0 ≤ ∫ s in Set.Ioi 0, Real.exp (-s * m^2) * heatKernelPositionSpace s r := by apply MeasureTheory.setIntegral_nonneg measurableSet_Ioi @@ -1283,7 +1288,7 @@ lemma gaussian_regulator_integrable' (α : ℝ) (hα : 0 < α) : have h := GaussianFourier.integrable_cexp_neg_mul_sq_norm_add (V := SpaceTime) hα_re 0 0 simp only [zero_mul, add_zero] at h have h' : Integrable (fun k : SpaceTime => (Real.exp (-α * ‖k‖^2) : ℂ)) volume := by - simp_all + simp_all only [ofReal_re, neg_mul, ofReal_exp, ofReal_neg, ofReal_mul, ofReal_pow] exact h'.re /-- The regulated covariance is uniformly bounded for all (x, y). @@ -1363,9 +1368,9 @@ lemma freeCovariance_regulated_uniformly_bounded (α : ℝ) (hα : 0 < α) (m : · -- exp * prop / norm ≤ exp / (m² * norm) iff prop ≤ 1/m² have h_prop_bound : freePropagatorMomentum m k ≤ 1 / m^2 := by unfold freePropagatorMomentum - have h_denom : m^2 ≤ ‖k‖^2 + m^2 := by nlinarith [sq_nonneg ‖k‖] + have h_denom : m^2 ≤ ‖k‖^2 + m^2 := by linarith only [sq_nonneg ‖k‖] apply div_le_div_of_nonneg_left _ (sq_pos_of_pos hm) h_denom - nlinarith [sq_nonneg ‖k‖] + linarith only [sq_nonneg ‖k‖] calc Real.exp (-α * ‖k‖^2) * freePropagatorMomentum m k / (2 * Real.pi) ^ STDimension ≤ Real.exp (-α * ‖k‖^2) * (1 / m^2) / (2 * Real.pi) ^ STDimension := by apply div_le_div_of_nonneg_right _ (by positivity) @@ -1434,7 +1439,7 @@ lemma aestronglyMeasurable_freeCovariance_regulated (α : ℝ) (hα : 0 < α) (m have h_prop_bound : freePropagatorMomentum m k ≤ 1 / m^2 := by simp only [freePropagatorMomentum] apply one_div_le_one_div_of_le (by positivity : 0 < m ^ 2) - linarith [sq_nonneg ‖k‖] + linarith only [sq_nonneg ‖k‖] have h_prop_nonneg : 0 ≤ freePropagatorMomentum m k := le_of_lt (h_prop_pos k) rw [Real.norm_of_nonneg (by positivity : 0 ≤ Real.exp (-α * ‖k‖ ^ 2) * freePropagatorMomentum m k / @@ -1679,7 +1684,7 @@ lemma freeCovarianceKernel_decay_bound (m : ℝ) (hm : 0 < m) : have hK_pos : 0 < besselK1 (m * ‖z‖) := besselK1_pos (m * ‖z‖) (by positivity) have h_kernel_nonneg : 0 ≤ (m / (4 * Real.pi^2 * ‖z‖)) * besselK1 (m * ‖z‖) := by apply mul_nonneg - · apply div_nonneg hm.le; nlinarith [Real.pi_pos] + · apply div_nonneg hm.le; nlinarith only [hr_pos, Real.pi_pos] · exact hK_pos.le rw [abs_of_nonneg h_kernel_nonneg] -- Use the near-origin bound K₁(z) ≤ (cosh(1) + 2)/z for z > 0 @@ -1691,7 +1696,7 @@ lemma freeCovarianceKernel_decay_bound (m : ℝ) (hm : 0 < m) : calc (m / (4 * Real.pi^2 * ‖z‖)) * besselK1 (m * ‖z‖) ≤ (m / (4 * Real.pi^2 * ‖z‖)) * ((Real.cosh 1 + 2) / (m * ‖z‖)) := by apply mul_le_mul_of_nonneg_left h_bessel_bound - apply div_nonneg hm.le; nlinarith [Real.pi_pos] + apply div_nonneg hm.le; nlinarith only [hr_pos, Real.pi_pos] _ = (Real.cosh 1 + 2) / (4 * Real.pi^2 * ‖z‖^2) := by field_simp [ne_of_gt hr_pos, ne_of_gt hm] _ = C * ‖z‖^(-2 : ℝ) := by @@ -1712,7 +1717,7 @@ lemma freeCovarianceKernel_decay_bound (m : ℝ) (hm : 0 < m) : -- Use x ≤ exp(x), which is a consequence of 1 + x ≤ exp(x) have h1 : m * ‖z‖ ≤ Real.exp (m * ‖z‖) := by have := add_one_le_exp (m * ‖z‖) - linarith + linarith only [this] -- Invert the inequality (anti-monotonicity of inverse) have h2 : (Real.exp (m * ‖z‖))⁻¹ ≤ (m * ‖z‖)⁻¹ := inv_anti₀ hmr_pos h1 calc Real.exp (-(m * ‖z‖)) = (Real.exp (m * ‖z‖))⁻¹ := by rw [Real.exp_neg] @@ -1722,22 +1727,22 @@ lemma freeCovarianceKernel_decay_bound (m : ℝ) (hm : 0 < m) : _ ≤ (Real.sinh 1 + 2) * (1 / (m * ‖z‖)) := by apply mul_le_mul_of_nonneg_left h_exp_bound have : 0 < Real.sinh 1 := Real.sinh_pos_iff.mpr (by norm_num : (0:ℝ) < 1) - linarith + linarith only [this] _ = (Real.sinh 1 + 2) / (m * ‖z‖) := by ring have h_sinh_le_cosh : Real.sinh 1 + 2 ≤ Real.cosh 1 + 2 := by have h1 : Real.sinh 1 = (Real.exp 1 - Real.exp (-1)) / 2 := Real.sinh_eq (1:ℝ) have h2' : Real.cosh 1 = (Real.exp 1 + Real.exp (-1)) / 2 := Real.cosh_eq (1:ℝ) rw [h1, h2'] - linarith [Real.exp_pos (-1 : ℝ)] + linarith only [Real.exp_pos (-1 : ℝ)] calc (m / (4 * Real.pi^2 * ‖z‖)) * besselK1 (m * ‖z‖) ≤ (m / (4 * Real.pi^2 * ‖z‖)) * ((Real.sinh 1 + 2) / (m * ‖z‖)) := by apply mul_le_mul_of_nonneg_left h_K_bound - apply div_nonneg hm.le; nlinarith [Real.pi_pos] + apply div_nonneg hm.le; nlinarith only [hr_pos, Real.pi_pos] _ = (Real.sinh 1 + 2) / (4 * Real.pi^2 * ‖z‖^2) := by field_simp [ne_of_gt hr_pos, ne_of_gt hm] _ ≤ (Real.cosh 1 + 2) / (4 * Real.pi^2 * ‖z‖^2) := by apply div_le_div_of_nonneg_right h_sinh_le_cosh - nlinarith [Real.pi_pos, sq_nonneg ‖z‖] + nlinarith only [Real.pi_pos, sq_nonneg ‖z‖] _ = C * ‖z‖^(-2 : ℝ) := by rw [hC_def] have h_rpow : ‖z‖ ^ (-2 : ℝ) = (‖z‖ ^ (2 : ℝ))⁻¹ := by @@ -1763,7 +1768,7 @@ lemma freeCovariance_exponential_bound (m : ℝ) (hm : 0 < m) (u v : SpaceTime) have huv : u ≠ v := by intro heq simp [heq] at h_sep - linarith + linarith only [h_sep] rw [abs_of_pos (freeCovarianceBessel_pos m hm u v huv)] -- Let r = ‖u - v‖ set r := ‖u - v‖ with hr_def @@ -1773,7 +1778,7 @@ lemma freeCovariance_exponential_bound (m : ℝ) (hm : 0 < m) (u v : SpaceTime) by_contra h_neg push Not at h_neg have : m * r ≤ 0 := mul_nonpos_of_nonneg_of_nonpos (le_of_lt hm) h_neg - linarith + linarith only [h_sep, this] have hr_ne : r ≠ 0 := ne_of_gt hr_pos -- Unfold the covariance: C(u,v) = (m / (4π²r)) · K₁(mr) unfold freeCovarianceBessel @@ -1786,7 +1791,7 @@ lemma freeCovariance_exponential_bound (m : ℝ) (hm : 0 < m) (u v : SpaceTime) have hm_over_r_le : m / r ≤ m^2 := by rw [div_le_iff₀ hr_pos, sq] calc m = m * 1 := by ring - _ ≤ m * (m * r) := by nlinarith + _ ≤ m * (m * r) := by nlinarith only [hm, h_sep] _ = m * m * r := by ring -- Combine: (m / (4π²r)) · K₁(mr) ≤ (m / (4π²r)) · (sinh 1 + 2) · e^{-mr} -- ≤ (m² / (4π²)) · (sinh 1 + 2) · e^{-mr} @@ -1802,7 +1807,8 @@ lemma freeCovariance_exponential_bound (m : ℝ) (hm : 0 < m) (u v : SpaceTime) apply mul_le_mul_of_nonneg_right hm_over_r_le positivity _ = m^2 * (Real.sinh 1 + 2) / (4 * Real.pi^2) * Real.exp (-m * r) := by - simp_all + simp_all only [ne_eq, norm_pos_iff, norm_eq_zero, not_false_eq_true, one_div, + Nat.ofNat_pos, mul_pos_iff_of_pos_left, div_pos_iff_of_pos_left, neg_mul] /-! ### Fact versions of decay bounds @@ -1850,14 +1856,16 @@ lemma freeCovarianceKernel_continuousOn (m : ℝ) (hm : 0 < m) : have h_norm_cont : ContinuousOn (fun z : SpaceTime => ‖z‖) {z | z ≠ 0} := continuous_norm.continuousOn have h_norm_pos : ∀ z ∈ ({z : SpaceTime | z ≠ 0} : Set SpaceTime), ‖z‖ ∈ Set.Ioi 0 := by - simp_all + simp_all only [ne_eq, Set.mem_ofPred_eq, Set.mem_Ioi, norm_pos_iff, not_false_eq_true, + implies_true] -- The composed function agrees with freeCovarianceKernel on {z ≠ 0} have h_eq : ∀ z ∈ ({z : SpaceTime | z ≠ 0} : Set SpaceTime), freeCovarianceKernel m z = (m / (4 * Real.pi^2 * ‖z‖)) * besselK1 (m * ‖z‖) := by intro z hz simp only [Set.mem_ofPred_eq] at hz unfold freeCovarianceKernel freeCovariance freeCovarianceBessel - simp_all + simp_all only [ne_eq, Set.mem_ofPred_eq, Set.mem_Ioi, norm_pos_iff, not_false_eq_true, + implies_true, zero_sub, norm_neg, norm_eq_zero, ↓reduceIte] apply ContinuousOn.congr _ h_eq exact hg_cont.comp h_norm_cont h_norm_pos @@ -1872,7 +1880,7 @@ theorem freeCovarianceℂ_bilinear_integrable' (m : ℝ) [Fact (0 < m)] (f g : T simp only [freeCovarianceKernel, freeCovariance, freeCovarianceBessel, zero_sub, norm_neg] have h_eq : (fun p : SpaceTime × SpaceTime => f p.1 * (freeCovariance m p.1 p.2 : ℂ) * g p.2) = (fun p => f p.1 * ((freeCovarianceKernel m (p.1 - p.2) : ℝ) : ℂ) * g p.2) := by - simp_all + simp_all only rw [h_eq] have hK_int : Integrable (fun z : SpaceTime => (freeCovarianceKernel m z : ℂ)) volume := Integrable.ofReal (freeCovarianceKernel_integrable m (Fact.out)) @@ -1996,7 +2004,7 @@ lemma momentumWeightSqrt_mathlib_sq (m : ℝ) [Fact (0 < m)] (k : SpaceTime) : have h_pos : 0 < (2 * Real.pi)^2 * ‖k‖^2 + m^2 := by have h1 : 0 ≤ (2 * Real.pi)^2 * ‖k‖^2 := by positivity have h2 : 0 < m^2 := sq_pos_of_pos (Fact.out : 0 < m) - linarith + linarith only [h1, h2] rw [div_pow, one_pow, Real.sq_sqrt (le_of_lt h_pos)] /-- The momentum weight sqrt function is continuous (physics convention). -/ @@ -2029,7 +2037,7 @@ private lemma one_div_sqrt_add_sq_le_inv (m : ℝ) (hm : 0 < m) {A : ℝ} (hA : 1 / Real.sqrt (A + m^2) ≤ 1 / m := by refine one_div_le_one_div_of_le hm ?_ calc m = Real.sqrt (m^2) := (Real.sqrt_sq hm.le).symm - _ ≤ Real.sqrt (A + m^2) := Real.sqrt_le_sqrt (by linarith) + _ ≤ Real.sqrt (A + m^2) := Real.sqrt_le_sqrt (by linarith only [hA]) /-- Helper: The weight function as an L^∞ function (essentially bounded). -/ lemma momentumWeightSqrt_bounded_ae (m : ℝ) [Fact (0 < m)] : diff --git a/LeanPool/OSforGFF/Covariance/Parseval.lean b/LeanPool/OSforGFF/Covariance/Parseval.lean index d9ed1c1d33..b0e70d4d57 100644 --- a/LeanPool/OSforGFF/Covariance/Parseval.lean +++ b/LeanPool/OSforGFF/Covariance/Parseval.lean @@ -725,7 +725,7 @@ theorem parseval_covariance_schwartz_correct (m : ℝ) [Fact (0 < m)] (f : TestF have h_exp_le_one : Real.exp (-α * (2 * Real.pi)^2 * ‖k‖^2) ≤ 1 := by rw [Real.exp_le_one_iff] have : 0 ≤ α * (2 * Real.pi)^2 * ‖k‖^2 := by positivity - linarith + linarith only [this] have h_prop_nonneg := freePropagatorMomentum_mathlib_nonneg m Fact.out k calc Real.exp (-α * (2 * Real.pi)^2 * ‖k‖^2) * ‖(SchwartzMap.fourierTransformCLM ℂ f) k‖^2 * freePropagatorMomentumMathlib m k diff --git a/LeanPool/OSforGFF/Covariance/Position.lean b/LeanPool/OSforGFF/Covariance/Position.lean index 76b8b2d403..10396c6dab 100644 --- a/LeanPool/OSforGFF/Covariance/Position.lean +++ b/LeanPool/OSforGFF/Covariance/Position.lean @@ -106,7 +106,7 @@ lemma double_integral_timeReflection_covariance -- Now goal is: ∫∫ f(Θx) * C(x,y) * g(y) = ∫∫ f(x) * C(Θx, Θy) * g(Θy) -- timeReflection is an involution: Θ ∘ Θ = id have hinv : ∀ z, QFT.timeReflection (QFT.timeReflection z) = z := by - simp_all + simp_all only [QFT.timeReflection_involutive, implies_true] -- Transform RHS using double_integral_timeReflection (in reverse direction) -- After substitution x' = Θx, y' = Θy: RHS = ∫∫ f(Θx') * C(x', y') * g(y') rw [← double_integral_timeReflection (fun x y => f (QFT.timeReflection x) * (freeCovariance m x y @@ -202,13 +202,15 @@ lemma integrable_real_covariance_kernel ‖((QFT.compTimeReflectionReal f) p.1 : ℂ) * ((freeCovariance m p.1 p.2 : ℝ) : ℂ) * ((f p.2 : ℝ) : ℂ)‖ = ‖(QFT.compTimeReflectionReal f) p.1 * freeCovariance m p.1 p.2 * f p.2‖ := by - simp_all + simp_all only [toComplex_apply, norm_real, norm_eq_abs, norm_mul, + implies_true] -- The .re of distributed casts ↑a * ↑b * ↑c equals a * b * c have h_re_eq : ∀ p : SpaceTime × SpaceTime, (((QFT.compTimeReflectionReal f) p.1 : ℂ) * ((freeCovariance m p.1 p.2 : ℝ) : ℂ) * ((f p.2 : ℝ) : ℂ)).re = (QFT.compTimeReflectionReal f) p.1 * freeCovariance m p.1 p.2 * f p.2 := by - simp_all + simp_all only [toComplex_apply, norm_real, norm_eq_abs, norm_mul, + implies_true, mul_re, ofReal_re, ofReal_im, mul_zero, sub_zero, mul_im, zero_mul, add_zero] -- Transfer integrability using norm equivalence via Integrable.mono' -- The real integrand is the .re of the complex integrand (which is real-valued) apply Integrable.mono' h_complex.norm @@ -216,7 +218,9 @@ lemma integrable_real_covariance_kernel convert h_complex.aestronglyMeasurable.re using 2 with p exact (h_re_eq p).symm · -- ‖real_integrand‖ ≤ ‖complex_integrand‖ a.e. (actually equal) - simp_all + simp_all only [toComplex_apply, norm_real, norm_eq_abs, norm_mul, + implies_true, mul_re, ofReal_re, ofReal_im, mul_zero, sub_zero, mul_im, zero_mul, add_zero, + Std.le_refl, eventually_true] /-- Fubini helper: rewrite the real kernel double integral over the product measure. -/ lemma integral_prod_real_covariance_kernel @@ -293,7 +297,7 @@ lemma toComplex_star_eq (f : OSforGFF.TestFunction) (x : SpaceTime) : starRingEnd ℂ ((toComplex f) x) = (toComplex f) x := by -- toComplex f x = (f x : ℂ) by definition - simp_all + simp_all only [toComplex_apply, conj_ofReal] /-- The time-reflected complexification of a real test function remains real-valued. -/ lemma compTimeReflection_toComplex_star_eq @@ -435,7 +439,7 @@ theorem freeCovarianceℂ_bilinear_smul_left rw [add_zero] at h have zero_bilinear : freeCovarianceℂBilinear m 0 g = 0 := by unfold freeCovarianceℂBilinear - simp_all + simp_all only [zero_apply, zero_mul, integral_zero] rwa [zero_bilinear, add_zero] at h /-- Symmetry of the complex bilinear form: swapping arguments gives the same result. -/ diff --git a/LeanPool/OSforGFF/Covariance/RealForm.lean b/LeanPool/OSforGFF/Covariance/RealForm.lean index 59e5f50ef6..69d2c62494 100644 --- a/LeanPool/OSforGFF/Covariance/RealForm.lean +++ b/LeanPool/OSforGFF/Covariance/RealForm.lean @@ -48,7 +48,7 @@ theorem freeCovarianceℂ_bilinear_agrees_on_reals have h : ∀ (x y : SpaceTime), ((f x : ℂ)) * ((freeCovariance m x y : ℂ)) * ((g y : ℂ)) = (((f x) * (freeCovariance m x y) * (g y) : ℝ) : ℂ) := by - simp_all + simp_all only [ofReal_mul, implies_true] simp_rw [h] have step1 : ∫ x, ∫ y, ((f x * freeCovariance m x y * g y : ℝ) : ℂ) = ∫ x, ((∫ y, f x * freeCovariance m x y * g y : ℝ) : ℂ) := by @@ -72,7 +72,7 @@ private lemma schwartz_real_smul_eq_complex (c : ℝ) (f : SchwartzMap SpaceTime private lemma lp_real_smul_eq_complex (c : ℝ) (g : Lp ℂ 2 (volume : Measure SpaceTime)) : c • g = (c : ℂ) • g := by ext1; filter_upwards [Lp.coeFn_smul c g, Lp.coeFn_smul (c : ℂ) g] with x h1 h2 - simp_all + simp_all only [Pi.smul_apply, real_smul, coe_smul, smul_eq_mul] /-- ℝ-linear view of the complex Fourier transform on Schwartz space. @@ -132,7 +132,7 @@ lemma sqrtPropagatorMap_sq_integrable (m : ℝ) [Fact (0 < m)] (f : OSforGFF.Tes (Continuous.comp_aestronglyMeasurable (by fun_prop) h_map_meas).pow 2 have h_dom_integrable : Integrable (fun k => (1 / m) ^ 2 * ‖F k‖ ^ 2) volume := by have := Integrable.const_mul hF_sq ((1 / m) ^ 2) - simp_all + simp_all only [one_div, inv_pow] have h_dom_pointwise : ∀ᵐ k ∂volume, ‖‖sqrtPropagatorMap m f k‖ ^ 2‖ ≤ ‖(1 / m) ^ 2 * ‖F k‖ ^ 2‖ := by have hmpos : 0 < m := Fact.out @@ -223,7 +223,7 @@ lemma freeCovarianceℂ_eq_bilinear_on_reals (m : ℝ) (f g : OSforGFF.TestFunct freeCovarianceℂ m (toComplex f) (toComplex g) = freeCovarianceℂBilinear m (toComplex f) (toComplex g) := by unfold freeCovarianceℂ freeCovarianceℂBilinear - simp_all + simp_all only [toComplex_apply, conj_ofReal] /-- Key lemma: The squared norm equals the covariance form. -/ lemma sqrtPropagatorMap_norm_eq_covariance (m : ℝ) [Fact (0 < m)] (f : OSforGFF.TestFunction) : @@ -245,7 +245,8 @@ lemma sqrtPropagatorMap_norm_eq_covariance (m : ℝ) [Fact (0 < m)] (f : OSforGF ‖sqrtPropagatorMap m f k‖ = ‖F k * momentumWeightSqrtMathlib m k‖ := rfl _ = ‖F k‖ * ‖(momentumWeightSqrtMathlib m k : ℂ)‖ := by simp _ = ‖F k‖ * momentumWeightSqrtMathlib m k := by - simp_all + simp_all only [norm_real, Real.norm_eq_abs, abs_eq_self, mul_eq_mul_left_iff, + norm_eq_zero, true_or] have h_sq : ‖sqrtPropagatorMap m f k‖ ^ 2 = ‖F k‖ ^ 2 * (momentumWeightSqrtMathlib m k) ^ 2 := by simp [pow_two, h_norm, mul_comm, mul_left_comm, mul_assoc] @@ -277,8 +278,8 @@ lemma sqrtPropagatorMap_norm_eq_covariance (m : ℝ) [Fact (0 < m)] (f : OSforGF freeCovarianceℂ_eq_bilinear_on_reals m f f _ = (freeCovarianceFormR m f f : ℂ) := freeCovarianceℂ_bilinear_agrees_on_reals m f f - simp_all - simp_all + simp_all only [ofReal_re] + simp_all only /-! ## The Proof of sqrtPropagatorEmbedding -/ @@ -394,7 +395,7 @@ lemma embeddingMapCLM_apply (m : ℝ) [Fact (0 < m)] (f : OSforGFF.TestFunction) have h_weight : (fun k => (momentumWeightSqrtMathlib m k : ℂ) * A k) =ᵐ[volume] fun k => (momentumWeightSqrtMathlib m k : ℂ) * g k := by refine h_A.mono ?_ - simp_all + simp_all only [SchwartzMap.fourierTransformCLM_apply, SchwartzMap.toLpCLM_apply, implies_true] have h_mul'' : embeddingMapCLM m f =ᵐ[volume] fun k => (momentumWeightSqrtMathlib m k : ℂ) * g k := h_mul'.trans h_weight @@ -468,7 +469,7 @@ theorem freeCovarianceFormR_pos (m : ℝ) [Fact (0 < m)] : freeCovarianceℂ_eq_bilinear_on_reals m f f have h3 : 0 ≤ (freeCovarianceℂ m (toComplex f) (toComplex f)).re := freeCovarianceℂ_positive m (toComplex f) - simp_all + simp_all only [ofReal_re] /-- Symmetry of the real covariance bilinear form. -/ theorem freeCovarianceFormR_symm (m : ℝ) [Fact (0 < m)] (f g : OSforGFF.TestFunction) : @@ -522,7 +523,7 @@ lemma freeCovarianceFormR_smul_left (m : ℝ) [Fact (0 < m)] (c : ℝ) (f g : OS (freeCovarianceFormR m f g : ℂ) = freeCovarianceℂBilinear m (toComplex f) (toComplex g) := (freeCovarianceℂ_bilinear_agrees_on_reals m f g).symm - simp_all + simp_all only [coe_smul, ofReal_mul] /-- Addition in the second argument of the real covariance bilinear form. -/ lemma freeCovarianceFormR_add_right (m : ℝ) [Fact (0 < m)] (f g₁ g₂ : OSforGFF.TestFunction) : @@ -564,13 +565,13 @@ lemma freeCovarianceFormR_smul_right (m : ℝ) [Fact (0 < m)] (c : ℝ) (f g : O (freeCovarianceFormR m f g : ℂ) = freeCovarianceℂBilinear m (toComplex f) (toComplex g) := (freeCovarianceℂ_bilinear_agrees_on_reals m f g).symm - simp_all + simp_all only [coe_smul, ofReal_mul] /-- Zero in the first argument gives zero. -/ lemma freeCovarianceFormR_zero_left (m : ℝ) [Fact (0 < m)] (g : OSforGFF.TestFunction) : freeCovarianceFormR m 0 g = 0 := by have h := freeCovarianceFormR_smul_left m (0 : ℝ) 0 g - simp_all + simp_all only [smul_zero, zero_mul] /-- Zero in the second argument gives zero. -/ lemma freeCovarianceFormR_zero_right (m : ℝ) [Fact (0 < m)] (f : OSforGFF.TestFunction) : @@ -621,7 +622,7 @@ lemma freeCovarianceFormR_reflection_invariant = ∫ x, ∫ y, fc x * (freeCovariance m x y : ℂ) * gc y ∂volume ∂volume := by - simp_all + simp_all only unfold freeCovarianceℂBilinear exact h_double'' have h₁ : @@ -635,7 +636,7 @@ lemma freeCovarianceFormR_reflection_invariant freeCovarianceℂBilinear m fc gc = (freeCovarianceFormR m f g : ℂ) := (freeCovarianceℂ_bilinear_agrees_on_reals (m := m) f g) - simp_all + simp_all only [ofReal_inj] /-- Mixed-time-reflection identity for the real free covariance. -/ lemma freeCovarianceFormR_reflection_cross diff --git a/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearSpace.lean b/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearSpace.lean index c47bc01d34..dfd9f49dea 100644 --- a/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearSpace.lean +++ b/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearSpace.lean @@ -109,7 +109,7 @@ lemma exists_CLF_le_seminorm constructor · have h1 := hg_le (-x) rw [map_neg, map_neg_eq_map] at h1 - linarith + linarith only [h1] · exact hg_le x -- g is continuous: bounded by continuous seminorm, hence continuous at 0 have hg_cont : Continuous g := by @@ -145,10 +145,10 @@ lemma finset_sup_poly_bound {E : Type*} [AddCommGroup E] [Module ℝ E] have ih' := ih (fun i hi => hx i (Finset.mem_cons.mpr (Or.inr hi))) obtain ⟨D₁, hD₁, S₁, hbound₁⟩ := ih' obtain ⟨Ca, hCa, ta, hbounda⟩ := hx a (Finset.mem_cons.mpr (Or.inl rfl)) - refine ⟨Ca + D₁, by linarith, max ta S₁, fun m => ?_⟩ + refine ⟨Ca + D₁, by linarith only [hD₁, hCa], max ta S₁, fun m => ?_⟩ rw [Finset.sup_cons] have h1m : (0 : ℝ) < 1 + (m : ℝ) := by positivity - have h1m_le : (1 : ℝ) ≤ 1 + (m : ℝ) := by linarith + have h1m_le : (1 : ℝ) ≤ 1 + (m : ℝ) := by linarith only [] have hpow_le_left : (1 + (m : ℝ)) ^ ta ≤ (1 + (m : ℝ)) ^ (max ta S₁) := pow_le_pow_right₀ h1m_le (le_max_left ta S₁) have hpow_le_right : (1 + (m : ℝ)) ^ S₁ ≤ (1 + (m : ℝ)) ^ (max ta S₁) := @@ -158,13 +158,13 @@ lemma finset_sup_poly_bound {E : Type*} [AddCommGroup E] [Module ℝ E] _ ≤ Ca * (1 + (m : ℝ)) ^ (max ta S₁) := mul_le_mul_of_nonneg_left hpow_le_left (le_of_lt hCa) _ ≤ (Ca + D₁) * (1 + (m : ℝ)) ^ (max ta S₁) := - mul_le_mul_of_nonneg_right (by linarith) (pow_nonneg (le_of_lt h1m) _) + mul_le_mul_of_nonneg_right (by linarith only [hD₁]) (pow_nonneg (le_of_lt h1m) _) have hle_sup_right : (s.sup p') (x m) ≤ (Ca + D₁) * (1 + (m : ℝ)) ^ (max ta S₁) := by calc (s.sup p') (x m) ≤ D₁ * (1 + (m : ℝ)) ^ S₁ := hbound₁ m _ ≤ D₁ * (1 + (m : ℝ)) ^ (max ta S₁) := mul_le_mul_of_nonneg_left hpow_le_right (le_of_lt hD₁) _ ≤ (Ca + D₁) * (1 + (m : ℝ)) ^ (max ta S₁) := - mul_le_mul_of_nonneg_right (by linarith) (pow_nonneg (le_of_lt h1m) _) + mul_le_mul_of_nonneg_right (by linarith only [hCa]) (pow_nonneg (le_of_lt h1m) _) exact sup_le hle_sup_left hle_sup_right /-- **Seminorm bound from Schauder expansion.** @@ -322,7 +322,9 @@ private lemma schauder_remainder_le set t' := t.map ⟨Subtype.val, Subtype.val_injective⟩ with ht'_def have h_disj : Disjoint t' s := by rw [Finset.disjoint_left] - simp_all + simp_all only [norm_mul, Real.norm_eq_abs, Finset.mem_map, Function.Embedding.coeFn_mk, + Subtype.exists, Set.mem_compl_iff, SetLike.mem_coe, exists_and_right, exists_eq_right, + forall_exists_index, not_false_eq_true, implies_true] have h_le := h_vanish t' h_disj rwa [ht'_def, Finset.sum_map] at h_le diff --git a/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearTensorProduct.lean b/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearTensorProduct.lean index 21674ac98a..1e658c6f4b 100644 --- a/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearTensorProduct.lean +++ b/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearTensorProduct.lean @@ -454,7 +454,7 @@ theorem hasSum_basisVec (a : RapidDecaySeq) : have h_fin_eq : ∑' n, (if (n ∈ s) then g n else (0 : ℝ)) = ∑ n ∈ s, g n := by rw [tsum_eq_sum (fun n hn => ite_eq_right hn)] exact Finset.sum_congr rfl (fun n hn => ite_eq_left hn) - linarith⟩ + linarith only [h_partial, h_split, h_fin_eq]⟩ theorem rapidDecay_expansion (φ : RapidDecaySeq →L[ℝ] ℝ) (a : RapidDecaySeq) : φ a = ∑' m, (a.val m) * φ (basisVec m) := by @@ -773,9 +773,9 @@ private theorem one_add_pair_le_sq (i j : ℕ) : have h_pair : (Nat.pair i j : ℝ) ≤ ((i : ℝ) + j + 1) ^ 2 := by exact_mod_cast nat_pair_bound i j calc (1 : ℝ) + Nat.pair i j - ≤ 1 + (i + j + 1) ^ 2 := by linarith + ≤ 1 + (i + j + 1) ^ 2 := by linarith only [h_pair] _ ≤ (i + j + 2) ^ 2 := by nlinarith - _ ≤ (2 * (1 + i) * (1 + j)) ^ 2 := pow_le_pow_left₀ (by positivity) (by nlinarith) _ + _ ≤ (2 * (1 + i) * (1 + j)) ^ 2 := pow_le_pow_left₀ (by positivity) (by nlinarith only []) _ /-- The pure tensor map: given `e₁ : E₁` and `e₂ : E₂` with DM structure, produces the sequence `m ↦ coeff(unpair(m).1, e₁) * coeff(unpair(m).2, e₂)`. @@ -927,7 +927,7 @@ theorem pure_seminorm_bound (k : ℕ) : have h4 : (4 : ℝ) ^ k = (2 : ℝ) ^ (2 * k) := by rw [show (4 : ℝ) = 2 ^ 2 from by norm_num, ← pow_mul] rw [h4, ← pow_mul, mul_pow, mul_pow] - linarith + linarith only [h1, h2] have h_a : |DyninMityaginSpace.coeff i e₁| * (1 + (i : ℝ)) ^ (2 * k) ≤ B₁ / (1 + (i : ℝ)) ^ 2 := by rw [le_div_iff₀ (pow_pos hi_pos 2)] @@ -1033,8 +1033,8 @@ private theorem finsetSup_seminorm_ball_mem_nhds intro x hx simp only [Set.mem_iInter, Set.mem_ofPred_eq] at hx ⊢ rcases Seminorm.zero_or_exists_apply_eq_finset_sup q t x with h | ⟨i, hi, heq⟩ - · linarith - · linarith [hx i hi] + · linarith only [hε, h] + · linarith only [hx, hi, heq, hx i hi] /-- The pure tensor map is jointly continuous on `E₁ × E₂`. -/ theorem pure_continuous : @@ -1079,11 +1079,11 @@ theorem pure_continuous : hbound e₁ e₂ _ ≤ ↑C * 1 * (ε / (↑C + 1)) := by apply mul_le_mul (mul_le_mul_of_nonneg_left he₁.le (NNReal.coe_nonneg C)) - he₂.le (apply_nonneg _ _) (mul_nonneg (NNReal.coe_nonneg C) (by linarith)) + he₂.le (apply_nonneg _ _) (mul_nonneg (NNReal.coe_nonneg C) (by linarith only [])) _ = ↑C * ε / (↑C + 1) := by ring _ < ε := by rw [div_lt_iff₀ (by positivity : (0 : ℝ) < ↑C + 1)] - linarith [NNReal.coe_nonneg C] + linarith only [hε, NNReal.coe_nonneg C] · -- Continuity of f x at 0 for each x intro e₁ exact (pureCLMRight e₁).continuous.continuousAt @@ -1132,9 +1132,9 @@ private lemma lift_summable set j := (Nat.unpair m).2 rw [norm_smul, Real.norm_eq_abs] have hi_le : (1 + (i : ℝ)) ≤ (1 + (m : ℝ)) := by - linarith [(Nat.cast_le (α := ℝ)).mpr (Nat.unpair_left_le m)] + linarith only [(Nat.cast_le (α := ℝ)).mpr (Nat.unpair_left_le m)] have hj_le : (1 + (j : ℝ)) ≤ (1 + (m : ℝ)) := by - linarith [(Nat.cast_le (α := ℝ)).mpr (Nat.unpair_right_le m)] + linarith only [(Nat.cast_le (α := ℝ)).mpr (Nat.unpair_right_le m)] have h1i : (0 : ℝ) ≤ 1 + (i : ℝ) := by positivity have h1j : (0 : ℝ) ≤ 1 + (j : ℝ) := by positivity calc |a.val m| * ‖B (DyninMityaginSpace.basis i) (DyninMityaginSpace.basis j)‖ @@ -1505,7 +1505,7 @@ theorem _root_.GaussianField.NuclearTensorProduct.basisVec_eq_pure apply h rw [← Nat.pair_unpair n, ← Nat.pair_unpair m, h₁, h₂] · simp only [h₂, ite_false] - · simp_all + · simp_all only [↓reduceIte, ite_self] end NuclearTensorProduct diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/Basis1D.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/Basis1D.lean index d6bf1ffbe6..5555da9bef 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/Basis1D.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/Basis1D.lean @@ -84,7 +84,7 @@ theorem schwartz_hermite_expansion_CLF -- h states: inner 1 (φ f) = ∑' n, hermiteCoeff1D n f * inner 1 (φ (schwartzHermiteBasis1D n)) -- On ℝ, RCLike.inner_apply tells us: inner x y = y * conj x -- For real numbers, conj x = x, so inner 1 x = x * 1 = x - simp_all + simp_all only [RCLike.inner_apply, conj_trivial, mul_one] /-! ## Seminorm Bounds diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteFunctions.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteFunctions.lean index 9d34a3a7b6..9b589d0744 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteFunctions.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteFunctions.lean @@ -107,18 +107,18 @@ private lemma pow_mul_exp_neg_le (k : ℕ) {b : ℝ} (hb : 0 < b) (x : ℝ) : have hquad : |x| ≤ b / 2 * x ^ 2 + 1 / (2 * b) := by have heq : b / 2 * x ^ 2 + 1 / (2 * b) = (b ^ 2 * x ^ 2 + 1) / (2 * b) := by field_simp rw [heq, le_div_iff₀ (by positivity : (0 : ℝ) < 2 * b)] - nlinarith [sq_abs x, sq_nonneg (b * |x| - 1)] + nlinarith only [sq_abs x, sq_nonneg (b * |x| - 1)] calc |x| ^ k * Real.exp (-b * x ^ 2) ≤ |x| ^ k * Real.exp (-(b / 2) * x ^ 2) := by apply mul_le_mul_of_nonneg_left _ (pow_nonneg (abs_nonneg x) k) - exact Real.exp_le_exp.mpr (by nlinarith [sq_nonneg x]) + exact Real.exp_le_exp.mpr (by nlinarith only [hb, sq_nonneg x]) _ ≤ ↑k.factorial * Real.exp (|x|) * Real.exp (-(b / 2) * x ^ 2) := mul_le_mul_of_nonneg_right hpow (Real.exp_pos _).le _ = ↑k.factorial * (Real.exp (|x|) * Real.exp (-(b / 2) * x ^ 2)) := by ring _ = ↑k.factorial * Real.exp (|x| + -(b / 2) * x ^ 2) := by rw [← Real.exp_add] _ ≤ ↑k.factorial * Real.exp (1 / (2 * b)) := by apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg' _) - exact Real.exp_le_exp.mpr (by linarith) + exact Real.exp_le_exp.mpr (by linarith only [hquad]) /-- Monomial times Gaussian is integrable: ∫ |x^k · exp(-b·x²)| dx < ∞. Uses the bound |x|^k ≤ k! · exp(|x|) (from Taylor series of exp) and @@ -148,7 +148,7 @@ private lemma integrable_pow_mul_exp_neg_mul_sq (k : ℕ) {b : ℝ} (hb : 0 < b) have hquad : |x| ≤ b / 2 * x ^ 2 + 1 / (2 * b) := by have heq : b / 2 * x ^ 2 + 1 / (2 * b) = (b ^ 2 * x ^ 2 + 1) / (2 * b) := by field_simp rw [heq, le_div_iff₀ (by positivity : (0 : ℝ) < 2 * b)] - nlinarith [sq_abs x, sq_nonneg (b * |x| - 1)] + nlinarith only [sq_abs x, sq_nonneg (b * |x| - 1)] -- Step 3: Factor exp(-b·x²) = exp(-(b/2)·x²) · exp(-(b/2)·x²) and combine have hfactor : Real.exp (-b * x ^ 2) = Real.exp (-(b / 2) * x ^ 2) * Real.exp (-(b / 2) * x ^ 2) := by @@ -163,7 +163,7 @@ private lemma integrable_pow_mul_exp_neg_mul_sq (k : ℕ) {b : ℝ} (hb : 0 < b) _ = ↑k.factorial * Real.exp (|x| + -(b / 2) * x ^ 2) := by rw [← Real.exp_add] _ ≤ ↑k.factorial * Real.exp (1 / (2 * b)) := by apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg' _) - exact Real.exp_le_exp.mpr (by linarith) + exact Real.exp_le_exp.mpr (by linarith only [hquad]) /-- For any polynomial p and b > 0, the function x ↦ p(x) · exp(-b·x²) is integrable. Proved by polynomial induction, reducing to monomial integrability. @@ -213,7 +213,7 @@ theorem hermiteFunction_memLp (n : ℕ) : simp only [ENNReal.toReal_ofNat] -- Reduce to showing (hermiteFunction n)² is integrable (npow, avoiding rpow headaches) suffices h : Integrable (fun x : ℝ => (hermiteFunction n x) ^ 2) volume by - simp_all + simp_all only [norm_eq_abs, rpow_ofNat, sq_abs] -- Express (hermiteFunction n x)² as c² · (Q·Q)(x) · exp(-x²) -- where Q = (hermiteR n) ∘ (√2 · X), so Q(x) = Hₙ(x√2) set P := (hermite n).map (Int.castRingHom ℝ) with hP_def @@ -289,13 +289,14 @@ private theorem deriv_hermiteEval_mul_gaussian (m : ℕ) (x : ℝ) : rw [hd] -- Convert deriv of polynomial eval via aeval have hpoly : deriv (fun u => (hermiteR m).eval u) x = (derivative (hermiteR m)).eval x := by - simp_all + simp_all only [Polynomial.deriv, derivative_map] rw [hpoly] have hexp : deriv (fun u : ℝ => Real.exp (-(u ^ 2 / 2))) x = -x * gaussian x := by have h1 : HasDerivAt (fun u : ℝ => -(u ^ 2 / 2)) (-x) x := by have := ((hasDerivAt_pow 2 x).div_const 2).neg have hf : (fun u : ℝ => -(u ^ 2 / 2)) = -fun x => x ^ 2 / 2 := by ext u; simp - simp_all + simp_all only [derivative_map, Polynomial.deriv, Nat.cast_ofNat, Nat.add_one_sub_one, + pow_one, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, mul_div_cancel_left₀] exact h1.exp.deriv.trans (mul_comm _ _) rw [hexp] -- Hermite recurrence: H_{m+1}(x) = x · Hₘ(x) - Hₘ'(x) @@ -303,7 +304,8 @@ private theorem deriv_hermiteEval_mul_gaussian (m : ℕ) (x : ℝ) : x := by have h1 : hermiteR (m + 1) = X * hermiteR m - derivative (hermiteR m) := by unfold hermiteR - simp_all + simp_all only [derivative_map, neg_mul, mul_neg, Polynomial.deriv, hermite_succ, + Polynomial.map_sub, Polynomial.map_mul, map_X] rw [h1]; simp [Polynomial.eval_sub, Polynomial.eval_mul, Polynomial.eval_X] rw [hrec]; ring @@ -453,10 +455,10 @@ private theorem J_succ_zero (k : ℕ) : J (k + 1) 0 = 0 := by simp [J_comm] -- So (k+2) * J(k+1, 0) = J(k+1, 0), hence (k+1) * J(k+1, 0) = 0 have h3 : (↑(k + 1) : ℝ) * J (k + 1) 0 = 0 := by - have h12 : (↑(k + 2) : ℝ) * J (k + 1) 0 - J (k + 1) 0 = 0 := by linarith + have h12 : (↑(k + 2) : ℝ) * J (k + 1) 0 - J (k + 1) 0 = 0 := by linarith only [h1, h2] have : (↑(k + 1) : ℝ) * J (k + 1) 0 = (↑(k + 2) : ℝ) * J (k + 1) 0 - J (k + 1) 0 := by push_cast; ring - linarith + linarith only [h1, h2, this] have h4 : (↑(k + 1) : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr (by omega) exact (mul_eq_zero.mp h3).resolve_left h4 @@ -683,7 +685,7 @@ lemma hermiteR_recurrence_succ (n : ℕ) (t : ℝ) : simp only [Polynomial.map_mul, Polynomial.map_add, Polynomial.map_X, Polynomial.map_natCast, Polynomial.eval_mul, Polynomial.eval_add, Polynomial.eval_X, Polynomial.eval_natCast] at h - linarith + linarith only [h] /-- Hermite recurrence for n = 0: t · H₀(t) = H₁(t). -/ lemma hermiteR_recurrence_zero (t : ℝ) : @@ -943,7 +945,7 @@ private lemma hermiteFunction_deriv_l2_sq (n : ℕ) : Real.mul_self_sqrt (div_nonneg (Nat.cast_nonneg' n) (by norm_num)) have h2 : Real.sqrt (↑(n + 1) / 2) * Real.sqrt (↑(n + 1) / 2) = ↑(n + 1) / 2 := Real.mul_self_sqrt (div_nonneg (Nat.cast_nonneg' (n+1)) (by norm_num)) - nlinarith [h1, h2] + nlinarith only [h1, h2] rw [h_eq] -- Integrability have hA : Integrable f_A := (hermiteFunction_sq_integrable (n - 1)).const_mul _ @@ -987,14 +989,10 @@ private lemma hasDerivAt_hermiteFunction_sq (n : ℕ) (x : ℝ) : /-- The derivative of hermiteFunction n is in L² (as a MemLp function). -/ private lemma deriv_hermiteFunction_memLp (n : ℕ) : MemLp (deriv (hermiteFunction n)) 2 volume := by - -- ψₙ' = √(n/2) ψ_{n-1} - √((n+1)/2) ψ_{n+1}, and each ψⱼ is in L² - have h_eq : deriv (hermiteFunction n) = - fun x => Real.sqrt (↑n / 2) * hermiteFunction (n - 1) x - - Real.sqrt (↑(n + 1) / 2) * hermiteFunction (n + 1) x := by - ext x; exact deriv_hermiteFunction n x - rw [h_eq] - exact (hermiteFunction_memLp (n - 1)).const_mul (Real.sqrt (↑n / 2)) - |>.sub ((hermiteFunction_memLp (n + 1)).const_mul (Real.sqrt (↑(n + 1) / 2))) + obtain ⟨φ, hφ⟩ := hermiteFunction_schwartz n + have heq : (φ : ℝ → ℝ) = hermiteFunction n := funext hφ + rw [← heq] + exact (SchwartzMap.derivCLM ℝ ℝ φ).memLp 2 volume /-- The product ψₙ · ψₙ' is integrable (for Cauchy-Schwarz/FTC). -/ private lemma integrable_hermiteFunction_mul_deriv (n : ℕ) : @@ -1005,7 +1003,7 @@ private lemma integrable_hermiteFunction_mul_deriv (n : ℕ) : private lemma schwartz_tendsto_atBot (φ : SchwartzMap ℝ ℝ) : Filter.Tendsto (fun x => φ x) Filter.atBot (nhds 0) := by have hza := ZeroAtInftyContinuousMapClass.zero_at_infty φ - simp_all + simp_all only [cocompact_eq_atBot_atTop, Filter.tendsto_sup] /-- ψₙ(x)² → 0 as x → -∞. -/ private lemma hermiteFunction_sq_tendsto_atBot (n : ℕ) : @@ -1108,7 +1106,7 @@ theorem hermiteFunction_sup_bound : -- 1 + (2n+1)/2 = (2n+3)/2 ≤ 2(1+n) since 2n+3 ≤ 4+4n iff 0 ≤ 2+2n have h_arith : 1 + (2 * (↑n : ℝ) + 1) / 2 ≤ 2 * (1 + ↑n) := by have : (0 : ℝ) ≤ ↑n := Nat.cast_nonneg n - linarith + linarith only [] have h_sq_le : hermiteFunction n a * hermiteFunction n a ≤ 2 * (1 + ↑n) := le_trans h_sq_final h_arith -- Now |ψ_n(a)|² ≤ 2·(1+n), so |ψ_n(a)| ≤ √(2·(1+n)) = √2 · (1+n)^{1/2} @@ -1145,12 +1143,12 @@ private theorem hermiteFunction_pointwise_bound (k m : ℕ) : -- Base case: k=0, m=0. Use hermiteFunction_sup_bound. obtain ⟨C, s, hC, hs, hbound⟩ := hermiteFunction_sup_bound exact ⟨C, s, hC, hs, fun n x => by - simp_all⟩ + simp_all only [pow_zero, iteratedDeriv_zero, norm_eq_abs, one_mul]⟩ | succ k ih => -- Step k → k+1 (m=0): use mul_x_hermiteFunction -- |x|^{k+1} |ψ_n| = |x|^k |x·ψ_n| ≤ |x|^k (√((n+1)/2)|ψ_{n+1}| + √(n/2)|ψ_{n-1}|) obtain ⟨C, s, hC, hs, hbound⟩ := ih - refine ⟨C * ((2 : ℝ) ^ s + 1), s + 1, by positivity, by linarith, fun n x => ?_⟩ + refine ⟨C * ((2 : ℝ) ^ s + 1), s + 1, by positivity, by linarith only [hs], fun n x => ?_⟩ simp only [iteratedDeriv_zero, Real.norm_eq_abs] at hbound ⊢ -- |x|^{k+1} * |ψ_n(x)| = |x|^k * |x * ψ_n(x)| rw [pow_succ, mul_assoc, ← abs_mul] @@ -1188,15 +1186,16 @@ private theorem hermiteFunction_pointwise_bound (k m : ℕ) : rw [← Real.sqrt_sq (by positivity : (0:ℝ) ≤ 1 + ↑n)] apply Real.sqrt_le_sqrt have : (0 : ℝ) ≤ (n : ℝ) := Nat.cast_nonneg n - nlinarith [sq_nonneg ((n : ℕ) : ℝ)] + nlinarith only [sq_nonneg ((n : ℕ) : ℝ)] have hrpow1 : (1 + ↑(n + 1) : ℝ) ^ s ≤ (2 : ℝ) ^ s * (1 + ↑n) ^ s := by rw [← Real.mul_rpow (by positivity : (0 : ℝ) ≤ 2) (by positivity : (0 : ℝ) ≤ 1 + ↑n)] - apply Real.rpow_le_rpow (by positivity) _ hs; push_cast; linarith + apply Real.rpow_le_rpow (by positivity) _ hs; push_cast; linarith only [] have hrpow2 : (1 + ↑(n - 1) : ℝ) ^ s ≤ (1 + (↑n : ℝ)) ^ s := by apply Real.rpow_le_rpow (by positivity) _ hs - simp_all + simp_all only [Nat.cast_add, Nat.cast_one, Nat.ofNat_nonneg, sqrt_div', + add_le_add_iff_left, Nat.cast_le, tsub_le_iff_right, le_add_iff_nonneg_right, zero_le] have hrpow_split : (1 + (↑n : ℝ)) ^ (s + 1) = (1 + ↑n) ^ s * (1 + ↑n) := by rw [Real.rpow_add (by positivity : (0:ℝ) < 1 + ↑n), Real.rpow_one] calc Real.sqrt ((↑(n + 1) : ℝ) / 2) * (|x| ^ k * |hermiteFunction (n + 1) x|) + @@ -1218,7 +1217,7 @@ private theorem hermiteFunction_pointwise_bound (k m : ℕ) : -- iteratedDeriv (m+1) ψ_n = iteratedDeriv m (ψ_n') -- = √(n/2) · iteratedDeriv m ψ_{n-1} - √((n+1)/2) · iteratedDeriv m ψ_{n+1} obtain ⟨C, s, hC, hs, hbound⟩ := ih - refine ⟨C * ((2 : ℝ) ^ s + 1), s + 1, by positivity, by linarith, fun n x => ?_⟩ + refine ⟨C * ((2 : ℝ) ^ s + 1), s + 1, by positivity, by linarith only [hs], fun n x => ?_⟩ -- iteratedDeriv (m+1) ψ_n = iteratedDeriv m (deriv ψ_n) rw [iteratedDeriv_succ'] -- deriv ψ_n = √(n/2) · ψ_{n-1} - √((n+1)/2) · ψ_{n+1} @@ -1282,10 +1281,12 @@ private theorem hermiteFunction_pointwise_bound (k m : ℕ) : · rw [← Real.sqrt_sq (by positivity : (0 : ℝ) ≤ 1 + ↑n)] apply Real.sqrt_le_sqrt have : (0 : ℝ) ≤ (n : ℝ) := Nat.cast_nonneg n - nlinarith [sq_nonneg ((n : ℕ) : ℝ)] + nlinarith only [sq_nonneg ((n : ℕ) : ℝ)] · apply mul_le_mul_of_nonneg_left _ (le_of_lt hC) apply Real.rpow_le_rpow (by positivity) _ hs - simp_all + simp_all only [norm_eq_abs, Nat.cast_nonneg, sqrt_div, Nat.cast_add, Nat.cast_one, + Nat.ofNat_nonneg, sqrt_div', norm_mul, norm_div, add_le_add_iff_left, Nat.cast_le, + tsub_le_iff_right, le_add_iff_nonneg_right, zero_le] · apply mul_le_mul _ _ (by positivity) (by positivity) · rw [← Real.sqrt_sq (by positivity : (0:ℝ) ≤ 1 + ↑n)] apply Real.sqrt_le_sqrt; push_cast @@ -1294,7 +1295,7 @@ private theorem hermiteFunction_pointwise_bound (k m : ℕ) : · apply mul_le_mul_of_nonneg_left _ (le_of_lt hC) rw [← Real.mul_rpow (by positivity : (0 : ℝ) ≤ 2) (by positivity : (0 : ℝ) ≤ 1 + ↑n)] - apply Real.rpow_le_rpow (by positivity) _ hs; push_cast; linarith + apply Real.rpow_le_rpow (by positivity) _ hs; push_cast; linarith only [] _ = C * ((2:ℝ) ^ s + 1) * ((1 + ↑n) ^ s * (1 + ↑n)) := by ring _ = C * ((2:ℝ) ^ s + 1) * (1 + ↑n) ^ (s + 1) := by rw [Real.rpow_add (by positivity : (0:ℝ) < 1 + ↑n), Real.rpow_one] @@ -1319,7 +1320,7 @@ theorem hermiteFunction_seminorm_bound (k m : ℕ) : · intro x have hext : ⇑(Classical.choose (hermiteFunction_schwartz n)) = hermiteFunction n := funext (Classical.choose_spec (hermiteFunction_schwartz n)) - simp_all + simp_all only [norm_eq_abs] /-! ## Sobolev-Hermite Spaces @@ -1340,7 +1341,7 @@ by the Sobolev-Hermite norms. theorem sobolevHermite_hs_sum_bound (s : ℝ) (hs : 1 / 2 < s) : ∃ C : ℝ, ∀ N : ℕ, ∑ i ∈ Finset.range N, ((1 + (i : ℝ)) ^ (-2 * s)) ≤ C := by -- The series ∑ (1+n)^{-2s} converges when 2s > 1, so partial sums are bounded by tsum - have hexp : -2 * s < -1 := by linarith + have hexp : -2 * s < -1 := by linarith only [hs] have hsumm : Summable (fun i : ℕ => (1 + (i : ℝ)) ^ (-2 * s)) := by have h := (summable_nat_add_iff (f := fun n => (↑n : ℝ) ^ (-2 * s)) 1).mpr (Real.summable_nat_rpow.mpr hexp) @@ -1573,7 +1574,7 @@ private lemma integrable_g_mul_exp_linear _ ≤ |f x| * Real.exp (c ^ 2 + -(x ^ 2 / 4)) := by apply mul_le_mul_of_nonneg_left _ (abs_nonneg _) apply Real.exp_le_exp_of_le - nlinarith [sq_nonneg (|x| / 2 - c), sq_abs x] + linarith only [sq_nonneg (|x| / 2 - c), sq_abs x] _ = Real.exp (c ^ 2) * (|f x| * Real.exp (-(x ^ 2 / 4))) := by rw [Real.exp_add]; ring /-- The L^1 Fourier transform of g(x) = f(x) exp(-x^2/2) vanishes when all @@ -1622,7 +1623,7 @@ private lemma fourierIntegral_f_mul_gaussian_eq_zero have h1 : (-2 : ℝ) * π * (y * ξ) = -(2 * π * (y * ξ)) := by ring rw [h1, abs_neg, abs_mul, abs_of_pos (by positivity : (0 : ℝ) < 2 * π), abs_mul] ring - linarith + linarith only [this] -- Step 3: ‖F N x‖ ≤ bound x have h_bound : ∀ N, ∀ᵐ x ∂volume, ‖F N x‖ ≤ bound x := by intro N @@ -1636,7 +1637,12 @@ private lemma fourierIntegral_f_mul_gaussian_eq_zero = ‖∑ k ∈ Finset.range N, z x ^ k / (Nat.factorial k : ℂ)‖ := rfl _ ≤ ∑ k ∈ Finset.range N, ‖z x ^ k / (Nat.factorial k : ℂ)‖ := norm_sum_le _ _ _ = ∑ k ∈ Finset.range N, ‖z x‖ ^ k / (Nat.factorial k) := by - simp_all + simp_all only [Complex.ofReal_mul, Complex.ofReal_exp, Complex.ofReal_neg, + Complex.ofReal_div, Complex.ofReal_pow, Complex.ofReal_ofNat, neg_mul, norm_mul, + norm_eq_abs, abs_exp, innerₗ_apply_apply, RCLike.inner_apply, conj_trivial, + norm_neg, Complex.norm_ofNat, Complex.norm_real, abs_pi, + Complex.norm_I, mul_one, mul_eq_mul_left_iff, abs_eq_zero, Complex.norm_div, + norm_pow, RCLike.norm_natCast] _ ≤ Real.exp ‖z x‖ := Real.sum_le_exp_of_nonneg (norm_nonneg _) N _ ≤ Real.exp (2 * π * |ξ| * |x|) := @@ -1680,7 +1686,10 @@ private lemma fourierIntegral_f_mul_gaussian_eq_zero intro k y simp only [z, innerₗ_apply_apply] rw [show @inner ℝ ℝ _ y ξ = y * ξ from by - simp_all] + simp_all only [Complex.ofReal_mul, Complex.ofReal_exp, Complex.ofReal_neg, + Complex.ofReal_div, Complex.ofReal_pow, Complex.ofReal_ofNat, neg_mul, norm_mul, + norm_eq_abs, abs_exp, innerₗ_apply_apply, RCLike.inner_apply, conj_trivial, norm_neg, + Complex.norm_ofNat, Complex.norm_real, abs_pi, Complex.norm_I, mul_one]] rw [show (↑(-2 * π * (y * ξ)) : ℂ) * Complex.I = c * ↑y from by simp only [c]; push_cast; ring] rw [mul_pow, Complex.ofReal_pow] @@ -1720,7 +1729,11 @@ private lemma fourierIntegral_f_mul_gaussian_eq_zero congr_arg _ integral_ofReal _ = 0 := by rw [h_moments k, Complex.ofReal_zero, mul_zero] -- Step 8: Limit of zeros is zero - simp_all + simp_all only [Complex.ofReal_mul, Complex.ofReal_exp, Complex.ofReal_neg, Complex.ofReal_div, + Complex.ofReal_pow, Complex.ofReal_ofNat, neg_mul, norm_mul, norm_eq_abs, abs_exp, + innerₗ_apply_apply, RCLike.inner_apply, conj_trivial, norm_neg, + Complex.norm_ofNat, Complex.norm_real, abs_pi, Complex.norm_I, mul_one, + tendsto_const_nhds_iff] /-- If ĝ = 0 and φ is smooth compactly supported, then ∫ φ · g = 0. Uses Parseval identity and Fourier inversion for Schwartz functions. @@ -1779,7 +1792,7 @@ private theorem hermiteFunction_complete_proof : have h_moments := integral_f_xpow_gaussian_zero f hf horth suffices hg : (fun x => f x * Real.exp (-(x ^ 2 / 2))) =ᵐ[volume] 0 by filter_upwards [hg] with x hx - simp_all + simp_all only [Pi.zero_apply, mul_eq_zero, exp_ne_zero, or_false] have hg_loc : LocallyIntegrable (fun x => f x * Real.exp (-(x ^ 2 / 2))) volume := (integrable_f_mul_gaussian f hf).locallyIntegrable exact ae_eq_zero_of_integral_contDiff_smul_eq_zero hg_loc diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteTensorProduct.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteTensorProduct.lean index 7d6f414603..97913572f0 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteTensorProduct.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteTensorProduct.lean @@ -404,7 +404,7 @@ private theorem rapidDecay_hasSum_generic {E : Type*} [NormedAddCommGroup E] [No ContDiff.sum (fun i _ => contDiff_const.mul (h_contDiff i l)) have hcoe_r : (⇑r : E → ℝ) = fun y => (∑' n, a.val n * b n y) - ∑ i ∈ s, G i y := by - ext y; simp_all + ext y; simp_all only [norm_eq_abs, sum_apply, smul_apply, smul_eq_mul, sub_apply] rw [hcoe_r] set h_sum := fun y => ∑ i ∈ s, G i y with h_sum_def have h_neg_cd : ContDiff ℝ l (-h_sum) := hg_cd.neg @@ -418,7 +418,8 @@ private theorem rapidDecay_hasSum_generic {E : Type*} [NormedAddCommGroup E] [No rw [h_sum_def] have h_eq := iteratedFDeriv_sum (𝕜 := ℝ) (f := G) (u := s) (i := l) (fun i _ => contDiff_const.mul (h_contDiff i l)) - simp_all + simp_all only [norm_eq_abs, sum_apply, smul_apply, smul_eq_mul, FunLike.coe_sub, + Finset.sum_apply] rw [h_iFD_h, ← h_summ_iFD.sum_add_tsum_compl (s := s)] abel have h_norm_summ : Summable (fun (i : ↥(↑s : Set ℕ)ᶜ) => @@ -454,7 +455,10 @@ private theorem rapidDecay_hasSum_generic {E : Type*} [NormedAddCommGroup E] [No set t' := t.map ⟨Subtype.val, Subtype.val_injective⟩ with ht'_def have h_disj : Disjoint t' s := by rw [Finset.disjoint_left] - simp_all + simp_all only [norm_eq_abs, sum_apply, smul_apply, smul_eq_mul, FunLike.coe_sub, + Subtype.forall, Set.mem_compl_iff, SetLike.mem_coe, Finset.mem_map, + Function.Embedding.coeFn_mk, Subtype.exists, exists_and_right, exists_eq_right, + forall_exists_index, not_false_eq_true, implies_true] have h_lt := hs₀ t' (Disjoint.mono_right hs h_disj) rw [Real.norm_of_nonneg (Finset.sum_nonneg fun i _ => mul_nonneg (abs_nonneg _) (apply_nonneg _ _))] at h_lt @@ -789,7 +793,7 @@ private lemma hermiteFunction_schwartz_seminorm_bound (n k m : ℕ) : have hcoe : (fun t => hermiteFunction n t) = ⇑φ := (funext hφ).symm refine ⟨SchwartzMap.seminorm ℝ k m φ, apply_nonneg _ _, fun t => ?_⟩ have hle := SchwartzMap.le_seminorm ℝ k m φ t - simp_all + simp_all only [implies_true, norm_eq_abs] -- The projection ‖EuclideanSpace.proj i‖ ≤ 1. private lemma euclidean_proj_norm_le_one (d : ℕ) (i : Fin d) : @@ -816,7 +820,8 @@ private lemma euclidean_norm_le_l1 (d : ℕ) (x : EuclideanSpace ℝ (Fin (d + 1 private lemma euclidean_norm_pow_le (d k : ℕ) (x : EuclideanSpace ℝ (Fin (d + 1))) : ‖x‖ ^ k ≤ ((d + 1 : ℝ) ^ k) * ∑ j : Fin (d + 1), |x j| ^ k := by rcases k with _ | k - · simp_all + · simp_all only [pow_zero, Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, + Nat.cast_add, Nat.cast_one, mul_one, one_mul, le_add_iff_nonneg_left, Nat.cast_nonneg] have h1 : (1 : ℝ) ≤ (d + 1 : ℝ) := by exact_mod_cast Nat.succ_le_succ (Nat.zero_le d) calc ‖x‖ ^ (k + 1) ≤ (∑ j : Fin (d + 1), |x j|) ^ (k + 1) := pow_le_pow_left₀ (norm_nonneg _) (euclidean_norm_le_l1 d x) _ @@ -1371,7 +1376,7 @@ private lemma hermiteCoeffNd_injective_succ (d' : ℕ) apply ih intro β have := hermiteCoeffNd_fubini d' f (Fin.snoc β n) - simp_all + simp_all only [Fin.snoc_castSucc, Fin.snoc_last] -- Step 2: All 1D slices are zero (by 1D completeness) have h_slice : ∀ y, schwartzSlice d' f y = 0 := by intro y @@ -1388,7 +1393,7 @@ private lemma hermiteCoeffNd_injective_succ (d' : ℕ) -- Step 3: f is zero everywhere ext x have h_zero : ∀ y t, (schwartzSlice d' f y) t = 0 := by - simp_all + simp_all only [zero_apply, implies_true] have h_val := h_zero (euclideanInit (d' + 1) x) (x (Fin.last (d' + 1))) rw [schwartz_slice_eq] at h_val rw [zero_apply] @@ -1531,7 +1536,7 @@ private lemma hermiteCoeffNd_decay (d' : ℕ) (k : ℝ) : le_add_of_nonneg_right (Nat.cast_nonneg _) have h_weight : (1 + (MultiIndex.abs α : ℝ)) ^ k ≤ (1 + (MultiIndex.abs α_rest : ℝ)) ^ k := by - apply rpow_le_rpow_of_nonpos (by linarith) (by linarith) hk.le + apply rpow_le_rpow_of_nonpos (by linarith only []) (by linarith only [h_abs_rest_le]) hk.le -- Unweighted axiom at k=0 gives seminorm bound have h_ax0 := h_ax f n simp only [rpow_zero, mul_one] at h_ax0 @@ -1639,7 +1644,8 @@ private lemma schwartzHermiteBasisNd_weighted_product_bound (d k l : ℕ) rw [Finset.prod_const] _ ≤ (C₁ * (1 + (MultiIndex.abs α : ℝ)) ^ s₁) ^ (d + 1) := by have hcard : ((Finset.univ : Finset (Fin (d + 1))).erase j₀).card = d := by - simp_all + simp_all only [Finset.mem_univ, Finset.card_erase_of_mem, Finset.card_univ, + Fintype.card_fin, add_tsub_cancel_right] rw [hcard, pow_succ'] intro α x p calc ‖x‖ ^ k * @@ -2339,7 +2345,7 @@ private lemma hermiteCoeffNd_rapidDecay_schwartzMapNd (d' : ℕ) (a : RapidDecay simp only [hermiteCoeffNdCLM_apply, map_smul, smul_eq_mul, flatBasisNd, hermiteCoeffNd_basisNd_kronecker] -- Use injectivity of multiIndexEquiv.symm to simplify the if-condition - simp_all + simp_all only [EmbeddingLike.apply_eq_iff_eq, mul_ite, mul_one, mul_zero, tsum_ite_eq'] /-- **Completeness of the multi-d Hermite expansion in Schwartz topology.** Proved purely algebraically! The series converges to `S_f := from(to(f))`. diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzHermiteExpansion.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzHermiteExpansion.lean index 8756d92f73..fb8a5fb69a 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzHermiteExpansion.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzHermiteExpansion.lean @@ -241,7 +241,7 @@ theorem schwartz_integration_by_parts_twice -- ibp1 : ∫ (derivCLM f) x * deriv g x = -∫ deriv(derivCLM f) x * g x -- So ∫ deriv(derivCLM f) x * g x = -∫ (derivCLM f) x * deriv g x have lhs_eq : ∫ x, deriv (⇑(derivCLM ℝ ℝ f)) x * g x = - -(∫ x, (derivCLM ℝ ℝ f) x * deriv (⇑g) x) := by linarith + -(∫ x, (derivCLM ℝ ℝ f) x * deriv (⇑g) x) := by linarith only [ibp1] -- Apply IBP to RHS: ∫ f * (derivCLM g)' = -∫ f' * (derivCLM g) -- i.e., ∫ f * deriv(derivCLM g) = -∫ deriv(f) * (derivCLM g) have ibp2 := integral_mul_deriv_eq_neg_deriv_mul f (derivCLM ℝ ℝ g) @@ -251,7 +251,7 @@ theorem schwartz_integration_by_parts_twice simp only [derivCLM_apply] at ibp1 ibp2 lhs_eq ⊢ -- Now lhs_eq : LHS = -(∫ deriv f x * deriv g x) -- ibp2 : RHS = -(∫ deriv f x * deriv g x) - linarith + linarith only [ibp1, ibp2] /-- The harmonic oscillator is symmetric on Schwartz space: ∫ Hf · ψₙ = (2n+1) ∫ f · ψₙ. @@ -303,7 +303,7 @@ theorem hermiteCoeff_harmonic_oscillator (n : ℕ) (f : SchwartzMap ℝ ℝ) : have : x ^ 2 * hermiteFunction n x = (2 * ↑n + 1) * hermiteFunction n x + iteratedDeriv 2 (hermiteFunction n) x := by - linarith + linarith only [h] calc x ^ 2 * f x * hermiteFunction n x = f x * (x ^ 2 * hermiteFunction n x) := by ring _ = f x * ((2 * ↑n + 1) * hermiteFunction n x + @@ -330,7 +330,7 @@ theorem hermiteCoeff_harmonic_oscillator (n : ℕ) (f : SchwartzMap ℝ ℝ) : have hx2 : x ^ 2 * hermiteFunction n x = (2 * ↑n + 1) * hermiteFunction n x + iteratedDeriv 2 (hermiteFunction n) x := by - linarith + linarith only [h] calc x ^ 2 * f x * hermiteFunction n x = f x * (x ^ 2 * hermiteFunction n x) := by ring _ = f x * ((2 * ↑n + 1) * hermiteFunction n x + @@ -358,7 +358,7 @@ theorem hermiteCoeff_harmonic_oscillator (n : ℕ) (f : SchwartzMap ℝ ℝ) : rw [integral_add hint_main hint_diff, integral_const_mul, integral_sub hint_fψ'' hint_f''ψ] -- Goal: (2n+1) * ∫ f·ψₙ + (∫ f·ψₙ'' - ∫ f''·ψₙ) = (2n+1) * hermiteCoeff1D n f -- By IBP: ∫ f''·ψₙ = ∫ f·ψₙ'', so the second term is 0 - rw [hibp]; unfold hermiteCoeff1D; linarith + rw [hibp]; unfold hermiteCoeff1D; linarith only [] /-! ## Section 5: Coefficient Decay @@ -412,7 +412,7 @@ private lemma cauchy_schwarz_integral (f g : ℝ → ℝ) (hf : Integrable (fun (∫ x, 2 * t * (f x * g x)) + ∫ x, t ^ 2 * (g x ^ 2) := integral_add hint1 hint2 rw [h_sq, h_s1, h_s2, integral_const_mul, integral_const_mul]; ring - linarith + linarith only [h0, heq] -- Case split on B by_cases hB : B = 0 · -- B = 0 implies g² =ᵐ 0, hence g =ᵐ 0, hence C = 0 @@ -433,7 +433,7 @@ private lemma cauchy_schwarz_integral (f g : ℝ → ℝ) (hf : Integrable (fun have hsimp : A + 2 * (-C / B) * C + (-C / B) ^ 2 * B = A - C ^ 2 / B := by field_simp; ring rw [hsimp] at h have hCsq : C ^ 2 ≤ A * B := by - have h1 : C ^ 2 / B ≤ A := by linarith + have h1 : C ^ 2 / B ≤ A := by linarith only [h] calc C ^ 2 = C ^ 2 / B * B := by field_simp _ ≤ A * B := mul_le_mul_of_nonneg_right h1 hB_pos.le -- |C| = √(C²) ≤ √(AB) = √A · √B @@ -518,7 +518,7 @@ private lemma schwartz_l2_le_sup_seminorm : have hI_nn : 0 ≤ ∫ x : ℝ, (1 + ‖x‖) ^ ((-2) : ℝ) := integral_nonneg (fun x => rpow_nonneg (by positivity) _) refine ⟨(1, 0), 2 * Real.sqrt (∫ x : ℝ, (1 + ‖x‖) ^ ((-2) : ℝ)) + 1, - by linarith [Real.sqrt_nonneg (∫ x : ℝ, (1 + ‖x‖) ^ ((-2) : ℝ))], fun f => ?_⟩ + by linarith only [Real.sqrt_nonneg (∫ x : ℝ, (1 + ‖x‖) ^ ((-2) : ℝ))], fun f => ?_⟩ set S := (Finset.Iic (1, 0)).sup (fun p => SchwartzMap.seminorm ℝ p.1 p.2) f have hS_nn : (0 : ℝ) ≤ S := apply_nonneg _ _ -- Integrability of f² @@ -545,7 +545,7 @@ private lemma schwartz_l2_le_sup_seminorm : rw [mul_pow, mul_comm ((1 + ‖x‖) ^ 2)]; simp_all rw [h_eq] calc ((1 + ‖x‖) * ‖f x‖) ^ 2 ≤ (2 * S) ^ 2 := - sq_le_sq' (by nlinarith [norm_nonneg (f x)]) (by linarith) + sq_le_sq' (by nlinarith only [hS_nn, hx_pos, norm_nonneg (f x)]) (by linarith only [h]) _ = 4 * S ^ 2 := by ring -- Integrate the bound have h_integral : ∫ x, (f x) ^ 2 ≤ @@ -561,8 +561,8 @@ private lemma schwartz_l2_le_sup_seminorm : _ = Real.sqrt (4 * S ^ 2) * Real.sqrt I := Real.sqrt_mul (by positivity) I _ = 2 * S * Real.sqrt I := by rw [show (4 : ℝ) * S ^ 2 = (2 * S) ^ 2 from by ring, - Real.sqrt_sq (by linarith)] - _ ≤ (2 * Real.sqrt I + 1) * S := by nlinarith [Real.sqrt_nonneg I] + Real.sqrt_sq (by linarith only [hS_nn])] + _ ≤ (2 * Real.sqrt I + 1) * S := by linarith only [hS_nn, Real.sqrt_nonneg I] -- Helper: a single seminorm of T f is bounded by finitely many seminorms of f private lemma clm_single_seminorm_bound (T : (SchwartzMap ℝ ℝ) →L[ℝ] (SchwartzMap ℝ ℝ)) @@ -620,7 +620,7 @@ private lemma clm_finset_sup_seminorm_bound _ ≤ (C_a : ℝ) * (Finset.Iic (q₁, q₂)).sup snf f := mul_le_mul_of_nonneg_left (hsub_a f) (NNReal.coe_nonneg C_a) _ ≤ (max C_s (C_a : ℝ) + 1) * (Finset.Iic (q₁, q₂)).sup snf f := by - gcongr; linarith [le_max_right C_s (C_a : ℝ)] + gcongr; linarith only [le_max_right C_s (C_a : ℝ)] · -- Bound for the rest (from IH) have hsub_s : (Finset.Iic q_s).sup snf ≤ (Finset.Iic (q₁, q₂)).sup snf := by apply Finset.sup_le; intro ⟨i, j⟩ hij @@ -632,7 +632,7 @@ private lemma clm_finset_sup_seminorm_bound _ ≤ C_s * (Finset.Iic (q₁, q₂)).sup snf f := mul_le_mul_of_nonneg_left (hsub_s f) (le_of_lt hC_s) _ ≤ (max C_s (C_a : ℝ) + 1) * (Finset.Iic (q₁, q₂)).sup snf f := by - gcongr; linarith [le_max_left C_s (C_a : ℝ)] + gcongr; linarith only [le_max_left C_s (C_a : ℝ)] -- Helper: sup-seminorms of T f bounded by sup-seminorms of f (single step, Iic version) private lemma clm_sup_seminorm_bound (T : (SchwartzMap ℝ ℝ) →L[ℝ] (SchwartzMap ℝ ℝ)) @@ -696,7 +696,7 @@ theorem hermiteCoeff1D_decay : (le_trans (le_max_left k 0) (Nat.le_ceil (max k 0))) _ = (1 + ↑n) ^ m := by rw [rpow_natCast] _ ≤ (2 * ↑n + 1) ^ m := - pow_le_pow_left₀ (by positivity) (by linarith) m + pow_le_pow_left₀ (by positivity) (by linarith only []) m -- Combine the exponent comparison and coefficient bound. calc |hermiteCoeff1D n f| * (1 + ↑n) ^ k ≤ |hermiteCoeff1D n f| * (2 * ↑n + 1) ^ m := @@ -813,7 +813,7 @@ private lemma partial_sum_inner_hermite (f : SchwartzMap ℝ ℝ) (N m : ℕ) (h (fun x => hermiteCoeff1D n f * (hermiteFunction n x * hermiteFunction m x)) from by intro n; ext x; ring] simp_rw [integral_const_mul, hermiteFunction_orthonormal] - simp_all + simp_all only [mul_ite, mul_one, mul_zero, Finset.sum_ite_eq', Finset.mem_range, ↓reduceIte] -- Helper: the L² norm of the partial sum: ∫ (∑ cₙψₙ)² = ∑ cₙ² private lemma partial_sum_l2_norm_sq (f : SchwartzMap ℝ ℝ) (N : ℕ) : @@ -886,7 +886,7 @@ private lemma bessel_inequality (f : SchwartzMap ℝ ℝ) (N : ℕ) : have hnn : 0 ≤ ∫ x, (f x - ∑ n ∈ Finset.range N, hermiteCoeff1D n f * hermiteFunction n x) ^ 2 := integral_nonneg (fun x => sq_nonneg _) - linarith + linarith only [h, hnn] -- Helper: summability of hermiteCoeff squares (Bessel's inequality) private lemma hermiteCoeff_sq_summable (f : SchwartzMap ℝ ℝ) : @@ -1046,7 +1046,7 @@ private lemma integral_tsum_mul_hermite (f : SchwartzMap ℝ ℝ) (m : ℕ) : simp only [Pi.add_apply] have h := two_mul_le_add_sq |hermiteFunction n a| |hermiteFunction m a| rw [sq_abs, sq_abs] at h - linarith + linarith only [h] _ = 1 := by rw [integral_div, integral_add (hψ_sq_int n) (hψ_sq_int m), hψ_sq n, hψ_sq m] norm_num @@ -1342,7 +1342,7 @@ private lemma schwartz_seminorm_remainder_le (f : SchwartzMap ℝ ℝ) (k l : have h_eq := iteratedFDeriv_sum (𝕜 := ℝ) (f := g) (u := s) (i := l) (fun i _ => (contDiff_const.mul (hermiteFunction_contDiff i l)).of_le le_rfl) -- h_eq : iteratedFDeriv ℝ l (∑ j ∈ s, g j ·) = ∑ j ∈ s, iteratedFDeriv ℝ l (g j) - simp_all + simp_all only [sum_apply, smul_apply, smul_eq_mul, Finset.sum_apply] -- Step 4: iteratedFDeriv of r = ∑'_{i∉s} iteratedFDeriv(gₙ) have h_iFD_r : iteratedFDeriv ℝ l (⇑r) x = ∑' (i : ↥(↑s : Set ℕ)ᶜ), iteratedFDeriv ℝ l (g ↑i) x := by @@ -1352,7 +1352,7 @@ private lemma schwartz_seminorm_remainder_le (f : SchwartzMap ℝ ℝ) (k l : (contDiff_const.mul (hermiteFunction_contDiff i l)).of_le le_rfl) -- ⇑r = ⇑f - (finite sum function) have hcoe_r : (⇑r : ℝ → ℝ) = fun y => f y - ∑ i ∈ s, g i y := by - ext y; simp_all + ext y; simp_all only [sum_apply, smul_apply, smul_eq_mul, sub_apply] rw [hcoe_r] -- Compute iteratedFDeriv of (f - sum) via iteratedFDeriv_add + iteratedFDeriv_neg set h_sum := fun y => ∑ i ∈ s, g i y with h_sum_def @@ -1367,7 +1367,7 @@ private lemma schwartz_seminorm_remainder_le (f : SchwartzMap ℝ ℝ) (k l : have h_eq := iteratedFDeriv_sum (𝕜 := ℝ) (f := g) (u := s) (i := l) (fun i _ => (contDiff_const.mul (hermiteFunction_contDiff i l)).of_le le_rfl) -- h_eq : iteratedFDeriv ℝ l (∑ j ∈ s, g j ·) = ∑ j ∈ s, iteratedFDeriv ℝ l (g j) - simp_all + simp_all only [sum_apply, smul_apply, smul_eq_mul, FunLike.coe_sub, Finset.sum_apply] rw [h_iFD_h, ← h_summ_iFD.sum_add_tsum_compl (s := s)] abel -- Step 5: Bound |x|^k * ‖iteratedDeriv l r x‖ @@ -1419,7 +1419,10 @@ private lemma schwartz_seminorm_remainder_le (f : SchwartzMap ℝ ℝ) (k l : set t' := t.map ⟨Subtype.val, Subtype.val_injective⟩ with ht'_def have h_disj : Disjoint t' s := by rw [Finset.disjoint_left] - simp_all + simp_all only [sum_apply, smul_apply, smul_eq_mul, FunLike.coe_sub, Subtype.forall, + Set.mem_compl_iff, SetLike.mem_coe, Finset.mem_map, Function.Embedding.coeFn_mk, + Subtype.exists, exists_and_right, exists_eq_right, forall_exists_index, + not_false_eq_true, implies_true] have h_le := h_vanish t' h_disj rwa [ht'_def, Finset.sum_map] at h_le diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzSlicing.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzSlicing.lean index 209976f99c..d9dab36999 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzSlicing.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzSlicing.lean @@ -131,7 +131,8 @@ private lemma euclideanSnoc_antilipschitz (d : ℕ) · intro j; simp [Fin.snoc_castSucc] have hsum : ∑ i, ‖(euclideanSnoc (d+1) y s - euclideanSnoc (d+1) y t) i‖ ^ 2 = ‖s - t‖ ^ 2 := by - simp_all + simp_all only [PiLp.sub_apply, norm_eq_abs, ite_pow, sq_abs, ne_eq, OfNat.ofNat_ne_zero, + not_false_eq_true, zero_pow, Finset.sum_ite_eq', Finset.mem_univ, ↓reduceIte] change dist s t ≤ dist (euclideanSnoc (d + 1) y s) (euclideanSnoc (d + 1) y t) rw [dist_eq_norm, dist_eq_norm (E := EuclideanSpace ℝ _), EuclideanSpace.norm_eq, hsum, Real.sqrt_sq (norm_nonneg _)] @@ -154,7 +155,7 @@ private lemma euclideanSnoc_norm_sq (d : ℕ) (∑ j : Fin (d + 1), ‖(euclideanSnoc (d + 1) y t) (Fin.castSucc j)‖ ^ 2) + ‖(euclideanSnoc (d + 1) y t) (Fin.last (d + 1))‖ ^ 2 from Fin.sum_univ_castSucc _] - simp_all + simp_all only [norm_eq_abs, sq_abs] /-- The first `d+1` coordinates contribute to the norm: `‖y‖ ≤ ‖euclideanSnoc (d+1) y t‖`. @@ -166,7 +167,7 @@ private lemma euclideanSnoc_norm_ge_left (d : ℕ) ← Real.sqrt_sq (norm_nonneg (euclideanSnoc (d + 1) y t))] apply Real.sqrt_le_sqrt rw [euclideanSnoc_norm_sq] - linarith [sq_nonneg t] + linarith only [sq_nonneg t] /-- The last coordinate contributes to the norm: `|t| ≤ ‖euclideanSnoc (d+1) y t‖`. @@ -178,7 +179,7 @@ private lemma euclideanSnoc_norm_ge_right (d : ℕ) ← Real.sqrt_sq (norm_nonneg (euclideanSnoc (d + 1) y t))] apply Real.sqrt_le_sqrt rw [euclideanSnoc_norm_sq, Real.norm_eq_abs, sq_abs] - linarith [sq_nonneg ‖y‖] + linarith only [sq_nonneg ‖y‖] -- A1: Slicing a Schwartz function along the last coordinate /-- Restrict `f ∈ S(ℝ^{d+2})` to the hyperplane `{x | x_rest = y}`, @@ -255,7 +256,8 @@ private lemma euclideanSnoc_y_hasTemperateGrowth (d : ℕ) (t : ℝ) : rw [one_mul] have hdef : ‖L_fun y‖ = ‖euclideanSnoc (d + 1) y 0‖ := rfl have h : ‖euclideanSnoc (d + 1) y 0‖ ^ 2 = ‖y‖ ^ 2 := by rw [euclideanSnoc_norm_sq]; ring - simp_all + simp_all only [norm_nonneg, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, pow_left_inj₀, + Std.le_refl] set L := L_fun.mkContinuous 1 hL_bound have h_eq : (fun y => euclideanSnoc (d + 1) y t) = fun y => c + L y := by funext y @@ -291,7 +293,8 @@ private lemma euclideanSnoc_y_antilipschitz (d : ℕ) (t : ℝ) : · simp [Fin.snoc_last] · intro j; simp [Fin.snoc_castSucc]] rw [euclideanSnoc_norm_sq]; ring - simp_all + simp_all only [norm_nonneg, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, pow_left_inj₀, + Std.le_refl] /-- For fixed `t`, the composition `f ∘ euclideanSnoc · t` is a Schwartz function of `y`. -/ private noncomputable def schwartz_slice_y (d : ℕ) @@ -647,7 +650,8 @@ Used for the `L_t` norm bound in several places. private lemma euclideanSnoc_Pi_single_norm_le (d : ℕ) (t : ℝ) : ‖(EuclideanSpace.equiv (Fin (d + 2)) ℝ).symm (Pi.single (Fin.last (d + 1)) t)‖ ≤ ‖t‖ := by - simp_all + simp_all only [PiLp.continuousLinearEquiv_symm_apply, PiLp.toLp_single, PiLp.norm_single, + norm_eq_abs, Std.le_refl] /-- The map `t ↦ euclideanSnoc y t` is smooth (affine in `t`). -/ private lemma euclideanSnoc_t_contDiff (d : ℕ) @@ -925,7 +929,7 @@ lemma schwartz_partial_hermiteCoeff_iteratedFDeriv (d : ℕ) gcongr; simpa using schwartz_slice_y_le_seminorm d f t 0 l' y _ = f.seminorm ℝ 0 l' * ‖hermiteFunction n t‖ := mul_comm _ _) rw [ContinuousMultilinearMap.integral_apply h_int v] - congr 1; simp_all + congr 1; simp_all only /-- Pointwise bound for the scalarized slice: for each `t`, `‖y‖^k * ‖t‖^a * ‖D^b_t[slice_partial](t)‖ ≤ ‖apply w‖ * f.seminorm (k+a) (b+l')`. diff --git a/LeanPool/OSforGFF/General/BesselFunction.lean b/LeanPool/OSforGFF/General/BesselFunction.lean index a006463b6e..5da908d38c 100644 --- a/LeanPool/OSforGFF/General/BesselFunction.lean +++ b/LeanPool/OSforGFF/General/BesselFunction.lean @@ -83,19 +83,20 @@ private lemma besselK1_integrand_integrableOn_Ioi (z : ℝ) (hz : 0 < z) : have h_cosh_le : cosh t ≤ exp t := by rw [cosh_eq] linarith [exp_le_exp.mpr (by linarith : -t ≤ t)] - have h_cosh_ge : cosh t ≥ exp t / 2 := by rw [cosh_eq]; linarith [exp_nonneg (-t)] + have h_cosh_ge : cosh t ≥ exp t / 2 := by rw [cosh_eq]; linarith only [exp_nonneg (-t)] calc cosh t * exp (t - z * cosh t) ≤ exp t * exp (t - z * cosh t) := mul_le_mul_of_nonneg_right h_cosh_le (exp_nonneg _) _ ≤ exp t * exp (t - z * (exp t / 2)) := by apply mul_le_mul_of_nonneg_left _ (exp_nonneg _) apply exp_le_exp.mpr - linarith [mul_le_mul_of_nonpos_left h_cosh_ge (by linarith : -z ≤ 0)] + linarith only [hz, h_cosh_ge, + mul_le_mul_of_nonpos_left h_cosh_ge (by linarith : -z ≤ 0)] _ = exp (2 * t - z * exp t / 2) := by rw [← exp_add]; ring_nf have h_exp_to_zero : Tendsto (fun t => exp (2 * t - z * exp t / 2)) atTop (nhds 0) := by apply tendsto_exp_atBot.comp have hexp_inf : Tendsto (fun t : ℝ => z * exp t / 2) atTop atTop := - Tendsto.atTop_div_const (by linarith) + Tendsto.atTop_div_const (by linarith only []) (Tendsto.const_mul_atTop hz tendsto_exp_atTop) have h_ratio : Tendsto (fun t : ℝ => t / exp t) atTop (nhds 0) := by have h := tendsto_pow_mul_exp_neg_atTop_nhds_zero 1; simp only [pow_one] at h @@ -122,7 +123,7 @@ private lemma besselK1_integrand_integrableOn_Ioi (z : ℝ) (hz : 0 < z) : have hgt : 0 < exp (-t) := exp_pos _ rw [abs_lt] at ht have : f t < exp (-t) := (div_lt_one hgt).mp ht.2 - simp only [neg_mul, one_mul]; linarith + simp only [neg_mul, one_mul]; linarith only [this] filter_upwards [h_eventually_le] with t ht rw [Real.norm_of_nonneg (besselK1_integrand_nonneg z t), Real.norm_of_nonneg (exp_nonneg _)] simpa only [one_mul] using ht @@ -131,7 +132,7 @@ private lemma besselK1_integrand_integrableOn_Ioi (z : ℝ) (hz : 0 < z) : private lemma besselK1_integrand_integrableOn_Ici_one (z : ℝ) (hz : 0 < z) : IntegrableOn (fun t => exp (-z * cosh t) * cosh t) (Ici 1) volume := (besselK1_integrand_integrableOn_Ioi z hz).mono_set - (fun x hx => by simp only [mem_Ioi, mem_Ici] at *; linarith) + (fun x hx => by simp only [mem_Ioi, mem_Ici] at *; linarith only [hx]) /-- The tail integral `∫₁^∞ exp(-z cosh t) cosh t dt` is bounded by `(2/z) exp(-z e/2)`. The bound `g t = e^t exp(-z e^t/2)` has the explicit antiderivative @@ -145,7 +146,7 @@ private lemma besselK1_integrand_tail_integral_le (z : ℝ) (hz : 0 < z) : have h_bound' : ∀ t ≥ (1 : ℝ), f t ≤ g t := by intro t _ simp only [hf_def, hg_def] - have h_cosh_ge : cosh t ≥ exp t / 2 := by rw [cosh_eq]; linarith [exp_nonneg (-t)] + have h_cosh_ge : cosh t ≥ exp t / 2 := by rw [cosh_eq]; linarith only [exp_nonneg (-t)] have h_cosh_le : cosh t ≤ exp t := by rw [cosh_eq] linarith [exp_le_exp.mpr (by linarith : -t ≤ t)] @@ -175,7 +176,7 @@ private lemma besselK1_integrand_tail_integral_le (z : ℝ) (hz : 0 < z) : have h1 : Tendsto (fun t => exp (-z * exp t / 2)) atTop (nhds 0) := by apply tendsto_exp_atBot.comp have h3 : Tendsto (fun t : ℝ => z / 2 * exp t) atTop atTop := - tendsto_exp_atTop.const_mul_atTop (by linarith : 0 < z / 2) + tendsto_exp_atTop.const_mul_atTop (by linarith only [hz] : 0 < z / 2) have h4 : Tendsto (fun t => -(z / 2 * exp t)) atTop atBot := Filter.tendsto_neg_atTop_atBot.comp h3 convert h4 using 1; ext t; ring @@ -239,7 +240,7 @@ lemma besselK1_continuousOn : ContinuousOn besselK1 (Ioi 0) := by exact (((continuous_exp.comp (continuous_const.mul continuous_cosh)).mul continuous_cosh).aestronglyMeasurable).restrict -- Dominated by bound for z in neighborhood of z₀ - · have hne : Ioi (z₀/2) ∈ nhds z₀ := Ioi_mem_nhds (by linarith : z₀/2 < z₀) + · have hne : Ioi (z₀/2) ∈ nhds z₀ := Ioi_mem_nhds (by linarith only [hz₀] : z₀/2 < z₀) filter_upwards [hne] with z hz filter_upwards with t rw [Real.norm_of_nonneg (mul_nonneg (exp_nonneg _) (cosh_pos t).le)] @@ -249,11 +250,11 @@ lemma besselK1_continuousOn : ContinuousOn besselK1 (Ioi 0) := by apply exp_le_exp.mpr -- Need: -z * cosh t ≤ -(z₀/2) * cosh t, i.e., (z₀/2) * cosh t ≤ z * cosh t have hcosh : 0 < cosh t := cosh_pos t - nlinarith [hcosh, hz] + nlinarith only [hz, hcosh] -- Bound is integrable (super-exponential decay via the shared helper with `z := z₀/2`) · have hbound_eq : bound = fun t => exp (-(z₀ / 2) * cosh t) * cosh t := hbound_def rw [hbound_eq] - exact (besselK1_integrand_integrableOn_Ioi (z₀ / 2) (by linarith)).congr_set_ae + exact (besselK1_integrand_integrableOn_Ioi (z₀ / 2) (by linarith only [hz₀])).congr_set_ae Ioi_ae_eq_Ici.symm -- Integrand is continuous in z for each t · filter_upwards with t @@ -354,12 +355,12 @@ lemma besselK1_mul_self_le (z : ℝ) (hz : 0 < z) (hz_le : z ≤ 1) : intro t ⟨ht0, ht1⟩ simp only [hf_def] have h_exp_le : exp (-z * cosh t) ≤ 1 := by - rw [exp_le_one_iff]; nlinarith [cosh_pos t] + rw [exp_le_one_iff]; nlinarith only [hz, cosh_pos t] have h_cosh_le : cosh t ≤ cosh 1 := by -- cosh is increasing on [0,∞), so for 0 ≤ t ≤ 1, cosh t ≤ cosh 1 rw [cosh_le_cosh] - rwa [abs_of_nonneg ht0, abs_of_pos (by linarith : (0:ℝ) < 1)] - calc exp (-z * cosh t) * cosh t ≤ 1 * cosh t := by nlinarith [cosh_pos t] + rwa [abs_of_nonneg ht0, abs_of_pos (by linarith only [] : (0:ℝ) < 1)] + calc exp (-z * cosh t) * cosh t ≤ 1 * cosh t := by nlinarith only [h_exp_le, cosh_pos t] _ ≤ cosh 1 := by simp [h_cosh_le] have h_meas_finite : volume (Icc (0:ℝ) 1) < ⊤ := measure_Icc_lt_top have h_meas_ne_top : volume (Icc (0:ℝ) 1) ≠ ⊤ := h_meas_finite.ne @@ -368,7 +369,11 @@ lemma besselK1_mul_self_le (z : ℝ) (hz : 0 < z) (hz_le : z ≤ 1) : have h_mono : ∫ t in Icc 0 1, f t ≤ ∫ _ in Icc (0:ℝ) 1, cosh 1 := by apply setIntegral_mono_on hf_int_Icc h_const_int measurableSet_Icc exact h_pointwise - simp_all + simp_all only [neg_mul, mem_Icc, and_imp, volume_Icc, sub_zero, ENNReal.ofReal_one, + ENNReal.one_lt_top, ne_eq, ENNReal.one_ne_top, not_false_eq_true, enorm_ne_top, + integrableOn_const_iff, enorm_eq_zero, or_true, integral_const, MeasurableSet.univ, + measureReal_restrict_apply, univ_inter, volume_real_Icc, zero_le_one, sup_of_le_left, + smul_eq_mul, one_mul] -- Part 2: Bound z * ∫₁^∞ f(t) dt ≤ 2 via the shared tail-integral helper have h_part2 : z * ∫ t in Ici 1, f t ≤ 2 := by rw [hf_def] @@ -378,16 +383,17 @@ lemma besselK1_mul_self_le (z : ℝ) (hz : 0 < z) (hz_le : z ≤ 1) : _ = 2 * exp (-z * exp 1 / 2) := by field_simp _ ≤ 2 * 1 := by apply mul_le_mul_of_nonneg_left _ (by norm_num : (0:ℝ) ≤ 2) - rw [exp_le_one_iff]; nlinarith [exp_pos (1:ℝ)] + rw [exp_le_one_iff]; nlinarith only [hz, exp_pos (1:ℝ)] _ = 2 := by ring -- Combine: Use Ico instead of Icc for proper disjointness have h_union' : Ici (0 : ℝ) = Ico 0 1 ∪ Ici 1 := by - simp_all + simp_all only [neg_mul, zero_le_one, Ico_union_Ici_eq_Ici] have hf_int_Ico : IntegrableOn f (Ico 0 1) := hf_int_Icc.mono_set Ico_subset_Icc_self -- Disjointness: Ico 0 1 and Ici 1 are disjoint since x < 1 and x ≥ 1 are contradictory have h_disjoint : Disjoint (Ico (0:ℝ) 1) (Ici 1) := by rw [Set.disjoint_left] - simp_all + simp_all only [neg_mul, zero_le_one, Ico_union_Ici_eq_Ici, mem_Ico, mem_Ici, not_le, + implies_true] -- The integrals over Ico and Icc are equal (they differ by a null set) have h_Ico_eq_Icc : ∫ t in Ico 0 1, f t = ∫ t in Icc 0 1, f t := setIntegral_congr_set Ico_ae_eq_Icc @@ -395,8 +401,8 @@ lemma besselK1_mul_self_le (z : ℝ) (hz : 0 < z) (hz_le : z ≤ 1) : have h_int_le : ∫ t in Ico 0 1, f t ≤ cosh 1 := by rw [h_Ico_eq_Icc]; exact h_part1 have h_z_mul_le : z * ∫ t in Ico 0 1, f t ≤ z * cosh 1 := mul_le_mul_of_nonneg_left h_int_le hz.le - have h_z_cosh_le : z * cosh 1 ≤ 1 * cosh 1 := by nlinarith [cosh_pos (1:ℝ)] - linarith + have h_z_cosh_le : z * cosh 1 ≤ 1 * cosh 1 := by nlinarith only [hz_le, cosh_pos (1:ℝ)] + linarith only [h_z_mul_le, h_z_cosh_le] have h_split : ∫ t in Ici 0, f t = (∫ t in Ico 0 1, f t) + (∫ t in Ici 1, f t) := by rw [h_union'] exact setIntegral_union h_disjoint measurableSet_Ici hf_int_Ico hf_int_Ici @@ -437,17 +443,17 @@ lemma radial_besselK1_integrable (m : ℝ) (hm : 0 < m) : -- For r ∈ (0, 1/m], we have mr ∈ (0, 1], so K₁(mr) ≤ (cosh 1 + 2)/(mr) -- The function (cosh 1 + 2)*r/m is integrable on (0, 1/m] set C := cosh 1 + 2 with hC_def - have hC_pos : 0 < C := by simp only [hC_def]; linarith [cosh_pos (1:ℝ)] + have hC_pos : 0 < C := by simp only [hC_def]; linarith only [cosh_pos (1:ℝ)] -- Bound: r² K₁(mr) ≤ C * r / m for r ∈ (0, 1/m] have h_bound : ∀ r ∈ Ioc (0:ℝ) (1/m), r ^ 2 * besselK1 (m * r) ≤ C * r / m := by intro r ⟨hr_pos, hr_le⟩ have hmr_pos : 0 < m * r := by positivity have hmr_le : m * r ≤ 1 := by - calc m * r ≤ m * (1/m) := by nlinarith + calc m * r ≤ m * (1/m) := by nlinarith only [hm, hr_le] _ = 1 := by field_simp have h := besselK1_near_origin_bound (m * r) hmr_pos hmr_le calc r ^ 2 * besselK1 (m * r) - ≤ r ^ 2 * (C / (m * r)) := by nlinarith [besselK1_pos (m * r) hmr_pos] + ≤ r ^ 2 * (C / (m * r)) := by nlinarith only [h, besselK1_pos (m * r) hmr_pos] _ = C * r / m := by field_simp [ne_of_gt hr_pos, ne_of_gt hm] -- The bounding function C*r/m is integrable on (0, 1/m] have h_bound_int : IntegrableOn (fun r => C * r / m) (Ioc 0 (1/m)) := @@ -483,7 +489,7 @@ lemma radial_besselK1_integrable (m : ℝ) (hm : 0 < m) : set C := sinh 1 + 2 with hC_def have hC_pos : 0 < C := by simp only [hC_def] - nlinarith [sinh_pos_iff.mpr (by norm_num : (0 : ℝ) < 1)] + linarith only [sinh_pos_iff.mpr (by norm_num : (0 : ℝ) < 1)] -- Bound: r² K₁(mr) ≤ C * r² * exp(-mr) for r > 1/m have h_bound : ∀ r ∈ Ioi (1 / m : ℝ), @@ -493,7 +499,7 @@ lemma radial_besselK1_integrable (m : ℝ) (hm : 0 < m) : simp only [mem_Ioi] at hr have h1 : m * (1/m) = 1 := by field_simp have h2 : m * r > m * (1/m) := mul_lt_mul_of_pos_left hr hm - linarith + linarith only [h1, h2] have hK1_bound := besselK1_asymptotic (m * r) hmr_ge calc r ^ 2 * besselK1 (m * r) ≤ r ^ 2 * (C * exp (-(m * r))) := by @@ -505,7 +511,7 @@ lemma radial_besselK1_integrable (m : ℝ) (hm : 0 < m) : -- Use integrable_of_isBigO_exp_neg: polynomial times exponential is integrable have h_int' : IntegrableOn (fun r => r ^ 2 * exp (-m * r)) (Ioi (1/m)) := by -- r² * exp(-mr) = O(exp(-m/2 * r)) since r² * exp(-mr/2) → 0 - apply integrable_of_isBigO_exp_neg (by linarith : 0 < m/2) + apply integrable_of_isBigO_exp_neg (by linarith only [hm] : 0 < m/2) · -- ContinuousOn (fun r => r² * exp(-mr)) (Ici (1/m)) apply ContinuousOn.mul (continuous_pow 2).continuousOn exact (by continuity : Continuous (fun r : ℝ => exp (-m * r))).continuousOn @@ -514,7 +520,7 @@ lemma radial_besselK1_integrable (m : ℝ) (hm : 0 < m) : have h_tendsto := tendsto_pow_mul_exp_neg_atTop_nhds_zero 2 -- Scale: (m/2 * r)² * exp(-(m/2)*r) → 0, so r² * exp(-(m/2)*r) → 0 have h_scale : Tendsto (fun r => r ^ 2 * exp (-(m/2) * r)) atTop (nhds 0) := by - have hm2 : 0 < m / 2 := by linarith + have hm2 : 0 < m / 2 := by linarith only [hm] have h1 := h_tendsto.comp (tendsto_id.const_mul_atTop hm2) -- Simplify h1 from composition form simp only [Function.comp_def, id] at h1 @@ -535,7 +541,7 @@ lemma radial_besselK1_integrable (m : ℝ) (hm : 0 < m) : -- Eventually r² * exp(-mr/2) ≤ 1 have h_ev : ∀ᶠ r in atTop, r ^ 2 * exp (-(m/2) * r) ≤ 1 := (Metric.tendsto_nhds.mp h_scale 1 one_pos).mono fun r h => by - simp only [Real.dist_eq, sub_zero] at h; rw [abs_lt] at h; linarith + simp only [Real.dist_eq, sub_zero] at h; rw [abs_lt] at h; linarith only [h] -- Now prove the IsBigO apply Asymptotics.IsBigO.of_bound 1 filter_upwards [eventually_ge_atTop (1:ℝ), h_ev] with r hr h_le @@ -547,7 +553,7 @@ lemma radial_besselK1_integrable (m : ℝ) (hm : 0 < m) : calc r ^ 2 * exp (-m * r) = r ^ 2 * (exp (-(m/2) * r) * exp (-(m/2) * r)) := by rw [hexp] _ = (r ^ 2 * exp (-(m/2) * r)) * exp (-(m/2) * r) := by ring - _ ≤ 1 * exp (-(m/2) * r) := by nlinarith [exp_pos (-(m/2) * r)] + _ ≤ 1 * exp (-(m/2) * r) := by nlinarith only [h_le, exp_pos (-(m/2) * r)] _ = exp (-(m/2) * r) := one_mul _ have h_eq : (fun r => C * r ^ 2 * exp (-m * r)) = (fun r => C * (r ^ 2 * exp (-m * r))) := by ext r; ring @@ -564,12 +570,12 @@ lemma radial_besselK1_integrable (m : ℝ) (hm : 0 < m) : intro r hr; simp only [mem_Ioi] at hr ⊢; exact mul_pos hm hr -- Ioi (1/m) ⊆ Ioi 0 for the restriction have hsub : Ioi (1 / m) ⊆ Ioi 0 := fun r hr => by - simp_all + simp_all only [one_div, mem_Ioi, neg_mul, mem_union, mem_Ioc, or_true] exact (hcont.mono hsub).aestronglyMeasurable measurableSet_Ioi have h_nonneg : ∀ r ∈ Ioi (1/m : ℝ), 0 ≤ r ^ 2 * besselK1 (m * r) := by intro r hr apply mul_nonneg (sq_nonneg r) - have hr' : 0 < r := by simp only [mem_Ioi] at hr; linarith [one_div_pos.mpr hm] + have hr' : 0 < r := by simp only [mem_Ioi] at hr; linarith only [hm, hr, one_div_pos.mpr hm] exact (besselK1_pos (m * r) (mul_pos hm hr')).le have h_norm_bound : ∀ᵐ r ∂(volume.restrict (Ioi (1 / m))), @@ -612,22 +618,22 @@ lemma bessel_symmetry_integral (z : ℝ) (hz : 0 < z) : have hu4 : u ≥ 4 := le_trans (le_max_left _ _) hu have hu8z : u ≥ 8/z := le_trans (le_max_right _ _) hu have hzu : z * u ≥ 8 := by - calc z * u ≥ z * (8 / z) := by nlinarith [hu8z] + calc z * u ≥ z * (8 / z) := by nlinarith only [hz, hu8z] _ = 8 := by field_simp have h_cosh_eq : cosh u = (exp u + exp (-u)) / 2 := cosh_eq u have h_cosh_lower : cosh u ≥ exp u / 2 := by - rw [h_cosh_eq]; have := exp_pos (-u); linarith + rw [h_cosh_eq]; have := exp_pos (-u); linarith only [this] have h_cosh_pos : 0 < cosh u := cosh_pos u -- Key bound: exp(u) ≥ u²/2 for u ≥ 4 -- Proof: exp(4) > 49 > 8 = 4²/2, and exp(u) - u²/2 is increasing for u ≥ 4 have h_exp_ge_usq : exp u ≥ u^2 / 2 := by - have h_exp1 : exp 1 > 2.7 := by have := Real.exp_one_gt_d9; linarith + have h_exp1 : exp 1 > 2.7 := by have := Real.exp_one_gt_d9; linarith only [this] have h_exp2 : exp 2 > 7 := by have h : exp 2 = exp 1 * exp 1 := by rw [← exp_add]; norm_num - nlinarith [h] + nlinarith only [h_exp1, h] have h_exp4 : exp 4 > 49 := by have h : exp 4 = exp 2 * exp 2 := by rw [← exp_add]; norm_num - nlinarith [h] + nlinarith only [h_exp2, h] -- exp(u) - u²/2 is strictly increasing for u ≥ 4 (derivative = exp(u) - u > 0) have h_strict_mono : StrictMonoOn (fun v => exp v - v^2 / 2) (Set.Ici 4) := by apply strictMonoOn_of_deriv_pos (convex_Ici 4) @@ -648,25 +654,25 @@ lemma bessel_symmetry_integral (z : ℝ) (hz : 0 < z) : -- Need exp(x) - x > 0 for x > 4. Use exp(x) > x for all x > 0. -- exp(x) ≥ 1 + x, so exp(x) - x ≥ 1 > 0 have := add_one_le_exp x - linarith + linarith only [this] by_cases hu4eq : u = 4 - · simp only [hu4eq]; linarith [h_exp4] + · simp only [hu4eq]; linarith only [h_exp4] · have hug4 : u > 4 := lt_of_le_of_ne hu4 (Ne.symm hu4eq) - have h_at_4 : exp 4 - (4 : ℝ)^2 / 2 > 0 := by norm_num; linarith [h_exp4] + have h_at_4 : exp 4 - (4 : ℝ)^2 / 2 > 0 := by norm_num; linarith only [h_exp4] have := h_strict_mono (Set.self_mem_Ici) (le_of_lt hug4) hug4 - linarith + linarith only [h_exp4, this] -- Now derive the main bound: z*cosh(u) ≥ 2u -- z*cosh(u) ≥ z*exp(u)/2 ≥ z*(u²/2)/2 = z*u²/4 -- Since z*u ≥ 8: z*u²/4 = (z*u/4)*u ≥ 2*u (when z*u/4 ≥ 2, i.e., z*u ≥ 8) have h_cosh_bound : 2 * u ≤ z * cosh u := by - have h1 : z * cosh u ≥ z * (exp u / 2) := by nlinarith [h_cosh_lower] - have h2 : z * (exp u / 2) ≥ z * (u^2 / 2) / 2 := by nlinarith [h_exp_ge_usq, hz] + have h1 : z * cosh u ≥ z * (exp u / 2) := by nlinarith only [hz, h_cosh_lower] + have h2 : z * (exp u / 2) ≥ z * (u^2 / 2) / 2 := by nlinarith only [hz, h_exp_ge_usq] have h3 : z * (u^2 / 2) / 2 = z * u^2 / 4 := by ring have h4 : z * u^2 / 4 = (z * u / 4) * u := by ring - have h5 : z * u / 4 ≥ 2 := by linarith [hzu] - have h6 : (z * u / 4) * u ≥ 2 * u := by nlinarith [hu4] - linarith - have h_ineq : u - z * cosh u ≤ -u := by linarith + have h5 : z * u / 4 ≥ 2 := by linarith only [hzu] + have h6 : (z * u / 4) * u ≥ 2 * u := by nlinarith only [hu4, hzu] + linarith only [h1, h2, h6] + have h_ineq : u - z * cosh u ≤ -u := by linarith only [h_cosh_bound] calc exp u * exp (-(z * cosh u)) = exp (u + (-(z * cosh u))) := by rw [← exp_add] _ = exp (u - z * cosh u) := by ring_nf @@ -692,7 +698,7 @@ lemma bessel_symmetry_integral (z : ℝ) (hz : 0 < z) : have h_cosh_pos : cosh u > 0 := cosh_pos u have h_exp_bound : exp (-z * cosh u) ≤ 1 := by rw [exp_le_one_iff] - nlinarith [hz, h_cosh_pos] + nlinarith only [hz, h_cosh_pos] calc exp (-u) * exp (-z * cosh u) ≤ exp (-u) * 1 := by nlinarith [exp_pos (-u)] _ = exp (-u) := mul_one _ have hf_int_Iic : IntegrableOn (fun u => exp (-u) * exp (-z * cosh u)) (Iic 0) := by diff --git a/LeanPool/OSforGFF/General/FourierTransforms.lean b/LeanPool/OSforGFF/General/FourierTransforms.lean index 63ae86267e..bdf9b03c45 100644 --- a/LeanPool/OSforGFF/General/FourierTransforms.lean +++ b/LeanPool/OSforGFF/General/FourierTransforms.lean @@ -172,7 +172,8 @@ lemma integrable_exponential_decay_fourier (μ : ℝ) (hμ : 0 < μ) (k : ℝ) : exact continuous_const · filter_upwards with x rw [Complex.norm_exp] - simp_all + simp_all only [neg_mul, ofReal_exp, ofReal_neg, ofReal_mul, mul_re, I_re, ofReal_re, zero_mul, + I_im, ofReal_im, mul_zero, sub_self, mul_im, one_mul, zero_add, Real.exp_zero, Std.le_refl] /-! ### Half-Line Integrals and Antiderivatives @@ -188,7 +189,7 @@ lemma ik_add_ne_zero (α : ℝ) (hα : α ≠ 0) (k : ℝ) : Complex.I * k + (α have hre : (Complex.I * k + (α : ℂ)).re = 0 := by simp [h] simp only [Complex.add_re, Complex.mul_re, Complex.I_re, Complex.ofReal_re, Complex.I_im, Complex.ofReal_im, mul_zero, zero_mul, sub_zero] at hre - simp_all + simp_all only [ne_eq, zero_add] /-- The antiderivative of e^{(ik+α)x} for α ≠ 0. This is the indefinite integral: ∫ e^{(ik+α)x} dx = e^{(ik+α)x} / (ik + α) @@ -218,7 +219,7 @@ lemma antideriv_exp_complex_linear (α : ℝ) (hα : α ≠ 0) (k x : ℝ) : by exact h_exp_deriv.div_const c -- Simplify: (e^{cx} * c)/c = e^{cx} - simp_all + simp_all only [ne_eq, not_false_eq_true, mul_div_cancel_right₀] /-- Complex exponential e^{cx} tends to 0 as x → +∞ when Re(c) < 0. Proof: ‖e^{cx}‖ = e^{Re(c)·x} → 0 since Re(c) < 0 and x → +∞. @@ -232,7 +233,8 @@ theorem tendsto_cexp_atTop_zero {c : ℂ} (hc : c.re < 0) : have hneg : 0 < -c.re := neg_pos.mpr hc have h1 : Filter.Tendsto (fun x => (-c.re) * x) Filter.atTop Filter.atTop := Filter.tendsto_id.const_mul_atTop hneg - simp_all + simp_all only [mul_re, ofReal_re, ofReal_im, mul_zero, sub_zero, implies_true, Left.neg_pos_iff, + neg_mul, Filter.tendsto_neg_atTop_iff] /-- Complex exponential e^{cx} tends to 0 as x → -∞ when Re(c) > 0. Proof: ‖e^{cx}‖ = e^{Re(c)·x} → 0 since Re(c) > 0 and x → -∞. @@ -253,7 +255,8 @@ theorem integrableOn_exp_decay_Ioi (μ : ℝ) (hμ : 0 < μ) (k : ℝ) : (fun x : ℝ => Complex.exp ((Complex.I * k - μ) * x)) (Set.Ioi 0) volume := by have hc_re : (Complex.I * k - μ).re < 0 := by - simp_all + simp_all only [sub_re, mul_re, I_re, ofReal_re, zero_mul, I_im, ofReal_im, mul_zero, sub_self, + zero_sub, Left.neg_neg_iff] exact integrableOn_exp_mul_complex_Ioi hc_re 0 /-- Exponential e^{bx} is integrable on (-∞, a) when b > 0. @@ -267,7 +270,7 @@ theorem exp_pos_integrableOn_Iio (a : ℝ) {b : ℝ} (h : 0 < b) : have h_eq : (fun x => Real.exp (b * x)) = (fun x => Real.exp (-b * (-x))) := by ext x; ring_nf rw [h_eq] have h_set : Set.Iio a = -Set.Ioi (-a) := by - simp_all + simp_all only [neg_mul, mul_neg, neg_neg, Set.neg_Ioi] rw [h_set] exact h_neg.comp_neg @@ -286,7 +289,8 @@ theorem integrableOn_exp_growth_Iic (μ : ℝ) (hμ : 0 < μ) (k : ℝ) : (fun x : ℝ => Complex.exp ((Complex.I * k + μ) * x)) (Set.Iic 0) volume := by have hc_re : 0 < (Complex.I * k + μ).re := by - simp_all + simp_all only [add_re, mul_re, I_re, ofReal_re, zero_mul, I_im, ofReal_im, mul_zero, sub_self, + zero_add] exact integrableOn_exp_mul_complex_Iic hc_re 0 /-- ik - μ is nonzero when μ ≠ 0 (since Re(ik - μ) = -μ ≠ 0). -/ @@ -416,25 +420,25 @@ lemma fourier_exponential_decay_split (μ : ℝ) (hμ : 0 < μ) (k : ℝ) : have hre : ((μ : ℂ) + Complex.I * k).re = 0 := by simp [h] simp only [Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.I_re, Complex.ofReal_im, Complex.I_im, mul_zero, zero_mul, sub_zero] at hre - linarith + linarith only [hμ, hre] have hdenom_ne' : (μ : ℂ) - Complex.I * k ≠ 0 := by intro h have hre : ((μ : ℂ) - Complex.I * k).re = 0 := by simp [h] simp only [Complex.sub_re, Complex.ofReal_re, Complex.mul_re, Complex.I_re, Complex.ofReal_im, Complex.I_im, mul_zero, zero_mul, sub_zero] at hre - linarith + linarith only [hμ, hre] -- Combine fractions: 1/(μ+ik) + 1/(μ-ik) = (μ-ik + μ+ik)/((μ+ik)(μ-ik)) = 2μ/(μ²+k²) have hdenom_prod : (μ : ℂ) + Complex.I * k ≠ 0 ∧ (μ : ℂ) - Complex.I * k ≠ 0 := ⟨hdenom_ne, hdenom_ne'⟩ have h_prod : ((μ : ℂ) + Complex.I * k) * ((μ : ℂ) - Complex.I * k) = μ^2 + k^2 := by ring_nf - simp_all + simp_all only [ne_eq, not_false_eq_true, I_sq, neg_mul, one_mul, sub_neg_eq_add] rw [add_comm, div_add_div _ _ hdenom_ne' hdenom_ne] congr 1 · ring · rw [mul_comm] ring_nf - simp_all + simp_all only [ne_eq, not_false_eq_true, I_sq, neg_mul, one_mul, sub_neg_eq_add] /-! ### Fourier Transform of Exponential Decay @@ -479,7 +483,8 @@ lemma fourier_exponential_decay' (μ : ℝ) (hμ : 0 < μ) (k : ℝ) : (∫ x : ℝ in Set.Ioi 0, Complex.exp (Complex.I * k * x) * Real.exp (-μ * |x|)) := by rw [← MeasureTheory.setIntegral_union₀ (Set.Iic_disjoint_Ioi (le_refl (0:ℝ))).aedisjoint measurableSet_Ioi.nullMeasurableSet h_int_Iic h_int_Ioi] - simp_all + simp_all only [neg_mul, ofReal_exp, ofReal_neg, ofReal_mul, Set.Iic_union_Ioi, + Measure.restrict_univ] rw [h_split, h_Iic, h_Ioi] exact fourier_exponential_decay_split μ hμ k @@ -562,7 +567,8 @@ lemma fourierIntegral_expDecayFun_eq (μ : ℝ) (hμ : 0 < μ) (ξ : ℝ) : -- h: ∫ exp(I * ↑(-2πξ) * v) * ... = 2μ / (↑(-2πξ)² + μ²) -- goal: ∫ exp(I * (-2 * ↑π * ↑ξ) * v) * ... = 2μ / (4π²ξ² + μ²) convert h using 2 - · simp_all + · simp_all only [RCLike.inner_apply, conj_trivial, neg_mul, ofReal_neg, ofReal_mul, + ofReal_ofNat, ofReal_exp, mul_neg, even_two, Even.neg_pow] · push_cast; ring /-- The Mathlib Fourier transform of expDecayFun is integrable. -/ @@ -596,7 +602,9 @@ lemma integrable_fourierIntegral_expDecayFun (μ : ℝ) (hμ : 0 < μ) : have h_int_real : Integrable (fun ξ : ℝ => 2 * μ / (4 * π^2 * ξ^2 + μ^2)) volume := by rw [h_eq_real]; exact h_lorentz convert h_int_real.ofReal using 1 - · simp_all + · simp_all only [ne_eq, div_eq_zero_iff, mul_eq_zero, OfNat.ofNat_ne_zero, pi_ne_zero, or_self, + not_false_eq_true, map_div₀, coe_algebraMap, ofReal_mul, ofReal_ofNat, ofReal_add, + ofReal_pow] /-- Fourier inversion theorem for the exponential decay / Lorentzian pair. If FT[e^{-μ|x|}](k) = 2μ/(k² + μ²), then the inverse transform gives: @@ -645,7 +653,9 @@ theorem fourier_inversion_exp_decay (μ : ℝ) (hμ : 0 < μ) (x : ℝ) : -- Key: ∫ G(2π * v) dv = |2π|⁻¹ * ∫ G(k) dk have h_cv : ∫ v : ℝ, G ((2 * π) * v) = |2 * π|⁻¹ * ∫ k, G k := by have h := MeasureTheory.Measure.integral_comp_smul volume G (2 * π) - simp_all + simp_all only [neg_mul, ofReal_exp, ofReal_neg, ofReal_mul, RCLike.inner_apply, conj_trivial, + ofReal_ofNat, Nat.ofNat_pos, mul_pos_iff_of_pos_left, smul_eq_mul, Module.finrank_self, + pow_one, mul_inv_rev, abs_mul, abs_inv, abs_pi, Nat.abs_ofNat, real_smul, ofReal_inv] -- Show that G(2π * v) equals the integrand in hinv have hG_eq : ∀ v : ℝ, G ((2 * π) * v) = Complex.exp (Complex.I * (2 * π * x) * v) * (2 * μ / (4 * π^2 * v^2 + μ^2)) := by @@ -666,7 +676,9 @@ theorem fourier_inversion_exp_decay (μ : ℝ) (hμ : 0 < μ) (x : ℝ) : -- Simplify G to match the goal have hG_def : ∀ k : ℝ, G k = Complex.exp (Complex.I * k * x) * (2 * μ / (k^2 + μ^2)) := by intro k; rfl - simp_all + simp_all only [neg_mul, ofReal_exp, ofReal_neg, ofReal_mul, RCLike.inner_apply, conj_trivial, + ofReal_ofNat, Nat.ofNat_pos, mul_pos_iff_of_pos_left, mul_inv_rev, ofReal_inv, abs_mul, + Nat.abs_ofNat, abs_pi, one_div] /-! ### The Lorentzian Fourier Transform (Main Result) @@ -706,7 +718,9 @@ theorem fourier_lorentzian_1d (μ : ℝ) (hμ : 0 < μ) (x : ℝ) : -- hinv : (1/2π) * (2μ * ∫ ...) = e^{-μ|x|} -- Rearrange: (μ/π) * ∫ ... = e^{-μ|x|} have hμπ_ne : (μ : ℂ) / π ≠ 0 := by - simp_all + simp_all only [ne_eq, pi_ne_zero, not_false_eq_true, mul_eq_zero, OfNat.ofNat_ne_zero, + or_self, one_div, mul_inv_rev, neg_mul, ofReal_exp, ofReal_neg, ofReal_mul, div_eq_zero_iff, + ofReal_eq_zero] -- Simplify coefficient: (1/2π) * (2μ * I) = (μ/π) * I have h_rearrange : (1 : ℂ) / (2 * π) * (2 * μ * ∫ k : ℝ, Complex.exp (Complex.I * k * x) / (k^2 + μ^2)) = @@ -730,7 +744,7 @@ theorem fourier_lorentzian_1d (μ : ℝ) (hμ : 0 < μ) (x : ℝ) : -/ lemma exp_factorization_reflection (μ : ℝ) (x y : ℝ) (hx : 0 ≤ x) (hy : y ≤ 0) : Real.exp (-μ * |x - y|) = Real.exp (-μ * x) * Real.exp (μ * y) := by - have h_diff : |x - y| = x - y := abs_of_nonneg (by linarith) + have h_diff : |x - y| = x - y := abs_of_nonneg (by linarith only [hx, hy]) rw [h_diff, ← Real.exp_add] congr 1 ring @@ -747,7 +761,7 @@ theorem fourier_lorentzian_1d_neg (μ : ℝ) (hμ : 0 < μ) (x : ℝ) : (π / μ) * Real.exp (-μ * |x|) := by -- Use fourier_lorentzian_1d with (-x), then show exp(I * k * (-x)) = exp(-I * k * x) have h := fourier_lorentzian_1d μ hμ (-x) - simp_all + simp_all only [ofReal_neg, mul_neg, abs_neg, neg_mul, ofReal_exp, ofReal_mul] /-! ## Application to Free Field Propagator diff --git a/LeanPool/OSforGFF/General/FrobeniusPositivity.lean b/LeanPool/OSforGFF/General/FrobeniusPositivity.lean index e1cdf51532..6ba49497a0 100644 --- a/LeanPool/OSforGFF/General/FrobeniusPositivity.lean +++ b/LeanPool/OSforGFF/General/FrobeniusPositivity.lean @@ -57,7 +57,7 @@ lemma congr_transpose_mul_mul_ne_zero have hcalc : U * (U.transpose * G * U) * U.transpose = (U * U.transpose) * G * (U * U.transpose) := by simp [Matrix.mul_assoc] - simp_all + simp_all only [ne_eq, mul_zero, zero_mul, one_mul, mul_one, not_true_eq_false] /-- Cauchy–Schwarz for the semi-inner product induced by a PSD real matrix. For all vectors x,y: (xᵀ H y)^2 ≤ (xᵀ H x) (yᵀ H y). @@ -108,7 +108,8 @@ lemma psd_offdiag_zero_of_diag_zero -- Apply Cauchy–Schwarz with x = e_i, y = e_j have hcs := psd_cauchy_schwarz H hH_psd (Pi.single i (1 : ℝ)) (Pi.single j (1 : ℝ)) -- Rewrite each quadratic form - simp_all + simp_all only [mulVec_single, MulOpposite.op_one, one_smul, single_dotProduct, col_apply, + one_mul, mul_zero, sq_nonpos_iff] /-- For a real PSD matrix, if it is nonzero then some diagonal entry is strictly positive. -/ lemma posSemidef_diag_pos_exists_of_ne_zero diff --git a/LeanPool/OSforGFF/General/FunctionalAnalysis.lean b/LeanPool/OSforGFF/General/FunctionalAnalysis.lean index a34839f8bb..20d4875372 100644 --- a/LeanPool/OSforGFF/General/FunctionalAnalysis.lean +++ b/LeanPool/OSforGFF/General/FunctionalAnalysis.lean @@ -307,7 +307,7 @@ lemma integrableOn_ball_of_radial {E F : Type*} indicator (Ioo 0 r) (fun y => y ^ (Module.finrank ℝ E - 1) • f y) y := by intro y hy simp only [indicator, mem_Ioo, mem_Iio, mem_Ioi] at hy ⊢ - simp_all + simp_all only [smul_ite, smul_zero, true_and] rw [integrableOn_congr_fun h_supp measurableSet_Ioi] -- IntegrableOn (indicator (Ioo 0 r) g) (Ioi 0) ← IntegrableOn g (Ioo 0 r) since Ioo 0 r ⊆ Ioi 0 have : Integrable (indicator (Ioo 0 r) (fun y => y ^ (Module.finrank ℝ E - 1) • f y)) volume := @@ -352,14 +352,15 @@ lemma integrableOn_ball_of_rpow_decay {d : ℕ} (hd : d ≥ 1) -- First show the rpow part is integrable have h_rpow : IntegrableOn (fun y => y ^ ((d : ℝ) - 1 - α)) (Ioo 0 r) volume := by rw [intervalIntegral.integrableOn_Ioo_rpow_iff hr] - linarith + linarith only [hα] exact h_rpow.const_mul C -- Now use integrableOn_ball_of_radial and monotonicity have h_bound := integrableOn_ball_of_radial volume hr hint -- h_bound : IntegrableOn (fun x => C * ‖x‖^(-α)) (ball 0 r) volume -- Show f is dominated by the bound apply Integrable.mono' h_bound h_meas.restrict - simp_all + simp_all only [ge_iff_le, finrank_euclideanSpace, Fintype.card_fin, smul_eq_mul, + Real.norm_eq_abs, Filter.eventually_true] /-- Integrability away from the origin for bounded functions on compact sets. -/ lemma integrableOn_compact_diff_ball {d : ℕ} @@ -382,7 +383,8 @@ lemma integrableOn_compact_diff_ball {d : ℕ} intro x hx have hx_in_K : x ∈ K := hx.1 have hx_norm_lower : δ ≤ ‖x‖ := by - simp_all + simp_all only [gt_iff_lt, Set.mem_sdiff, Metric.mem_ball, dist_zero_right, not_lt, + true_and] have hx_norm_upper : ‖x‖ ≤ R := hR x hx_in_K have hx_norm_pos : 0 < ‖x‖ := hδ.trans_le hx_norm_lower calc |f x| ≤ C * ‖x‖ ^ (-α) := h_decay x @@ -401,10 +403,11 @@ lemma integrableOn_compact_diff_ball {d : ℕ} push Not at hα_nonneg have h1 : ‖x‖ ^ (-α) ≤ R ^ (-α) := by apply Real.rpow_le_rpow (le_of_lt hx_norm_pos) hx_norm_upper - linarith + linarith only [hα_nonneg] exact le_max_of_le_right h1 have hM_bound : ∀ x ∈ K \ Metric.ball 0 δ, ‖f x‖ ≤ M := fun x hx => by - simp_all + simp_all only [gt_iff_lt, Set.mem_sdiff, Metric.mem_ball, dist_zero_right, not_lt, and_imp, + Real.norm_eq_abs] have h_const : IntegrableOn (fun _ => M) (K \ Metric.ball 0 δ) volume := MeasureTheory.integrableOn_const (μ := volume) (s := K \ Metric.ball 0 δ) (ne_top_of_lt h_finite) @@ -471,9 +474,10 @@ lemma polynomial_decay_integrable_3d : -- Convert (1 + ‖x‖)^(-4) to 1 / (1 + ‖x‖)^4 convert h_int using 1 ext x - have h_pos : 0 < 1 + ‖x‖ := by linarith [norm_nonneg x] + have h_pos : 0 < 1 + ‖x‖ := by linarith only [norm_nonneg x] simp only [Real.rpow_neg (le_of_lt h_pos), one_div] - simp_all + simp_all only [finrank_euclideanSpace, Fintype.card_fin, Nat.cast_ofNat, Real.rpow_neg_ofNat, + Int.reduceNeg, zpow_neg, zpow_ofNat, Real.rpow_ofNat] /-! ## Bilinear Integrability for L¹ Translation-Invariant Kernels @@ -622,7 +626,7 @@ lemma SchwartzMap.integrable_conj (f : SchwartzMap E ℂ) : have hf_star_meas : AEStronglyMeasurable (fun y => starRingEnd ℂ (f y)) μ := hf_int.aestronglyMeasurable.star have h_norm_eq : ∀ᵐ y ∂μ, ‖f y‖ = ‖starRingEnd ℂ (f y)‖ := by - simp_all + simp_all only [RCLike.norm_conj, Filter.eventually_true] exact hf_int.congr' hf_star_meas h_norm_eq end SchwartzBounded @@ -639,7 +643,8 @@ lemma norm_exp_I_mul_real (r : ℝ) : ‖Complex.exp (Complex.I * r)‖ = 1 := /-- Complex exponential of negative pure imaginary argument has norm 1. -/ lemma norm_exp_neg_I_mul_real (r : ℝ) : ‖Complex.exp (-Complex.I * r)‖ = 1 := by rw [Complex.norm_exp] - simp_all + simp_all only [neg_mul, neg_re, mul_re, I_re, ofReal_re, zero_mul, I_im, ofReal_im, mul_zero, + sub_self, neg_zero, Real.exp_zero] /-! ## Linear Vanishing Bound for Schwartz Functions @@ -670,7 +675,7 @@ theorem schwartz_vanishing_linear_bound_general have h := SchwartzMap.le_seminorm ℝ 0 1 f y simp only [pow_zero, one_mul] at h calc ‖iteratedFDeriv ℝ 1 (⇑f) y‖ ≤ (SchwartzMap.seminorm ℝ 0 1) f := h - _ ≤ (SchwartzMap.seminorm ℝ 0 1) f + 1 := by linarith + _ ≤ (SchwartzMap.seminorm ℝ 0 1) f + 1 := by linarith only [] _ = C_deriv := rfl -- The convex set (whole space) have h_convex : Convex ℝ (Set.univ : Set (ℝ × E)) := convex_univ @@ -681,7 +686,8 @@ theorem schwartz_vanishing_linear_bound_general exact f.differentiableAt.hasFDerivAt.hasFDerivWithinAt -- Connection: ‖fderiv ℝ f y‖ = ‖iteratedFDeriv ℝ 1 f y‖ have h_fderiv_bound : ∀ y ∈ (Set.univ : Set (ℝ × E)), ‖fderiv ℝ f y‖ ≤ C_deriv := by - simp_all + simp_all only [norm_iteratedFDeriv_one, Prod.forall, Set.mem_univ, hasFDerivWithinAt_univ, + forall_const] use C_deriv intro t ht x -- 2. The reference point: (0, x) where f vanishes @@ -702,7 +708,9 @@ theorem schwartz_vanishing_linear_bound_general -- Compute ‖B - A‖ = ‖(t, x) - (0, x)‖ = ‖(t, 0)‖ = |t| = t have h_dist : ‖B - A‖ = t := by simp only [B, A, Prod.mk_sub_mk, sub_zero] - simp_all + simp_all only [norm_iteratedFDeriv_one, Set.mem_univ, implies_true, hasFDerivWithinAt_univ, + forall_const, Prod.forall, ge_iff_le, sub_self, Prod.norm_mk, Real.norm_eq_abs, norm_zero, + abs_nonneg, sup_of_le_left, abs_eq_self] rwa [h_dist] at h_mvt end SchwartzLinearBound @@ -785,7 +793,7 @@ theorem schwartz_integrable_decay {V : Type*} [NormedAddCommGroup V] · exact hC_pos k · use 0; simp · intro x - rw [div_eq_mul_inv, le_mul_inv_iff₀ (pow_pos (by linarith [norm_nonneg x]) _)] + rw [div_eq_mul_inv, le_mul_inv_iff₀ (pow_pos (by linarith only [norm_nonneg x]) _)] -- Expand (1 + ‖x‖)^N have h_binom : (1 + ‖x‖)^N = Finset.sum (Finset.range (N + 1)) (fun k => (N.choose k : ℝ) * ‖x‖^k) := by @@ -852,7 +860,7 @@ lemma bumpSelfConv_integral (φ : ContDiffBump (0 : E)) : rw [integral_convolution (L := ContinuousLinearMap.lsmul ℝ ℝ)] · simp only [ContinuousLinearMap.lsmul_apply, smul_eq_mul] have h1 := φ.integral_normed (μ := volume) - simp_all + simp_all only [mul_one] · exact φ.integrable_normed · exact φ.integrable_normed @@ -897,7 +905,8 @@ lemma bumpSelfConv_support_tendsto {ι : Type*} {l : Filter ι} rw [Metric.mem_ball, dist_zero_right] at hx_ball ⊢ calc ‖x‖ < 2 * (φ i).rOut := hx_ball _ < 2 * (ε / 2) := by - simp_all + simp_all only [gt_iff_lt, mem_support, ne_eq, support_subset_iff, Metric.mem_ball, + dist_zero_right, not_false_eq_true, Nat.ofNat_pos, mul_lt_mul_iff_right₀] _ = ε := by ring /-- **Main theorem: Double mollifier convergence via associativity.** @@ -1077,8 +1086,8 @@ theorem double_mollifier_convergence rcases htv with ⟨ht, _⟩ calc ‖a‖ ≤ 2 * (φ i).rOut := ht _ < 2 * (‖a‖ / 3) := mul_lt_mul_of_pos_left hr (by norm_num) - _ < ‖a‖ := by linarith [norm_nonneg a] - linarith + _ < ‖a‖ := by linarith only [hr_pos, hr, ht, norm_nonneg a] + linarith only [hr_pos, htv, hr] change Integrable F (volume.prod volume) rw [← MeasureTheory.integrableOn_iff_integrable_of_support_subset h_supp_F] exact h_cont_F.integrableOn_compact hK_compact diff --git a/LeanPool/OSforGFF/General/GaussianRBF.lean b/LeanPool/OSforGFF/General/GaussianRBF.lean index a006bbd394..e884d50e1a 100644 --- a/LeanPool/OSforGFF/General/GaussianRBF.lean +++ b/LeanPool/OSforGFF/General/GaussianRBF.lean @@ -57,7 +57,9 @@ lemma innerProduct_is_pd_kernel : intro i j simp only [a, b, star_def] apply Complex.ext - · simp_all + · simp_all only [mul_re, conj_re, conj_im, neg_mul, sub_neg_eq_add, ofReal_add, ofReal_mul, + ofReal_sub, add_re, ofReal_re, ofReal_im, mul_zero, sub_zero, I_re, sub_re, zero_mul, + I_im, sub_im, mul_im, add_zero, sub_self] · simp only [Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re, mul_zero, zero_add, Complex.conj_re, Complex.conj_im] @@ -65,11 +67,15 @@ lemma innerProduct_is_pd_kernel : -- The product cbarᵢcⱼ⟪xᵢ,xⱼ⟫ has real part (aᵢaⱼ + bᵢbⱼ)⟪xᵢ,xⱼ⟫ have re_prod : ∀ i j, (star (c i) * c j * (⟪x i, x j⟫_ℝ : ℂ)).re = (a i * a j + b i * b j) * ⟪x i, x j⟫_ℝ := by - simp_all + simp_all only [RCLike.star_def, ofReal_add, ofReal_mul, ofReal_sub, mul_re, add_re, ofReal_re, + ofReal_im, mul_zero, sub_zero, I_re, sub_re, zero_mul, I_im, sub_im, mul_im, add_zero, + sub_self, add_im, one_mul, zero_add, implies_true] -- Sum over i,j: Re(∑∑) = ∑∑ (aᵢaⱼ + bᵢbⱼ)⟪xᵢ,xⱼ⟫ have sum_re : (∑ i : Fin m, ∑ j : Fin m, star (c i) * c j * (⟪x i, x j⟫_ℝ : ℂ)).re = ∑ i : Fin m, ∑ j : Fin m, (a i * a j + b i * b j) * ⟪x i, x j⟫_ℝ := by - simp_all + simp_all only [RCLike.star_def, ofReal_add, ofReal_mul, ofReal_sub, mul_re, add_re, ofReal_re, + ofReal_im, mul_zero, sub_zero, I_re, sub_re, zero_mul, I_im, sub_im, mul_im, add_zero, + sub_self, add_im, one_mul, zero_add, implies_true, re_sum] rw [sum_re] -- Split into two sums have split_sum : ∑ i : Fin m, ∑ j : Fin m, (a i * a j + b i * b j) * ⟪x i, x j⟫_ℝ = @@ -112,7 +118,7 @@ lemma real_valued_PD_kernel_gives_PSD_matrix {α : Type*} (K : α → α → ℂ constructor · -- Hermitian (symmetric for real matrices) ext i j - simp_all + simp_all only [conjTranspose_apply, of_apply, star_trivial] · -- Nonneg quadratic form for real vectors intro v have h := hK m x (fun i => (v i : ℂ)) @@ -261,7 +267,8 @@ theorem gaussian_rbf_pd_innerProduct_proof : have h_sum' : ∑ i : Fin m, ∑ j : Fin m, (starRingEnd ℂ) (c i) * c j * cexp (-(1/2 : ℂ) * (‖x i - x j‖^2 : ℝ)) = ∑ i : Fin m, ∑ j : Fin m, (starRingEnd ℂ) (d i) * d j * cexp (⟪x i, x j⟫_ℝ : ℂ) := by - simp_all + simp_all only [one_div, ofReal_sub, ofReal_add, ofReal_pow, ofReal_mul, ofReal_ofNat, neg_mul, + RCLike.star_def] rw [h_sum'] -- Now apply that exp(⟨·,·⟩) is a PD kernel have h_inner_pd : IsPositiveDefiniteKernel (fun (u v : H) => (⟪u, diff --git a/LeanPool/OSforGFF/General/HadamardExp.lean b/LeanPool/OSforGFF/General/HadamardExp.lean index 067f322c4b..0d437dc317 100644 --- a/LeanPool/OSforGFF/General/HadamardExp.lean +++ b/LeanPool/OSforGFF/General/HadamardExp.lean @@ -149,7 +149,7 @@ lemma entrywiseExp_eq_hadamardSeries (R : Matrix ι ι ℝ) : simpa [Complex.ofReal_re] using congrArg Complex.re hpt -- Combine: real parts of both sides of h_seriesC give the real series identity have hx_sum : ∑' n : ℕ, fR n = Real.exp x := by - simp_all + simp_all only [mul_one, sub_zero] -- Massaging coefficients and finishing have hx_sum' : Real.exp x = ∑' n : ℕ, (1 / (Nat.factorial n : ℝ)) * x ^ n := by simpa [fR, one_div, div_eq_mul_inv, mul_comm] using hx_sum.symm @@ -177,7 +177,8 @@ lemma hadamardPow_posDef_of_posDef rw [hEq]; exact hR | succ k ih => -- n = (k+1)+1 = k+2 - simp_all + simp_all only [Nat.succ_eq_add_one, le_add_iff_nonneg_left, zero_le, hadamardPow, + forall_const, schur_product_posDef] /-- The quadratic form of the Hadamard series equals the sum of quadratic forms of individual terms. This lemma handles the complex interchange of summation and quadratic form evaluation. @@ -220,14 +221,14 @@ lemma quadratic_form_entrywiseExp_hadamardSeries HasSum (fun n => ∑ j, (1 / (Nat.factorial n : ℝ)) * (x i * hadamardPow R n i j * x j)) (∑ j, x i * ((entrywiseExpHadamardSeries R) i j) * x j) := by apply hasSum_sum - simp_all + simp_all only [one_div, Finset.mem_univ, imp_self, implies_true] -- Combine over i (finite) similarly have hHas_sum_i : HasSum (fun n => ∑ i, ∑ j, (1 / (Nat.factorial n : ℝ)) * (x i * hadamardPow (ι:=ι) R n i j * x j)) (∑ i, ∑ j, x i * ((entrywiseExpHadamardSeries (ι:=ι) R) i j) * x j) := by apply hasSum_sum - simp_all + simp_all only [one_div, Finset.mem_univ, imp_self, implies_true] -- Take tsum of hHas_sum_i have htsum_eq := hHas_sum_i.tsum_eq -- Expand the RHS to x ⬝ᵥ (...) ⬝ᵥ x @@ -243,7 +244,7 @@ lemma quadratic_form_entrywiseExp_hadamardSeries simp only [Matrix.mulVec, dotProduct, Finset.mul_sum] congr 1; ext i; congr 1; ext j; ring -- Put it all together - simp_all + simp_all only [one_div] /-- Summability of the scalar quadratic-form coefficients appearing in the Hadamard exponential series. @@ -414,7 +415,8 @@ lemma posSemidef_entrywiseExp_hadamardSeries_of_posSemidef -- This uses: (1) R + εI is Hermitian, (2) quadratic form is x^T R x + ε ||x||^2 > 0 for x ≠ 0 have hR_herm := hR.isHermitian have h_add_herm : (R + ε • (1 : Matrix ι ι ℝ)).IsHermitian := by - simp_all + simp_all only [gt_iff_lt, Matrix.isHermitian_iff_isSymm, Matrix.isSymm_one, + Matrix.IsSymm.smul, Matrix.IsSymm.add] apply Matrix.PosDef.of_dotProduct_mulVec_pos h_add_herm intro x hx_ne_zero have hR_nonneg := hR.dotProduct_mulVec_nonneg x @@ -429,7 +431,9 @@ lemma posSemidef_entrywiseExp_hadamardSeries_of_posSemidef rw [Matrix.add_mulVec, dotProduct_add] -- Need to show: x ⬝ᵥ ε • x = ε * x ⬝ᵥ x rw [Matrix.smul_mulVec, Matrix.one_mulVec] - simp_all + simp_all only [gt_iff_lt, Matrix.isHermitian_iff_isSymm, Matrix.isSymm_one, + Matrix.IsSymm.smul, Matrix.IsSymm.add, ne_eq, star_trivial, mul_pos_iff_of_pos_left, + dotProduct_smul, smul_eq_mul] -- Goal has star x, but for real vectors star x = x have : star x ⬝ᵥ (R + ε • 1).mulVec x = x ⬝ᵥ (R + ε • 1).mulVec x := by simp [star] rw [this, h_expand] diff --git a/LeanPool/OSforGFF/General/L2TimeIntegral.lean b/LeanPool/OSforGFF/General/L2TimeIntegral.lean index be4b9889c9..d9c6bd3474 100644 --- a/LeanPool/OSforGFF/General/L2TimeIntegral.lean +++ b/LeanPool/OSforGFF/General/L2TimeIntegral.lean @@ -99,7 +99,7 @@ theorem sq_setIntegral_le_measure_mul_setIntegral_sq_proved rw [show (∫ x in Icc a b, ‖(fun _ => (1:ℂ)) x‖ * ‖f x‖) = ∫ x in Icc a b, ‖f x‖ from by congr 1; ext x; simp] at h_holder rw [show (∫ x in Icc a b, ‖(fun _ => (1:ℂ)) x‖ ^ (2:ℝ)) = b - a from by - simp; linarith] at h_holder + simp; linarith only [hab]] at h_holder -- Chain: ‖∫f‖ ≤ ∫‖f‖ ≤ (b-a)^(1/2) * (∫‖f‖²)^(1/2), then square have h_sq := pow_le_pow_left₀ (norm_nonneg _) (le_trans (norm_integral_le_integral_norm (f := f)) h_holder) 2 @@ -317,9 +317,10 @@ theorem memLp_prod_of_uniform_slicewise_bound (μ : Measure Ω) [SFinite μ] filter_upwards with s have h := (h_memLp s).integrable_norm_rpow (by simp : (2 : ℝ≥0∞) ≠ 0) (by simp : (2 : ℝ≥0∞) ≠ ⊤) - simp_all + simp_all only [ENNReal.toReal_ofNat, Real.rpow_ofNat] · -- Integral of slices is constant, hence integrable on bounded [0,T] - simp_all + simp_all only [norm_pow, norm_norm, ne_eq, enorm_ne_top, not_false_eq_true, + integrable_const_enorm] -- Now use the integrability to get MemLp 2 rwa [memLp_two_iff_integrable_sq_norm h_meas] @@ -535,11 +536,12 @@ theorem double_integral_polynomial_decay_bound_proved (α : ℝ) (hα : α > 1) ≤ ∫ s in Icc 0 T, (∫ t, g t) := by apply integral_mono_of_nonneg · filter_upwards with s; exact integral_nonneg (fun u => h_nonneg _) - · simp_all + · simp_all only [gt_iff_lt, ne_eq, enorm_ne_top, not_false_eq_true, + integrable_const_enorm] · filter_upwards with s; exact h_inner s _ = (∫ t, g t) * T := by rw [setIntegral_const, Measure.real, Real.volume_Icc, sub_zero, - ENNReal.toReal_ofReal (by linarith : 0 ≤ T), smul_eq_mul, mul_comm] + ENNReal.toReal_ofReal (by linarith only [hT] : 0 ≤ T), smul_eq_mul, mul_comm] /-! ## Minkowski Inequality for Weighted L² Sums @@ -585,7 +587,7 @@ private lemma integrable_mul_of_sq_integrable simp only [Real.norm_eq_abs, Pi.add_apply, Pi.mul_apply] calc |f x * g x| ≤ ((f x) ^ 2 + (g x) ^ 2) / 2 := by rw [abs_mul] - nlinarith [sq_abs (f x), sq_abs (g x), sq_nonneg (|f x| - |g x|)] + linarith only [sq_abs (f x), sq_abs (g x), sq_nonneg (|f x| - |g x|)] _ ≤ |((f x) ^ 2 + (g x) ^ 2) / 2| := le_abs_self _ private lemma sqrt_integral_sq_add_le @@ -622,8 +624,8 @@ private lemma sqrt_integral_sq_add_le integral_add hf_int (hfg_int.const_mul 2) have i3 : ∫ x, 2 * (f x * g x) ∂μ = 2 * ∫ x, f x * g x ∂μ := integral_const_mul .. - linarith - linarith [h_cs, hA_sq, hB_sq] + linarith only [i1, i2, i3] + linarith only [hA_sq, hB_sq, h_cs, h_split] private lemma sqrt_integral_sq_mul (c : ℝ) (hc : 0 ≤ c) (f : α → ℝ) : Real.sqrt (∫ x, (c * f x) ^ 2 ∂μ) = c * Real.sqrt (∫ x, (f x) ^ 2 ∂μ) := by @@ -765,7 +767,7 @@ theorem _root_.OSforGFF.L2_variance_time_average_bound (μ : Measure Ω) [IsProb have h_sum : ∫ s in Icc 0 T, (A s ω - EA) = (∫ s in Icc 0 T, A s ω) - ↑T * EA := by rw [integral_sub hω (integrable_const EA), integral_const, measureReal_def, - Measure.restrict_apply_univ, Real.volume_Icc, ENNReal.toReal_ofReal (by linarith), + Measure.restrict_apply_univ, Real.volume_Icc, ENNReal.toReal_ofReal (by linarith only [hT]), sub_zero]; congr 1 rw [← h_sum] have : starRingEnd ℂ (∫ s in Icc 0 T, A s ω - EA) = diff --git a/LeanPool/OSforGFF/General/LaplaceIntegral.lean b/LeanPool/OSforGFF/General/LaplaceIntegral.lean index be31f3d62b..eb6b7955d6 100644 --- a/LeanPool/OSforGFF/General/LaplaceIntegral.lean +++ b/LeanPool/OSforGFF/General/LaplaceIntegral.lean @@ -61,7 +61,7 @@ lemma glasser_expand (c u : ℝ) (hu : u ≠ 0) : (c / u - u)^2 = c^2 / u^2 - 2* /-- Lower bound: (c/u - u)² ≥ u² - 2c -/ lemma glasser_lower_bound (c u : ℝ) (hu : u ≠ 0) : (c / u - u)^2 ≥ u^2 - 2*c := by rw [glasser_expand c u hu]; have : 0 ≤ c^2 / u^2 := div_nonneg (sq_nonneg c) (sq_nonneg u); - linarith + linarith only [this] /-- The derivative of u ↦ c/u - u is -c/u² - 1 -/ @@ -115,7 +115,7 @@ lemma glasser_integral_substitution_identity (c : ℝ) (hc : 0 < c) : · rintro ⟨u, hu, rfl⟩; exact div_pos hc hu · intro hv; exact ⟨c / v, div_pos hc hv, by field_simp⟩ have h_inj : InjOn (fun u => c / u) (Ioi 0) := fun x hx y hy hxy => by - simp only [mem_Ioi] at hx hy; field_simp at hxy; nlinarith [mul_pos hx hy] + simp only [mem_Ioi] at hx hy; field_simp at hxy; linarith only [hxy, mul_pos hx hy] have h_deriv : ∀ u ∈ Ioi 0, HasDerivWithinAt (fun u => c / u) (-c / u^2) (Ioi 0) u := fun u hu => (((hasDerivAt_inv (ne_of_gt hu)).const_mul c).hasDerivWithinAt).congr_deriv (by field_simp) let g : ℝ → ℝ := fun v => exp (-(c/v - v)^2) @@ -126,7 +126,7 @@ lemma glasser_integral_substitution_identity (c : ℝ) (hc : 0 < c) : have h_simp : ∀ u ∈ Ioi 0, |-c / u^2| * g (c / u) = (c / u^2) * exp (-(c/u - u)^2) := fun u hu => by have hu_pos : 0 < u := hu - rw [abs_of_neg (div_neg_of_neg_of_pos (by linarith) (sq_pos_of_pos hu_pos))] + rw [abs_of_neg (div_neg_of_neg_of_pos (by linarith only [hc]) (sq_pos_of_pos hu_pos))] simp only [g]; congr 2 · ring · have h_eq : c / (c / u) - c / u = u - c / u := by field_simp [ne_of_gt hu_pos] @@ -136,7 +136,7 @@ lemma glasser_integral_substitution_identity (c : ℝ) (hc : 0 < c) : /-- Split (0, ∞) = (0, 1] ∪ (1, ∞) -/ private lemma Ioi_zero_eq_Ioc_union_Ioi : Ioi (0 : ℝ) = Ioc 0 1 ∪ Ioi 1 := by - simp_all + simp_all only [zero_le_one, Ioc_union_Ioi_eq_Ioi] /-- The Glasser integrand is integrable on (0, ∞). Proof: On (0, 1], bounded by 1 on finite measure set. @@ -221,7 +221,7 @@ theorem glasser_weighted_integrable (c : ℝ) (hc : 0 < c) : · field_simp have h_int_image : IntegrableOn (fun v => exp (-(c/v - v)^2)) (Ici c) := by apply h_base.mono_set - simp_all + simp_all only [Ici_subset_Ioi] -- f(u) = c/u is antitone on (0, 1] have h_anti : AntitoneOn (fun u => c / u) (Ioc 0 1) := by intro x hx y hy hxy @@ -273,7 +273,7 @@ theorem glasser_weighted_integrable (c : ℝ) (hc : 0 < c) : rw [Real.norm_eq_abs, abs_of_pos (mul_pos (div_pos hc (sq_pos_of_pos hu_pos)) (exp_pos _))] rw [Real.norm_eq_abs, abs_of_pos (mul_pos (mul_pos hc (exp_pos _)) (exp_pos _))] have h_cu2 : c / u^2 ≤ c := by - have h_u2_ge_1 : 1 ≤ u^2 := by nlinarith + have h_u2_ge_1 : 1 ≤ u^2 := by nlinarith only [hu1] -- div_le_div_of_nonneg_left : 0 ≤ a → 0 < c → c ≤ b → a / b ≤ a / c -- For c/u² ≤ c/1: a=c, b=u², c=1. Need: 0 ≤ c, 0 < 1, 1 ≤ u² calc c / u^2 ≤ c / 1 := div_le_div_of_nonneg_left (le_of_lt hc) one_pos h_u2_ge_1 @@ -329,7 +329,7 @@ lemma glasser_tendsto_atTop_at_zero (c : ℝ) (hc : 0 < c) : refine ⟨isOpen_Iio, (zero_lt_one : (0 : ℝ) < 1), ?_⟩ intro x hx simp_all - · intro u hu; simp only [mem_Ioo] at hu; linarith + · intro u hu; simp only [mem_Ioo] at hu; linarith only [hu] have h_eq : (fun u => c / u - u) = (fun u => (-u) + (c / u)) := by ext u; ring rw [h_eq] exact tendsto_atTop_add_left_of_le' _ (-1) h_bdd h3 @@ -357,13 +357,13 @@ lemma glasser_strictAntiOn (c : ℝ) (hc : 0 < c) : StrictAntiOn (fun u => c / u -- c(y - x)/(xy) > 0 > x - y ✓ have h1 : c / x - c / y = c * (y - x) / (x * y) := by field_simp have h2 : 0 < c * (y - x) / (x * y) := by - simp_all + simp_all only [ne_eq, mul_pos_iff_of_pos_left, sub_pos, div_pos_iff_of_pos_left] have h3 : x - y < 0 := sub_neg_of_lt hxy calc c / y - y = c / x - (c / x - c / y) - y := by ring _ = c / x - c * (y - x) / (x * y) - y := by rw [h1] - _ < c / x - 0 - y := by linarith + _ < c / x - 0 - y := by linarith only [h2] _ = c / x - x + (x - y) := by ring - _ < c / x - x + 0 := by linarith + _ < c / x - x + 0 := by linarith only [hxy] _ = c / x - x := by ring /-- The Glasser map is injective on (0, ∞). -/ @@ -386,7 +386,7 @@ lemma glasser_image_eq_univ (c : ℝ) (hc : 0 < c) : have hbot := glasser_tendsto_atBot_at_top c hc have h_at_sqrt : f (sqrt c) = 0 := by simp only [f] - simp_all + simp_all only [div_sqrt, sub_self] have h_sqrt_pos : sqrt c ∈ Ioi 0 := sqrt_pos.mpr hc have hpc : IsPreconnected (Ioi (0 : ℝ)) := isPreconnected_Ioi have hatTop_le : (atTop : Filter ℝ) ≤ 𝓟 (Ioi 0) := le_principal_iff.mpr (Ioi_mem_atTop 0) @@ -411,7 +411,7 @@ lemma glasser_image_eq_univ (c : ℝ) (hc : 0 < c) : lemma glasser_deriv_abs (c : ℝ) (hc : 0 < c) (u : ℝ) (hu : u ∈ Ioi 0) : |(-c / u^2 - 1)| = 1 + c / u^2 := by have h : 0 < c / u^2 := div_pos hc (sq_pos_of_pos hu) - rw [show -c / u^2 = -(c / u^2) by ring, abs_of_neg (by linarith)]; ring + rw [show -c / u^2 = -(c / u^2) by ring, abs_of_neg (by linarith only [h])]; ring /-- The weighted integral equals √π via change of variables w = c/u - u. This is the core analytical step. @@ -433,7 +433,7 @@ theorem weighted_glasser_integral_eq_gaussian (c : ℝ) (hc : 0 < c) : -- The LHS of h_cov is ∫_ℝ exp(-w²) = √π have h_gaussian : ∫ w : ℝ, exp (-w^2) = sqrt π := by have h := integral_gaussian (1 : ℝ) - simp_all + simp_all only [Measure.restrict_univ, smul_eq_mul, neg_mul, one_mul, div_one] -- Transform h_cov: ∫_ℝ g = ∫_{Ioi 0} |f'| • (g ∘ f) -- i.e., √π = ∫_{Ioi 0} |f' u| * exp(-(c/u - u)²) simp only [smul_eq_mul, f, f', g] at h_cov @@ -448,7 +448,7 @@ theorem weighted_glasser_integral_eq_gaussian (c : ℝ) (hc : 0 < c) : theorem glasser_gaussian_integral (c : ℝ) (hc : 0 < c) : ∫ u in Ioi 0, exp (-(c/u - u)^2) = sqrt π / 2 := by - linarith [glasser_integral_double c hc, weighted_glasser_integral_eq_gaussian c hc] + linarith only [hc, glasser_integral_double c hc, weighted_glasser_integral_eq_gaussian c hc] /-! ## Part 4: Completing the square -/ diff --git a/LeanPool/OSforGFF/General/QuantitativeDecay.lean b/LeanPool/OSforGFF/General/QuantitativeDecay.lean index ab1fa59fd0..5a409d2710 100644 --- a/LeanPool/OSforGFF/General/QuantitativeDecay.lean +++ b/LeanPool/OSforGFF/General/QuantitativeDecay.lean @@ -154,7 +154,7 @@ lemma exp_decay_implies_polynomial_decay (m α : ℝ) (hm : m > 0) (hα : α > 0 _ = (α / m)^α * Real.exp m * (1 + x)^(-α) := by rw [h_exp_combine] _ ≤ ((α / m)^α * Real.exp m + 1) * (1 + x)^(-α) := by have hrpow : (1 + x)^(-α) ≥ 0 := Real.rpow_nonneg h_one_plus_nonneg _ - nlinarith + linarith only [hrpow] /-- Exponential decay of norms implies polynomial decay bounds. -/ def normExpDecayImpliesPolynomialDecay {F : Type*} [NormedAddCommGroup F] @@ -234,14 +234,14 @@ This follows from 1 + x ≤ 2 + x = 2(1 + x/2), so (1+x)^N ≤ 2^N(1+x/2)^N. -/ lemma one_add_half_pow_le (x : ℝ) (hx : x ≥ 0) (N : ℝ) (hN : N > 0) : (1 + x/2)^(-N) ≤ (2:ℝ)^N * (1 + x)^(-N) := by - have h1 : 0 < 1 + x/2 := by linarith + have h1 : 0 < 1 + x/2 := by linarith only [hx] have h2 : 0 < 1 + x := by positivity have h1_nonneg : 0 ≤ 1 + x/2 := h1.le have h2_nonneg : 0 ≤ 1 + x := h2.le have h2_pos : (0 : ℝ) < 2 := by norm_num -- Key: 1 + x ≤ 2 * (1 + x/2) = 2 + x, so (1+x)^N ≤ (2*(1+x/2))^N = 2^N * (1+x/2)^N -- Therefore (1+x/2)^{-N} = 1/(1+x/2)^N ≤ 2^N/(1+x)^N = 2^N * (1+x)^{-N} - have h_base : 1 + x ≤ 2 * (1 + x / 2) := by linarith + have h_base : 1 + x ≤ 2 * (1 + x / 2) := by linarith only [] have h_rpow_le : (1 + x)^N ≤ (2 * (1 + x / 2))^N := Real.rpow_le_rpow h2_nonneg h_base hN.le have h_mul_rpow : (2 * (1 + x / 2))^N = 2^N * (1 + x/2)^N := @@ -259,7 +259,7 @@ lemma one_add_half_pow_le (x : ℝ) (hx : x ≥ 0) (N : ℝ) (hN : N > 0) : have h2_rpow_pos : 0 < (1 + x) ^ N := Real.rpow_pos_of_pos h2 N have h_two_rpow_pos : 0 < (2:ℝ) ^ N := Real.rpow_pos_of_pos h2_pos N rw [inv_eq_one_div, inv_eq_one_div, mul_one_div, div_le_div_iff₀ h1_rpow_pos h2_rpow_pos] - simp_all + simp_all only [ge_iff_le, gt_iff_lt, Nat.ofNat_pos, one_mul] /-- Core lemma: If u, v both have polynomial decay of order N > dim(E), then their convolution also has polynomial decay of order N. @@ -325,7 +325,7 @@ private lemma convolution_polynomial_decay_exists apply div_le_div_of_nonneg_left (le_of_lt hC_u_pos) · positivity · simp only [A, mem_ofPred_eq] at hy - exact Real.rpow_le_rpow (by positivity) (by linarith) (lt_of_le_of_lt + exact Real.rpow_le_rpow (by positivity) (by linarith only [hy]) (lt_of_le_of_lt (Nat.cast_nonneg _) hN_dim).le _ = c_A * ∫ y in A, ‖v (x - y)‖ := by rw [MeasureTheory.integral_const_mul] _ ≤ c_A * ∫ y, ‖v (x - y)‖ := by @@ -365,15 +365,15 @@ private lemma convolution_polynomial_decay_exists -- ‖x - y‖ ≥ ‖x‖ - ‖y‖ > ‖x‖ - ‖x‖/2 = ‖x‖/2 have h_xy : ‖x - y‖ ≥ ‖x‖ / 2 := by have h1 : ‖x - y‖ ≥ ‖x‖ - ‖y‖ := norm_sub_norm_le x y - have h2 : ‖x‖ - ‖y‖ > ‖x‖ - ‖x‖ / 2 := by linarith + have h2 : ‖x‖ - ‖y‖ > ‖x‖ - ‖x‖ / 2 := by linarith only [hy] have h3 : ‖x‖ - ‖x‖ / 2 = ‖x‖ / 2 := by ring - linarith + linarith only [hy, h1] have hN_pos : N > 0 := lt_of_le_of_lt (Nat.cast_nonneg _) hN_dim calc ‖v (x - y)‖ ≤ C_v / (1 + ‖x - y‖)^N := hv_bound (x - y) _ ≤ c_Ac := by apply div_le_div_of_nonneg_left (le_of_lt hC_v_pos) · positivity - · exact Real.rpow_le_rpow (by positivity) (by linarith) hN_pos.le + · exact Real.rpow_le_rpow (by positivity) (by linarith only [h_xy]) hN_pos.le _ = (∫ y in Aᶜ, ‖u y‖) * c_Ac := by rw [MeasureTheory.integral_mul_const] _ ≤ I_u * c_Ac := by have h_set_le := setIntegral_le_integral (s := Aᶜ) hu_int.norm @@ -405,15 +405,15 @@ private lemma convolution_polynomial_decay_exists _ = 2^N * (C_u * I_v + C_v * I_u) / (1 + ‖x‖)^N := by ring _ ≤ 2^N * (C_u * (I_v + 1) + C_v * (I_u + 1)) / (1 + ‖x‖)^N := by gcongr - · linarith - · linarith + · linarith only [] + · linarith only [] _ = (2^N * (C_u * (I_v + 1) + C_v * (I_u + 1))) * (1 + ‖x‖)^(-N) := by rw [Real.rpow_neg (le_of_lt h_one_plus_pos)] ring _ ≤ C * (1 + ‖x‖)^(-N) := by gcongr simp only [C] - linarith + linarith only [] _ = C / (1 + ‖x‖)^N := by rw [Real.rpow_neg (le_of_lt h_one_plus_pos)] ring @@ -486,12 +486,12 @@ private lemma convolution_compactSupport_decay_exists (f : SchwartzMap E ℂ) (K _ ≤ ‖y - x‖ + ‖x‖ := norm_add_le _ _ _ = ‖x - y‖ + ‖x‖ := by rw [norm_sub_rev] _ = ‖x‖ + ‖x - y‖ := by ring - calc 1 + ‖y‖ ≤ 1 + ‖x‖ + ‖x - y‖ := by linarith - _ ≤ 1 + ‖x‖ + R₀ := by linarith - _ ≤ (1 + ‖x‖) * (1 + R₀) := by nlinarith [norm_nonneg x] + calc 1 + ‖y‖ ≤ 1 + ‖x‖ + ‖x - y‖ := by linarith only [h1] + _ ≤ 1 + ‖x‖ + R₀ := by linarith only [h_xy_le] + _ ≤ (1 + ‖x‖) * (1 + R₀) := by nlinarith only [hR₀, norm_nonneg x] -- Raise to power N and rearrange have h_pow : (1 + ‖y‖)^(N : ℝ) ≤ ((1 + ‖x‖) * (1 + R₀))^(N : ℝ) := by - apply Real.rpow_le_rpow (by linarith : 0 ≤ 1 + ‖y‖) h_peetre_base + apply Real.rpow_le_rpow (by linarith only [h_one_plus_y_pos] : 0 ≤ 1 + ‖y‖) h_peetre_base exact Nat.cast_nonneg N rw [Real.mul_rpow (le_of_lt h_one_plus_x_pos) (le_of_lt h_one_plus_R₀_pos)] at h_pow -- h_pow : (1 + ‖y‖)^N ≤ (1 + ‖x‖)^N * (1 + R₀)^N @@ -522,7 +522,7 @@ private lemma convolution_compactSupport_decay_exists (f : SchwartzMap E ℂ) (K -- C_f / (1 + ‖x‖)^N ≤ C_f since (1 + ‖x‖)^N ≥ 1 -- So integrand ≤ C_f * |K_sing(x - y)|, which is integrable have hbdd : ∀ x : E, C_f / (1 + ‖x‖)^(N : ℝ) ≤ C_f := fun x => by - have h1 : 1 ≤ 1 + ‖x‖ := by linarith [norm_nonneg x] + have h1 : 1 ≤ 1 + ‖x‖ := by linarith only [norm_nonneg x] have h2 : 1 ≤ (1 + ‖x‖)^(N : ℝ) := Real.one_le_rpow h1 (Nat.cast_nonneg N) calc C_f / (1 + ‖x‖)^(N : ℝ) ≤ C_f / 1 := by @@ -536,9 +536,9 @@ private lemma convolution_compactSupport_decay_exists (f : SchwartzMap E ℂ) (K apply Continuous.div continuous_const · refine Continuous.rpow_const ?_ (fun x => Or.inl ?_) · exact continuous_const.add continuous_norm - · have := norm_nonneg x; linarith + · have := norm_nonneg x; linarith only [this] · intro x - have hpos : 0 < 1 + ‖x‖ := by have := norm_nonneg x; linarith + have hpos : 0 < 1 + ‖x‖ := by have := norm_nonneg x; linarith only [this] exact ne_of_gt (Real.rpow_pos_of_pos hpos N) exact h_cont.aestronglyMeasurable.mul hK_shift_int.aestronglyMeasurable · -- Bound: ‖(C_f / ...) * |...|‖ ≤ ‖C_f * |...|‖ @@ -590,9 +590,9 @@ private lemma convolution_compactSupport_decay_exists (f : SchwartzMap E ℂ) (K rw [heq] apply div_le_div_of_nonneg_right _ (le_of_lt h_rpow_pos) calc C_f * (1 + R₀) ^ (N : ℝ) * I_Ksing - ≤ C_f * (1 + R₀) ^ (N : ℝ) * (I_Ksing + 1) := by gcongr; linarith + ≤ C_f * (1 + R₀) ^ (N : ℝ) * (I_Ksing + 1) := by gcongr; linarith only [] _ = C_f * (1 + R₀) ^ N * (I_Ksing + 1) := by rw [Real.rpow_natCast] - _ ≤ C := by simp only [C]; linarith + _ ≤ C := by simp only [C]; linarith only [] /-- Convolution of a Schwartz function with the compactly supported singular kernel part has polynomial decay. -/ @@ -669,7 +669,7 @@ private lemma convolution_expDecay_polynomial_decay_exists (f : SchwartzMap E have h_bound : ∀ z : E, ‖K_refl z‖ ≤ C_poly * (1 + ‖z‖)^(-N) := by intro z have hb := hK_refl_bound z - rw [Real.rpow_neg (by linarith [norm_nonneg z] : 0 ≤ 1 + ‖z‖)] + rw [Real.rpow_neg (by linarith only [norm_nonneg z] : 0 ≤ 1 + ‖z‖)] calc ‖K_refl z‖ ≤ C_poly / (1 + ‖z‖)^N := hb _ = C_poly * ((1 + ‖z‖)^N)⁻¹ := by ring -- Use Integrable.mono with bounding integrable function @@ -696,7 +696,7 @@ private lemma convolution_expDecay_polynomial_decay_exists (f : SchwartzMap E have hb := h_bound z have h_nonneg : 0 ≤ C_poly * (1 + ‖z‖)^(-N) := by apply mul_nonneg (le_of_lt hC_poly_pos) - exact Real.rpow_nonneg (by linarith [norm_nonneg z]) _ + exact Real.rpow_nonneg (by linarith only [norm_nonneg z]) _ rwa [Real.norm_eq_abs, abs_of_nonneg h_nonneg] -- The integral ∫ f(x) K_tail(x - y) dx equals (f ⋆ K_refl)(y) have h_conv_eq : ∀ y, ∫ x, f x * (kernelTail K R₀ (x - y) : ℂ) = @@ -760,9 +760,9 @@ theorem schwartz_bilinear_translation_decay_polynomial_proof let d := Module.finrank ℝ E -- Choose N > max(α, d) for integrability let N := max α d + 1 - have hN_pos : N > 0 := by simp only [N]; linarith [le_max_left α d, hα] - have hN_gt_α : N > α := by simp only [N]; linarith [le_max_left α d] - have hN_gt_d : N > d := by simp only [N]; linarith [le_max_right α d] + have hN_pos : N > 0 := by simp only [N]; linarith only [hα, le_max_left α d] + have hN_gt_α : N > α := by simp only [N]; linarith only [le_max_left α d] + have hN_gt_d : N > d := by simp only [N]; linarith only [le_max_right α d] -- Step 3: K_tail is bounded (from the decay bound on the complement) have hK_tail_bdd : ∃ M : ℝ, ∀ z : E, |kernelTail K R₀ z| ≤ M := by use max C_K 1 @@ -772,12 +772,14 @@ theorem schwartz_bilinear_translation_decay_polynomial_proof · rw [indicator_of_mem hz, mul_one] have hz' : ‖z‖ ≥ R₀ := by simp only [mem_compl_iff, mem_closedBall, dist_zero_right, not_le] at hz - linarith + linarith only [hz] calc |K z| ≤ C_K * Real.exp (-m * ‖z‖) := hK_decay z hz' - _ ≤ C_K * Real.exp 0 := by gcongr; nlinarith [norm_nonneg z] + _ ≤ C_K * Real.exp 0 := by gcongr; nlinarith only [hm, hR₀, hz', norm_nonneg z] _ = C_K := by simp _ ≤ max C_K 1 := le_max_left _ _ - · simp_all + · simp_all only [gt_iff_lt, ge_iff_le, neg_mul, mem_compl_iff, mem_closedBall, + dist_zero_right, not_le, not_lt, not_true_eq_false, not_false_eq_true, + indicator_of_notMem, mul_zero, abs_zero, le_max_iff, zero_le_one, or_true] -- Step 4: Build H(y) = ∫ f(x) K(x-y) dx and show it has polynomial decay -- For the full proof, we need: -- 1. H_sing has polynomial decay (convolutionCompactSupportDecay) @@ -851,7 +853,7 @@ theorem schwartz_bilinear_translation_decay_polynomial_proof obtain ⟨M_tail, hM_tail⟩ := hK_tail_bdd -- f is bounded by C_f (from Schwartz decay with denominator ≥ 1) have hf_bdd : ∀ x, ‖f x‖ ≤ C_f := fun x => by - have h1 : 1 ≤ 1 + ‖x‖ := by linarith [norm_nonneg x] + have h1 : 1 ≤ 1 + ‖x‖ := by linarith only [norm_nonneg x] have h2 : 1 ≤ (1 + ‖x‖)^N := Real.one_le_rpow h1 hN_pos.le calc ‖f x‖ ≤ C_f / (1 + ‖x‖)^N := hf_bound x _ ≤ C_f / 1 := by apply div_le_div_of_nonneg_left (le_of_lt hC_f_pos) one_pos h2 @@ -868,13 +870,14 @@ theorem schwartz_bilinear_translation_decay_polynomial_proof (fun x => (kernelTail K R₀ (x - y) : ℂ)) volume := hK_tail_shift_meas.complex_ofReal.aestronglyMeasurable have hK_tail_shift_bdd : ∀ x, ‖(kernelTail K R₀ (x - y) : ℂ)‖ ≤ M_tail := fun x => by - simp_all + simp_all only [gt_iff_lt, ge_iff_le, neg_mul, Real.rpow_natCast, norm_real, + Real.norm_eq_abs] exact hf_int.mul_bdd (c := M_tail) hK_tail_shift_aesm (Eventually.of_forall hK_tail_shift_bdd) have hbound1 : ‖∫ x, f x * (kernelSingular K R₀ (x - y) : ℂ)‖ ≤ C_Hsing / (1 + ‖y‖)^N := by have h1 := hHsing_bound y have hle : N ≤ (⌈N⌉₊ : ℝ) := Nat.le_ceil N - have hbase : 1 ≤ 1 + ‖y‖ := by linarith [norm_nonneg y] + have hbase : 1 ≤ 1 + ‖y‖ := by linarith only [norm_nonneg y] have hpow : (1 + ‖y‖)^N ≤ (1 + ‖y‖)^(⌈N⌉₊ : ℝ) := Real.rpow_le_rpow_of_exponent_le hbase hle have hdenom_pos : 0 < (1 + ‖y‖)^N := by positivity @@ -939,7 +942,7 @@ theorem schwartz_bilinear_translation_decay_polynomial_proof have hbound := hH_combined y have h_eq : (C_Hsing + C_Htail) / (1 + ‖y‖)^N = (C_Hsing + C_Htail) * (1 + ‖y‖)^(-N) := by - have h1plus_pos : 0 ≤ 1 + ‖y‖ := by linarith [norm_nonneg y] + have h1plus_pos : 0 ≤ 1 + ‖y‖ := by linarith only [norm_nonneg y] rw [div_eq_mul_inv, Real.rpow_neg h1plus_pos] exact le_trans hbound (le_of_eq h_eq) exact Integrable.mono' h_bound_int hH_meas hH_bound_ae @@ -957,7 +960,7 @@ theorem schwartz_bilinear_translation_decay_polynomial_proof · exact le_of_lt hC_conv_pos · intro a have h_one_plus_pos : 0 < 1 + ‖a‖ := by positivity - have h_base_ge_one : 1 ≤ 1 + ‖a‖ := by linarith [norm_nonneg a] + have h_base_ge_one : 1 ≤ 1 + ‖a‖ := by linarith only [norm_nonneg a] -- The bound from convolutionPolynomialDecay gives us: -- ‖∫ H(y) g_flip(a-y) dy‖ ≤ C_conv / (1 + ‖a‖)^N ≤ C_conv * (1 + ‖a‖)^(-α) have h_conv_to_goal : ‖∫ y, H y * g_flip (a - y)‖ ≤ C_conv * (1 + ‖a‖)^(-α) := by diff --git a/LeanPool/OSforGFF/General/SchurProduct.lean b/LeanPool/OSforGFF/General/SchurProduct.lean index 687486c551..ebd498184e 100644 --- a/LeanPool/OSforGFF/General/SchurProduct.lean +++ b/LeanPool/OSforGFF/General/SchurProduct.lean @@ -56,12 +56,8 @@ lemma sum_pairs_eq_double [Fintype ι] (g : ι × ι → ℝ) : /-- Over `ℝ`, the Hadamard product of Hermitian matrices is Hermitian. -/ private lemma isHermitian_hadamard_real {A B : Matrix ι ι ℝ} - (hA : A.IsHermitian) (hB : B.IsHermitian) : (A ∘ₕ B).IsHermitian := by - rw [Matrix.IsHermitian] - ext i j - have hAij : A i j = A j i := by simpa using (Matrix.IsHermitian.apply hA i j).symm - have hBij : B i j = B j i := by simpa using (Matrix.IsHermitian.apply hB i j).symm - simp [Matrix.conjTranspose, Matrix.hadamard, hAij, hBij] + (hA : A.IsHermitian) (hB : B.IsHermitian) : (A ∘ₕ B).IsHermitian := + hA.hadamard hB /-- Schur product theorem (real case, finite index): If A B are positive definite matrices over ℝ, then the Hadamard product is positive definite. diff --git a/LeanPool/OSforGFF/General/SchwartzTranslationDecay.lean b/LeanPool/OSforGFF/General/SchwartzTranslationDecay.lean index 8639b8de8b..770dadb397 100644 --- a/LeanPool/OSforGFF/General/SchwartzTranslationDecay.lean +++ b/LeanPool/OSforGFF/General/SchwartzTranslationDecay.lean @@ -84,8 +84,10 @@ lemma kernel_decomposition (K : E → ℝ) (R₀ : ℝ) : ext x simp only [kernelSingular, kernelTail] by_cases hx : x ∈ closedBall (0 : E) R₀ - · simp_all - · simp_all + · simp_all only [mem_closedBall, dist_zero_right, indicator_of_mem, mul_one, mem_compl_iff, + not_true_eq_false, not_false_eq_true, indicator_of_notMem, mul_zero, add_zero] + · simp_all only [mem_closedBall, dist_zero_right, not_le, indicator_of_notMem, mul_zero, + mem_compl_iff, indicator_of_mem, mul_one, zero_add] omit [MeasurableSpace E] [BorelSpace E] in /-- K_tail vanishes at infinity when K has polynomial decay. -/ @@ -113,7 +115,8 @@ lemma kernelTail_tendsto_zero (K : E → ℝ) (R₀ : ℝ) have hbound := hK_decay z hz.le have : |K z| ≤ 0 := le_trans hbound (div_nonpos_of_nonpos_of_nonneg hC (Real.rpow_nonneg (norm_nonneg z) α)) - simp_all + simp_all only [gt_iff_lt, ge_iff_le, mem_compl_iff, mem_closedBall, dist_zero_right, not_le, + abs_nonpos_iff, norm_zero] · -- C > 0 case push Not at hC let R := max R₀ ((C / ε) ^ (1 / α) + 1) @@ -128,12 +131,14 @@ lemma kernelTail_tendsto_zero (K : E → ℝ) (R₀ : ℝ) by_cases hz_R₀ : ‖z‖ ≤ R₀ · -- Inside R₀ ball: kernelTail z = 0 simp only [kernelTail] - simp_all + simp_all only [gt_iff_lt, ge_iff_le, mem_compl_iff, mem_closedBall, dist_zero_right, + not_true_eq_false, not_false_eq_true, indicator_of_notMem, mul_zero, norm_zero] · -- Outside R₀ ball: use decay bound push Not at hz_R₀ simp only [kernelTail] have hmem : z ∈ (closedBall (0 : E) R₀)ᶜ := by - simp_all + simp_all only [gt_iff_lt, ge_iff_le, mem_compl_iff, mem_closedBall, dist_zero_right, + not_le] rw [indicator_of_mem hmem, mul_one] have hbound := hK_decay z hz_R₀.le have hz_large : ‖z‖ > (C / ε) ^ (1 / α) := by @@ -197,7 +202,8 @@ lemma bounded_of_continuous_tendsto_zero by_cases hx : x ∈ K · have : ‖g x‖ ∈ Set.image (‖g ·‖) K := ⟨x, hx, rfl⟩ have hle : ‖g x‖ ∈ closedBall (0 : ℝ) M := hM this - simp_all + simp_all only [gt_iff_lt, dist_zero_right, image_subset_iff, mem_image, mem_closedBall, + norm_norm, le_max_iff, true_or] · exact le_trans (le_of_lt (hK x hx)) (le_max_right _ _) /-- For integrable f and ε > 0, there exists a compact set K with small tail integral. @@ -259,7 +265,7 @@ theorem convolution_vanishes_of_integrable_and_C0 let If := ∫ x, ‖f x‖ have hIf_nonneg : 0 ≤ If := integral_nonneg (fun _ => norm_nonneg _) let η := ε / (2 * (If + 1)) - have hη_pos : 0 < η := div_pos hε (mul_pos two_pos (by linarith)) + have hη_pos : 0 < η := div_pos hε (mul_pos two_pos (by linarith only [hIf_nonneg])) rw [Metric.tendsto_nhds] at hg_C0 have hg_small := hg_C0 η hη_pos rw [Filter.eventually_iff_exists_mem] at hg_small @@ -292,7 +298,7 @@ theorem convolution_vanishes_of_integrable_and_C0 -- ‖y‖ - ‖x‖ ≤ ‖y - x‖ = ‖x - y‖ have h1 : ‖y‖ - ‖x‖ ≤ ‖y - x‖ := norm_sub_norm_le y x have h2 : ‖y - x‖ = ‖x - y‖ := norm_sub_rev y x - linarith + linarith only [hy, hx_bound, hxy_bound, h1, h2] -- For x ∈ K, |g(x-y)| < η have hg_small_on_K : ∀ x ∈ K, ‖g (x - y)‖ < η := by intro x hxK @@ -319,7 +325,8 @@ theorem convolution_vanishes_of_integrable_and_C0 have hg_meas : AEStronglyMeasurable (fun x => ‖g (x - y)‖) volume := (hg_cont.comp (continuous_id.sub continuous_const)).norm.aestronglyMeasurable refine Integrable.mul_bdd (c := max B 1) hf_int.norm hg_meas ?_ - simp_all + simp_all only [gt_iff_lt, dist_zero_right, lt_max_iff, zero_lt_one, or_true, implies_true, + le_max_iff, true_or, norm_norm, eventually_true] -- Split integral over K and Kᶜ have hK_meas : MeasurableSet K := hK_cpct.isClosed.measurableSet -- Bound on K using setIntegral_mono_on (which gives us the membership hypothesis) @@ -353,13 +360,13 @@ theorem convolution_vanishes_of_integrable_and_C0 have hlt : η * If < η * (If + 1) := mul_lt_mul_of_pos_left (lt_add_one If) hη_pos have heq : η * (If + 1) = ε / 2 := by simp only [η] - have hne : If + 1 ≠ 0 := by linarith + have hne : If + 1 ≠ 0 := by linarith only [hIf_nonneg] field_simp - linarith + linarith only [hη_pos, heq] have h2 : max B 1 * (ε / (2 * max B 1)) = ε / 2 := by have hne : max B 1 ≠ 0 := ne_of_gt hB_pos field_simp - linarith + linarith only [h1, h2] /-! ## Product Space Integrability for Fubini @@ -513,7 +520,7 @@ theorem schwartz_bilinear_prod_integrable Function.uncurry (fun x y => f x * (K_tail (x - y) : ℂ) * g (y - a)) := by ext ⟨x, y⟩ simp only [Function.uncurry, Pi.add_apply, h_split] - simp_all + simp_all only [gt_iff_lt, integrable_add_iff_integrable_right] /-! ## Main theorem -/ @@ -559,7 +566,8 @@ private lemma schwartz_bilinear_kernelSingular_vanish simp only [mem_closedBall, dist_zero_right, not_le] at h have : K_sing (x - y) = 0 := by simp only [K_sing, kernelSingular] - simp_all + simp_all only [gt_iff_lt, dist_zero_right, norm_real, Real.norm_eq_abs, ne_eq, + mem_closedBall, not_le, indicator_of_notMem, mul_zero] exact hK_ne this have h1 : ‖x - y‖ ≤ R₀ := by simpa [mem_closedBall, dist_zero_right] using hxy_in_ball have h2 : ‖x‖ ≤ R_L := by simpa [mem_closedBall, dist_zero_right] using hR_L hx_in_L @@ -567,7 +575,7 @@ private lemma schwartz_bilinear_kernelSingular_vanish calc ‖y‖ = ‖(y - x) + x‖ := by rw [sub_add_cancel] _ ≤ ‖y - x‖ + ‖x‖ := norm_add_le _ _ have h4 : ‖y - x‖ = ‖x - y‖ := norm_sub_rev y x - linarith + linarith only [hy, h1, h2, h3, h4] have hf_small_on_supp : ∀ x, K_sing (x - y) ≠ 0 → ‖f x‖ < δ := by intro x hK_ne have hx_not_L : x ∉ L := hxy_outside x hK_ne @@ -602,7 +610,7 @@ private lemma schwartz_bilinear_kernelSingular_vanish _ < ε := by have : δ * I_Ksing < δ * (I_Ksing + 1) := mul_lt_mul_of_pos_left (lt_add_one _) hδ_pos have heq : δ * (I_Ksing + 1) = ε := by simp only [δ]; field_simp - linarith + linarith only [hδ_pos, heq] private lemma schwartz_bilinear_kernelTail_vanish (f : SchwartzMap E ℂ) (K : E → ℝ) (hK_meas : Measurable K) @@ -632,7 +640,9 @@ private lemma schwartz_bilinear_kernelTail_vanish apply div_le_div_of_nonneg_left hC.le (Real.rpow_pos_of_pos hR₀ α) exact Real.rpow_le_rpow hR₀.le hz' hα.le _ ≤ max (C / R₀ ^ α) 1 := le_max_left _ _ - · simp_all + · simp_all only [gt_iff_lt, ge_iff_le, mem_compl_iff, mem_closedBall, dist_zero_right, not_le, + not_lt, not_true_eq_false, not_false_eq_true, indicator_of_notMem, mul_zero, norm_zero, + le_max_iff, zero_le_one, or_true] obtain ⟨M, hM_pos, hM⟩ := hK_tail_bdd rw [Metric.tendsto_nhds] intro ε hε @@ -641,7 +651,7 @@ private lemma schwartz_bilinear_kernelTail_vanish let If := ∫ x, ‖f x‖ have hIf_nonneg : 0 ≤ If := integral_nonneg (fun _ => norm_nonneg _) let η := ε / (2 * (If + 1)) - have hη_pos : 0 < η := div_pos hε (mul_pos two_pos (by linarith)) + have hη_pos : 0 < η := div_pos hε (mul_pos two_pos (by linarith only [hIf_nonneg])) rw [Metric.tendsto_nhds] at hK_tail_C0 have hKt_small := hK_tail_C0 η hη_pos rw [Filter.eventually_iff_exists_mem] at hKt_small @@ -668,11 +678,11 @@ private lemma schwartz_bilinear_kernelTail_vanish calc ‖y‖ = ‖(y - x) + x‖ := by rw [sub_add_cancel] _ ≤ ‖y - x‖ + ‖x‖ := norm_add_le _ _ have h2 : ‖y - x‖ = ‖x - y‖ := norm_sub_rev y x - linarith + linarith only [hy, hx_bound, hxy_bound, h1, h2] have hKt_small_on_K : ∀ x ∈ K_set, ‖(K_tail (x - y) : ℂ)‖ < η := by intro x hxK have : x - y ∈ S := hL_sub (hxy_outside x hxK) - simp_all + simp_all only [gt_iff_lt, ge_iff_le, dist_zero_right, Real.norm_eq_abs, norm_real] have hKt_y_meas : AEStronglyMeasurable (fun x => (K_tail (x - y) : ℂ)) volume := by have hind : Measurable ((closedBall (0 : E) R₀)ᶜ.indicator (fun _ => (1 : ℝ))) := measurable_const.indicator isClosed_closedBall.measurableSet.compl @@ -682,7 +692,8 @@ private lemma schwartz_bilinear_kernelTail_vanish exact (measurable_ofReal.comp h2).aestronglyMeasurable have h_int : Integrable (fun x => ‖f x‖ * ‖(K_tail (x - y) : ℂ)‖) volume := by refine Integrable.mul_bdd (c := M) hf_int.norm hKt_y_meas.norm ?_ - simp_all + simp_all only [gt_iff_lt, ge_iff_le, dist_zero_right, Real.norm_eq_abs, norm_real, abs_abs, + eventually_true] have hK_meas : MeasurableSet K_set := hK_cpct.isClosed.measurableSet have hK_bound : ∫ x in K_set, ‖f x‖ * ‖(K_tail (x - y) : ℂ)‖ ≤ η * If := by have h1 : ∫ x in K_set, ‖f x‖ * ‖(K_tail (x - y) : ℂ)‖ ≤ ∫ x in K_set, ‖f x‖ * η := by @@ -715,13 +726,13 @@ private lemma schwartz_bilinear_kernelTail_vanish have hlt : η * If < η * (If + 1) := mul_lt_mul_of_pos_left (lt_add_one If) hη_pos have heq : η * (If + 1) = ε / 2 := by simp only [η] - have hne : If + 1 ≠ 0 := by linarith + have hne : If + 1 ≠ 0 := by linarith only [hIf_nonneg] field_simp - linarith + linarith only [hη_pos, heq] have h2 : M * (ε / (2 * M)) = ε / 2 := by have hne : M ≠ 0 := ne_of_gt hM_pos field_simp - linarith + linarith only [h1, h2] private lemma schwartz_bilinear_kernel_convolution_continuous (f : SchwartzMap E ℂ) (K : E → ℝ) (hK_meas : Measurable K) @@ -1011,7 +1022,9 @@ theorem schwartz_bilinear_translation_decay_proof apply div_le_div_of_nonneg_left hC.le (Real.rpow_pos_of_pos hR₀ α) exact Real.rpow_le_rpow hR₀.le hz' hα.le _ ≤ max (C / R₀ ^ α) 1 := le_max_left _ _ - · simp_all + · simp_all only [gt_iff_lt, ge_iff_le, lt_max_iff, zero_lt_one, or_true, mem_compl_iff, + mem_closedBall, dist_zero_right, not_le, not_lt, not_true_eq_false, not_false_eq_true, + indicator_of_notMem, mul_zero, norm_zero, le_max_iff, zero_le_one] obtain ⟨M_tail, hM_tail_pos, hM_tail⟩ := hK_tail_bdd -- Step 10a: H is continuous (convolution of Schwartz with locally integrable kernel) have hH_cont : Continuous H := by @@ -1031,7 +1044,8 @@ theorem schwartz_bilinear_translation_decay_proof refine ⟨-K, hK_cpct.neg, ?_⟩ intro a ha apply hK_sub - simp_all + simp_all only [gt_iff_lt, ge_iff_le, lt_max_iff, zero_lt_one, or_true, norm_real, + Real.norm_eq_abs, mem_compl_iff, Set.mem_neg, not_false_eq_true] -- Step 10d: Compose to get decay in -a have h_composed : Tendsto (fun a => ∫ w : E, g w * H (w - (-a))) (cocompact E) (nhds 0) := h_decay.comp h_neg_cocompact @@ -1081,6 +1095,7 @@ theorem schwartz_bilinear_translation_decay_proof rw [integral_add_right_eq_self (fun y => g (y - a) * H y) a] simpa only [add_sub_cancel_right] using this -- Step 10e-iii: Rewrite w + a = w - (-a) - simp_all + simp_all only [gt_iff_lt, ge_iff_le, lt_max_iff, zero_lt_one, or_true, norm_real, + Real.norm_eq_abs, sub_neg_eq_add] end diff --git a/LeanPool/OSforGFF/KolmogorovExtension4/CompactSystem.lean b/LeanPool/OSforGFF/KolmogorovExtension4/CompactSystem.lean index a41fd929d4..5118593497 100644 --- a/LeanPool/OSforGFF/KolmogorovExtension4/CompactSystem.lean +++ b/LeanPool/OSforGFF/KolmogorovExtension4/CompactSystem.lean @@ -215,7 +215,7 @@ theorem nonempty_iInter_projCylinder_inter_piCylinderSet (hs : ∀ n, s n ∈ cl congr rw [this] have hyi : y ∈ projCylinder hs i := by - simp_all + simp_all only [nonempty_iInter, mem_iInter] rwa [mem_projCylinder] at hyi · rw [mem_piCylinderSet] intro i diff --git a/LeanPool/OSforGFF/KolmogorovExtension4/KolmogorovExtension.lean b/LeanPool/OSforGFF/KolmogorovExtension4/KolmogorovExtension.lean index 126bf35ff7..0bf1d3628a 100644 --- a/LeanPool/OSforGFF/KolmogorovExtension4/KolmogorovExtension.lean +++ b/LeanPool/OSforGFF/KolmogorovExtension4/KolmogorovExtension.lean @@ -41,7 +41,7 @@ theorem exists_compact ∃ K, IsCompact K ∧ IsClosed K ∧ K ⊆ A ∧ P J (A \ K) ≤ ε := by by_cases hPA : P J A = 0 · refine ⟨∅, isCompact_empty, isClosed_empty, empty_subset _, ?_⟩ - simp_all + simp_all only [sdiff_empty, zero_le] have h : P J A - ε < P J A := ENNReal.sub_lt_self (measure_ne_top _ _) hPA hε.ne' obtain ⟨K, hKA, ⟨hK_compact, hK_closed⟩, h_lt⟩ := hP_inner J hA (P J A - ε) h refine ⟨K, hK_compact, hK_closed, hKA, ?_⟩ diff --git a/LeanPool/OSforGFF/Measure/Construct.lean b/LeanPool/OSforGFF/Measure/Construct.lean index e5693001d7..07e4d9435e 100644 --- a/LeanPool/OSforGFF/Measure/Construct.lean +++ b/LeanPool/OSforGFF/Measure/Construct.lean @@ -326,7 +326,8 @@ lemma gff_second_moment_eq_covariance have h_mean : (gaussianReal 0 (freeCovarianceFormR m φ φ).toNNReal)[fun x => x] = 0 := by simp [integral_id_gaussianReal] exact variance_of_integral_eq_zero (by fun_prop) h_mean - simp_all + simp_all only [distributionPairingCLM, ContinuousLinearMap.coe_mk', LinearMap.coe_mk, + AddHom.coe_mk, variance_fun_id_gaussianReal, Real.coe_toNNReal'] _ = freeCovarianceFormR m φ φ := by simp [Real.coe_toNNReal', freeCovarianceFormR_pos] @@ -431,7 +432,8 @@ theorem gaussianFreeField_pairing_expSq_integrable -- Convert ‖x‖² to x² for ℝ (they are equal for real numbers) convert hC_int using 2 -- Goal: exp (C * y²) = exp (C * ‖y‖²) where y : ℝ - simp_all + simp_all only [distributionPairingCLM, ContinuousLinearMap.coe_mk', LinearMap.coe_mk, + AddHom.coe_mk, Real.norm_eq_abs, sq_abs, Function.comp_apply] /-- For real test functions, the square of the Gaussian pairing is integrable under the free Gaussian Free Field measure. This is the diagonal (f = g) case needed for diff --git a/LeanPool/OSforGFF/Measure/GaussianFreeField.lean b/LeanPool/OSforGFF/Measure/GaussianFreeField.lean index 679c89eefb..f20d50da29 100644 --- a/LeanPool/OSforGFF/Measure/GaussianFreeField.lean +++ b/LeanPool/OSforGFF/Measure/GaussianFreeField.lean @@ -100,7 +100,7 @@ theorem gaussian_satisfies_OS0 have h_rewrite : (fun z : Fin n → ℂ => GJGeneratingFunctionalℂ dμ_config (∑ i, z i • J i)) = (fun z => Complex.exp (-(1/2 : ℂ) * SchwingerFunctionℂ₂ dμ_config (∑ i, z i • J i) (∑ i, z i • J i))) := by - simp_all + simp_all only [one_div, neg_mul] rw [h_rewrite] -- Show exp(-½ * quadratic_form) is analytic apply AnalyticOn.cexp diff --git a/LeanPool/OSforGFF/Measure/IsGaussian.lean b/LeanPool/OSforGFF/Measure/IsGaussian.lean index 51d2080e89..a4b5e7dc92 100644 --- a/LeanPool/OSforGFF/Measure/IsGaussian.lean +++ b/LeanPool/OSforGFF/Measure/IsGaussian.lean @@ -79,7 +79,7 @@ lemma gff_cf_two_testfunctions (f g : OSforGFF.TestFunction) (t s : ℝ) : 2 * t * s * freeCovarianceFormR m f g + s^2 * freeCovarianceFormR m g g)) := by have h := gff_real_characteristic m (t • f + s • g) rw [freeCovarianceFormR_bilinear_expand] at h - simp_all + simp_all only [one_div, ofReal_add, ofReal_mul, ofReal_pow, ofReal_ofNat, neg_mul] /-! ## OS0-Based Derivative Machinery @@ -93,7 +93,8 @@ lemma gff_two_param_analytic (f g : OSforGFF.TestFunction) : Set.univ := by -- Direct application of gaussianFreeField_satisfies_OS0 with n=2, J = ![toComplex f, toComplex g] have h := gaussianFreeField_satisfies_OS0 m 2 ![toComplex f, toComplex g] - simp_all + simp_all only [muGFF, Fin.sum_univ_two, Fin.isValue, Matrix.cons_val_zero, Matrix.cons_val_one, + Matrix.cons_val_fin_one, analyticOn_univ] /-! ## OS0-Based Complex Extension via Identity Theorem @@ -209,10 +210,10 @@ private lemma eq_of_analytic_agree_on_reals {F G : ℂ → ℂ} have h_mem_V : ((ε / 2 : ℝ) : ℂ) ∈ V := hε_ball (by simp only [Metric.mem_ball, Complex.dist_eq, sub_zero, Complex.norm_real] rw [Real.norm_eq_abs, abs_of_pos h_half_pos] - linarith) + linarith only [hε_pos]) have h_ne : ((ε / 2 : ℝ) : ℂ) ≠ 0 := by simp only [ne_eq, Complex.ofReal_eq_zero] - linarith + linarith only [hε_pos] exact hV_sub ⟨h_mem_V, h_ne⟩ (h_agree (ε / 2)) exact congrFun h_eq z @@ -230,7 +231,7 @@ lemma gff_cf_agrees_on_reals_OS0 (f g : OSforGFF.TestFunction) (t s : ℝ) : -- First note: t • f + s • g is real, so toComplex (t • f + s • g) = t • toComplex f + s • -- toComplex g have h_eq_test : (t : ℂ) • toComplex f + (s : ℂ) • toComplex g = toComplex (t • f + s • g) := by - simp_all + simp_all only [one_div, neg_mul, coe_smul, toComplex_add, toComplex_smul] rw [h_eq_test] -- GJGeneratingFunctionalℂ on a real test function equals GJGeneratingFunctional rw [GJGeneratingFunctionalℂ_toComplex, h] @@ -276,7 +277,7 @@ theorem gff_complex_characteristic_OS0 : -- Step 5: Simplify LHS have h_LHS : GJGeneratingFunctionalℂ (gaussianFreeFieldFree m) J = F 1 Complex.I := by simp only [F, hJ] - simp_all + simp_all only [implies_true, one_smul] -- Step 6: Simplify RHS using Qc formula have h_RHS : Complex.exp (-(1/2 : ℂ) * freeCovarianceℂBilinear m J J) = G 1 Complex.I := by simp only [G] diff --git a/LeanPool/OSforGFF/Measure/MinlosAnalytic.lean b/LeanPool/OSforGFF/Measure/MinlosAnalytic.lean index 0f4b76eaa3..489b46d64a 100644 --- a/LeanPool/OSforGFF/Measure/MinlosAnalytic.lean +++ b/LeanPool/OSforGFF/Measure/MinlosAnalytic.lean @@ -125,14 +125,14 @@ lemma integral_neg_invariance (fun ω => starRingEnd ℂ (Complex.exp (Complex.I * (distributionPairing ω g : ℂ)))) := by funext ω rw [negMap, h_neg_eq, ← Complex.exp_conj] - simp_all + simp_all only [one_div, neg_mul, ofReal_neg, mul_neg, map_mul, conj_I, conj_ofReal] conv_lhs => rw [h_integrand_conj] rw [integral_conj] simp only [distributionPairing] at * rw [h_realCF g] have h_CF_is_real : (Complex.exp (-(1/2 : ℂ) * (C.Q g g : ℂ))).im = 0 := by have h_eq : (-(1/2 : ℂ) * (C.Q g g : ℂ)) = ((-(1/2 : ℝ) * C.Q g g : ℝ) : ℂ) := by - simp_all + simp_all only [one_div, neg_mul, ofReal_neg, ofReal_mul, ofReal_inv, ofReal_ofNat] rw [h_eq] exact Complex.exp_ofReal_im (-(1/2) * C.Q g g) rw [Complex.conj_eq_iff_im.mpr h_CF_is_real] diff --git a/LeanPool/OSforGFF/Minlos/MeasurableModification.lean b/LeanPool/OSforGFF/Minlos/MeasurableModification.lean index 0279028bf6..492c314d05 100644 --- a/LeanPool/OSforGFF/Minlos/MeasurableModification.lean +++ b/LeanPool/OSforGFF/Minlos/MeasurableModification.lean @@ -211,7 +211,7 @@ private lemma extensionFun_eq (d : ℕ → E) (hd : DenseRange d) rw [Finsupp.sum_add_index (fun i => by simp) (fun i => by simp [add_mul]), Finsupp.sum_single_index (by simp), Finsupp.sum_single_index (by simp)] ring - simp_all + simp_all only -- Use the bound to prove ContinuousWithinAt change Filter.Tendsto ω (nhdsWithin (d n) (Set.range d)) (nhds (ω (d n))) rw [Metric.tendsto_nhds] @@ -229,7 +229,7 @@ private lemma extensionFun_eq (d : ℕ → E) (hd : DenseRange d) calc |ω (d m) - ω (d n)| ≤ (↑C : ℝ) * (s.sup p) (d m - d n) := h_bound m _ ≤ (↑C + 1) * (s.sup p) (d m - d n) := by - apply mul_le_mul_of_nonneg_right (by linarith) (apply_nonneg _ _) + apply mul_le_mul_of_nonneg_right (by linarith only []) (apply_nonneg _ _) _ < (↑C + 1) * (ε / (↑C + 1)) := by exact mul_lt_mul_of_pos_left hx_U hCε _ = ε := mul_div_cancel₀ ε (ne_of_gt hCε) @@ -293,7 +293,7 @@ private lemma extensionFun_continuous (d : ℕ → E) (hd : DenseRange d) calc |ω (d m) - ω (d n)| ≤ (C : ℝ) * (s.sup p) (d m - d n) := h_bound m n _ ≤ ((C : ℝ) + 1) * (s.sup p) (d m - d n) := by - apply mul_le_mul_of_nonneg_right (by linarith) (apply_nonneg _ _) + apply mul_le_mul_of_nonneg_right (by linarith only []) (apply_nonneg _ _) _ ≤ ((C : ℝ) + 1) * ((s.sup p) (d m - x) + (s.sup p) (d n - x)) := by gcongr calc (s.sup p) (d m - d n) @@ -383,10 +383,10 @@ private lemma extensionFun_map_add (d : ℕ → E) (hd : DenseRange d) calc |ω (d k) - ω (d m + d n)| = |ω (d k - (d m + d n))| := by have := hql_c'.trans h2' -- ω(dk-(dm+dn)) = ω(dk) - ω(dm) - ω(dn) - rw [h_ω_sum]; congr 1; linarith + rw [h_ω_sum]; congr 1; linarith only [hql_c', h2'] _ ≤ (C : ℝ) * (s.sup p) (d k - (d m + d n)) := hbd_c' _ ≤ ((C : ℝ) + 1) * (s.sup p) (d k - (d m + d n)) := by - apply mul_le_mul_of_nonneg_right (by linarith) (apply_nonneg _ _) + apply mul_le_mul_of_nonneg_right (by linarith only []) (apply_nonneg _ _) _ < ((C : ℝ) + 1) * (ε / ((C : ℝ) + 1)) := mul_lt_mul_of_pos_left hz_U hCε _ = ε := mul_div_cancel₀ ε (ne_of_gt hCε) rw [hg_at, hql_c, h2, hg_eq, hg_eq] @@ -470,10 +470,10 @@ private lemma extensionFun_map_smul (d : ℕ → E) (hd : DenseRange d) calc |ω (d m) - ω ((q : ℝ) • d n)| = |ω (d m) - (q : ℝ) * ω (d n)| := by rw [h_ω_qn] _ = |ω (d m - (q : ℝ) • d n)| := by - simp_all + simp_all only [gt_iff_lt] _ ≤ (C : ℝ) * (s.sup p) (d m - (q : ℝ) • d n) := hbd_c' _ ≤ ((C : ℝ) + 1) * (s.sup p) (d m - (q : ℝ) • d n) := by - apply mul_le_mul_of_nonneg_right (by linarith) (apply_nonneg _ _) + apply mul_le_mul_of_nonneg_right (by linarith only []) (apply_nonneg _ _) _ < ((C : ℝ) + 1) * (ε / ((C : ℝ) + 1)) := mul_lt_mul_of_pos_left hx_U hCε _ = ε := mul_div_cancel₀ ε (ne_of_gt hCε) rw [hg_at, hql_c, h2, hg_eq] @@ -532,7 +532,7 @@ lemma embed_mem_goodPaths simp only [qLinearPaths, Set.mem_iInter, Set.mem_ofPred_eq] intro c simp only [weakDualEmbed, Finsupp.sum] - simp_all + simp_all only [map_sum, map_smul, smul_eq_mul] · -- Boundedness: l is continuous, hence bounded by finitely many p_n simp only [boundedPaths, Set.mem_iUnion, Set.mem_iInter, Set.mem_ofPred_eq] -- View |l(·)| as a continuous seminorm and apply bound_of_continuous @@ -662,7 +662,7 @@ private lemma measurable_eval_comp_projection unfold measurableProjectionAux rw [dite_eq_right hω] rfl - simp_all + simp_all only [tendsto_const_nhds_iff] exact measurable_of_tendsto_metrizable hF_meas hF_tendsto /-- The projection map is measurable. @@ -798,12 +798,12 @@ theorem qLinearPaths_ae [SeparableSpace E] [Nonempty E] simp only [← Finset.sum_coe_sort c.support, σ] exact Fintype.sum_equiv c.support.equivFin.symm _ _ (fun _ => rfl) rw [h2, Finsupp.sum] - simp_all + simp_all only [ofReal_sum, ofReal_mul] -- Apply ae_eq_zero_of_charfun_eq_one have := ae_eq_zero_of_charfun_eq_one hX_meas hX_cf filter_upwards [this] with ω hω -- X(ω) = 0 means ω(y) = ∑ cᵢ * ω(dᵢ) - linarith [show X ω = 0 from hω] + linarith only [hω, show X ω = 0 from hω] omit [IsTopologicalAddGroup E] [ContinuousSMul ℝ E] in /-- **Minlos concentration** — see `Minlos.MinlosConcentration`. -/ @@ -891,9 +891,11 @@ theorem boundedPaths_ae [SeparableSpace E] [IsHilbertNuclear E] [Nonempty E] (C : ℝ) * (s.sup p) (c.sum fun i a => (a : ℝ) • d i))} := by intro ω hω simp only [Set.mem_ofPred_eq, boundedPaths, Set.mem_iUnion, Set.mem_iInter] at hω ⊢ - simp_all + simp_all only [ofReal_sum, ofReal_mul, not_le, ne_eq, measure_ne_top, not_false_eq_true, + ENNReal.ofReal_toReal, not_exists, not_forall] have h_lt := lt_of_le_of_lt (measure_mono h_subset) hC - simp_all + simp_all only [ofReal_sum, ofReal_mul, not_le, ne_eq, measure_ne_top, not_false_eq_true, + ENNReal.ofReal_toReal, Set.ofPred_subset_ofPred, lt_self_iff_false] omit [IsTopologicalAddGroup E] [ContinuousSMul ℝ E] in /-- The good paths have full ν-measure. Combines ℚ-linearity and boundedness a.e. -/ @@ -939,7 +941,9 @@ theorem projection_ae_eq [SeparableSpace E] [IsHilbertNuclear E] [Nonempty E] -- Step 0: Derive Φ(0) = 1 from h_cf_joint with n=1 have h_normalized : Φ 0 = 1 := by have h1 := h_cf_joint 1 (fun _ => 0) (fun _ => (0 : E)) - simp_all + simp_all only [ofReal_sum, ofReal_mul, Finset.univ_unique, Fin.default_eq_zero, Fin.isValue, + zero_mul, Finset.sum_const_zero, ofReal_zero, mul_zero, exp_zero, integral_const, + probReal_univ, one_smul, smul_zero] -- Step 1: Good paths have full measure have h_good := goodPaths_ae Φ ν h_cf_joint h_cf_cont h_normalized -- Step 2: Choose a sequence d(n_k) → f @@ -988,7 +992,7 @@ theorem projection_ae_eq [SeparableSpace E] [IsHilbertNuclear E] [Nonempty E] h_Pω_cont.continuousAt.tendsto.comp hφ have h_ω_tendsto : Filter.Tendsto (fun k => ω (d (φ k))) Filter.atTop (nhds ((measurableProjection ω : E →L[ℝ] ℝ) f)) := by - simp_all + simp_all only [ofReal_sum, ofReal_mul, Filter.eventually_mem_set] exact Filter.Tendsto.sub h_ω_tendsto tendsto_const_nhds -- Step 8: Apply DCT + CF convergence to show ∫ exp(it Z) = 1 have hZ_cf : ∀ t : ℝ, ∫ ω, exp (I * ↑(t * Z ω)) ∂ν = 1 := by @@ -1108,7 +1112,7 @@ lemma uniqueness_via_projection [SeparableSpace E] [IsHilbertNuclear E] [Nonempt MeasurableEquiv.trans_apply, MeasurableEquiv.coe_mk, Equiv.coe_fn_mk, MeasurableEquiv.coe_toLp, Function.comp_apply, Finset.restrict, weakDualEmbed] - simp_all + simp_all only [RCLike.inner_apply, conj_trivial, map_sum, map_smul, smul_eq_mul] simp_rw [h_inner_eq, mul_comm _ Complex.I] rw [← hμ'] rfl diff --git a/LeanPool/OSforGFF/Minlos/MinlosConcentration.lean b/LeanPool/OSforGFF/Minlos/MinlosConcentration.lean index 1d0b7ce193..ee1691b194 100644 --- a/LeanPool/OSforGFF/Minlos/MinlosConcentration.lean +++ b/LeanPool/OSforGFF/Minlos/MinlosConcentration.lean @@ -83,7 +83,7 @@ lemma ae_eq_zero_of_charfun_eq_one {Ω : Type*} [MeasurableSpace Ω] have : @inner ℝ ℝ _ (X ω) t = t * X ω := by change t * starRingEnd ℝ (X ω) = t * X ω; simp rw [this]; push_cast; ring_nf - simp_all + simp_all only [ofReal_mul, RCLike.inner_apply, conj_trivial, ofReal_zero, zero_mul, exp_zero] -- Step 2: Deduce X = 0 a.e. have h_ae : ∀ᵐ y ∂(ν.map X), y = 0 := by rw [h_eq]; exact ae_dirac_iff (measurableSet_singleton 0) |>.mpr rfl @@ -111,14 +111,15 @@ lemma cf_norm_le_one calc ‖∫ ω, exp (I * ↑(ω x)) ∂ν‖ ≤ ∫ ω, ‖exp (I * ↑(ω x))‖ ∂ν := norm_integral_le_integral_norm _ _ = ∫ ω, 1 ∂ν := by - simp_all + simp_all only [ofReal_sum, ofReal_mul, norm_exp_I_mul_ofReal, integral_const, + probReal_univ, smul_eq_mul, mul_one] _ = 1 := by simp /-- `1 - Re(z) ≤ 2` when `‖z‖ ≤ 1`. -/ lemma one_sub_re_le_two_of_norm_le (z : ℂ) (hz : ‖z‖ ≤ 1) : 1 - z.re ≤ 2 := by have h1 : |z.re| ≤ ‖z‖ := abs_re_le_norm z - have h2 : -1 ≤ z.re := by linarith [abs_le.mp (h1.trans hz)] - linarith + have h2 : -1 ≤ z.re := by linarith only [hz, h1, abs_le.mp (h1.trans hz)] + linarith only [h2] omit [TopologicalSpace E] [IsTopologicalAddGroup E] [ContinuousSMul ℝ E] in /-- Quadratic bound outside a seminorm ball: if `q(x) ≥ δ > 0` and `‖Φ(x)‖ ≤ 1`, @@ -134,7 +135,7 @@ lemma quadratic_bound_outside _ = (2 / δ ^ 2) * δ ^ 2 := by field_simp _ ≤ (2 / δ ^ 2) * q x ^ 2 := by apply mul_le_mul_of_nonneg_left _ (by positivity) - exact sq_le_sq' (by linarith) hx + exact sq_le_sq' (by linarith only [hδ, hx]) hx omit [AddCommGroup E] [Module ℝ E] [TopologicalSpace E] [IsTopologicalAddGroup E] [ContinuousSMul ℝ E] in @@ -143,8 +144,8 @@ lemma one_sub_re_nonneg (Φ : E → ℂ) (h_norm_le : ∀ x : E, ‖Φ x‖ ≤ 1) (x : E) : 0 ≤ 1 - (Φ x).re := by have h1 : |Complex.re (Φ x)| ≤ ‖Φ x‖ := abs_re_le_norm _ - have h2 : (Φ x).re ≤ 1 := by linarith [abs_le.mp (h1.trans (h_norm_le x))] - linarith + have h2 : (Φ x).re ≤ 1 := by linarith only [h_norm_le, h1, abs_le.mp (h1.trans (h_norm_le x))] + linarith only [h2] omit [IsTopologicalAddGroup E] [ContinuousSMul ℝ E] in /-- From `Continuous Φ`, `Φ 0 = 1`, and `WithSeminorms p`: extract a finite set @@ -226,14 +227,14 @@ lemma combined_quadratic_bound have h1 : 1 - (Φ x).re ≤ ‖1 - Φ x‖ := by have := abs_re_le_norm (1 - Φ x) simp only [Complex.sub_re, Complex.one_re] at this - linarith [abs_le.mp this] + linarith only [this, abs_le.mp this] have h3 : (0 : ℝ) ≤ 2 / r ^ 2 * (p m₀) x ^ 2 := by positivity - linarith [h_ball x hx] + linarith only [h_ball, hx, h1, h3, h_ball x hx] · -- Outside ball: use quadratic_bound_outside with q = p m₀ push Not at hx have hx' : r ≤ (p m₀) x := le_trans hx (h_mono x) have := quadratic_bound_outside Φ h_norm_le (p m₀) r hr x hx' - linarith + linarith only [hε, this] /-! ## CF vanishes on seminorm kernel -/ @@ -259,7 +260,7 @@ lemma cf_kernel_of_ball_bound _ = ‖t‖ * 0 := by rw [hz] _ = 0 := mul_zero _ _ < r := hr - linarith [h_bound (t • z) h_qtz] + linarith only [h_bound, h_qtz, h_bound (t • z) h_qtz] /-! ## Linear combination a.e. from joint CF -/ @@ -303,10 +304,10 @@ lemma linear_combination_ae rw [show ∑ j : Fin k, -t * β j * ω' (e j) = -(t * ∑ j, β j * ω' (e j)) from by rw [Finset.mul_sum, ← Finset.sum_neg_distrib]; congr 1; ext j; ring] - simp_all + simp_all only [ofReal_sum, ofReal_mul] have := ae_eq_zero_of_charfun_eq_one hX_meas hX_cf filter_upwards [this] with ω hω - linarith [show X ω = 0 from hω] + linarith only [hω, show X ω = 0 from hω] /-! ## Pushforward CF for finite evaluation maps -/ @@ -384,7 +385,8 @@ lemma kernel_eval_ae_zero apply ae_eq_zero_of_charfun_eq_one (measurable_pi_apply z) intro t have h := h_cf_joint 1 (fun _ => t) (fun _ => z) - simp_all + simp_all only [ofReal_sum, ofReal_mul, Finset.univ_unique, Fin.default_eq_zero, Fin.isValue, + Finset.sum_const, Finset.card_singleton, one_smul] /-! ## ℚ-linearity for all Finsupp simultaneously -/ @@ -529,8 +531,8 @@ private lemma gs_pythagoras (p : Seminorm ℝ F) (hp : p.IsHilbertian) (x y : F) (hxy : p.innerProd x y = 0) : p (x + y) ^ 2 = p x ^ 2 + p y ^ 2 := by have h1 : p (x + y) ^ 2 = p (x - y) ^ 2 := by - simp only [Seminorm.innerProd] at hxy; linarith - linarith [hp x y] + simp only [Seminorm.innerProd] at hxy; linarith only [hxy] + linarith only [hp, h1, hp x y] omit [TopologicalSpace F] [IsTopologicalAddGroup F] [ContinuousSMul ℝ F] in /-- **Gram-Schmidt for Hilbertian seminorms**: given N vectors in F and a Hilbertian @@ -560,7 +562,7 @@ lemma gram_schmidt_seminorm_aux (p : Seminorm ℝ F) (hp : p.IsHilbertian) intro j; change p.innerProd (v - ∑ i : Fin k, c i • e i) (e j) = 0 rw [gs_innerProd_sub_left p hp, p.innerProd_sum_left hp] simp_rw [p.innerProd_smul_left hp] - suffices h : ∑ i : Fin k, c i * p.innerProd (e i) (e j) = c j by linarith + suffices h : ∑ i : Fin k, c i * p.innerProd (e i) (e j) = c j by linarith only [h] conv_lhs => arg 2; ext i; rw [he_orth i j] simp [Finset.sum_ite_eq', Finset.mem_univ] -- u ⊥ (Σ c_j e_j) @@ -935,7 +937,7 @@ private lemma joint_kernel_bound_finite refine ⟨m, ?_⟩ rw [div_le_iff₀ (show (0 : ℝ) < ↑m + 1 from by positivity)] have := (div_lt_iff₀ hS).mp hm - linarith + linarith only [hS, this] · rintro ⟨m, hm⟩; exact lt_of_lt_of_le (by positivity) hm have h_mono : Monotone (fun m : ℕ => {ω : E → ℝ | (1 : ℝ) / (↑m + 1) ≤ S ω}) := by intro m₁ m₂ h ω hω; simp only [Set.mem_ofPred_eq] at hω ⊢ @@ -979,8 +981,8 @@ private lemma joint_kernel_bound_finite fun ω hω => by simp only [Set.mem_ofPred_eq] at hω have : Real.exp (-(σ ^ 2 * (S ω) / 2)) ≤ Real.exp (-(σ ^ 2 * δ / 2)) := - Real.exp_le_exp_of_le (by nlinarith [sq_nonneg σ]) - linarith + Real.exp_le_exp_of_le (by nlinarith only [hω, sq_nonneg σ]) + linarith only [this] _ ≤ ∫ ω, (1 - Real.exp (-(σ ^ 2 * (S ω) / 2))) ∂ν := setIntegral_le_integral h_f_int (Filter.Eventually.of_forall h_nn) _ ≤ ε_q := h_int_σ @@ -988,7 +990,7 @@ private lemma joint_kernel_bound_finite intro η hη set target := Real.log ((ε_q + η) / η) with h_target have h_target_pos : 0 < target := by - rw [h_target]; exact Real.log_pos (by rw [lt_div_iff₀ hη]; linarith) + rw [h_target]; exact Real.log_pos (by rw [lt_div_iff₀ hη]; linarith only [hε_q]) set σ₀ := Real.sqrt (2 * target / δ + 1) have hσ₀_pos : 0 < σ₀ := Real.sqrt_pos_of_pos (by positivity) have hσ₀_sq : σ₀ ^ 2 = 2 * target / δ + 1 := by @@ -1002,11 +1004,11 @@ private lemma joint_kernel_bound_finite have h_ratio_pos : (0 : ℝ) < η / (ε_q + η) := by positivity rw [← Real.lt_log_iff_exp_lt h_ratio_pos] have h_log_ratio : Real.log (η / (ε_q + η)) = -target := by - rw [Real.log_div (by linarith) (by linarith : ε_q + η ≠ 0)] + rw [Real.log_div (by linarith only [hη]) (by linarith only [hε_q, hη] : ε_q + η ≠ 0)] have : Real.log (ε_q + η) - Real.log η = target := by - rw [← Real.log_div (by linarith) (by linarith : η ≠ 0), h_target] - linarith - linarith [h_log_ratio] + rw [← Real.log_div (by linarith) (by linarith only [hη] : η ≠ 0), h_target] + linarith only [this] + linarith only [hδ_pos, h_log_ratio] have h_bound := h_cheb σ₀ hσ₀_pos have h_sum_one : ε_q / (ε_q + η) + η / (ε_q + η) = 1 := by field_simp have h_c_lb : ε_q / (ε_q + η) < 1 - Real.exp (-(σ₀ ^ 2 * δ / 2)) := by linarith @@ -1294,7 +1296,7 @@ private lemma tail_bound_uniform_gaussian_average ε_q + K * σ ^ 2 * C_HS := by rcases k with _ | k · simp [Finset.sum_empty, Real.exp_zero] - linarith [hε_q, mul_nonneg (mul_nonneg hK (sq_nonneg σ)) hC_HS] + linarith only [hK, hε_q, hC_HS, mul_nonneg (mul_nonneg hK (sq_nonneg σ)) hC_HS] set V := EuclideanSpace ℝ (Fin (k + 1)) with hV_def let toLp := MeasurableEquiv.toLp (p := 2) (X := Fin (k + 1) → ℝ) let eval_e : (E → ℝ) → V := fun ω => toLp (fun j => ω (e j)) @@ -1399,14 +1401,19 @@ private lemma tail_bound_uniform_gaussian_average have h_single_left : ∀ (v : V), @inner ℝ V _ (EuclideanSpace.single j 1) v = v j := by intro v; erw [PiLp.inner_apply] - simp_all + simp_all only [ofReal_sum, ofReal_mul, tsub_le_iff_right, implies_true, PiLp.single_apply, + RCLike.inner_apply, MonoidWithZeroHom.map_ite_one_zero, mul_ite, mul_one, mul_zero, + Finset.sum_ite_eq', Finset.mem_univ, ↓reduceIte] have h_single_right : ∀ (v : V), @inner ℝ V _ v (EuclideanSpace.single l 1) = v l := by intro v; erw [PiLp.inner_apply] - simp_all - simp_all + simp_all only [ofReal_sum, ofReal_mul, tsub_le_iff_right, implies_true, PiLp.single_apply, + RCLike.inner_apply, conj_trivial, ite_mul, one_mul, zero_mul, Finset.sum_ite_eq', + Finset.mem_univ, ↓reduceIte] + simp_all only [ofReal_sum, ofReal_mul, tsub_le_iff_right, implies_true, PiLp.single_apply] suffices h_suff : ∑ j, Mij j j ≤ C_HS by - simp_all + simp_all only [ofReal_sum, ofReal_mul, tsub_le_iff_right, implies_true, mul_ite, mul_one, + mul_zero, Finset.sum_ite_eq, ↓reduceIte] simp_rw [show ∀ j : Fin (k + 1), Mij j j = p_inner (e j) ^ 2 from fun j => Seminorm.innerProd_self p_inner (e j)] exact h_HS (k + 1) e he @@ -1462,7 +1469,7 @@ private lemma tail_bound_uniform ε_q K hK hε_q h_quad C_HS hC_HS p_outer h_HS -- Step 2: Choose σ and R (depending on ε_q, K, C_HS, δ, not on k) set gap := δ - ε_q - have h_gap_pos : 0 < gap := by linarith + have h_gap_pos : 0 < gap := by linarith only [hε_q_lt_δ] set σ₀ : ℝ := if K * C_HS = 0 then 1 else Real.sqrt (gap / (2 * (K * C_HS))) have hσ₀_pos : 0 < σ₀ := by simp only [σ₀]; split_ifs with h @@ -1483,7 +1490,7 @@ private lemma tail_bound_uniform rw [show K * C_HS * (gap / (2 * (K * C_HS))) = gap * (K * C_HS) / (2 * (K * C_HS)) from by ring] rw [mul_div_mul_right gap 2 (ne_of_gt hKC_pos)] - _ < δ := by simp only [gap]; linarith + _ < δ := by simp only [gap]; linarith only [hε_q_lt_δ] set bound_σ := ε_q + K * σ₀ ^ 2 * C_HS have h_bound_σ_pos : 0 < bound_σ := by positivity -- Choose R so that bound_σ / (1 - exp(-σ₀²R²/2)) ≤ δ @@ -1491,14 +1498,14 @@ private lemma tail_bound_uniform have h_dt_pos : 0 < denom_target := by simp only [denom_target]; rw [sub_pos, div_lt_one hδ]; exact h_bound_σ have h_dt_le_one : denom_target ≤ 1 := by - simp only [denom_target]; linarith [div_nonneg h_bound_σ_pos.le hδ.le] + simp only [denom_target]; linarith only [hδ, h_bound_σ_pos, div_nonneg h_bound_σ_pos.le hδ.le] have hlog_nn : 0 ≤ -Real.log denom_target := by rw [neg_nonneg]; exact Real.log_nonpos h_dt_pos.le h_dt_le_one set R := Real.sqrt (2 * (-Real.log denom_target) / σ₀ ^ 2 + 1) have hR_pos : 0 < R := by apply Real.sqrt_pos_of_pos have : 0 ≤ 2 * (-Real.log denom_target) / σ₀ ^ 2 := by positivity - linarith + linarith only [this] refine ⟨R, hR_pos, fun k e he => ?_⟩ -- Step 3: For k = 0, the set is empty rcases k with _ | k @@ -1545,8 +1552,8 @@ private lemma tail_bound_uniform fun ω hω => by simp only [Set.mem_ofPred_eq] at hω have : Real.exp (-(σ₀ ^ 2 * (T ω) / 2)) ≤ Real.exp (-(σ₀ ^ 2 * R ^ 2 / 2)) := - Real.exp_le_exp_of_le (by nlinarith [sq_nonneg σ₀]) - linarith + Real.exp_le_exp_of_le (by nlinarith only [hω, sq_nonneg σ₀]) + linarith only [this] _ ≤ ∫ ω, (1 - Real.exp (-(σ₀ ^ 2 * (T ω) / 2))) ∂ν := setIntegral_le_integral h_f_int (Filter.Eventually.of_forall h_nn) _ ≤ bound_σ := h_int @@ -1558,16 +1565,16 @@ private lemma tail_bound_uniform have h1 : σ₀ ^ 2 * (2 * (-Real.log denom_target) / σ₀ ^ 2 + 1) / 2 = -Real.log denom_target + σ₀ ^ 2 / 2 := by field_simp - linarith [hσ₀_sq_pos] + linarith only [hσ₀_sq_pos, h1] have h_exp_bound : Real.exp (-(σ₀ ^ 2 * R ^ 2 / 2)) ≤ denom_target := by - rw [← Real.le_log_iff_exp_le h_dt_pos]; linarith [hσR_bound] + rw [← Real.le_log_iff_exp_le h_dt_pos]; linarith only [hσR_bound] have h_dt_lt_one : denom_target < 1 := by - simp only [denom_target]; linarith [div_pos h_bound_σ_pos hδ] + simp only [denom_target]; linarith only [hδ, h_bound_σ_pos, div_pos h_bound_σ_pos hδ] have h_denom_pos : 0 < 1 - Real.exp (-(σ₀ ^ 2 * R ^ 2 / 2)) := by - linarith [h_exp_bound, h_dt_lt_one] + linarith only [h_exp_bound, h_dt_lt_one] have h_denom_bound : bound_σ / δ ≤ 1 - Real.exp (-(σ₀ ^ 2 * R ^ 2 / 2)) := by have : 1 - denom_target = bound_σ / δ := by simp only [denom_target]; ring - linarith [h_exp_bound] + linarith only [h_exp_bound] calc (ν {ω | R ^ 2 < T ω}).toReal ≤ bound_σ / (1 - Real.exp (-(σ₀ ^ 2 * R ^ 2 / 2))) := by rw [le_div_iff₀ h_denom_pos, mul_comm]; exact h_cheb_σ₀ @@ -1669,7 +1676,7 @@ theorem nuclear_cylindrical_concentration -- Step 1: Get quadratic bound from CF continuity have h_norm_le : ∀ x : E, ‖Φ x‖ ≤ 1 := cf_norm_le_one Φ ν h_cf_joint obtain ⟨m₀, K, hK, h_quad⟩ := combined_quadratic_bound Φ ν h_cf_cont h_normalized - h_cf_joint p hp_top hp_hs (ε / 8) (by linarith) + h_cf_joint p hp_top hp_hs (ε / 8) (by linarith only [hε]) -- Step 2: Set m = m₀ + 1 so ker(p m) ⊆ ker(p m₀) set m := m₀ + 1 -- Step 3: HS constant for embedding p m₀ → p m @@ -1681,7 +1688,7 @@ theorem nuclear_cylindrical_concentration intro x hx t have h_pm₀_zero : (p m₀) x = 0 := by have h_mono : (p m₀) x ≤ (p m) x := h_le_m x - linarith [apply_nonneg (p m₀) x] + linarith only [hx, h_mono, apply_nonneg (p m₀) x] calc 1 - (Φ (t • x)).re ≤ ε / 8 + K * (p m₀) (t • x) ^ 2 := h_quad (t • x) _ = ε / 8 + K * (‖t‖ * (p m₀) x) ^ 2 := by rw [map_smul_eq_mul] @@ -1757,19 +1764,19 @@ theorem nuclear_cylindrical_concentration -- Need: |ω(x)| ≤ C_nat · p(x) exact le_trans h_le (mul_le_mul_of_nonneg_right hC_ge (apply_nonneg _ _)) _ ≤ ENNReal.ofReal (ε / 2) := h_bound N - · exact ENNReal.ofReal_lt_ofReal_iff_of_nonneg (by linarith) |>.mpr (by linarith) + · exact ENNReal.ofReal_lt_ofReal_iff_of_nonneg (by linarith) |>.mpr (by linarith only [hε]) -- Now prove the suffices: ∃ C_real, 0 < C_real ∧ ∀ N, ν(B_N) ≤ ofReal(ε/2) -- Step 6a: Get uniform tail bound R obtain ⟨R, hR_pos, h_tail_unif⟩ := tail_bound_uniform Φ ν h_cf_joint h_norm_le - (p m₀) (hp_hilb m₀) (ε / 8) K (by linarith) hK h_quad C_HS hC_HS (ε / 4) (by linarith) - (by linarith) (p m) h_HS_bound + (p m₀) (hp_hilb m₀) (ε / 8) K (by linarith only [hε]) hK h_quad C_HS hC_HS (ε / 4) (by linarith) + (by linarith only [hε]) (p m) h_HS_bound -- Step 6b: Use C_real = R refine ⟨R, hR_pos, fun N => ?_⟩ -- For this N, get Gram-Schmidt data obtain ⟨k, e, α_map, he_orth, h_ker_decomp, h_pars⟩ := h_gs N -- Step 6c: Kernel concentration bound have h_ker_bound := kernel_concentration_bound Φ ν h_cf_joint h_normalized - (p m) (ε / 8) (by linarith) h_kernel_quad d N e α_map h_ker_decomp + (p m) (ε / 8) (by linarith only [hε]) h_kernel_quad d N e α_map h_ker_decomp -- Step 6d: Apply badSetN_bound_with_kernel have h_bn := badSetN_bound_with_kernel Φ ν d (p m) e α_map R hR_pos N h_pars (ENNReal.ofReal (ε / 8)) h_ker_bound @@ -1781,7 +1788,7 @@ theorem nuclear_cylindrical_concentration _ ≤ ENNReal.ofReal (ε / 4) + ENNReal.ofReal (ε / 8) := by gcongr _ ≤ ENNReal.ofReal (ε / 4 + ε / 8) := ENNReal.ofReal_add (by linarith) (by linarith) |>.symm.le _ ≤ ENNReal.ofReal (ε / 2) := by - apply ENNReal.ofReal_le_ofReal; linarith + apply ENNReal.ofReal_le_ofReal; linarith only [hε] /-! ## Main theorem -/ diff --git a/LeanPool/OSforGFF/Minlos/PietschBridge.lean b/LeanPool/OSforGFF/Minlos/PietschBridge.lean index 436e5b30fd..09c5dea623 100644 --- a/LeanPool/OSforGFF/Minlos/PietschBridge.lean +++ b/LeanPool/OSforGFF/Minlos/PietschBridge.lean @@ -75,7 +75,7 @@ lemma summable_sq_mul_of_bounded (f : ℕ → (E →L[ℝ] ℝ)) (c : ℕ → calc (f n x) ^ 2 = |f n x| ^ 2 := (sq_abs _).symm _ ≤ (q x) ^ 2 := by apply sq_le_sq' - · linarith [abs_nonneg (f n x), hfq n x, apply_nonneg q x] + · linarith only [hfq, abs_nonneg (f n x), hfq n x, apply_nonneg q x] · exact hfq n x exact mul_le_mul_of_nonneg_right h1 (hc_nn n) · exact (hc_sum.mul_left ((q x) ^ 2)).congr (fun n => by ring) @@ -263,7 +263,7 @@ theorem hilbertianLift_le_dominator (f : ℕ → (E →L[ℝ] ℝ)) (c : ℕ → calc (f n x) ^ 2 = |f n x| ^ 2 := (sq_abs _).symm _ ≤ (q x) ^ 2 := by apply sq_le_sq' - · linarith [abs_nonneg (f n x), hfq n x] + · linarith only [hqx, abs_nonneg (f n x), hfq n x] · exact hfq n x exact mul_le_mul_of_nonneg_right h1 (hc_nn n)) _ = Real.sqrt ((q x) ^ 2 * ∑' n, c n) := by rw [tsum_mul_left] @@ -320,7 +320,7 @@ lemma Seminorm.innerProd_add_left (R : Seminorm ℝ E) (hR : R.IsHilbertian) (x rw [show x₂ + y - x₁ = -(x₁ - x₂ - y) from by abel, map_neg_eq_map] at p3 rw [R_congr' R (show x₂ - y + x₁ = x₁ + x₂ - y by abel)] at p4 rw [show x₂ - y - x₁ = -(x₁ - x₂ + y) from by abel, map_neg_eq_map] at p4 - linarith + linarith only [p1, p2, p3, p4] omit [TopologicalSpace E] in /-- `ip(∑ xⱼ, y) = ∑ ip(xⱼ, y)` (finite sum in first argument). -/ @@ -383,14 +383,14 @@ private lemma Seminorm.sq_add_of_innerProd_eq_zero (R : Seminorm ℝ E) (hR : R.IsHilbertian) (x y : E) (hxy : R.innerProd x y = 0) : R (x + y) ^ 2 = R x ^ 2 + R y ^ 2 := by have h1 : R (x + y) ^ 2 = R (x - y) ^ 2 := by simp only [Seminorm.innerProd] at hxy; linarith - linarith [hR x y] + linarith only [hR, h1, hR x y] omit [TopologicalSpace E] in /-- `R(vⱼ) = 1` for an R-orthonormal sequence. -/ private lemma R_orthonormal_norm (R : Seminorm ℝ E) {N : ℕ} (v : Fin N → E) (hv : R.IsOrthonormalSeq v) (j : Fin N) : R (v j) = 1 := by have h : R (v j) ^ 2 = 1 := by simpa [R.innerProd_self] using hv j j - nlinarith [apply_nonneg R (v j)] + nlinarith only [h, apply_nonneg R (v j)] omit [TopologicalSpace E] in /-- `R(∑ⱼ aⱼ • vⱼ)² = ∑ⱼ aⱼ²` for R-orthonormal `{vⱼ}` (by induction using Pythagoras). -/ @@ -445,7 +445,7 @@ theorem bessel_hilbertian {N : ℕ} _ ≤ |φ w| := le_abs_self _ _ ≤ R w := hφ w have hRw_sq : R w ^ 2 = S := R.sq_sum_orthonormal hR v hv (fun j => φ (v j)) - nlinarith [sq_nonneg (R w), sq_nonneg (S - 1), apply_nonneg R w] + nlinarith only [hS_le, hRw_sq, sq_nonneg (R w), sq_nonneg (S - 1), apply_nonneg R w] /-! ### HS Embedding from Nuclear Factorization -/ @@ -501,7 +501,7 @@ theorem isHilbertSchmidtEmbedding_of_nuclear calc (∑' n, |f n (e j)| * c n) ^ 2 ≤ (Real.sqrt (∑' n, c n) * Real.sqrt (∑' n, (f n (e j)) ^ 2 * c n)) ^ 2 := - sq_le_sq' (by linarith) h_le + sq_le_sq' (by linarith only [h_le, h_nn]) h_le _ = (∑' n, c n) * (∑' n, (f n (e j)) ^ 2 * c n) := by rw [mul_pow, Real.sq_sqrt (tsum_nonneg hc_nn), Real.sq_sqrt (tsum_nonneg (fun n => @@ -561,8 +561,8 @@ private lemma hilbertian_smul (K : NNReal) (R : Seminorm ℝ E) (hR : R.IsHilber have h3 : (K • R) x = ↑K * R x := rfl have h4 : (K • R) y = ↑K * R y := rfl rw [h1, h2, h3, h4, mul_pow, mul_pow, mul_pow, mul_pow] - nlinarith [hR x y, sq_nonneg (↑K : ℝ), - mul_add ((↑K : ℝ) ^ 2) (R (x + y) ^ 2) (R (x - y) ^ 2)] + nlinarith only [hR, hR x y, sq_nonneg (↑K : ℝ), + mul_add ((↑K : ℝ) ^ 2) (R (x + y) ^ 2) (R (x - y) ^ 2)] /-- **Double Pietsch step**: Apply `IsNuclear` twice to produce a Hilbertian seminorm `r ≥ p` with a nuclear expansion whose functionals are bounded by `r`. @@ -767,7 +767,7 @@ private theorem buildHilbertianFamily_hs f c hc_nn hc_sum hf_le_r (fun x => by -- r(n) ≤ sup(r(n), q₀(n+1)) = p ≤ Σ|fₖ|cₖ - simp_all) + simp_all only [Seminorm.coe_sup, Pi.sup_apply, sup_le_iff]) /-- The Hilbertian family generates the same topology as `q₀`. diff --git a/LeanPool/OSforGFF/Minlos/SazonovTightness.lean b/LeanPool/OSforGFF/Minlos/SazonovTightness.lean index 3dd40018a3..499a9cdec2 100644 --- a/LeanPool/OSforGFF/Minlos/SazonovTightness.lean +++ b/LeanPool/OSforGFF/Minlos/SazonovTightness.lean @@ -81,7 +81,7 @@ lemma marginalFun_isPositiveDefinite (φ : H → ℂ) (hpd : IsPositiveDefinite /-- 1 - exp(-t) > 0 for t > 0. -/ lemma one_sub_exp_neg_pos {t : ℝ} (ht : 0 < t) : 0 < 1 - Real.exp (-t) := by - simp_all + simp_all only [sub_pos, Real.exp_lt_one_iff, Left.neg_neg_iff] /-- exp(-b) ≤ exp(-a) when a ≤ b. -/ lemma exp_neg_le_exp_neg {a b : ℝ} (hab : a ≤ b) : @@ -104,7 +104,8 @@ lemma tail_bound_from_exp_integral {V : Type*} [NormedAddCommGroup V] (μ.toMeasure {y | R ≤ ‖y‖}).toReal ≤ C / (1 - Real.exp (-(σ ^ 2 * R ^ 2 / 2))) := by set δ := 1 - Real.exp (-(σ ^ 2 * R ^ 2 / 2)) with hδ_def have hδ_pos : 0 < δ := by - simp_all + simp_all only [sub_pos, Real.exp_lt_one_iff, Left.neg_neg_iff, Nat.ofNat_pos, + div_pos_iff_of_pos_right, pow_succ_pos, mul_pos_iff_of_pos_left] set A := {y : V | R ≤ ‖y‖} set f : V → ℝ := fun y => 1 - Real.exp (-(σ ^ 2 * ‖y‖ ^ 2 / 2)) have hA_meas : MeasurableSet A := @@ -113,14 +114,14 @@ lemma tail_bound_from_exp_integral {V : Type*} [NormedAddCommGroup V] intro y; simp only [f] have : Real.exp (-(σ ^ 2 * ‖y‖ ^ 2 / 2)) ≤ Real.exp 0 := Real.exp_le_exp_of_le (by linarith [show 0 ≤ σ ^ 2 * ‖y‖ ^ 2 / 2 from by positivity]) - rw [Real.exp_zero] at this; linarith + rw [Real.exp_zero] at this; linarith only [this] have hf_ge_δ : ∀ y ∈ A, δ ≤ f y := by intro y hy simp only [A, mem_ofPred_eq] at hy; simp only [f, hδ_def] have : σ ^ 2 * R ^ 2 / 2 ≤ σ ^ 2 * ‖y‖ ^ 2 / 2 := by apply div_le_div_of_nonneg_right _ (by positivity : (0:ℝ) ≤ 2) - exact mul_le_mul_of_nonneg_left (sq_le_sq' (by linarith) hy) (by positivity) - linarith [Real.exp_le_exp_of_le (neg_le_neg this)] + exact mul_le_mul_of_nonneg_left (sq_le_sq' (by linarith only [hR, hy]) hy) (by positivity) + linarith only [this, Real.exp_le_exp_of_le (neg_le_neg this)] have hf_cont : Continuous f := by simp only [f]; apply continuous_const.sub exact Real.continuous_exp.comp (continuous_neg.comp @@ -129,7 +130,7 @@ lemma tail_bound_from_exp_integral {V : Type*} [NormedAddCommGroup V] apply Integrable.mono' (integrable_const (1 : ℝ)) hf_cont.aestronglyMeasurable exact Eventually.of_forall fun y => by rw [Real.norm_eq_abs, abs_of_nonneg (hf_nn y)] - simp only [f]; linarith [Real.exp_nonneg (-(σ ^ 2 * ‖y‖ ^ 2 / 2))] + simp only [f]; linarith only [Real.exp_nonneg (-(σ ^ 2 * ‖y‖ ^ 2 / 2))] have key : δ * (μ.toMeasure A).toReal ≤ C := calc δ * (μ.toMeasure A).toReal = ∫ _ in A, δ ∂μ.toMeasure := by @@ -140,7 +141,7 @@ lemma tail_bound_from_exp_integral {V : Type*} [NormedAddCommGroup V] _ ≤ ∫ y, f y ∂μ.toMeasure := setIntegral_le_integral hf_int (Eventually.of_forall hf_nn) _ ≤ C := hC - exact (le_div_iff₀ hδ_pos).mpr (by linarith) + exact (le_div_iff₀ hδ_pos).mpr (by linarith only [key]) /-! ## The Gaussian Averaging Bound (with scaling parameter) -/ @@ -174,7 +175,7 @@ lemma gaussDensity_integrable' (σ : ℝ) (hσ : 0 < σ) : have hcint : Integrable (fun x : V => cexp (-(b : ℂ) * ↑(‖x‖ ^ 2))) := by have := GaussianFourier.integrable_cexp_neg_mul_sq_norm_add (show 0 < ((b : ℂ)).re by simp [hb]) (0 : ℂ) (0 : V) - simp_all + simp_all only [neg_mul, inner_zero_left, ofReal_zero, mul_zero, add_zero, ofReal_pow] have heq : gaussDensity (V := V) σ = fun x => ‖cexp (-(b : ℂ) * ↑(‖x‖ ^ 2))‖ := by ext x; unfold gaussDensity; rw [Complex.norm_exp]; congr 1 simp only [Complex.neg_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, @@ -223,7 +224,7 @@ private lemma exp_neg_sq_integrable_prob' (μ : ProbabilityMeasure V) (σ : ℝ) filter_upwards with y simp only [Real.norm_eq_abs, abs_of_nonneg (Real.exp_nonneg _)] rw [← Real.exp_zero] - exact Real.exp_le_exp_of_le (by nlinarith [sq_nonneg σ, sq_nonneg ‖y‖]) + exact Real.exp_le_exp_of_le (by nlinarith only [sq_nonneg σ, sq_nonneg ‖y‖]) omit [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] [SecondCountableTopology V] in private lemma cexp_neg_sq_integrable_prob' (μ : ProbabilityMeasure V) (σ : ℝ) (_hσ : 0 < σ) : @@ -311,8 +312,13 @@ theorem fubini_gaussian_charFun apply Integrable.mono' (gaussDensity_integrable' σ hσ) (by fun_prop : Continuous (fun x : V => (↑(gaussDensity σ x) : ℂ) * cexp (↑⟪y, x⟫_ℝ * I))).aestronglyMeasurable - simp_all - · simp_all + simp_all only [ne_eq, ofReal_div, ofReal_mul, ofReal_pow, ofReal_ofNat, ofReal_exp, one_div, + mul_inv_rev, neg_mul, ofReal_neg, ofReal_inv, Complex.norm_mul, norm_exp_ofReal_mul_I, + mul_one, forall_const, Std.le_refl, eventually_true] + · simp_all only [ne_eq, ofReal_div, ofReal_mul, ofReal_pow, ofReal_ofNat, ofReal_exp, one_div, + mul_inv_rev, neg_mul, ofReal_neg, ofReal_inv, Complex.norm_mul, norm_exp_ofReal_mul_I, + mul_one, forall_const, uncurry_apply_pair, enorm_ne_top, not_false_eq_true, + integrable_const_enorm] have fubini := integral_integral_swap hprod have lhs_eq : ∫ y, (∫ x, (gaussDensity σ x : ℂ) * cexp (↑⟪y, x⟫_ℝ * I)) ∂μ.toMeasure = ↑C * ∫ y, cexp (-(σ ^ 2 * ‖y‖ ^ 2 / 2 : ℝ)) ∂μ.toMeasure := by @@ -380,26 +386,26 @@ private lemma gaussian_real_formula' (b : ℝ) (hb : 0 < b) (w : V) (c : ℝ) : congr 1; push_cast; ring private lemma id_le_sinh' {t : ℝ} (ht : 0 ≤ t) : t ≤ Real.sinh t := by - simp_all + simp_all only [Real.self_le_sinh_iff] private lemma half_sq_le_cosh_sub_one' (x : ℝ) : x ^ 2 / 2 ≤ Real.cosh x - 1 := by suffices key : (x / 2) ^ 2 ≤ Real.sinh (x / 2) ^ 2 by have h1 := Real.cosh_two_mul (x / 2) rw [show 2 * (x / 2) = x from by ring] at h1 - nlinarith [Real.cosh_sq (x / 2)] + linarith only [key, h1, Real.cosh_sq (x / 2)] set t := x / 2 suffices h : 0 ≤ (Real.sinh t + t) * (Real.sinh t - t) by nlinarith [sq_sub_sq (Real.sinh t) t] by_cases ht : 0 ≤ t · have h1 := id_le_sinh' ht - exact mul_nonneg (by linarith) (by linarith) + exact mul_nonneg (by linarith only [ht, h1]) (by linarith only [h1]) · push Not at ht have h1 : Real.sinh t ≤ t := by - have := id_le_sinh' (by linarith : 0 ≤ -t) - rw [Real.sinh_neg] at this; linarith + have := id_le_sinh' (by linarith only [ht] : 0 ≤ -t) + rw [Real.sinh_neg] at this; linarith only [this] have h2 : Real.sinh t ≤ 0 := by - simp_all - have ha : Real.sinh t + t ≤ 0 := by linarith - have hb : Real.sinh t - t ≤ 0 := by linarith + simp_all only [Real.sinh_le_self_iff, Real.sinh_nonpos_iff] + have ha : Real.sinh t + t ≤ 0 := by linarith only [ht, h1] + have hb : Real.sinh t - t ≤ 0 := by linarith only [h1] exact mul_nonneg_of_nonpos_of_nonpos ha hb omit [SecondCountableTopology V] in @@ -444,7 +450,7 @@ private lemma tendsto_exp_slope' (A : ℝ) : ((hasDerivAt_id (0 : ℝ)).mul_const A) change HasDerivAt (fun t : ℝ => rexp (t * A)) A 0 simpa [zero_mul, Real.exp_zero, Function.comp_def] using this - simp_all + simp_all only [hasDerivAt_sub_const_iff] have := hd.tendsto_slope_zero_right simp only [zero_add, zero_mul, Real.exp_zero, sub_self, sub_zero] at this exact this.congr fun t => by rw [smul_eq_mul, ← div_eq_inv_mul] @@ -498,9 +504,9 @@ private lemma gaussDensity_mul_inner_sq_integrable' (σ : ℝ) (hσ : 0 < σ) (w change gaussDensity σ x * |(@inner ℝ V _ w x) ^ 2| ≤ 2 * (gaussDensity σ x * Real.cosh (1 * @inner ℝ V _ w x)) rw [abs_of_nonneg (sq_nonneg _), one_mul] - nlinarith [half_sq_le_cosh_sub_one' (@inner ℝ V _ w x), - Real.one_le_cosh (@inner ℝ V _ w x), - gaussDensity_nonneg' σ x, Real.cosh_pos (@inner ℝ V _ w x)] + nlinarith only [half_sq_le_cosh_sub_one' (@inner ℝ V _ w x), + Real.one_le_cosh (@inner ℝ V _ w x), gaussDensity_nonneg' σ x, + Real.cosh_pos (@inner ℝ V _ w x)] private lemma gaussian_inner_sq_le' (σ : ℝ) (hσ : 0 < σ) (w : V) : ∫ x : V, gaussDensity σ x * (@inner ℝ V _ w x) ^ 2 ≤ @@ -526,7 +532,7 @@ private lemma gaussian_inner_sq_le' (σ : ℝ) (hσ : 0 < σ) (w : V) : (gaussDensity_integrable' σ hσ) |>.const_mul 2 |>.congr (Eventually.of_forall fun x => by simp only [Pi.sub_apply]; ring)) fun x => mul_le_mul_of_nonneg_left - (by nlinarith [half_sq_le_cosh_sub_one' (c * @inner ℝ V _ w x)]) + (by linarith only [half_sq_le_cosh_sub_one' (c * @inner ℝ V _ w x)]) (gaussDensity_nonneg' σ x) _ = 2 * C * (rexp (t * A) - 1) := by have step_a : ∫ x : V, gaussDensity σ x * @@ -595,7 +601,8 @@ theorem gaussian_quadForm_integral_le fun i => gaussian_inner_sq_le' σ hσ (b i) have hnorm : ∀ i, ‖b i‖ = 1 := fun i => b.orthonormal.1 i have heveq : ∀ i, ev i = @inner ℝ V _ (b i) (S (b i)) := by - simp_all + simp_all only [ContinuousLinearMap.coe_coe, one_pow, mul_one, OrthonormalBasis.norm_eq_one, + implies_true, inner_self_eq_norm_sq_to_K, RCLike.ofReal_real_eq_id, id_eq] rw [hint_eq] have hbound' : ∀ i, ∫ x : V, gaussDensity σ x * (@inner ℝ V _ (b i) x) ^ 2 ≤ C * σ ^ 2 := by @@ -621,7 +628,7 @@ theorem gaussian_quadForm_integral_le private lemma mul_exp_neg_le_one' {t : ℝ} (_ht : 0 ≤ t) : t * Real.exp (-t) ≤ 1 := by rw [Real.exp_neg, ← div_eq_mul_inv, div_le_one (Real.exp_pos t)] - linarith [Real.add_one_le_exp t] + linarith only [Real.add_one_le_exp t] omit [SecondCountableTopology V] in lemma gaussDensity_mul_quadForm_integrable' (σ : ℝ) (hσ : 0 < σ) @@ -667,7 +674,7 @@ lemma gaussDensity_mul_quadForm_integrable' (σ : ℝ) (hσ : 0 < σ) calc Real.exp (-(b / 2 * s)) * s * b = 2 * (b / 2 * (Real.exp (-(b / 2 * s)) * s)) := by ring _ = 2 * (b / 2 * s * Real.exp (-(b / 2 * s))) := by ring - _ ≤ 2 * 1 := by linarith + _ ≤ 2 * 1 := by linarith only [key] _ = 2 := by ring rw [show -(b / 2) * s = -(b / 2 * s) from by ring] at hexp_nn ⊢ calc Real.exp (-(b / 2 * s)) * Real.exp (-(b / 2 * s)) * s @@ -717,14 +724,14 @@ theorem gaussian_averaging_bound calc (1 - (φ x).re) = (1 - φ x).re := by simp [sub_re] _ ≤ |(1 - φ x).re| := le_abs_self _ _ ≤ ‖1 - φ x‖ := abs_re_le_norm _ - linarith [h_bound x hqf, quadForm_nonneg hS x] + linarith only [hS, h_bound, hqf, hre, h_bound x hqf, quadForm_nonneg hS x] · push Not at hqf have hre_le : (φ x).re ≤ ‖φ x‖ := le_trans (le_abs_self _) (abs_re_le_norm _) have hnorm_le : ‖φ x‖ ≤ 1 := by rw [← hφ]; have : IsProbabilityMeasure μ.toMeasure := inferInstance exact norm_charFun_le_one x have hneg_re : -(φ x).re ≤ ‖φ x‖ := le_trans (neg_le_abs _) (abs_re_le_norm _) - linarith + linarith only [hε, hqf, hnorm_le, hneg_re] -- Step 3: Integrability have hgqf_int : Integrable (fun x => g x * quadForm S x) volume := gaussDensity_mul_quadForm_integrable' (V := V) σ hσ S @@ -798,7 +805,7 @@ lemma scaled_tail_bound (ε + 2 * σ ^ 2 * T) / (1 - Real.exp (-(σ ^ 2 * R ^ 2 / 2))) := by have hσ2 : 0 < σ ^ 2 := by positivity have hRσ : 0 < σ ^ 2 * R ^ 2 / 2 := by positivity - have hC0 : 0 ≤ ε + 2 * σ ^ 2 * T := by nlinarith + have hC0 : 0 ≤ ε + 2 * σ ^ 2 * T := by nlinarith only [hε, hT] have hgab := gaussian_averaging_bound μ φ hφ ε hε σ hσ S hS h_bound T hT h_trace exact tail_bound_from_exp_integral μ σ hσ _ hC0 hgab R hR @@ -901,7 +908,7 @@ theorem orthonormal_diag_le_hilbert_trace (S : H →L[ℝ] H) (hS : S.IsPositive ∑' k, @inner ℝ H _ (b k) (S (b k)) by have h_nn : 0 ≤ ∑' k, @inner ℝ H _ (b k - Pv (b k)) (S (b k - Pv (b k))) := tsum_nonneg fun k => hnn (b k - Pv (b k)) - linarith + linarith only [hsuff, h_nn] have expand : ∀ k, @inner ℝ H _ (b k - Pv (b k)) (S (b k - Pv (b k))) = @inner ℝ H _ (b k) (S (b k)) - 2 * @inner ℝ H _ (Pv (b k)) (S (b k)) + @inner ℝ H _ (Pv (b k)) (S (Pv (b k))) := by @@ -957,7 +964,7 @@ theorem orthonormal_diag_le_hilbert_trace (S : H →L[ℝ] H) (hS : S.IsPositive rw [← hv] refine h.congr (fun k => ?_) ring_nf - linarith [hQ.tsum_eq] + linarith only [hQ, hQ.tsum_eq] omit [CompleteSpace H] in /-- The trace of restrictOp in any ONB of EuclideanSpace equals ∑ⱼ ⟪vⱼ, S(vⱼ)⟫. @@ -989,8 +996,10 @@ lemma restrictOp_trace_eq_diag (S : H →L[ℝ] H) {n : ℕ} (v : Fin n → H) have h_app : ∀ i, (restrictOp S v (EuclideanSpace.single j 1)) i = @inner ℝ H _ (v i) (S (v j)) := by intro i; rw [restrictOp_apply] - simp_all - simp_all + simp_all only [EuclideanSpace.basisFun_apply, PiLp.single_apply, ite_smul, one_smul, + zero_smul, Finset.sum_ite_eq', Finset.mem_univ, ↓reduceIte] + simp_all only [EuclideanSpace.basisFun_apply, PiLp.single_apply, mul_ite, mul_one, mul_zero, + Finset.sum_ite_eq', Finset.mem_univ, ↓reduceIte] exact lhs_eq.trans ((h1.symm.trans h2).trans rhs_eq) /-- The trace of the restricted operator is bounded by the trace of the @@ -1016,24 +1025,24 @@ lemma restrictOp_trace_le (S : H →L[ℝ] H) (hS : S.IsPositive) -/ lemma exists_R_for_tail_bound (C η σ : ℝ) (hC : 0 < C) (hCη : C < η) (hσ : 0 < σ) : ∃ R > 0, C / (1 - Real.exp (-(σ ^ 2 * R ^ 2 / 2))) < η := by - have hη : 0 < η := by linarith + have hη : 0 < η := by linarith only [hC, hCη] set δ := (1 - C / η) / 2 with hδ_def have hCη' : C / η < 1 := by rwa [div_lt_one hη] - have hδ_pos : 0 < δ := by rw [hδ_def]; linarith - have hδ_bound : δ < 1 - C / η := by rw [hδ_def]; linarith - have hδ_lt_one : δ < 1 := by linarith [div_pos hC hη] + have hδ_pos : 0 < δ := by rw [hδ_def]; linarith only [hCη'] + have hδ_bound : δ < 1 - C / η := by rw [hδ_def]; linarith only [hδ_def, hδ_pos] + have hδ_lt_one : δ < 1 := by linarith only [hC, hη, hδ_def, hδ_pos, div_pos hC hη] have hlog_neg : Real.log δ < 0 := Real.log_neg hδ_pos hδ_lt_one set R := Real.sqrt (2 * (-Real.log δ)) / σ with hR_def use R constructor - · rw [hR_def]; apply div_pos (Real.sqrt_pos.mpr (by nlinarith)) hσ + · rw [hR_def]; apply div_pos (Real.sqrt_pos.mpr (by linarith only [hlog_neg])) hσ · have hσ2 : 0 < σ ^ 2 := by positivity have hR_sq : R ^ 2 = 2 * (-Real.log δ) / σ ^ 2 := by - rw [hR_def, div_pow, Real.sq_sqrt (by nlinarith)] + rw [hR_def, div_pow, Real.sq_sqrt (by linarith only [hlog_neg])] have h_exp_arg : σ ^ 2 * R ^ 2 / 2 = -Real.log δ := by rw [hR_sq]; field_simp rw [h_exp_arg, neg_neg, Real.exp_log hδ_pos, div_lt_iff₀ (by linarith : 0 < 1 - δ)] have : η * (1 - δ) = (η + C) / 2 := by rw [hδ_def]; field_simp; ring - linarith + linarith only [hCη, this] /-- **Sazonov Tightness Theorem.** If φ : H → ℂ is positive definite, normalized, and Sazonov-continuous at 0, then the family of all finite-dimensional @@ -1048,7 +1057,7 @@ theorem sazonov_tightness (φ : H → ℂ) (_hpd : IsPositiveDefinite φ) (μ.toMeasure {y | R ≤ ‖y‖}).toReal < η := by intro η hη set ε := η / 3 with hε_def - have hε : 0 < ε := by linarith + have hε : 0 < ε := by linarith only [hη, hε_def] obtain ⟨S, hS_bound⟩ := hsaz ε hε obtain ⟨hpos, ι, b, hsum⟩ := S.traceClass set T := ∑' i, @inner ℝ H _ (b i) (S.op (b i)) with hT_def @@ -1058,7 +1067,7 @@ theorem sazonov_tightness (φ : H → ℂ) (_hpd : IsPositiveDefinite φ) simp only [RCLike.re_to_real] at this rwa [real_inner_comm] set σ := Real.sqrt (η / (6 * (T + 1))) with hσ_def - have hT1 : 0 < T + 1 := by linarith + have hT1 : 0 < T + 1 := by linarith only [hT_nn] have hσ_sq_pos : 0 < η / (6 * (T + 1)) := by positivity have hσ_pos : 0 < σ := Real.sqrt_pos.mpr hσ_sq_pos have hσ_sq : σ ^ 2 = η / (6 * (T + 1)) := by rw [hσ_def, sq, Real.mul_self_sqrt hσ_sq_pos.le] @@ -1070,8 +1079,8 @@ theorem sazonov_tightness (φ : H → ℂ) (_hpd : IsPositiveDefinite φ) field_simp; ring] rw [div_add_div _ _ (by positivity : (3:ℝ) ≠ 0) (by positivity : 3 * (T + 1) ≠ 0)] rw [div_lt_iff₀ (by positivity : 0 < 3 * (3 * (T + 1)))] - nlinarith - have hC_pos : 0 < C := by rw [hC_def]; nlinarith [sq_nonneg σ] + nlinarith only [hη, hT_nn] + have hC_pos : 0 < C := by rw [hC_def]; nlinarith only [hε, hT_nn, sq_nonneg σ] obtain ⟨R, hR, hR_bound⟩ := exists_R_for_tail_bound C η σ hC_pos hC_bound hσ_pos use R, hR intro n v hv μ hμ diff --git a/LeanPool/OSforGFF/OS/NonTrivial.lean b/LeanPool/OSforGFF/OS/NonTrivial.lean index 1b170096d2..086e3589c0 100644 --- a/LeanPool/OSforGFF/OS/NonTrivial.lean +++ b/LeanPool/OSforGFF/OS/NonTrivial.lean @@ -135,7 +135,8 @@ theorem sqrtPropagatorMap_eq_zero_iff (m : ℝ) [Fact (0 < m)] (f : OSforGFF.Tes exact toComplex_injective (h_tc_zero.trans h_tc_0.symm) · intro h; subst h; intro k unfold sqrtPropagatorMap - simp_all + simp_all only [SchwartzMap.fourierTransformCLM_apply, FourierTransform.fourier_zero, + zero_apply, zero_mul] /-- The embedding `T : S(ℝ⁴,ℝ) → L²(ℝ⁴,ℂ)` is injective. @@ -152,7 +153,8 @@ theorem embeddingMap_injective (m : ℝ) [Fact (0 < m)] : have h_norm_zero : ‖embeddingMap m (f - g)‖ = 0 := by rw [map_sub, h, sub_self, norm_zero] have h_int_zero : ∫ k, ‖sqrtPropagatorMap m (f - g) k‖ ^ 2 ∂volume = 0 := by have h_sq := embeddingMap_norm_sq m (f - g) - simp_all + simp_all only [map_sub, sub_self, norm_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, + zero_pow] -- Nonneg continuous integrand with zero integral vanishes a.e., hence (‖·‖²=0 ⟹ ·=0) a.e. have h_ae_sq : ∀ᵐ k ∂volume, ‖sqrtPropagatorMap m (f - g) k‖ ^ 2 = 0 := (integral_eq_zero_iff_of_nonneg_ae (Filter.Eventually.of_forall fun k => sq_nonneg _) diff --git a/LeanPool/OSforGFF/OS/OS0Analyticity.lean b/LeanPool/OSforGFF/OS/OS0Analyticity.lean index 83292f907b..5b8f04a4b8 100644 --- a/LeanPool/OSforGFF/OS/OS0Analyticity.lean +++ b/LeanPool/OSforGFF/OS/OS0Analyticity.lean @@ -8,7 +8,6 @@ module public import LeanPool.OSforGFF.OS.Axioms public import LeanPool.OSforGFF.Measure.Construct import Mathlib.Algebra.Order.Star.Real -import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.Analysis.Complex.CauchyIntegral import Mathlib.Analysis.SpecialFunctions.Trigonometric.DerivHyp import Mathlib.Data.Nat.Choose.Multinomial @@ -73,7 +72,7 @@ private lemma young_ineq (c α : ℝ) (hα : 0 < α) (x : ℝ) : c * |x| ≤ c ^ 2 / (4 * α) + α * x ^ 2 := by rw [show c ^ 2 / (4 * α) + α * x ^ 2 = (c ^ 2 + 4 * α ^ 2 * x ^ 2) / (4 * α) from by field_simp, le_div_iff₀ (by positivity : (0:ℝ) < 4 * α)] - nlinarith [sq_nonneg (c - 2 * α * |x|), sq_abs x] + nlinarith only [sq_nonneg (c - 2 * α * |x|), sq_abs x] variable (m : ℝ) [Fact (0 < m)] @@ -155,7 +154,8 @@ lemma norm_exp_I_distributionPairingℂ_real (f : TestFunctionℂ) (ω : FieldCo simp only [distributionPairingℂReal, complexTestFunctionDecompose] -- I * ((ω f_re : ℂ) + I * (ω f_im : ℂ)) = I * (ω f_re) - (ω f_im) -- The real part is -(ω f_im) - simp_all + simp_all only [mul_re, I_re, add_re, ofReal_re, zero_mul, I_im, ofReal_im, mul_zero, sub_self, + add_zero, add_im, mul_im, one_mul, zero_add, zero_sub] /-- Integrability of exp(-ω f) for a real test function f under the GFF measure. This follows from the Gaussian nature: for centered Gaussian X with variance σ², @@ -175,7 +175,7 @@ lemma gff_exp_neg_pairing_integrable (f : OSforGFF.TestFunction) : refine Real.exp_le_exp.mpr ?_ have := young_ineq 1 α hα_pos (ω f) rw [one_mul] at this - linarith [neg_abs_le (ω f), this] + linarith only [this, neg_abs_le (ω f)] /-- exp(|ω f|) is in L^2 (and in fact all L^p) under the GFF measure. This follows from Fernique's theorem: if exp(α x²) is integrable, then exp(|x|)^p is integrable @@ -204,7 +204,9 @@ lemma gff_exp_abs_pairing_memLp (f : OSforGFF.TestFunction) (p : ENNReal) (hp : h_fernique.const_mul (Real.exp (p.toReal^2 / (4 * α))) apply h_dom.mono' ((Real.continuous_exp.measurable.comp (measurable_const.mul (continuous_abs.measurable.comp (WeakDual.eval_measurable f)))).aestronglyMeasurable) - simp_all + simp_all only [ne_eq, distributionPairingCLM, ContinuousLinearMap.coe_mk', LinearMap.coe_mk, + AddHom.coe_mk, muGFF, Function.comp_apply, Pi.mul_apply, Real.norm_eq_abs, Real.abs_exp, + Filter.eventually_true] rw [memLp_iff, eLpNorm_lt_top_iff_lintegral_rpow_enorm_lt_top hp_pos hp h_aesm] -- ‖exp(|x|)‖ₑ^p = exp(p|x|), reducing finiteness to h_exp_p_integrable. have h_eq : ∀ ω : FieldConfiguration, @@ -380,7 +382,7 @@ lemma gff_cf_slice_entire (f_re f_im : OSforGFF.TestFunction) : rw [dist_eq_norm] at h_dist have h1 := Complex.abs_im_le_norm (t - t₀) simp only [Complex.sub_im] at h1 - linarith [abs_sub_abs_le_abs_sub t.im t₀.im] + linarith only [h_dist, h1, abs_sub_abs_le_abs_sub t.im t₀.im] -- Integrability of F(t₀, ·) have hF_int : Integrable (F t₀) (muGFF m).toMeasure := by apply (fernique_dom (|t₀.im|) (abs_nonneg _)).mono (hF_meas t₀) @@ -436,7 +438,7 @@ lemma gff_cf_slice_entire (f_re f_im : OSforGFF.TestFunction) : calc |ω f_im| * Real.exp (c * |ω f_im|) ≤ Real.exp |ω f_im| * Real.exp (c * |ω f_im|) := by apply mul_le_mul_of_nonneg_right _ (Real.exp_nonneg _) - calc |ω f_im| ≤ |ω f_im| + 1 := by linarith + calc |ω f_im| ≤ |ω f_im| + 1 := by linarith only [] _ ≤ Real.exp |ω f_im| := Real.add_one_le_exp _ _ = Real.exp ((c + 1) * |ω f_im|) := by rw [← Real.exp_add]; ring_nf -- Apply parametric integral differentiation @@ -520,9 +522,9 @@ theorem gff_complex_CF_covariance (f : TestFunctionℂ) : have h_mem_V : ((ε / 2 : ℝ) : ℂ) ∈ V := hε_ball (by simp only [Metric.mem_ball, Complex.dist_eq, sub_zero, Complex.norm_real] rw [Real.norm_eq_abs, abs_of_pos h_half_pos] - linarith) + linarith only [hε_pos]) have h_ne : ((ε / 2 : ℝ) : ℂ) ≠ 0 := by - simp only [ne_eq, Complex.ofReal_eq_zero]; linarith + simp only [ne_eq, Complex.ofReal_eq_zero]; linarith only [hε_pos] exact hV_sub ⟨h_mem_V, h_ne⟩ (h_agree (ε / 2)) -- Step 5: Evaluate at t = I have h_eval : L Complex.I = R Complex.I := congrFun h_eq Complex.I diff --git a/LeanPool/OSforGFF/OS/OS1Regularity.lean b/LeanPool/OSforGFF/OS/OS1Regularity.lean index 277b149c4e..779f1c909a 100644 --- a/LeanPool/OSforGFF/OS/OS1Regularity.lean +++ b/LeanPool/OSforGFF/OS/OS1Regularity.lean @@ -228,7 +228,7 @@ lemma gff_generating_bound_by_imaginary (m : ℝ) [Fact (0 < m)] (f : TestFuncti set fRe := (complexTestFunctionDecompose f).1 -- Equivalently: -Re C(f,f) ≤ Re C(toComplex fIm, toComplex fIm) suffices h : -(freeCovarianceℂBilinear m f f).re ≤ - (freeCovarianceℂBilinear m (toComplex fIm) (toComplex fIm)).re by linarith + (freeCovarianceℂBilinear m (toComplex fIm) (toComplex fIm)).re by linarith only [h] -- Expand using toComplex to connect with the bilinear expansion let frC := toComplex fRe let fiC := toComplex fIm @@ -286,7 +286,7 @@ lemma gff_generating_bound_by_imaginary (m : ℝ) [Fact (0 < m)] (f : TestFuncti -- so freeCovarianceℂBilinear agrees with freeCovarianceℂ rw [← freeCovarianceℂ_eq_bilinear_on_reals m] exact freeCovarianceℂ_positive m frC - linarith + linarith only [h_pos] /- The covariance of the imaginary part is bounded by (1/m²) times the L² norm squared. @@ -324,7 +324,7 @@ lemma covariance_imaginary_L2_bound (m : ℝ) [Fact (0 < m)] (f : TestFunction have hm2pos : 0 < m^2 := sq_pos_of_pos hmpos have hden : m^2 ≤ (2 * Real.pi)^2 * ‖k‖^2 + m^2 := by have : 0 ≤ (2 * Real.pi)^2 * ‖k‖^2 := by positivity - linarith + linarith only [this] -- 0 < m^2 and m^2 ≤ (2π)²‖k‖² + m^2 ⇒ 1 / ((2π)²‖k‖² + m^2) ≤ 1 / m^2 have := one_div_le_one_div_of_le (a := m^2) (b := (2 * Real.pi)^2 * ‖k‖^2 + m^2) (by exact hm2pos) hden diff --git a/LeanPool/OSforGFF/OS/OS2Invariance.lean b/LeanPool/OSforGFF/OS/OS2Invariance.lean index 39bc5a10d2..6ec71e196a 100644 --- a/LeanPool/OSforGFF/OS/OS2Invariance.lean +++ b/LeanPool/OSforGFF/OS/OS2Invariance.lean @@ -43,7 +43,7 @@ variable (m : ℝ) [Fact (0 < m)] lemma euclidean_action_apply (g : E) (f : TestFunctionℂ) (x : SpaceTime) : euclideanAction g f x = f (euclideanPullback g x) := by unfold euclideanAction - simp_all + simp_all only [SchwartzMap.compCLM_apply, Function.comp_apply] /-- The Euclidean pullback satisfies euclideanPullback g x = g⁻¹ • x = act g⁻¹ x. -/ lemma euclidean_pullback_eq_inv_act (g : E) (x : SpaceTime) : diff --git a/LeanPool/OSforGFF/OS/OS3CovarianceRP.lean b/LeanPool/OSforGFF/OS/OS3CovarianceRP.lean index 0eb722a96e..0e4479c7d6 100644 --- a/LeanPool/OSforGFF/OS/OS3CovarianceRP.lean +++ b/LeanPool/OSforGFF/OS/OS3CovarianceRP.lean @@ -144,14 +144,14 @@ theorem mixed_representation (f : TestFunctionℂ) lemma energy_pos (k_sp : SpatialCoords) : 0 < Real.sqrt (‖k_sp‖^2 + m^2) := by apply Real.sqrt_pos_of_pos have hm : 0 < m := Fact.out - nlinarith [sq_nonneg ‖k_sp‖] + nlinarith only [hm, sq_nonneg ‖k_sp‖] /-! ## Part 5: Factorization Helpers -/ omit [Fact (0 < m)] in lemma abs_neg_sum_nonneg (x0 y0 : ℝ) (hx : 0 ≤ x0) (hy : 0 ≤ y0) : |-x0 - y0| = x0 + y0 := by - rw [abs_of_nonpos (by linarith : -x0 - y0 ≤ 0)]; ring + rw [abs_of_nonpos (by linarith only [hx, hy] : -x0 - y0 ≤ 0)]; ring omit [Fact (0 < m)] in lemma spatialDot_sub (k_sp x_sp y_sp : SpatialCoords) : @@ -185,7 +185,7 @@ omit [Fact (0 < m)] in lemma spatialDot_neg_left (k_sp x_sp : SpatialCoords) : spatialDot (-k_sp) x_sp = -spatialDot k_sp x_sp := by simp only [spatialDot] - simp_all + simp_all only [Nat.add_one_sub_one, PiLp.neg_apply, neg_mul, Finset.sum_neg_distrib] omit [Fact (0 < m)] in lemma xIntegralFactor_eq_conj_neg (f : TestFunctionℂ) (k_sp : SpatialCoords) @@ -209,9 +209,11 @@ lemma xIntegralFactor_eq_conj_neg (f : TestFunctionℂ) (k_sp : SpatialCoords) rw [h_ic] congr 1; ext x; simp only [map_mul] have h_star_exp : ∀ z : ℂ, starRingEnd ℂ (Complex.exp z) = Complex.exp (starRingEnd ℂ z) := by - simp_all + simp_all only [Fin.isValue, norm_neg, mul_neg, neg_mul, neg_neg, implies_true, map_mul, + exp_conj] simp only [h_star_exp] - simp_all + simp_all only [Fin.isValue, norm_neg, mul_neg, neg_mul, neg_neg, implies_true, map_mul, map_neg, + conj_ofReal, conj_I, exp_conj] omit [Fact (0 < m)] in lemma yIntegralFactor_eq_neg (f : TestFunctionℂ) (k_sp : SpatialCoords) : @@ -220,7 +222,7 @@ lemma yIntegralFactor_eq_neg (f : TestFunctionℂ) (k_sp : SpatialCoords) : simp only [yIntegralFactor, weightedLaplaceFourier] have h_norm : ‖-k_sp‖ = ‖k_sp‖ := norm_neg_eq k_sp have h_dot : ∀ x_sp, spatialDot (-k_sp) x_sp = -spatialDot k_sp x_sp := spatialDot_neg_left k_sp - simp_all + simp_all only [norm_neg, Fin.isValue, neg_mul, ofReal_neg, mul_neg, neg_neg] /-! ## Part 6: Factorization to Squared Norm (Direct Approach) -/ @@ -446,7 +448,7 @@ theorem freeCovariance_reflection_positive_bilinear_real (m : ℝ) [Fact (0 < m) 0 ≤ ∫ x, ∫ y, (QFT.compTimeReflectionReal f) x * freeCovariance m x y * f y := by -- Use the complex theorem for toComplex f have h_complex := freeCovariance_reflection_positive_bilinear m (toComplex f) (by - simp_all) + simp_all only [Fin.isValue, toComplex_apply, ofReal_zero, implies_true]) -- Connect the real integral to the complex one via real_integral_eq_complex_re rw [real_integral_eq_complex_re m f] -- Show that the complex integral equals rpInnerProduct @@ -455,7 +457,7 @@ theorem freeCovariance_reflection_positive_bilinear_real (m : ℝ) [Fact (0 < m) = rpInnerProduct m (toComplex f) := by rw [rpInnerProduct_toComplex_eq] rfl - simp_all + simp_all only [Fin.isValue, toComplex_apply] /-- Alias for `freeCovariance_reflection_positive_bilinear_real` to match expected name. -/ theorem freeCovariance_reflection_positive_real (m : ℝ) [Fact (0 < m)] (f : OSforGFF.TestFunction) diff --git a/LeanPool/OSforGFF/OS/OS3MixedRep.lean b/LeanPool/OSforGFF/OS/OS3MixedRep.lean index 630dd6948b..35bf7435c1 100644 --- a/LeanPool/OSforGFF/OS/OS3MixedRep.lean +++ b/LeanPool/OSforGFF/OS/OS3MixedRep.lean @@ -258,7 +258,8 @@ theorem heatKernel_bilinear_fourier_form (m : ℝ) (f : TestFunctionℂ) : ∫ k : SpaceTime, Complex.exp (-Complex.I * ⟪k, timeReflection x - y⟫_ℝ) * Complex.exp (-(s : ℂ) * ‖k‖^2)) := by apply MeasureTheory.setIntegral_congr_ae measurableSet_Ioi - simp_all + simp_all only [one_div, ofReal_inv, ofReal_pow, ofReal_mul, ofReal_ofNat, neg_mul, + Set.mem_Ioi, ofReal_exp, ofReal_neg, implies_true, eventually_true] -- Step 3: Apply k_integral_after_k0_eval to evaluate the k-integral -- For each (s, x, y), this replaces the k-integral with: -- √(π/s) exp(-z₀²/(4s)) × ∫_{k_sp} exp(-I k_sp·z_sp) exp(-s‖k_sp‖²) @@ -519,7 +520,8 @@ lemma s_integral_eval_complex (t : ℝ) (ω : ℝ) (hω : 0 < ω) : (Real.sqrt (π / s) : ℂ) * Complex.exp (-(t^2 / (4 * s) : ℝ)) * Complex.exp (-(s * ω^2 : ℝ)) = (((Real.sqrt (π / s) * Real.exp (-(t^2 / (4 * s))) * Real.exp (-(s * ω^2))) : ℝ) : ℂ) := by - simp_all + simp_all only [Set.mem_Ioi, ofReal_div, ofReal_pow, ofReal_mul, ofReal_ofNat, ofReal_exp, + ofReal_neg, implies_true] rw [setIntegral_congr_fun measurableSet_Ioi h_integrand] -- Step 2: Normalize -(x * ω²) to -x * ω² to match s_integral_eval have h_form : ∀ x : ℝ, -(x * ω^2) = -x * ω^2 := by intro x; ring @@ -580,11 +582,12 @@ lemma s_integral_complex_eval (k_sp : SpatialCoords) (x y : SpaceTime) (m : ℝ) -- using ω² = ‖k_sp‖² + m² have h_omega_sq : ω^2 = ‖k_sp‖^2 + m^2 := by simp only [ω] - exact Real.sq_sqrt (by nlinarith [sq_nonneg ‖k_sp‖, sq_pos_of_pos hm]) + exact Real.sq_sqrt (by linarith only [hm, sq_nonneg ‖k_sp‖, sq_pos_of_pos hm]) have h_exp_conv : ∀ a ∈ Set.Ioi (0:ℝ), Complex.exp (-(a : ℂ) * ((‖k_sp‖^2 : ℂ) + (m^2 : ℂ))) = Complex.exp (-(a * ω^2 : ℝ)) := by - simp_all + simp_all only [Set.mem_Ioi, Fin.isValue, ofReal_div, ofReal_pow, ofReal_sub, ofReal_neg, + ofReal_mul, ofReal_ofNat, neg_mul, ofReal_add, implies_true] have h_integrand_conv : ∀ a ∈ Set.Ioi (0:ℝ), (Real.sqrt (π / a) : ℂ) * Complex.exp (-((-(x 0) - y 0)^2 / (4 * a) : ℝ)) * Complex.exp (-(a : ℂ) * ((‖k_sp‖^2 : ℂ) + (m^2 : ℂ))) = @@ -1030,7 +1033,7 @@ lemma freeCovariance_eq_schwingerRep (m : ℝ) (hm : 0 < m) (x y : SpaceTime) -- Goal: ↑(∫ t in Ioi 0, f t) = ∫ s in Ioi 0, ↑(f s) -- Use integral_complex_ofReal (reversed) rw [← integral_complex_ofReal] - simp_all + simp_all only [ne_eq, neg_mul, ofReal_mul, ofReal_exp, ofReal_neg, ofReal_pow] /-- **Bessel bilinear form equals the Schwinger heat kernel form.** @@ -1193,7 +1196,7 @@ lemma mixed_rep_to_k0_inside_integrand (k_spatial : SpatialCoords) (m : ℝ) [Fa simp only [ω] apply Real.sqrt_pos_of_pos have hm : 0 < m := Fact.out - nlinarith [sq_nonneg ‖k_spatial‖] + nlinarith only [hm, sq_nonneg ‖k_spatial‖] -- By fourier_lorentzian_1d_neg: ∫ exp(-ik₀t)/(k₀²+ω²) = (π/ω) exp(-ω|t|) have h_fourier := fourier_lorentzian_1d_neg ω hω_pos t -- Rearrange: (1/ω) exp(-ω|t|) = (1/π) * (π/ω) exp(-ω|t|) = (1/π) * ∫... @@ -1297,7 +1300,8 @@ theorem bilinear_to_k0_inside (m : ℝ) [Fact (0 < m)] (f : TestFunctionℂ) -- h_key says: (1/ω) exp(-|t|ω) = (1/π) ∫_{k₀} exp(-ik₀t)/(k₀²+ω²) -- First, convert the RHS to use t instead of the explicit expression have ht_eq : (-↑(x.ofLp 0) - ↑(y.ofLp 0) : ℂ) = (t : ℂ) := by - simp_all + simp_all only [Fin.isValue, Nat.add_one_sub_one, one_div, mul_inv_rev, ofReal_mul, ofReal_inv, + ofReal_pow, ofReal_ofNat, neg_mul, ofReal_sub, ofReal_neg] -- Rewrite the RHS to use t conv_rhs => rw [ht_eq] -- Substitute RHS using h_integral_factor diff --git a/LeanPool/OSforGFF/OS/OS3MixedRepInfra.lean b/LeanPool/OSforGFF/OS/OS3MixedRepInfra.lean index b809718f43..2fa9c6e961 100644 --- a/LeanPool/OSforGFF/OS/OS3MixedRepInfra.lean +++ b/LeanPool/OSforGFF/OS/OS3MixedRepInfra.lean @@ -91,14 +91,14 @@ private lemma norm_cexp_neg_normSq_add_le (s m : ℝ) (hs : 0 ≤ s) (k : Spatia simp only [Complex.add_re, sq, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] simp only [h_im, h_re, mul_zero, sub_zero] - nlinarith [sq_nonneg ‖k‖] + nlinarith only [hs, sq_nonneg ‖k‖] /-- Norm bound for the heat-kernel factor: `‖exp(-((-a-b)²/(4s)))‖ ≤ 1` for `s ≥ 0`. -/ private lemma norm_cexp_neg_heat_le_one (a b s : ℝ) (hs : 0 ≤ s) : ‖Complex.exp (-((-a - b)^2 / (4 * s) : ℝ))‖ ≤ 1 := by rw [Complex.norm_exp] simp only [neg_re, Complex.ofReal_re] - exact Real.exp_le_one_iff.mpr (neg_nonpos.mpr (div_nonneg (sq_nonneg _) (by linarith))) + exact Real.exp_le_one_iff.mpr (neg_nonpos.mpr (div_nonneg (sq_nonneg _) (by linarith only [hs]))) /-- Norm of the `√(π/s)` scalar factor cast to `ℂ`. -/ private lemma norm_sqrt_pi_div (s : ℝ) : @@ -346,6 +346,16 @@ lemma heatKernelPositionSpace_continuousOn : simp only [Set.mem_Ioi] at ht simp only [ne_eq, mul_eq_zero, OfNat.ofNat_ne_zero, false_or]; exact ht.ne' +private lemma reflectedDistance_continuous : + Continuous (fun p : SpaceTime × SpaceTime => ‖timeReflection p.1 - p.2‖) := + ((timeReflectionCLM.continuous.comp continuous_fst).sub continuous_snd).norm + +private lemma heatKernelPositionSpace_continuous_right (s : ℝ) : + Continuous (fun r : ℝ => heatKernelPositionSpace s r) := by + unfold heatKernelPositionSpace + exact continuous_const.mul + (Real.continuous_exp.comp ((continuous_id.pow 2).neg.div_const (4 * s))) + /-- The real heat-kernel composition `p ↦ H(p.1, ‖Θ p.2.1 - p.2.2‖)` is continuous on the support `Ioi 0 ×ˢ univ`. Shared core of the two `aestronglyMeasurable` theorems below. -/ private lemma heatKernelPositionSpace_comp_continuousOn : @@ -365,7 +375,9 @@ private lemma heatKernelPositionSpace_comp_continuousOn : (fun p : ℝ × SpaceTime × SpaceTime => (p.1, ‖timeReflection p.2.1 - p.2.2‖)) (Set.Ioi 0 ×ˢ Set.univ) (Set.Ioi 0 ×ˢ Set.univ) := fun _ ⟨hs, _⟩ => ⟨hs, Set.mem_univ _⟩ - exact heatKernelPositionSpace_continuousOn.comp h_proj h_maps + exact heatKernelPositionSpace_continuousOn.comp' + (f := fun p : ℝ × SpaceTime × SpaceTime => + (p.1, ‖timeReflection p.2.1 - p.2.2‖)) h_proj h_maps /-- **Heat kernel composition is AEStronglyMeasurable.** @@ -407,7 +419,7 @@ lemma heatKernelPositionSpace_integral_translated (s : ℝ) (hs : 0 < s) (a : Sp rw [← neg_sub, norm_neg] have h_fun : (fun y : SpaceTime => heatKernelPositionSpace s ‖a - y‖) = (fun y : SpaceTime => heatKernelPositionSpace s ‖y - a‖) := by - simp_all + simp_all only rw [h_fun] -- Use translation invariance: ∫ f(y - a) dy = ∫ f(z) dz -- SpaceTime = EuclideanSpace ℝ (Fin 4) has translation-invariant Lebesgue measure @@ -500,21 +512,8 @@ lemma schwinger_bound_integrable_xy (s : ℝ) (hs : 0 < s) (fun p : SpaceTime × SpaceTime => heatKernelPositionSpace s ‖timeReflection p.1 - p.2‖) (volume.prod volume) := by - have h_norm : Continuous (fun p : SpaceTime × SpaceTime => - ‖timeReflection p.1 - p.2‖) := by - apply continuous_norm.comp - apply Continuous.sub - · exact (LinearIsometryEquiv.continuous timeReflectionLE).comp continuous_fst - · exact continuous_snd - have h_cont_r : Continuous (fun r : ℝ => heatKernelPositionSpace s r) := by - have h_cont_on : ContinuousOn (fun r : ℝ => heatKernelPositionSpace s r) Set.univ := by - have h_proj : ContinuousOn (fun r : ℝ => (s, r)) Set.univ := by - exact (continuous_const.prodMk continuous_id).continuousOn - have h_maps : Set.MapsTo (fun r : ℝ => (s, r)) Set.univ (Set.Ioi 0 ×ˢ Set.univ) := by - intro r _; exact ⟨hs, Set.mem_univ _⟩ - exact heatKernelPositionSpace_continuousOn.comp h_proj h_maps - exact (continuousOn_univ.mp h_cont_on) - exact (h_cont_r.comp h_norm).aestronglyMeasurable + exact ((heatKernelPositionSpace_continuous_right s).comp + reflectedDistance_continuous).aestronglyMeasurable have h_fCexp : AEStronglyMeasurable (fun p : SpaceTime × SpaceTime => (‖f p.1‖ * Cf) * Real.exp (-s * m^2)) (volume.prod volume) := @@ -545,12 +544,12 @@ lemma schwinger_bound_integrable_xy (s : ℝ) (hs : 0 < s) = ∫ y : SpaceTime, (‖f x‖ * Cf * Real.exp (-s * m^2)) * heatKernelPositionSpace s ‖timeReflection x - y‖ := by - simp_all + simp_all only [norm_eq_abs, neg_mul] _ = (‖f x‖ * Cf * Real.exp (-s * m^2)) := schwinger_bound_integrand_integral_y s hs f Cf m x have h_int_x : Integrable (fun x : SpaceTime => ‖f x‖ * Cf * Real.exp (-s * m^2)) := schwinger_bound_integrand_integrable_x s f Cf m h_f_int - simp_all + simp_all only [norm_eq_abs, neg_mul] /-- Compute the (x,y)-integral of the Schwinger bound integrand for fixed `s > 0`. -/ lemma schwinger_bound_integrand_integral_xy (s : ℝ) (hs : 0 < s) @@ -576,7 +575,7 @@ lemma schwinger_bound_integrand_integral_xy (s : ℝ) (hs : 0 < s) = ∫ x : SpaceTime, ∫ y : SpaceTime, G (x, y) := by rwa [Measure.volume_eq_prod] _ = ∫ x : SpaceTime, ‖f x‖ * Cf * Real.exp (-s * m^2) := by - simp_all + simp_all only [neg_mul] _ = (Cf * (∫ x : SpaceTime, ‖f x‖)) * Real.exp (-s * m^2) := by -- pull out the constant let r : ℝ := Cf * Real.exp (-s * m^2) @@ -597,88 +596,34 @@ theorem schwinger_bound_integrable_fubini (m : ℝ) [Fact (0 < m)] (f : TestFunc ‖f p.2.1‖ * Cf * Real.exp (-p.1 * m^2) * heatKernelPositionSpace p.1 ‖timeReflection p.2.1 - p.2.2‖) ((volume.restrict (Set.Ioi 0)).prod (volume.prod volume)) := by - classical - -- Mark unused parameters as used (they are part of the hypotheses contract). + -- These hypotheses are part of the existing statement. have _ := hCf have _ := h_y_eq_one let F : ℝ × SpaceTime × SpaceTime → ℝ := fun p => ‖f p.2.1‖ * Cf * Real.exp (-p.1 * m^2) * heatKernelPositionSpace p.1 ‖timeReflection p.2.1 - p.2.2‖ have h_meas : AEStronglyMeasurable F - ((volume.restrict (Set.Ioi 0)).prod (volume.prod volume)) := by - have h_f : AEStronglyMeasurable (fun p : ℝ × SpaceTime × SpaceTime => ‖f p.2.1‖) - ((volume.restrict (Set.Ioi 0)).prod (volume.prod volume)) := by - have hf_cont : Continuous (fun p : ℝ × SpaceTime × SpaceTime => f p.2.1) := - (SchwartzMap.continuous f).comp (continuous_snd.fst) - exact hf_cont.aestronglyMeasurable.norm - have h_exp : AEStronglyMeasurable (fun p : ℝ × SpaceTime × SpaceTime => - Real.exp (-p.1 * m^2)) ((volume.restrict (Set.Ioi 0)).prod (volume.prod volume)) := by - have h_cont : Continuous (fun p : ℝ × SpaceTime × SpaceTime => Real.exp (-p.1 * m^2)) := - (Real.continuous_exp.comp (continuous_fst.neg.mul continuous_const)) - exact h_cont.aestronglyMeasurable - have h_heat : AEStronglyMeasurable - (fun p : ℝ × SpaceTime × SpaceTime => - heatKernelPositionSpace p.1 ‖timeReflection p.2.1 - p.2.2‖) - ((volume.restrict (Set.Ioi 0)).prod (volume.prod volume)) := + ((volume.restrict (Set.Ioi 0)).prod (volume.prod volume)) := + ((((f.continuous.comp continuous_snd.fst).aestronglyMeasurable.norm).mul_const Cf).mul + (Real.continuous_exp.comp + (continuous_fst.neg.mul continuous_const)).aestronglyMeasurable).mul heatKernelPositionSpace_aestronglyMeasurable_real - have h_fCexp : AEStronglyMeasurable - (fun p : ℝ × SpaceTime × SpaceTime => (‖f p.2.1‖ * Cf) * Real.exp (-p.1 * m^2)) - ((volume.restrict (Set.Ioi 0)).prod (volume.prod volume)) := - (h_f.mul_const Cf).mul h_exp - have h_all : AEStronglyMeasurable - (fun p : ℝ × SpaceTime × SpaceTime => - (‖f p.2.1‖ * Cf) * Real.exp (-p.1 * m^2) * - heatKernelPositionSpace p.1 ‖timeReflection p.2.1 - p.2.2‖) - ((volume.restrict (Set.Ioi 0)).prod (volume.prod volume)) := - h_fCexp.mul h_heat - simpa [F, mul_assoc, mul_left_comm, mul_comm] using h_all refine (MeasureTheory.integrable_prod_iff (μ := volume.restrict (Set.Ioi 0)) - (ν := volume.prod volume) h_meas).2 ?_ - constructor - · refine (ae_restrict_mem measurableSet_Ioi).mono ?_ - intro s hs - have hs' : 0 < s := hs - exact schwinger_bound_integrable_xy s hs' f Cf m hCf_nonneg h_f_int - · -- integrable of s ↦ ∫_{x,y} ‖F(s,x,y)‖ - have h_exp_ne_zero : (∫ s in Set.Ioi 0, Real.exp (-s * m^2)) ≠ 0 := by + (ν := volume.prod volume) h_meas).2 ⟨?_, ?_⟩ + · exact (ae_restrict_mem measurableSet_Ioi).mono fun s hs => + schwinger_bound_integrable_xy s hs f Cf m hCf_nonneg h_f_int + · have h_exp_ne_zero : (∫ s in Set.Ioi 0, Real.exp (-s * m^2)) ≠ 0 := by rw [h_exp_int] - have hm : m ≠ 0 := ne_of_gt (Fact.out : 0 < m) - exact one_div_ne_zero (pow_ne_zero 2 hm) + exact one_div_ne_zero (pow_ne_zero 2 (ne_of_gt (Fact.out : 0 < m))) have h_exp_intg : Integrable (fun s : ℝ => Real.exp (-s * m^2)) (volume.restrict (Set.Ioi 0)) := Integrable.of_integral_ne_zero h_exp_ne_zero - have h_const : Integrable (fun s : ℝ => (Cf * (∫ x : SpaceTime, ‖f x‖)) * - Real.exp (-s * m^2)) (volume.restrict (Set.Ioi 0)) := by - have h := h_exp_intg.const_mul (Cf * (∫ x : SpaceTime, ‖f x‖)) - simpa [mul_comm, mul_left_comm, mul_assoc] using h - refine h_const.congr ?_ - refine (ae_restrict_mem measurableSet_Ioi).mono ?_ - intro s hs - have hs' : 0 < s := hs - have h_eq_norm : - ∫ p : SpaceTime × SpaceTime, ‖F (s, p.1, p.2)‖ = - ∫ p : SpaceTime × SpaceTime, - ‖f p.1‖ * Cf * Real.exp (-s * m^2) * - heatKernelPositionSpace s ‖timeReflection p.1 - p.2‖ := by - refine integral_congr_ae ?_ - filter_upwards with p - have h_nonneg' : 0 ≤ F (s, p.1, p.2) := by - simpa [F] using - schwinger_bound_integrand_nonneg s hs' f Cf hCf_nonneg m p.1 p.2 - have : ‖F (s, p.1, p.2)‖ = F (s, p.1, p.2) := by - simpa using (Real.norm_of_nonneg h_nonneg') - simpa [F, this, mul_assoc] - have h_eq : - ∫ p : SpaceTime × SpaceTime, ‖F (s, p.1, p.2)‖ = - (Cf * (∫ x : SpaceTime, ‖f x‖)) * Real.exp (-s * m^2) := by - calc - ∫ p : SpaceTime × SpaceTime, ‖F (s, p.1, p.2)‖ - = ∫ p : SpaceTime × SpaceTime, - ‖f p.1‖ * Cf * Real.exp (-s * m^2) * - heatKernelPositionSpace s ‖timeReflection p.1 - p.2‖ := h_eq_norm - _ = (Cf * (∫ x : SpaceTime, ‖f x‖)) * Real.exp (-s * m^2) := - schwinger_bound_integrand_integral_xy s hs' f Cf m hCf_nonneg h_f_int - exact h_eq.symm + refine (h_exp_intg.const_mul (Cf * (∫ x : SpaceTime, ‖f x‖))).congr ?_ + refine (ae_restrict_mem measurableSet_Ioi).mono fun s hs => ?_ + exact (schwinger_bound_integrand_integral_xy s hs f Cf m hCf_nonneg h_f_int).symm.trans + (integral_congr_ae (Eventually.of_forall fun p => + (Real.norm_of_nonneg + (schwinger_bound_integrand_nonneg s hs f Cf hCf_nonneg m p.1 p.2)).symm)) /-- **Bound function for Schwinger integrability is integrable.** @@ -721,7 +666,7 @@ theorem schwinger_bound_integrable (m : ℝ) [Fact (0 < m)] (f : TestFunctionℂ fun s hs x => heatKernelPositionSpace_integral_translated s hs (timeReflection x) have hCf_nonneg : 0 ≤ Cf := by have := hCf 0 - linarith [norm_nonneg (f 0)] + linarith only [this, norm_nonneg (f 0)] exact schwinger_bound_integrable_fubini m f Cf hCf h_f_int hCf_nonneg h_y_eq_one h_exp_int @@ -749,7 +694,7 @@ theorem integrable_s_inv_sq_exp_neg_inv_s {a : ℝ} (ha : 0 < a) : integrableOn_exp_mul_Ioi (neg_neg_of_pos ha) 0 -- Step 2: f '' (Ioi 0) = Ioi 0 have h_img : (fun s : ℝ => s⁻¹) '' Set.Ioi 0 = Set.Ioi 0 := by - ext y; simp_all + ext y; simp_all only [neg_mul, Set.image_inv_eq_inv, Set.mem_inv, Set.mem_Ioi, inv_pos] -- Step 3: Define f' and apply the iff let f' : ℝ → ℝ := fun s => -(s^((-2 : ℝ))) have h_iff := integrableOn_image_iff_integrableOn_deriv_smul_of_antitoneOn @@ -765,7 +710,7 @@ theorem integrable_s_inv_sq_exp_neg_inv_s {a : ℝ} (ha : 0 < a) : -- We need -(s^(-2 : ℝ)) which equals -(s^2)⁻¹ have heq : -(s^((-2 : ℝ))) = -(s ^ (2 : ℕ))⁻¹ := by rw [Real.rpow_neg (le_of_lt hs_pos)] - simp_all + simp_all only [neg_mul, Set.image_inv_eq_inv, Set.mem_Ioi, ne_eq, rpow_ofNat] rwa [heq] exact h.hasDerivWithinAt) (fun x hx y _ hxy => inv_anti₀ hx hxy) @@ -878,7 +823,7 @@ theorem integrable_dominate_G (C : ℝ) (m : ℝ) [Fact (0 < m)] : Real.exp (-s * ‖k‖^2)) ∂volume ∂volume := by apply lintegral_congr_ae filter_upwards [h_eq_integrand] with s hs - simp_all + simp_all only [Prod.forall, neg_mul, measurableSet_Ioi, ae_restrict_eq] _ < ⊤ := by -- Strategy: Compute exact inner integral using Gaussian formula, then bound outer -- @@ -905,7 +850,8 @@ theorem integrable_dominate_G (C : ℝ) (m : ℝ) [Fact (0 < m)] : simp only [zero_mul, add_zero, inner_zero_left, Complex.ofReal_zero] at h have h_eq : (fun k_sp : SpatialCoords => Complex.exp (-(s : ℂ) * ‖k_sp‖^2)) = (fun k_sp => (Real.exp (-s * ‖k_sp‖^2) : ℂ)) := by - simp_all + simp_all only [Prod.forall, neg_mul, measurableSet_Ioi, ae_restrict_eq, + Set.mem_Ioi, ofReal_re, ofReal_exp, ofReal_neg, ofReal_mul, ofReal_pow] rw [h_eq] at h exact h.re -- Show integrand is nonnegative @@ -1119,7 +1065,7 @@ lemma triangular_fubini_quadrant {f : ℝ → ℝ → ℝ} -- Use the change of variables formula with φ(y) = y + x -- The image of Ioi 0 under (· + x) is Ioi x have h_image : (fun y => y + x) '' Set.Ioi 0 = Set.Ioi x := by - simp_all + simp_all only [Set.image_add_right, Set.preimage_add_const_Ioi, sub_neg_eq_add, zero_add] -- Apply integral_image_eq_integral_abs_deriv_smul with derivative = 1 rw [← h_image] symm @@ -1135,7 +1081,7 @@ lemma triangular_fubini_quadrant {f : ℝ → ℝ → ℝ} intro y _ exact (hasDerivWithinAt_id y _).add_const x · -- Injectivity of (· + x) - exact fun _ _ _ _ h => by linarith + exact fun _ _ _ _ h => by linarith only [h] -- Step 2: ∫_{x>0} ∫_{u>x} f(x, u) du dx = ∫_{u>0} ∫_{0 0. This follows from `integrable_mul_exp_neg_mul_sq` restricted to positive reals. @@ -1507,7 +1453,8 @@ lemma gaussian_moment_integrableOn_Ioi {b : ℝ} (hb : 0 < b) : rw [MeasureTheory.IntegrableOn] apply MeasureTheory.Integrable.mono (h_int.restrict) · fun_prop - · simp_all + · simp_all only [neg_mul, norm_mul, norm_eq_abs, abs_exp, abs_abs, Std.le_refl, + measurableSet_Ioi, ae_restrict_eq, eventually_true] /-- Helper lemma: For s > 0 and any t₁ ≥ 0, the function t₂ ↦ t₂ * exp(-(t₁+t₂)²/(4s)) is integrable on (0, ∞). This is the key integrability fact for heat kernel moment bounds. @@ -1527,7 +1474,7 @@ lemma heat_kernel_inner_integrableOn {s t₁ : ℝ} (hs : 0 < s) (ht₁ : 0 ≤ (fun t => t * Real.exp (-t^2 / (4 * s))) (MeasureTheory.volume.restrict (Set.Ioi 0)) := by convert h_dom using 2 with t congr 1 - have h4s : 4 * s ≠ 0 := by linarith + have h4s : 4 * s ≠ 0 := by linarith only [hs] field_simp -- The integrand is dominated by t₂ * exp(-t₂²/(4s)) on Ioi 0 apply MeasureTheory.Integrable.mono h_dom' @@ -1542,9 +1489,9 @@ lemma heat_kernel_inner_integrableOn {s t₁ : ℝ} (hs : 0 < s) (ht₁ : 0 ≤ apply mul_le_mul_of_nonneg_left _ (le_of_lt ht₂) apply Real.exp_le_exp.mpr -- Need: -(t₁+t₂)²/(4s) ≤ -t₂²/(4s), i.e., (t₁+t₂)² ≥ t₂² - apply div_le_div_of_nonneg_right _ (by linarith : 0 ≤ 4 * s) + apply div_le_div_of_nonneg_right _ (by linarith only [hs] : 0 ≤ 4 * s) apply neg_le_neg - nlinarith [sq_nonneg t₁] + nlinarith only [ht₁, ht₂, sq_nonneg t₁] /-- The heat kernel moment integrand is integrable on the product quadrant (0,∞)². This is the key integrability result extracted from heat_kernel_moment_integral. @@ -1589,14 +1536,14 @@ lemma heat_kernel_moment_integrableOn_quadrant (s : ℝ) (hs : 0 < s) : have hsum : (x + y)^2 ≥ x^2 + y^2 := by nlinarith [sq_nonneg x, sq_nonneg y, mul_pos hx hy] have hexp : Real.exp (-(x+y)^2/(4*s)) ≤ Real.exp (-(x^2 + y^2)/(4*s)) := by apply Real.exp_le_exp_of_le - apply div_le_div_of_nonneg_right _ (le_of_lt (by linarith : 0 < 4*s)) - linarith [hsum] + apply div_le_div_of_nonneg_right _ (le_of_lt (by linarith only [hs] : 0 < 4*s)) + linarith only [hsum] have hexp_factor : Real.exp (-(x^2 + y^2)/(4*s)) = Real.exp (-(1/(4*s)) * x^2) * Real.exp (-(1/(4*s)) * y^2) := by rw [← Real.exp_add]; congr 1; field_simp; ring calc x * y * Real.exp (-(x + y)^2 / (4 * s)) ≤ x * y * Real.exp (-(x^2 + y^2)/(4*s)) := by - nlinarith [Real.exp_nonneg (-(x^2 + y^2)/(4*s))] + nlinarith only [hsum, hexp, Real.exp_nonneg (-(x^2 + y^2)/(4*s))] _ = x * y * (Real.exp (-(1/(4*s)) * x^2) * Real.exp (-(1/(4*s)) * y^2)) := by rw [hexp_factor] _ = x * Real.exp (-(1/(4*s)) * x^2) * (y * Real.exp (-(1/(4*s)) * y^2)) := by ring @@ -1659,7 +1606,9 @@ lemma heatKernelMomentExt_parametric_eq_setIntegral (s : ℝ) (t₁ : ℝ) (ht unfold heatKernelMomentExt by_cases ht₂ : t₂ > 0 · simp only [ht₁, ht₂, and_self, ↓reduceIte, Set.indicator_apply, Set.mem_Ioi] - · simp_all + · simp_all only [gt_iff_lt, not_lt, true_and, Set.mem_Ioi, Set.indicator_of_notMem, + ite_eq_right_iff, mul_eq_zero, Real.exp_ne_zero, or_false, isEmpty_Prop, + IsEmpty.forall_iff] simp_rw [h_eq] rw [MeasureTheory.integral_indicator measurableSet_Ioi] @@ -1722,12 +1671,12 @@ private lemma heat_kernel_spatial_integral_bound (s : ℝ) (hs : 0 < s) intro t₁ symm apply MeasureTheory.setIntegral_eq_integral_of_forall_compl_eq_zero - simp_all + simp_all only [Set.mem_Ioi, not_lt, mul_zero, implies_true] have h_supp_outer : ∫ t₁ : ℝ, ∫ t₂ in Set.Ioi 0, K t₁ t₂ * G t₁ * G t₂ = ∫ t₁ in Set.Ioi 0, ∫ t₂ in Set.Ioi 0, K t₁ t₂ * G t₁ * G t₂ := by symm apply MeasureTheory.setIntegral_eq_integral_of_forall_compl_eq_zero - simp_all + simp_all only [Set.mem_Ioi, not_lt, mul_zero, zero_mul, integral_zero, implies_true] have h_bound : ∀ t₁ ∈ Set.Ioi (0:ℝ), ∀ t₂ ∈ Set.Ioi (0:ℝ), K t₁ t₂ * G t₁ * G t₂ ≤ K t₁ t₂ * (C_sp * t₁) * (C_sp * t₂) := by intro t₁ ht₁ t₂ ht₂ @@ -1812,7 +1761,8 @@ private lemma heat_kernel_spatial_integral_bound (s : ℝ) (hs : 0 < s) rw [Real.norm_eq_abs, abs_of_nonneg, Real.norm_eq_abs, abs_of_nonneg] · exact h_mono_inner t₁ (Set.mem_Ioi.mpr ht₁) · apply MeasureTheory.setIntegral_nonneg measurableSet_Ioi - simp_all + simp_all only [Set.mem_Ioi, mul_pos_iff_of_pos_left, mul_nonneg_iff_of_pos_right, + implies_true] · apply MeasureTheory.setIntegral_nonneg measurableSet_Ioi intro t₂ ht₂ apply mul_nonneg @@ -1958,7 +1908,7 @@ lemma spacetime_fubini_linear_vanishing_bound (f : TestFunctionℂ) apply mul_le_mul_of_nonneg_left _ (Real.sqrt_nonneg _) rw [Real.exp_le_one_iff] apply div_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr (sq_nonneg _)) - linarith + linarith only [hs] _ = Real.sqrt (π / s) := mul_one _ have h_tonelli := schwartz_tonelli_spacetime f f K hK_nonneg hK_meas hK_bdd -- G from h_tonelli matches spatialNormIntegral via the linking lemma @@ -1979,7 +1929,7 @@ lemma spacetime_fubini_linear_vanishing_bound (f : TestFunctionℂ) by_cases ht : 0 < t · have h1 : G t ≤ C_sp * t := h_spatial t ht simpa only [max_eq_left (le_of_lt ht)] using h1 - · simp_all + · simp_all only [Fin.isValue, not_lt, sup_of_le_right, mul_zero, Std.le_refl] -- Bound: K * G(t₁) * G(t₂) ≤ K * C_sp² * max(t₁,0) * max(t₂,0) have h_pointwise_bound : ∀ t₁ t₂, K t₁ t₂ * G t₁ * G t₂ ≤ K t₁ t₂ * (C_sp * max t₁ 0) * (C_sp * max t₂ 0) := by @@ -2054,63 +2004,37 @@ lemma schwartz_iterated_integral_integrable (f : TestFunctionℂ) (c₁ c₂ : ℝ) (s : ℝ) (hs : 0 < s) : Integrable (fun x : SpaceTime => ∫ y : SpaceTime, ‖f x‖ * ‖f y‖ * c₁ * Real.exp (-(x 0 + y 0)^2 / (4 * s)) * c₂) volume := by - -- Work on the product space and use Fubini/Tonelli via Integrable.integral_prod_left. let G : SpaceTime × SpaceTime → ℝ := fun p => ‖f p.1‖ * ‖f p.2‖ * c₁ * Real.exp (-(p.1 0 + p.2 0)^2 / (4 * s)) * c₂ - have hG_meas : AEStronglyMeasurable G (volume.prod volume) := by - have hf : Continuous f := f.continuous - have h0 : Continuous (fun a : SpaceTime => a 0) := - PiLp.continuous_apply 2 (fun _ : Fin STDimension => ℝ) 0 - have hG_cont : Continuous G := by - simp only [G] - fun_prop (disch := assumption) - exact hG_cont.aestronglyMeasurable - have hG_int : Integrable G (volume.prod volume) := by - -- Bound by |c₁ c₂| * ‖f p.1‖ * ‖f p.2‖ using exp ≤ 1. - have h_bound : ∀ p, ‖G p‖ ≤ (|c₁| * |c₂|) * (‖f p.1‖ * ‖f p.2‖) := by - intro p - have h_exp_le : Real.exp (-(p.1 0 + p.2 0)^2 / (4 * s)) ≤ 1 := by - have h_nonneg : 0 ≤ (p.1 0 + p.2 0)^2 / (4 * s) := by - have hsq : 0 ≤ (p.1 0 + p.2 0)^2 := sq_nonneg _ - have hden : 0 < (4 * s) := by nlinarith [hs] - exact div_nonneg hsq (le_of_lt hden) - have hneg' : -(p.1 0 + p.2 0)^2 / (4 * s) = -((p.1 0 + p.2 0)^2 / (4 * s)) := by - ring - simp_all - have h1 : |Real.exp (-(p.1 0 + p.2 0)^2 / (4 * s))| ≤ 1 := by - simpa [abs_of_nonneg (Real.exp_nonneg _)] using h_exp_le - have h_nonneg : 0 ≤ (|c₁| * |c₂|) * (‖f p.1‖ * ‖f p.2‖) := by - apply mul_nonneg - · exact mul_nonneg (abs_nonneg _) (abs_nonneg _) - · exact mul_nonneg (norm_nonneg _) (norm_nonneg _) - have h2 : (|c₁| * |c₂|) * (‖f p.1‖ * ‖f p.2‖) * - |Real.exp (-(p.1 0 + p.2 0)^2 / (4 * s))| ≤ - (|c₁| * |c₂|) * (‖f p.1‖ * ‖f p.2‖) * 1 := by - exact mul_le_mul_of_nonneg_left h1 h_nonneg - -- Convert to abs bound - have hnorm : ‖G p‖ = (‖f p.1‖ * ‖f p.2‖) * |c₁| * - |Real.exp (-(p.1 0 + p.2 0)^2 / (4 * s))| * |c₂| := by - simp [G, Real.norm_eq_abs, mul_assoc, abs_of_nonneg (Real.exp_nonneg _)] - have h2' : ((‖f p.1‖ * ‖f p.2‖) * |c₁| * - |Real.exp (-(p.1 0 + p.2 0)^2 / (4 * s))|) * |c₂| ≤ - ((‖f p.1‖ * ‖f p.2‖) * |c₁| * 1) * |c₂| := by - have h_nonneg' : 0 ≤ (‖f p.1‖ * ‖f p.2‖) * |c₁| := by - exact mul_nonneg (mul_nonneg (norm_nonneg _) (norm_nonneg _)) (abs_nonneg _) - exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left h1 h_nonneg') (abs_nonneg _) - have h2'' : ((‖f p.1‖ * ‖f p.2‖) * |c₁| * 1) * |c₂| = - (|c₁| * |c₂|) * (‖f p.1‖ * ‖f p.2‖) := by - ring - simp_all - have h_bound_int : Integrable (fun p : SpaceTime × SpaceTime => - (|c₁| * |c₂|) * (‖f p.1‖ * ‖f p.2‖)) (volume.prod volume) := by - have h_prod : Integrable (fun p : SpaceTime × SpaceTime => ‖f p.1‖ * ‖f p.2‖) - (volume.prod volume) := hf_int_norm.mul_prod hf_int_norm - simpa [mul_assoc] using h_prod.const_mul (|c₁| * |c₂|) - exact Integrable.mono' h_bound_int hG_meas (Eventually.of_forall h_bound) - -- Conclude by integrating out the second variable. - have h_int_left : Integrable (fun x : SpaceTime => ∫ y : SpaceTime, G (x, y)) volume := - hG_int.integral_prod_left - simpa [G, mul_assoc, mul_left_comm, mul_comm] using h_int_left + have h0 : Continuous (fun a : SpaceTime => a 0) := + PiLp.continuous_apply 2 (fun _ : Fin STDimension => ℝ) 0 + have h_exp_cont : Continuous (fun p : SpaceTime × SpaceTime => + Real.exp (-(p.1 0 + p.2 0)^2 / (4 * s))) := + Real.continuous_exp.comp + ((((h0.comp continuous_fst).add (h0.comp continuous_snd)).pow 2).neg.div_const + (4 * s)) + have hG_meas : AEStronglyMeasurable G (volume.prod volume) := + (((((f.continuous.norm.comp continuous_fst).mul + (f.continuous.norm.comp continuous_snd)).mul_const c₁).mul + h_exp_cont).mul_const c₂).aestronglyMeasurable + have h_bound : ∀ p, ‖G p‖ ≤ (|c₁| * |c₂|) * (‖f p.1‖ * ‖f p.2‖) := by + intro p + have h_exp : Real.exp (-(p.1 0 + p.2 0)^2 / (4 * s)) ≤ 1 := by + apply Real.exp_le_one_iff.mpr + exact div_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr (sq_nonneg _)) (by positivity) + calc + ‖G p‖ = ‖f p.1‖ * ‖f p.2‖ * |c₁| * + Real.exp (-(p.1 0 + p.2 0)^2 / (4 * s)) * |c₂| := by + simp only [G, norm_mul, Real.norm_eq_abs, abs_norm, abs_exp] + _ ≤ ‖f p.1‖ * ‖f p.2‖ * |c₁| * 1 * |c₂| := + mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left h_exp + (mul_nonneg (mul_nonneg (norm_nonneg _) (norm_nonneg _)) (abs_nonneg _))) + (abs_nonneg _) + _ = (|c₁| * |c₂|) * (‖f p.1‖ * ‖f p.2‖) := by ring + exact (Integrable.mono' + ((hf_int_norm.mul_prod hf_int_norm).const_mul (|c₁| * |c₂|)) + hG_meas (Eventually.of_forall h_bound)).integral_prod_left /-- Bound on F(s, k_sp) using linear vanishing of f. @@ -2244,12 +2168,12 @@ lemma F_norm_bound_via_linear_vanishing (m : ℝ) [Fact (0 < m)] (f : TestFuncti intro a simp only [norm_mul, Real.norm_eq_abs, abs_of_nonneg (norm_nonneg _), abs_of_nonneg (Real.sqrt_nonneg _), abs_of_nonneg hexp_nonneg] - have h4s_pos : 0 < 4 * s := by linarith + have h4s_pos : 0 < 4 * s := by linarith only [hs] have hexp_le : Real.exp (-(x 0 + a 0)^2 / (4 * s)) ≤ 1 := by rw [Real.exp_le_one_iff] apply div_nonpos_of_nonpos_of_nonneg · exact neg_nonpos.mpr (sq_nonneg _) - · linarith + · linarith only [hs] calc ‖f x‖ * ‖f a‖ * √(π / s) * |rexp (-(x 0 + a 0)^2 / (4 * s))| * exp_factor ≤ ‖f x‖ * ‖f a‖ * √(π / s) * 1 * exp_factor := by gcongr; rw [abs_of_nonneg (Real.exp_nonneg _)]; exact hexp_le @@ -2499,7 +2423,7 @@ lemma s_xy_swap_bound_integrable (f : TestFunctionℂ) (m : ℝ) [Fact (0 < m)] have h1 : (-(1:ℝ)/2) * π = -(π/2) := by ring rw [h1, Real.cos_neg, Real.cos_pi_div_two] rw [hcos, mul_zero] - simp_all + simp_all only [pow_succ_pos, mul_zero, neg_mul, zero_mul] private lemma fubini_s_xy_swap_integrable (m : ℝ) [Fact (0 < m)] (f : TestFunctionℂ) (k_sp : SpatialCoords) : @@ -2748,7 +2672,7 @@ lemma gaussian_integrable_spatialCoords (s : ℝ) (hs : 0 < s) : -- Convert complex exponential to real: exp(-(s:ℂ) * ‖v‖²) for real s is real have h_eq : (fun k_sp : SpatialCoords => Complex.exp (-(s : ℂ) * ‖k_sp‖^2)) = (fun k_sp => (Real.exp (-s * ‖k_sp‖^2) : ℂ)) := by - simp_all + simp_all only [ofReal_re, neg_mul, ofReal_exp, ofReal_neg, ofReal_mul, ofReal_pow] rw [h_eq] at h -- Integrable (ofReal ∘ g) implies Integrable g via .re since re(ofReal x) = x exact h.re diff --git a/LeanPool/OSforGFF/OS/OS3ReflectionPositivity.lean b/LeanPool/OSforGFF/OS/OS3ReflectionPositivity.lean index 7abed9eeb1..93d66da9ab 100644 --- a/LeanPool/OSforGFF/OS/OS3ReflectionPositivity.lean +++ b/LeanPool/OSforGFF/OS/OS3ReflectionPositivity.lean @@ -261,7 +261,7 @@ lemma freeCovarianceFormR_reflection_expansion have h_negneg : freeCovarianceFormR m (-θg) (-θg) = freeCovarianceFormR m θg θg := by - simp_all + simp_all only [neg_neg] calc freeCovarianceFormR m (-θg) (f - θg) = freeCovarianceFormR m (f - θg) (-θg) := freeCovarianceFormR_symm m (-θg) (f - θg) @@ -309,7 +309,7 @@ lemma gaussianFreeField_real_generating_re (Complex.exp (-(1 / 2 : ℂ) * (freeCovarianceFormR m h h : ℝ))).re = Real.exp r := by simpa [h_arg, r] using (Complex.exp_ofReal_re r) - simp_all + simp_all only [one_div, neg_mul] /-- Factorisation of OS3 matrix entries in the purely real setting. -/ lemma gaussianFreeField_real_entry_factor @@ -449,7 +449,7 @@ lemma gaussianFreeField_OS3_matrix_real classical simp [Matrix.mulVec, dotProduct, Finset.mul_sum, mul_comm, mul_assoc] have hy_nonneg : 0 ≤ y ⬝ᵥ (E.mulVec y) := h_E_psd.dotProduct_mulVec_nonneg y - simp_all + simp_all only /-- Main theorem: the Gaussian free field satisfies OS3_real (reflection positivity, real version). -/ @@ -731,7 +731,7 @@ private lemma entrywiseExp_IsRePSD apply posSemidef_sum intro k _ have hcoeff : (0 : ℂ) ≤ (↑(Nat.factorial k : ℕ) : ℂ)⁻¹ := by - simp_all + simp_all only [Finset.mem_range, Order.lt_add_one_iff, inv_nonneg, Nat.cast_nonneg] exact (hHP_psd k).smul hcoeff -- S N i j = ∑_{k=0}^N (k!)⁻¹ * (M i j)^k have hS_entry : ∀ N i j, S N i j = @@ -767,7 +767,10 @@ private lemma entrywiseExp_IsRePSD (Complex.exp (M i j)) := by rw [Complex.exp_eq_exp_ℂ] have h' := NormedSpace.exp_series_hasSum_exp' (𝕂 := ℂ) (M i j) - simp_all + simp_all only [re_sum, mul_re, conj_re, conj_im, neg_mul, sub_neg_eq_add, inv_re, + natCast_re, normSq_natCast, div_self_mul_self', inv_im, natCast_im, neg_zero, zero_div, + zero_mul, sub_zero, mul_im, im_sum, add_zero, Finset.sum_sub_distrib, sub_nonneg, + smul_eq_mul] rw [HasSum] at h exact h.comp (Filter.tendsto_finset_range.comp (Filter.tendsto_atTop_atTop_of_monotone (fun a b hab => Nat.add_le_add_right hab 1) (fun b => ⟨b, Nat.le_succ b⟩))) diff --git a/LeanPool/OSforGFF/OS/OS4Clustering.lean b/LeanPool/OSforGFF/OS/OS4Clustering.lean index 7cae5bd57e..2e7d0d98c2 100644 --- a/LeanPool/OSforGFF/OS/OS4Clustering.lean +++ b/LeanPool/OSforGFF/OS/OS4Clustering.lean @@ -156,11 +156,15 @@ lemma gff_generating_norm_le_one_real (m : ℝ) [Fact (0 < m)] (f : OSforGFF.Tes have heq : freeCovarianceℂBilinear m (toComplex f) (toComplex f) = freeCovarianceℂ m (toComplex f) (toComplex f) := by unfold freeCovarianceℂBilinear freeCovarianceℂ - simp_all + simp_all only [one_div, neg_mul, neg_re, mul_re, inv_re, re_ofNat, normSq_ofNat, + div_self_mul_self', inv_im, im_ofNat, neg_zero, zero_div, zero_mul, sub_zero, + toComplex_apply, conj_ofReal] rw [heq] have h_nonneg : 0 ≤ (freeCovarianceℂ m (toComplex f) (toComplex f)).re := freeCovarianceℂ_positive m (toComplex f) - simp_all + simp_all only [one_div, neg_mul, neg_re, mul_re, inv_re, re_ofNat, normSq_ofNat, + div_self_mul_self', inv_im, im_ofNat, neg_zero, zero_div, zero_mul, sub_zero, + Real.exp_le_one_iff, Left.neg_nonpos_iff, inv_pos, Nat.ofNat_pos, mul_nonneg_iff_of_pos_left] /-! ## Technical Lemma for OS4 (Real Test Functions) -/ @@ -253,7 +257,7 @@ lemma GFF_OS4_from_small_decay_real (m : ℝ) [Fact (0 < m)] -- fC = toComplex f and T_a_gC = toComplex (g.translate a) change distributionPairingℂReal ω (toComplex f) * distributionPairingℂReal ω (toComplex (g.translate a)) = _ - simp_all + simp_all only [gt_iff_lt, Real.norm_eq_abs, distributionPairingℂ_real_toComplex, ofReal_mul] rw [h_fun_eq] exact integral_complex_ofReal have h_S2_norm : ‖S₂ fC T_a_gC‖ = |SchwingerFunction₂ (gaussianFreeFieldFree m) f (g.translate @@ -276,7 +280,8 @@ lemma GFF_OS4_from_small_decay_real (m : ℝ) [Fact (0 < m)] _ = 2 * |SchwingerFunction₂ (gaussianFreeFieldFree m) f (g.translate a)| := by simp [norm_neg, h_S2_norm] _ < 2 * δ := by - simp_all + simp_all only [gt_iff_lt, Real.norm_eq_abs, norm_real, norm_neg, Nat.ofNat_pos, + mul_lt_mul_iff_right₀] /-! ## Main Theorem: OS4 for Gaussian Free Field -/ @@ -320,7 +325,7 @@ theorem schwartz_cross_covariance_decay_real (m : ℝ) [Fact (0 < m)] intro z hz simp only [Set.mem_compl_iff, Metric.mem_closedBall, dist_zero_right, not_le] at hz simp only [Set.mem_ofPred_eq, ne_eq] - exact norm_ne_zero_iff.mp (by linarith) + exact norm_ne_zero_iff.mp (by linarith only [hz]) have h_decay_tendsto : Filter.Tendsto (fun a => ∫ x : SpaceTime, ∫ y : SpaceTime, (toComplex f) x * (freeCovarianceKernel m (x - y) : ℂ) * (toComplex g) (y - a)) @@ -349,7 +354,7 @@ theorem schwartz_cross_covariance_decay_real (m : ℝ) [Fact (0 < m)] have := hR_bound ha_in simp only [Metric.mem_ball, dist_zero_right] at this have : ‖a‖ ≤ R := le_of_lt this - linarith [lt_of_le_of_lt (le_max_left R 1) ha] + linarith only [ha, this, lt_of_le_of_lt (le_max_left R 1) ha] -- Apply the decay bound from cocompact membership have h_int_bound := hK_compl ha_not_in_K simp only [Set.mem_ofPred_eq, dist_zero_right] at h_int_bound @@ -703,7 +708,7 @@ theorem gaussianFreeField_satisfies_OS4_PolynomialClustering (m : ℝ) [Fact (0 apply mul_le_mul h_bound · apply Real.exp_le_exp.mpr h_bound · exact Real.exp_nonneg _ - · exact mul_nonneg hc_nonneg (Real.rpow_nonneg (by linarith : 0 ≤ 1 + t) _) + · exact mul_nonneg hc_nonneg (Real.rpow_nonneg (by linarith only [ht] : 0 ≤ 1 + t) _) _ ≤ ‖Ef‖ * ‖Eg‖ * (c_decay * (1 + t)^(-α) * Real.exp c_decay) := by apply mul_le_mul_of_nonneg_left _ (mul_nonneg (norm_nonneg _) (norm_nonneg _)) apply mul_le_mul_of_nonneg_left _ (mul_nonneg hc_nonneg (Real.rpow_nonneg (by linarith) _)) @@ -713,8 +718,8 @@ theorem gaussianFreeField_satisfies_OS4_PolynomialClustering (m : ℝ) [Fact (0 apply mul_le_mul_of_nonneg_left _ hc_nonneg -- Use: for x ≥ 1 and z ≤ 0, x^z ≤ 1 apply Real.rpow_le_one_of_one_le_of_nonpos - · linarith -- 1 ≤ 1 + t - · linarith -- -α ≤ 0 + · linarith only [ht] -- 1 ≤ 1 + t + · linarith only [hα] -- -α ≤ 0 _ = c_decay := by ring _ = final_c * (1 + t)^(-α) := by ring diff --git a/LeanPool/OSforGFF/OS/OS4Ergodicity.lean b/LeanPool/OSforGFF/OS/OS4Ergodicity.lean index 13a98be08a..a0ff728cd7 100644 --- a/LeanPool/OSforGFF/OS/OS4Ergodicity.lean +++ b/LeanPool/OSforGFF/OS/OS4Ergodicity.lean @@ -104,12 +104,14 @@ private lemma timeTranslated_exp_stronglyMeasurable (s : ℝ) (f : TestFunction /-- The integral of a constant `c : ℂ` over `Icc 0 T` (with `T ≥ 0`) is `T * c`. -/ private lemma setIntegral_const_Icc_zero {T : ℝ} (hT : 0 ≤ T) (c : ℂ) : ∫ _s in Set.Icc (0 : ℝ) T, c = T * c := by - simp_all + simp_all only [integral_const, MeasurableSet.univ, measureReal_restrict_apply, Set.univ_inter, + volume_real_Icc, sub_zero, sup_of_le_left, Complex.real_smul] /-- A constant `ℂ`-valued function is integrable on `Icc 0 T`. -/ private lemma integrableOn_const_Icc_zero (T : ℝ) (c : ℂ) : MeasureTheory.IntegrableOn (fun _ : ℝ => c) (Set.Icc 0 T) MeasureTheory.volume := by - simp_all + simp_all only [ne_eq, enorm_ne_top, not_false_eq_true, integrableOn_const_iff, enorm_eq_zero, + volume_Icc, sub_zero, ENNReal.ofReal_lt_top, or_true] /-- The GFF exponential is integrable with respect to the GFF measure. -/ lemma gff_exp_pairing_integrable (m : ℝ) [Fact (0 < m)] (f : TestFunctionℂ) : @@ -181,13 +183,13 @@ lemma gff_exp_time_translated_memLp_two (m : ℝ) [Fact (0 < m)] (s : ℝ) (f : apply Real.exp_le_exp.mpr have h_le : ω (complexTestFunctionDecompose g).1 ≤ |ω (complexTestFunctionDecompose g).1| := le_abs_self _ - linarith + linarith only [h_le] -- Conclude MemLp 2 via domination rw [MeasureTheory.memLp_two_iff_integrable_sq_norm h_meas] have h_sq_meas : AEStronglyMeasurable (fun ω => ‖Complex.exp (distributionPairingℂReal ω g)‖^2) (gaussianFreeFieldFree m).toMeasure := h_meas.norm.pow 2 apply h_dom.mono' h_sq_meas - simp_all + simp_all only [norm_pow, norm_norm, Filter.eventually_true] /-! ## GFF Time Translation Invariance -/ @@ -195,7 +197,7 @@ lemma gff_exp_time_translated_memLp_two (m : ℝ) [Fact (0 < m)] (s : ℝ) (f : lemma timeTranslationSchwartzℂ_conj_comm (t : ℝ) (f : TestFunctionℂ) : timeTranslationSchwartzℂ t (conjSchwartz f) = conjSchwartz (timeTranslationSchwartzℂ t f) := by ext x - simp_all + simp_all only [timeTranslationSchwartzℂ_apply, conjSchwartz_apply] /-- The product exp(⟨ω, T_t g₁⟩) · conj(exp(⟨ω, T_t g₂⟩)) integral is time-shift invariant. This follows from the GFF characteristic function and covariance time-translation invariance. @@ -220,7 +222,7 @@ lemma gff_exp_product_time_shift_invariant (m : ℝ) [Fact (0 < m)] (g₁ g₂ : distributionPairingℂReal ω f + distributionPairingℂReal ω g = distributionPairingℂReal ω (f + g) := fun ω f g => by have := pairing_linear_combo ω f g 1 1 - simp_all + simp_all only [one_smul, one_mul] simp_rw [h_add] -- T_t f + T_t g = T_t(f + g) have h_T_add : ∀ (f g : TestFunctionℂ), @@ -345,7 +347,7 @@ lemma gff_err_sq_integrable (m : ℝ) [Fact (0 < m)] (T : ℝ) (hT : T > 0) (f : -- Goal matches h_sq_int up to notation: smul ↔ mul, and ∫ ω' ... ↔ EA have h_EA : ∫ ω' : FieldConfiguration, Complex.exp (distributionPairingℂReal ω' f) ∂μ = EA := by simp only [EA, A] - simp_all + simp_all only [gt_iff_lt, one_div, timeTranslationDistribution_zero] -- Rewrite the goal to match h_sq_int have h_eq : (fun ω => ‖((1 : ℝ) / T) • (∫ s in Set.Icc (0 : ℝ) T, Complex.exp (distributionPairingℂReal (timeTranslationDistribution s ω) f)) @@ -375,7 +377,7 @@ lemma double_integral_decay_bound : intro T hT calc ∫ s in Set.Icc (0 : ℝ) T, ∫ u in Set.Icc (0 : ℝ) T, (1 + |s - u|)^(-(3 : ℝ)) ≤ C₀ * T := hC₀_bound T hT - _ ≤ 2 * T * C₀ := by nlinarith + _ ≤ 2 * T * C₀ := by nlinarith only [hC₀_pos, hT] /-- Product expectation stationarity. -/ lemma gff_product_expectation_stationarity (m : ℝ) [Fact (0 < m)] (f : TestFunctionℂ) @@ -432,7 +434,7 @@ lemma gff_covariance_timeTranslation_continuous (m : ℝ) [Fact (0 < m)] obtain ⟨Cg, hCg⟩ := bounded_of_continuous_tendsto_zero g.continuous (schwartz_tendsto_zero g) -- Time translation preserves the bound have hTsf_bdd : ∀ s x, ‖(timeTranslationSchwartzℂ s f) x‖ ≤ Cf := by - simp_all + simp_all only [timeTranslationSchwartzℂ_apply, implies_true] -- Convert to product integral for continuous_of_dominated have h_fubini : ∀ s, ∫ x, ∫ y, (timeTranslationSchwartzℂ s f) x * (freeCovariance m x y : ℂ) * g y = @@ -478,7 +480,8 @@ lemma gff_covariance_timeTranslation_continuous (m : ℝ) [Fact (0 < m)] have hK_norm : Integrable (fun z => ‖(freeCovarianceKernel m z : ℂ)‖) (volume : Measure SpaceTime) := by have := hK_int.norm - simp_all + simp_all only [timeTranslationSchwartzℂ_apply, implies_true, Complex.norm_mul, + Complex.norm_real, norm_eq_abs, Prod.forall] have h_eq3 : (fun p : SpaceTime × SpaceTime => ‖(freeCovarianceKernel m (p.1 - p.2) : ℂ)‖ * ‖g p.2‖) = (fun p => ‖g p.2‖ * ‖(freeCovarianceKernel m (p.1 - p.2) : ℂ)‖) := by ext p; ring @@ -708,7 +711,8 @@ lemma L2_time_average_variance_bound (m : ℝ) [Fact (0 < m)] (f : TestFunction _ = ‖∫ ω, ‖(T⁻¹ : ℂ) * (∫ s in Set.Icc (0 : ℝ) T, A s ω) - EA‖^2 ∂μ‖ := h_lhs_eq.symm _ ≤ T⁻¹^2 * ‖∫ s in Set.Icc (0 : ℝ) T, ∫ u in Set.Icc (0 : ℝ) T, Cov s u‖ := h_axiom _ ≤ T⁻¹^2 * ∫ s in Set.Icc (0 : ℝ) T, ∫ u in Set.Icc (0 : ℝ) T, ‖Cov s u‖ := by - simp_all + simp_all only [gt_iff_lt, map_sub, inv_pow, norm_eq_abs, abs_eq_self, one_div, inv_pos, + pow_succ_pos, mul_le_mul_iff_right₀] /-! ## Clustering Implies Covariance Decay -/ @@ -765,7 +769,7 @@ private lemma clustering_decay_at (m : ℝ) [Fact (0 < m)] (f : TestFunctionℂ) _ ≤ c_ff * (1 + t)^(-(6:ℝ)) := hc_ff t ht _ ≤ c_ff * (1 + t)^(-(3:ℝ)) := by apply mul_le_mul_of_nonneg_left _ hc_ff_nonneg - exact Real.rpow_le_rpow_of_exponent_le (by linarith) (by norm_num : (-6 : ℝ) ≤ -3) + exact Real.rpow_le_rpow_of_exponent_le (by linarith only [ht]) (by norm_num : (-6 : ℝ) ≤ -3) /-- OS4'' clustering implies covariance decay with exponent -3. -/ lemma clustering_implies_covariance_decay (m : ℝ) [Fact (0 < m)] (f : TestFunctionℂ) @@ -793,8 +797,8 @@ lemma clustering_implies_covariance_decay (m : ℝ) [Fact (0 < m)] (f : TestFunc exact clustering_decay_at m f c_ff hc_ff_nonneg hc_ff (s - u) (sub_nonneg.mpr h_sign) · -- Case s < u: |s - u| = u - s push Not at h_sign - rw [show |s - u| = u - s by rw [abs_sub_comm]; exact abs_of_nonneg (by linarith)] - have h_nonneg : u - s ≥ 0 := by linarith + rw [show |s - u| = u - s by rw [abs_sub_comm]; exact abs_of_nonneg (by linarith only [h_sign])] + have h_nonneg : u - s ≥ 0 := by linarith only [h_sign] -- By norm conjugation symmetry, swap A(s-u) and A(0), then apply stationarity with shift u - s have h_norm_eq : ‖∫ ω, A (s - u) ω * starRingEnd ℂ (A 0 ω) ∂μ - EA * starRingEnd ℂ EA‖ = ‖∫ ω, A 0 ω * starRingEnd ℂ (A (s - u) ω) ∂μ - EA * starRingEnd ℂ EA‖ := by @@ -888,7 +892,7 @@ lemma variance_decay_from_clustering (m : ℝ) [Fact (0 < m)] (f : TestFunction · intro x left -- 1 + |x.1 - x.2| ≥ 1 > 0, so never zero - linarith [abs_nonneg (x.1 - x.2)] + linarith only [abs_nonneg (x.1 - x.2)] have h_cov_double_bound : ∫ s in Set.Icc (0 : ℝ) T, ∫ u in Set.Icc (0 : ℝ) T, ‖Cov s u‖ ≤ c * (2 * T * C) := by -- First bound by ∫∫ c·(1+|s-u|)^{-3} @@ -930,7 +934,7 @@ lemma variance_decay_from_clustering (m : ℝ) [Fact (0 < m)] (f : TestFunction simp_rw [MeasureTheory.integral_const_mul] -- Now: c * ∫∫ (1+|s-u|)^{-3} ≤ c * (2*T*C) exact mul_le_mul_of_nonneg_left h_double_T hc - linarith + linarith only [h1, h2] -- Rewrite goal to match h_var's form -- The subtraction `∫ exp - mean` needs to become `(∫ exp) - mean` after scaling have h_goal_eq : ∀ ω, ‖(1 / T) * (∫ s in Set.Icc (0 : ℝ) T, @@ -959,7 +963,9 @@ lemma variance_decay_from_clustering (m : ℝ) [Fact (0 < m)] (f : TestFunction calc ∫ ω, ‖(1 / T) * (∫ s in Set.Icc (0 : ℝ) T, A s ω) - EA‖^2 ∂μ ≤ (1 / T^2) * ∫ s in Set.Icc (0 : ℝ) T, ∫ u in Set.Icc (0 : ℝ) T, ‖Cov s u‖ := h_var _ ≤ (1 / T^2) * (c * (2 * T * C)) := by - simp_all + simp_all only [ge_iff_le, rpow_neg_ofNat, Int.reduceNeg, zpow_neg, zpow_ofNat, + gt_iff_lt, one_div, Set.mem_Icc, and_imp, Complex.norm_mul, norm_inv, + Complex.norm_real, norm_eq_abs, inv_pos, pow_succ_pos, mul_le_mul_iff_right₀] _ = 2 * c * C / T := by field_simp -- 2·c·C / T → 0 as T → ∞ have h_tends : Filter.Tendsto (fun T : ℝ => 2 * c * C / T) Filter.atTop (nhds 0) := by @@ -990,11 +996,11 @@ lemma norm_sq_weighted_sum_le {n : ℕ} (w : Fin n → ℂ) (a : Fin n → ℂ) calc ‖∑ j, w j * a j‖ ≤ ∑ j, ‖w j * a j‖ := norm_sum_le _ _ _ = ∑ j, ‖w j‖ * ‖a j‖ := by simp_rw [norm_mul] have h2 : ‖∑ j, w j * a j‖^2 ≤ (∑ j, ‖w j‖ * ‖a j‖)^2 := - sq_le_sq' (by nlinarith [norm_nonneg (∑ j, w j * a j)]) h1 + sq_le_sq' (by linarith only [h1, norm_nonneg (∑ j, w j * a j)]) h1 have h3 : (∑ j : Fin n, ‖w j‖ * ‖a j‖)^2 ≤ (∑ j, ‖w j‖^2) * (∑ j, ‖a j‖^2) := by have := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ (fun j => ‖w j‖) (fun j => ‖a j‖) exact this - linarith + linarith only [h2, h3] /-- OS4' → OS4: Generating function ergodicity implies full ergodicity. @@ -1158,7 +1164,7 @@ theorem OS4'_implies_OS4 (m : ℝ) [Fact (0 < m)] : convert h_sum using 1 ext ω simp only [Finset.sum_apply] - · simp_all + · simp_all only [gt_iff_lt, one_div, norm_pow, norm_norm, Filter.eventually_true] -- Integrate calc ∫ ω, ‖(1 / T) * ∫ s in Set.Icc (0 : ℝ) T, A (timeTranslationDistribution s ω) - ∫ ω', A ω' ∂μ‖^2 ∂μ diff --git a/LeanPool/OSforGFF/OS/OS4MGF.lean b/LeanPool/OSforGFF/OS/OS4MGF.lean index f8eea75959..0980ef20b0 100644 --- a/LeanPool/OSforGFF/OS/OS4MGF.lean +++ b/LeanPool/OSforGFF/OS/OS4MGF.lean @@ -171,7 +171,7 @@ lemma gff_mgf_formula (m : ℝ) [Fact (0 < m)] (J : TestFunctionℂ) : simp only [negI] ring_nf simp [Complex.I_sq] - simp_all + simp_all only [one_div, mul_neg, neg_mul, neg_neg] /-- The GFF generating function is invariant under time translation. -/ lemma gff_generating_time_invariant (m : ℝ) [Fact (0 < m)] (s : ℝ) (f : TestFunctionℂ) : @@ -221,12 +221,12 @@ lemma exp_sub_one_bound_general (x : ℂ) : ‖Complex.exp x - 1‖ ≤ ‖x‖ have h2 : Real.exp ‖x‖ - 1 ≤ ‖x‖ * Real.exp ‖x‖ := by by_cases hr1 : ‖x‖ ≤ 1 · have hle : 1 - Real.exp (-‖x‖) ≤ ‖x‖ := by - have := Real.add_one_le_exp (-‖x‖); linarith + have := Real.add_one_le_exp (-‖x‖); linarith only [this] have hkey : Real.exp ‖x‖ - 1 = Real.exp ‖x‖ * (1 - Real.exp (-‖x‖)) := by rw [Real.exp_neg]; field_simp - nlinarith [mul_le_mul_of_nonneg_left hle (le_of_lt hexp_pos)] + linarith only [hexp_pos, hle, hkey, mul_le_mul_of_nonneg_left hle (le_of_lt hexp_pos)] · push Not at hr1 - nlinarith [(le_mul_iff_one_le_left hexp_pos).mpr (le_of_lt hr1)] - linarith + linarith only [hexp_pos, hr1, (le_mul_iff_one_le_left hexp_pos).mpr (le_of_lt hr1)] + linarith only [h1, h2] end OS4infra diff --git a/LeanPool/OSforGFF/Schwinger/GaussianMoments.lean b/LeanPool/OSforGFF/Schwinger/GaussianMoments.lean index 0ea18088a0..0a42f4dbd8 100644 --- a/LeanPool/OSforGFF/Schwinger/GaussianMoments.lean +++ b/LeanPool/OSforGFF/Schwinger/GaussianMoments.lean @@ -94,7 +94,8 @@ lemma gaussian_complex_pairing_abs_sq_integrable -- Final simplification: a + (-0) = a simp only [neg_zero, add_zero] -- Finish by using integrability of the individual squares - simp_all + simp_all only [distributionPairingCLM, ContinuousLinearMap.coe_mk', LinearMap.coe_mk, + AddHom.coe_mk, integrable_add_iff_integrable_right'] end GaussianMoments @@ -222,7 +223,8 @@ theorem gaussian_pairing_product_integrable_free_2point distributionPairing ω φIm * distributionPairing ω ψIm : ℂ)) = (fun ω => ↑(distributionPairing ω φRe * distributionPairing ω ψRe - distributionPairing ω φIm * distributionPairing ω ψIm)) := by - simp_all + simp_all only [distributionPairingCLM, ContinuousLinearMap.coe_mk', LinearMap.coe_mk, + AddHom.coe_mk, ofReal_sub, ofReal_mul] rw [h_cast] exact Integrable.ofReal h_ac_bd have h_imag_part : Integrable (fun ω => Complex.I * (distributionPairing ω φRe * @@ -235,7 +237,8 @@ theorem gaussian_pairing_product_integrable_free_2point distributionPairing ω φIm * distributionPairing ω ψRe : ℂ)) = (fun ω => ↑(distributionPairing ω φRe * distributionPairing ω ψIm + distributionPairing ω φIm * distributionPairing ω ψRe)) := by - simp_all + simp_all only [distributionPairingCLM, ContinuousLinearMap.coe_mk', LinearMap.coe_mk, + AddHom.coe_mk, ofReal_add, ofReal_mul] rw [h_cast] exact Integrable.ofReal h_ad_bc exact Integrable.add h_real_part h_imag_part diff --git a/LeanPool/OSforGFF/Schwinger/TwoPoint.lean b/LeanPool/OSforGFF/Schwinger/TwoPoint.lean index 6132419abb..7f6658842e 100644 --- a/LeanPool/OSforGFF/Schwinger/TwoPoint.lean +++ b/LeanPool/OSforGFF/Schwinger/TwoPoint.lean @@ -155,7 +155,7 @@ theorem smearedTwoPoint_tendsto_schwingerTwoPoint (bumpToSchwartz (φ i)) = ∫ u, ∫ v, (translateSchwartz (bumpToSchwartz (φ i)) x) u * C (u - v) * (bumpToSchwartz (φ i)) v := by - simp_all + simp_all only [ne_eq, bumpToSchwartz_apply, implies_true] simp_rw [h_eq] -- bumpToSchwartz produces the normed bump, so we can directly apply double_mollifier_convergence -- translateSchwartz is SchwartzMap.translate, which shifts by x diff --git a/LeanPool/OSforGFF/Spacetime/ComplexTestFunction.lean b/LeanPool/OSforGFF/Spacetime/ComplexTestFunction.lean index a44f2a8ed3..6ba58536b9 100644 --- a/LeanPool/OSforGFF/Spacetime/ComplexTestFunction.lean +++ b/LeanPool/OSforGFF/Spacetime/ComplexTestFunction.lean @@ -89,7 +89,7 @@ lemma ω_re_decompose_linear add_re, mul_re, imCLM_apply] ring -- Apply ω (a real-linear functional) to both sides - simp_all + simp_all only [map_sub, map_add, map_smul, smul_eq_mul] /-- ω-linearity of the imaginary component of the complex test-function decomposition under complex linear combinations. @@ -118,7 +118,7 @@ lemma ω_im_decompose_linear add_im, mul_im, reCLM_apply] ring -- Apply ω (a real-linear functional) to both sides - simp_all + simp_all only [map_add, map_smul, smul_eq_mul] /-- Linearity of the complex pairing in the test-function argument. -/ lemma pairing_linear_combo @@ -150,7 +150,9 @@ lemma pairing_linear_combo -- Use ω-linearity identity on the LHS have hre := ω_re_decompose_linear ω f g t s -- Finish by rewriting both sides to the same expression - simp_all + simp_all only [add_re, mul_re, ofReal_re, I_re, zero_mul, I_im, ofReal_im, mul_zero, sub_self, + add_zero, add_im, mul_im, one_mul, zero_add, ofReal_sub, ofReal_add, ofReal_mul, sub_re, + sub_zero] · -- Imag parts simp only [distributionPairingℂReal, add_im, mul_im] have him_rhs : @@ -168,7 +170,8 @@ lemma pairing_linear_combo ((ω ((complexTestFunctionDecompose g).1) : ℂ) + I * (ω ((complexTestFunctionDecompose g).2) : ℂ)) have him := ω_im_decompose_linear ω f g t s - simp_all + simp_all only [add_im, mul_im, ofReal_im, I_re, mul_zero, I_im, ofReal_re, one_mul, zero_add, + add_re, mul_re, zero_mul, sub_self, add_zero, ofReal_add, ofReal_mul, sub_zero] /-! ## Helper lemmas for real→complex Schwartz embedding -/ @@ -190,7 +193,8 @@ lemma norm_compContinuousMultilinearMap_ofReal {n : ℕ} {E : Fin n → Type*} _ = ‖m‖ := by rw [Complex.norm_ofRealCLM, one_mul] · refine ContinuousMultilinearMap.opNorm_le_bound (norm_nonneg _) (fun v => ?_) rw [show ‖m v‖ = ‖(Complex.ofRealCLM.compContinuousMultilinearMap m) v‖ from by - simp_all] + simp_all only [Real.norm_eq_abs, ContinuousLinearMap.compContinuousMultilinearMap_coe, + Function.comp_apply, ofRealCLM_apply, norm_real]] exact (Complex.ofRealCLM.compContinuousMultilinearMap m).le_opNorm v /-- The norm of the n-th iterated derivative of a Schwartz function composed with @@ -363,9 +367,10 @@ lemma distributionPairingℂ_real_conj (ω : FieldConfiguration) (f : TestFuncti have h_conj_re : (complexTestFunctionDecompose (conjSchwartz f)).1 = (complexTestFunctionDecompose f).1 := by ext x - simp_all + simp_all only [complex_testfunction_decompose_fst_apply, conjSchwartz_apply, conj_re] have h_conj_im : (complexTestFunctionDecompose (conjSchwartz f)).2 = -(complexTestFunctionDecompose f).2 := by ext x - simp_all - simp_all + simp_all only [complex_testfunction_decompose_snd_apply, conjSchwartz_apply, conj_im, + neg_apply] + simp_all only [map_add, conj_ofReal, map_mul, conj_I, neg_mul, map_neg, ofReal_neg, mul_neg] diff --git a/LeanPool/OSforGFF/Spacetime/DiscreteSymmetry.lean b/LeanPool/OSforGFF/Spacetime/DiscreteSymmetry.lean index f7b8da37e7..a558585276 100644 --- a/LeanPool/OSforGFF/Spacetime/DiscreteSymmetry.lean +++ b/LeanPool/OSforGFF/Spacetime/DiscreteSymmetry.lean @@ -89,7 +89,8 @@ lemma timeReflection_inner_map (x y : SpaceTime) : @[simp] lemma timeReflection_involutive (x : SpaceTime) : timeReflection (timeReflection x) = x := by refine PiLp.ext fun i => ?_ - simp_all + simp_all only [WithLp.equiv_symm_apply_ofLp, Fin.isValue, Function.update_self, neg_neg, + Function.update_idem, Function.update_eq_self] /-- The `timeReflectionLE` declaration. -/ def timeReflectionLE : SpaceTime ≃ₗᵢ[ℝ] SpaceTime := @@ -126,7 +127,7 @@ private lemma timeReflection_hg_upper : refine ⟨1, 1, fun x => ?_⟩ have h_iso : ‖timeReflectionCLM x‖ = ‖x‖ := by rw [← LinearIsometryEquiv.norm_map timeReflectionLE x]; rfl - simp_all + simp_all only [pow_one, one_mul, le_add_iff_nonneg_left, zero_le_one] /-- The `compTimeReflection` declaration. -/ noncomputable def compTimeReflection : TestFunctionℂ →L[ℝ] TestFunctionℂ := diff --git a/LeanPool/OSforGFF/Spacetime/Euclidean.lean b/LeanPool/OSforGFF/Spacetime/Euclidean.lean index 86aeaadea0..d2dd5b899b 100644 --- a/LeanPool/OSforGFF/Spacetime/Euclidean.lean +++ b/LeanPool/OSforGFF/Spacetime/Euclidean.lean @@ -241,7 +241,7 @@ private theorem act_inv_poly_bound (g : E) : _ = ‖x‖ + ‖g⁻¹.t‖ := by rw [g⁻¹.R.norm_map x] _ ≤ (1 + ‖g⁻¹.t‖) * (1 + ‖x‖)^1 := by simp only [pow_one] - nlinarith [norm_nonneg x, norm_nonneg g⁻¹.t] + nlinarith only [norm_nonneg x, norm_nonneg g⁻¹.t] /-! ### Unified Action of Euclidean group on function spaces --------- UNIFIED EUCLIDEAN ACTION FRAMEWORK @@ -287,7 +287,7 @@ lemma euclidean_pullback_polynomial_bounds (g : E) : calc ‖g⁻¹.R x‖ ≤ ‖g⁻¹.R x + g⁻¹.t‖ + ‖g⁻¹.t‖ := norm_le_add_norm_add _ _ _ ≤ (1 + ‖g⁻¹.t‖) * (1 + ‖g⁻¹.R x + g⁻¹.t‖) := by - nlinarith [norm_nonneg (g⁻¹.R x + g⁻¹.t), norm_nonneg g⁻¹.t] + nlinarith only [norm_nonneg (g⁻¹.R x + g⁻¹.t), norm_nonneg g⁻¹.t] /-- Action of Euclidean group on test functions via pullback. For g ∈ E and f ∈ TestFunctionℂ, define (g • f)(x) = f(g⁻¹ • x). diff --git a/LeanPool/OSforGFF/Spacetime/PositiveTimeTestFunction.lean b/LeanPool/OSforGFF/Spacetime/PositiveTimeTestFunction.lean index a2ef2339e2..3365808d12 100644 --- a/LeanPool/OSforGFF/Spacetime/PositiveTimeTestFunction.lean +++ b/LeanPool/OSforGFF/Spacetime/PositiveTimeTestFunction.lean @@ -97,7 +97,7 @@ lemma PositiveTimeTestFunctionℂ.zero_on_nonpositive refine image_eq_zero_of_notMem_tsupport (fun hx_mem => ?_) have hx_pos : getTimeComponent x > 0 := by simpa [positiveTimeSet, HasPositiveTime] using f.property hx_mem - linarith + linarith only [hx, hx_pos] /-- Helper lemma: starRingEnd ℂ commutes through derivatives and preserves norms -/ lemma starRingEnd_iteratedFDeriv_norm_eq (g : TestFunctionℂ) (n : ℕ) (x : SpaceTime) : @@ -105,7 +105,7 @@ lemma starRingEnd_iteratedFDeriv_norm_eq (g : TestFunctionℂ) (n : ℕ) (x : Sp -- Use the fact that starRingEnd ℂ = Complex.conjLIE (as functions) have h : (fun x => starRingEnd ℂ (g x)) = Complex.conjLIE ∘ g := by ext y - simp_all + simp_all only [comp_apply, Complex.conjLIE_apply] rw [h] -- Now apply the norm preservation lemma for LinearIsometryEquiv exact LinearIsometryEquiv.norm_iteratedFDeriv_comp_left Complex.conjLIE g x n @@ -142,6 +142,6 @@ lemma PositiveTimeTestFunction.zero_on_nonpositive refine image_eq_zero_of_notMem_tsupport (fun hx_mem => ?_) have hx_pos : getTimeComponent x > 0 := by simpa [positiveTimeSet, HasPositiveTime] using f.property hx_mem - linarith + linarith only [hx, hx_pos] end diff --git a/LeanPool/OSforGFF/Spacetime/ProdIntegrable.lean b/LeanPool/OSforGFF/Spacetime/ProdIntegrable.lean index 14a7305ca4..4c96894bcd 100644 --- a/LeanPool/OSforGFF/Spacetime/ProdIntegrable.lean +++ b/LeanPool/OSforGFF/Spacetime/ProdIntegrable.lean @@ -6,7 +6,6 @@ Authors: Michael R. Douglas, Sarah Hoback, Anna Mei, Ron Nissim module public import LeanPool.OSforGFF.Spacetime.Basic -import LeanPool.OSforGFF.General.FunctionalAnalysis import Mathlib.Analysis.SpecialFunctions.Gamma.Basic import Mathlib.Data.Nat.Factorial.DoubleFactorial @@ -35,7 +34,7 @@ section SpaceTime /-- `‖iteratedFDeriv ℝ 1 f y‖ = ‖fderiv ℝ f y‖` via the curry isometry. -/ private lemma norm_iteratedFDeriv_one_eq (f : TestFunctionℂ) (y : SpaceTime) : ‖iteratedFDeriv ℝ 1 f y‖ = ‖fderiv ℝ f y‖ := by - simp_all + simp_all only [norm_iteratedFDeriv_one] /-- For a Schwartz function vanishing on {x₀ ≤ 0}, the linear bound ‖f(x)‖ ≤ C · x₀ holds. Follows from mean value theorem + global derivative bounds on Schwartz functions. @@ -88,7 +87,8 @@ theorem schwartz_vanishing_linear_bound (f : TestFunctionℂ) exact f.differentiableAt.hasFDerivAt.hasFDerivWithinAt -- Connection: ‖fderiv ℝ f y‖ = ‖iteratedFDeriv ℝ 1 f y‖ (via curry isomorphism) have h_fderiv_bound : ∀ y ∈ (Set.univ : Set SpaceTime), ‖fderiv ℝ f y‖ ≤ C_deriv := by - simp_all + simp_all only [Fin.isValue, pow_zero, norm_iteratedFDeriv_one, one_mul, Std.le_refl, mem_univ, + hasFDerivWithinAt_univ, forall_const] -- Apply the Mean Value Theorem (Convex.norm_image_sub_le_of_norm_hasFDerivWithin_le) -- Note: The lemma gives ‖f y - f x‖ ≤ C * ‖y - x‖, so we need to swap x and x₀_bdy have h_mvt := h_convex.norm_image_sub_le_of_norm_hasFDerivWithin_le @@ -98,7 +98,7 @@ theorem schwartz_vanishing_linear_bound (f : TestFunctionℂ) _ = ‖f x - f x₀_bdy‖ := by rw [hf_bdy] _ ≤ C_deriv * ‖x - x₀_bdy‖ := h_mvt _ = C_deriv * (x 0) := by rw [h_dist] - _ ≤ (C_deriv + 1) * (x 0) := by nlinarith [hx_pos] + _ ≤ (C_deriv + 1) * (x 0) := by linarith only [hx_pos] /-! ## Integrate over space first (Fubini approach) @@ -169,7 +169,7 @@ lemma spacetimeOfTimeSpace_norm_ge (t : ℝ) (x : SpatialCoords3) : simp only [h1, h2, h3] ring have hsq_le : ‖x‖ ^ 2 ≤ ‖spacetimeOfTimeSpace t x‖ ^ 2 := by - rw [hsq]; nlinarith [sq_nonneg t] + rw [hsq]; linarith only [sq_nonneg t] have hx : 0 ≤ ‖x‖ := norm_nonneg _ have hy : 0 ≤ ‖spacetimeOfTimeSpace t x‖ := norm_nonneg _ exact (sq_le_sq₀ hx hy).mp hsq_le @@ -224,7 +224,7 @@ lemma schwartz_time_slice_integrable (f : TestFunctionℂ) (t : ℝ) : -- -- Use Schwartz decay bound from FunctionalAnalysis have hST_dim : Module.finrank ℝ SpaceTime < 5 := by - simp_all + simp_all only [finrank_euclideanSpace, Fintype.card_fin, Nat.lt_add_one] obtain ⟨C, hC_pos, hf_decay⟩ := schwartz_integrable_decay f 5 hST_dim -- Note: SpatialCoords3 has dimension 3, and we need N > dim, so N = 5 > 3 works -- The dominator function: x ↦ C / (1 + ‖x‖)^5 @@ -236,7 +236,7 @@ lemma schwartz_time_slice_integrable (f : TestFunctionℂ) (t : ℝ) : -- Convert between (1+‖x‖)^(-5:ℝ) and C/(1+‖x‖)^5 have h_eq : ∀ x : SpatialCoords3, C / (1 + ‖x‖) ^ 5 = C * (1 + ‖x‖) ^ (-(5 : ℝ)) := by intro x - have h_pos : 0 < 1 + ‖x‖ := by linarith [norm_nonneg x] + have h_pos : 0 < 1 + ‖x‖ := by linarith only [norm_nonneg x] have h1 : ((1 + ‖x‖) ^ 5)⁻¹ = (1 + ‖x‖) ^ (-(5 : ℝ)) := by rw [← Real.rpow_natCast (1 + ‖x‖) 5, ← Real.rpow_neg (le_of_lt h_pos)] simp @@ -254,10 +254,10 @@ lemma schwartz_time_slice_integrable (f : TestFunctionℂ) (t : ℝ) : -- This follows from ‖spacetimeOfTimeSpace t x‖ ≥ ‖x‖. have h_norm_ge : ‖spacetimeOfTimeSpace t x‖ ≥ ‖x‖ := spacetimeOfTimeSpace_norm_ge t x - have h_bracket_ge : 1 + ‖spacetimeOfTimeSpace t x‖ ≥ 1 + ‖x‖ := by linarith - have h_bracket_pos : 0 < 1 + ‖x‖ := by linarith [norm_nonneg x] + have h_bracket_ge : 1 + ‖spacetimeOfTimeSpace t x‖ ≥ 1 + ‖x‖ := by linarith only [h_norm_ge] + have h_bracket_pos : 0 < 1 + ‖x‖ := by linarith only [norm_nonneg x] have h_pow_le : (1 + ‖x‖)^5 ≤ (1 + ‖spacetimeOfTimeSpace t x‖)^5 := by - apply pow_le_pow_left₀ (by linarith [norm_nonneg x]) h_bracket_ge + apply pow_le_pow_left₀ (by linarith only [h_bracket_pos, norm_nonneg x]) h_bracket_ge calc ‖f (spacetimeOfTimeSpace t x)‖ ≤ C / (1 + ‖spacetimeOfTimeSpace t x‖)^5 := h1 _ ≤ C / (1 + ‖x‖)^5 := by @@ -335,16 +335,16 @@ lemma schwartz_vanishing_ftc_decay (f : TestFunctionℂ) -- For ‖y‖ ≥ 1: ‖Df‖ ≤ C_decay/‖y‖^4 ≤ 16*C_decay/(1+‖y‖)^4 -- For ‖y‖ < 1: ‖Df‖ ≤ C_unif ≤ 16*C_unif/(1+‖y‖)^4 since (1+‖y‖)^4 < 16 let C := 16 * (C_decay + C_unif) + 1 - have hC_pos : 0 < C := by simp only [C]; linarith + have hC_pos : 0 < C := by simp only [C]; linarith only [hC_decay_nn, hC_unif_nn] -- Key bound: ‖fderiv ℝ f y‖ ≤ C / (1 + ‖y‖)^4 have h_fderiv_decay : ∀ y : SpaceTime, ‖fderiv ℝ f y‖ ≤ C / (1 + ‖y‖)^4 := by intro y have h_norm_eq : ‖iteratedFDeriv ℝ 1 f y‖ = ‖fderiv ℝ f y‖ := norm_iteratedFDeriv_one_eq f y - have h1y : 0 < 1 + ‖y‖ := by linarith [norm_nonneg y] + have h1y : 0 < 1 + ‖y‖ := by linarith only [norm_nonneg y] have h1y_pow : 0 < (1 + ‖y‖)^4 := pow_pos h1y 4 by_cases hy_large : 1 ≤ ‖y‖ · -- Large ‖y‖ case: use decay' 4 1 - have hy_pos : 0 < ‖y‖ := by linarith + have hy_pos : 0 < ‖y‖ := by linarith only [hy_large] have hy_pow : 0 < ‖y‖^4 := pow_pos hy_pos 4 have h_raw := hC_decay y -- From ‖y‖^4 * ‖iteratedFDeriv 1 f y‖ ≤ C_decay, get ‖fderiv f y‖ ≤ C_decay / ‖y‖^4 @@ -355,24 +355,24 @@ lemma schwartz_vanishing_ftc_decay (f : TestFunctionℂ) -- Convert: 1 + ‖y‖ ≤ 2‖y‖ implies (1+‖y‖)^4 ≤ 16*‖y‖^4 have h_16 : (1 + ‖y‖)^4 ≤ 16 * ‖y‖^4 := by have : (1 + ‖y‖)^4 ≤ (2 * ‖y‖)^4 := by - apply pow_le_pow_left₀ (by linarith [norm_nonneg y]); linarith + apply pow_le_pow_left₀ (by linarith [norm_nonneg y]); linarith only [hy_large] calc (1 + ‖y‖)^4 ≤ (2 * ‖y‖)^4 := this _ = 16 * ‖y‖^4 := by ring have h_norm_ge : ‖y‖^4 ≥ (1 + ‖y‖)^4 / 16 := by - rw [ge_iff_le, div_le_iff₀ (by norm_num : (0:ℝ) < 16)]; linarith [h_16] + rw [ge_iff_le, div_le_iff₀ (by norm_num : (0:ℝ) < 16)]; linarith only [h_16] calc ‖fderiv ℝ f y‖ ≤ C_decay / ‖y‖^4 := h_fderiv_raw _ ≤ C_decay / ((1 + ‖y‖)^4 / 16) := by apply div_le_div_of_nonneg_left hC_decay_nn (div_pos h1y_pow (by norm_num)) h_norm_ge _ = 16 * C_decay / (1 + ‖y‖)^4 := by field_simp _ ≤ C / (1 + ‖y‖)^4 := by apply div_le_div_of_nonneg_right _ (le_of_lt h1y_pow) - simp only [C]; linarith + simp only [C]; linarith only [hC_unif_nn] · -- Small ‖y‖ case: use uniform bound C_unif push Not at hy_large -- For ‖y‖ < 1: (1+‖y‖)^4 < 16, so C_unif ≤ 16*C_unif/(1+‖y‖)^4 have h_bracket_small : (1 + ‖y‖)^4 ≤ 16 := by calc (1 + ‖y‖)^4 ≤ 2^4 := by - apply pow_le_pow_left₀ (by linarith [norm_nonneg y]); linarith + apply pow_le_pow_left₀ (by linarith [norm_nonneg y]); linarith only [hy_large] _ = 16 := by norm_num calc ‖fderiv ℝ f y‖ = ‖iteratedFDeriv ℝ 1 f y‖ := h_norm_eq.symm _ ≤ C_unif := h_unif y @@ -385,7 +385,7 @@ lemma schwartz_vanishing_ftc_decay (f : TestFunctionℂ) _ = 16 * C_unif / (1 + ‖y‖)^4 := by ring _ ≤ C / (1 + ‖y‖)^4 := by apply div_le_div_of_nonneg_right _ (le_of_lt h1y_pow) - simp only [C]; linarith + simp only [C]; linarith only [hC_decay_nn] -- Use C as the constant refine ⟨C, hC_pos, fun t ht x_sp => ?_⟩ -- Step 2: Segment bound - on path from (0, x_sp) to (t, x_sp), use spacetimeOfTimeSpace_norm_ge @@ -396,11 +396,11 @@ lemma schwartz_vanishing_ftc_decay (f : TestFunctionℂ) intros s _ _ have h_decay := h_fderiv_decay (spacetimeOfTimeSpace s x_sp) have h_norm_ge : ‖spacetimeOfTimeSpace s x_sp‖ ≥ ‖x_sp‖ := spacetimeOfTimeSpace_norm_ge s x_sp - have h1x : 0 < 1 + ‖x_sp‖ := by linarith [norm_nonneg x_sp] + have h1x : 0 < 1 + ‖x_sp‖ := by linarith only [norm_nonneg x_sp] have h1x_pow : 0 < (1 + ‖x_sp‖)^4 := pow_pos h1x 4 have h_bracket : (1 + ‖spacetimeOfTimeSpace s x_sp‖)^4 ≥ (1 + ‖x_sp‖)^4 := by - apply pow_le_pow_left₀ (by linarith [norm_nonneg x_sp]) - linarith [h_norm_ge] + apply pow_le_pow_left₀ (by linarith only [h1x, norm_nonneg x_sp]) + linarith only [h_norm_ge] calc ‖fderiv ℝ f (spacetimeOfTimeSpace s x_sp)‖ ≤ C / (1 + ‖spacetimeOfTimeSpace s x_sp‖)^4 := h_decay _ ≤ C / (1 + ‖x_sp‖)^4 := by @@ -412,7 +412,7 @@ lemma schwartz_vanishing_ftc_decay (f : TestFunctionℂ) let x := spacetimeOfTimeSpace t x_sp let x₀_bdy := spacetimeOfTimeSpace 0 x_sp have hf_bdy : f x₀_bdy = 0 := hf_supp x₀_bdy (by rw [spacetimeOfTimeSpace_time]) - have h1x : 0 < 1 + ‖x_sp‖ := by linarith [norm_nonneg x_sp] + have h1x : 0 < 1 + ‖x_sp‖ := by linarith only [norm_nonneg x_sp] have h1x_pow : 0 < (1 + ‖x_sp‖)^4 := pow_pos h1x 4 -- Compute ‖x - x₀_bdy‖ = t have h_dist : ‖x - x₀_bdy‖ = t := by @@ -436,9 +436,11 @@ lemma schwartz_vanishing_ftc_decay (f : TestFunctionℂ) 0 1 have h3 : (spacetimeOfTimeSpace t 0 : SpaceTime).ofLp 3 = 0 := spacetimeOfTimeSpace_spatial t 0 2 - simp_all + simp_all only [Fin.isValue, norm_iteratedFDeriv_one, pow_zero, one_mul, pow_succ_pos, + norm_eq_abs, sq_abs, norm_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, + add_zero] have hnorm : 0 ≤ ‖spacetimeOfTimeSpace t 0‖ := norm_nonneg _ - nlinarith [sq_nonneg ‖spacetimeOfTimeSpace t 0‖, sq_nonneg t, hsq, ht] + nlinarith only [ht, hsq, hnorm, sq_nonneg ‖spacetimeOfTimeSpace t 0‖, sq_nonneg t] -- Apply 1D MVT via parameterization F(s) = f(spacetimeOfTimeSpace s x_sp) -- F : ℝ → ℂ is differentiable, and we have ‖F'(s)‖ ≤ C/(1+‖x_sp‖)^4 on [0,t] -- Define F @@ -518,7 +520,7 @@ lemma schwartz_vanishing_ftc_decay (f : TestFunctionℂ) -- Step 3: derivWithin equals the computed derivative have h_deriv_eq : derivWithin F (Set.Icc 0 t) s = (fderiv ℝ f (spacetimeOfTimeSpace s x_sp)) e₀ := - h_F_deriv.derivWithin (uniqueDiffOn_Icc (by linarith : (0 : ℝ) < t) s h_in_Icc) + h_F_deriv.derivWithin (uniqueDiffOn_Icc (by linarith only [ht] : (0 : ℝ) < t) s h_in_Icc) -- Step 4: Bound using operator norm rw [h_deriv_eq] calc ‖(fderiv ℝ f (spacetimeOfTimeSpace s x_sp)) e₀‖ @@ -555,7 +557,7 @@ theorem spatialNormIntegral_linear_bound (f : TestFunctionℂ) -- K is nonnegative (integral of nonnegative function) have hK_nonneg : 0 ≤ K := integral_nonneg (fun x => by positivity) -- Use C = C_pt * (K + 1) to ensure positivity - refine ⟨C_pt * (K + 1), mul_pos hC_pt_pos (by linarith), fun t ht => ?_⟩ + refine ⟨C_pt * (K + 1), mul_pos hC_pt_pos (by linarith only [hK_nonneg]), fun t ht => ?_⟩ -- Step 4: Apply integral monotonicity -- First, show the integrand is bounded pointwise have h_pointwise : ∀ x : SpatialCoords3, @@ -583,7 +585,7 @@ theorem spatialNormIntegral_linear_bound (f : TestFunctionℂ) = ∫ x : SpatialCoords3, ‖f (spacetimeOfTimeSpace t x)‖ := rfl _ ≤ ∫ x : SpatialCoords3, C_pt * t / (1 + ‖x‖)^4 := h_mono _ = C_pt * t * K := h_factor - _ ≤ C_pt * t * (K + 1) := by nlinarith [mul_pos hC_pt_pos ht] + _ ≤ C_pt * t * (K + 1) := by linarith only [hC_pt_pos, ht, mul_pos hC_pt_pos ht] _ = C_pt * (K + 1) * t := by ring end SpaceTime diff --git a/LeanPool/OSforGFF/Spacetime/TimeTranslation.lean b/LeanPool/OSforGFF/Spacetime/TimeTranslation.lean index 1109ecd52f..fe9f972941 100644 --- a/LeanPool/OSforGFF/Spacetime/TimeTranslation.lean +++ b/LeanPool/OSforGFF/Spacetime/TimeTranslation.lean @@ -160,13 +160,13 @@ lemma timeShift_hasTemperateGrowth (s : ℝ) : Function.HasTemperateGrowth (time have h_eq : fderiv ℝ (timeShift s) = fun _ => ContinuousLinearMap.id ℝ SpaceTime := by ext x v have h : timeShift s = fun u => u + timeShiftConst s := funext (timeShift_eq_add_const s) - simp_all - simp_all + simp_all only [fderiv_add_const, fderiv_fun_id, ContinuousLinearMap.id_apply] + simp_all only [Function.HasTemperateGrowth.const] -- timeShift is differentiable have h_diff : Differentiable ℝ (timeShift s) := by intro x have h : timeShift s = fun u => u + timeShiftConst s := funext (timeShift_eq_add_const s) - simp_all + simp_all only [differentiableAt_fun_id, differentiableAt_const, DifferentiableAt.fun_add] -- Polynomial bound: ‖timeShift s x‖ ≤ C * (1 + ‖x‖)^k have h_bound : ∀ x : SpaceTime, ‖timeShift s x‖ ≤ (1 + ‖timeShiftConst s‖) * (1 + ‖x‖) ^ 1 := by intro x @@ -174,7 +174,7 @@ lemma timeShift_hasTemperateGrowth (s : ℝ) : Function.HasTemperateGrowth (time calc ‖x + timeShiftConst s‖ ≤ ‖x‖ + ‖timeShiftConst s‖ := norm_add_le _ _ _ ≤ (1 + ‖timeShiftConst s‖) * (1 + ‖x‖) := by - nlinarith [norm_nonneg x, norm_nonneg (timeShiftConst s)] + nlinarith only [norm_nonneg x, norm_nonneg (timeShiftConst s)] exact Function.HasTemperateGrowth.of_fderiv h_fderiv_temperate h_diff h_bound /-! ## Time Translation on Schwartz Functions @@ -309,11 +309,11 @@ lemma peetre_weight_bound (x y : SpaceTime) (k : ℕ) : _ ≤ ‖x + y‖ + ‖-y‖ := norm_add_le _ _ _ = ‖x + y‖ + ‖y‖ := by rw [norm_neg] have h2 : 1 + ‖x‖ ≤ (1 + ‖x + y‖) * (1 + ‖y‖) := by - calc 1 + ‖x‖ ≤ 1 + (‖x + y‖ + ‖y‖) := by linarith + calc 1 + ‖x‖ ≤ 1 + (‖x + y‖ + ‖y‖) := by linarith only [h1] _ = 1 + ‖x + y‖ + ‖y‖ := by ring - _ ≤ (1 + ‖x + y‖) * (1 + ‖y‖) := by nlinarith [norm_nonneg (x + y), norm_nonneg y] + _ ≤ (1 + ‖x + y‖) * (1 + ‖y‖) := by nlinarith only [norm_nonneg (x + y), norm_nonneg y] calc (1 + ‖x‖) ^ k ≤ ((1 + ‖x + y‖) * (1 + ‖y‖)) ^ k := by - apply pow_le_pow_left₀ (by linarith [norm_nonneg x]) h2 + apply pow_le_pow_left₀ (by linarith only [norm_nonneg x]) h2 _ = (1 + ‖x + y‖) ^ k * (1 + ‖y‖) ^ k := mul_pow _ _ _ /-- The iterated derivative commutes with time translation. @@ -327,7 +327,8 @@ lemma iteratedFDeriv_timeTranslationSchwartz (n : ℕ) (h : ℝ) have h_shift_eq : timeShiftConst h = h • unitTimeDir := by ext i simp only [timeShiftConst, unitTimeDir, EuclideanSpace.single, timeIndex] - simp_all + simp_all only [Fin.val_eq_zero_iff, Fin.isValue, Fin.zero_eta, PiLp.smul_apply, + PiLp.single_apply, smul_eq_mul, mul_ite, mul_one, mul_zero] have h_eq : ∀ z, timeTranslationSchwartz h f z = f (z + h • unitTimeDir) := by intro z rw [timeTranslationSchwartz_apply, timeShift_eq_add_const, h_shift_eq] @@ -777,14 +778,14 @@ lemma continuous_timeTranslationSchwartz (f : OSforGFF.TestFunction) : have h_eps : |h| < ε / L := lt_of_lt_of_le hh (min_le_right _ _) -- For |h| < 1: (1 + |h|)^k ≤ 2^k have h_pow_bound : (1 + |h|) ^ k ≤ (2 : ℝ) ^ k := by - apply pow_le_pow_left₀ (by linarith [abs_nonneg h]) - linarith + apply pow_le_pow_left₀ (by linarith only [abs_nonneg h]) + linarith only [h_small] have h4 : (2 : ℝ) ^ k * (2 : ℝ) ^ k = (4 : ℝ) ^ k := by rw [← mul_pow]; norm_num calc (SchwartzMap.seminorm ℝ k n) (timeTranslationSchwartz h f - f) _ ≤ |h| * (1 + |h|) ^ k * (2 : ℝ) ^ k * C := h_lip _ ≤ |h| * (2 : ℝ) ^ k * (2 : ℝ) ^ k * C := by gcongr _ = |h| * L := by simp only [L, ← h4]; ring - _ < (ε / L) * L := by nlinarith [abs_nonneg h] + _ < (ε / L) * L := by nlinarith only [hL_pos, h_eps, abs_nonneg h] _ = ε := by field_simp /-! ## Time Translation on Tempered Distributions @@ -838,6 +839,7 @@ lemma timeTranslationDistribution_add (s t : ℝ) (ω : FieldConfiguration) : lemma timeTranslationDistribution_zero (ω : FieldConfiguration) : timeTranslationDistribution 0 ω = ω := by apply DFunLike.ext - simp_all + simp_all only [timeTranslationDistribution_apply, neg_zero, timeTranslationSchwartz_zero, + implies_true] end TimeTranslation diff --git a/LeanPool/OSforGFF/Spacetime/Tonelli.lean b/LeanPool/OSforGFF/Spacetime/Tonelli.lean index 27d5767d78..27077fb164 100644 --- a/LeanPool/OSforGFF/Spacetime/Tonelli.lean +++ b/LeanPool/OSforGFF/Spacetime/Tonelli.lean @@ -6,7 +6,6 @@ Authors: Michael R. Douglas, Sarah Hoback, Anna Mei, Ron Nissim module public import LeanPool.OSforGFF.Spacetime.Decomposition -import LeanPool.OSforGFF.General.FunctionalAnalysis import Mathlib.Analysis.SpecialFunctions.Gamma.Basic import Mathlib.Data.Nat.Factorial.DoubleFactorial @@ -45,7 +44,7 @@ lemma spacetimeDecomp_symm_norm_ge (t : ℝ) (v : SpatialCoords) : have h_decomp := spacetime_norm_sq_decompose (spacetimeDecomp.symm (t, v)) rw [h_time, h_spatial] at h_decomp have h_sq_ge : ‖spacetimeDecomp.symm (t, v)‖^2 ≥ ‖v‖^2 := by - rw [h_decomp]; nlinarith [sq_nonneg t] + rw [h_decomp]; linarith only [sq_nonneg t] have h_norm_nonneg : 0 ≤ ‖spacetimeDecomp.symm (t, v)‖ := norm_nonneg _ exact le_of_sq_le_sq h_sq_ge h_norm_nonneg @@ -61,7 +60,7 @@ lemma schwartz_slice_integrable (f : SchwartzMap SpaceTime ℂ) (t : ℝ) : have h_int := integrable_one_add_norm (E := SpatialCoords) (μ := volume) (r := 5) h_dim have h_eq : ∀ v : SpatialCoords, C / (1 + ‖v‖) ^ 5 = C * (1 + ‖v‖) ^ (-(5 : ℝ)) := by intro v - have h_pos : 0 < 1 + ‖v‖ := by linarith [norm_nonneg v] + have h_pos : 0 < 1 + ‖v‖ := by linarith only [norm_nonneg v] have h1 : ((1 + ‖v‖) ^ 5)⁻¹ = (1 + ‖v‖) ^ (-(5 : ℝ)) := by rw [← Real.rpow_natCast (1 + ‖v‖) 5, ← Real.rpow_neg (le_of_lt h_pos)]; simp rw [div_eq_mul_inv, h1] @@ -72,9 +71,9 @@ lemma schwartz_slice_integrable (f : SchwartzMap SpaceTime ℂ) (t : ℝ) : have h1 := hf_decay (spacetimeDecomp.symm (t, v)) have h_norm_ge := spacetimeDecomp_symm_norm_ge t v have h_bracket_ge : 1 + ‖spacetimeDecomp.symm (t, v)‖ ≥ 1 + ‖v‖ := by linarith - have h_bracket_pos : 0 < 1 + ‖v‖ := by linarith [norm_nonneg v] + have h_bracket_pos : 0 < 1 + ‖v‖ := by linarith only [norm_nonneg v] have h_pow_le : (1 + ‖v‖)^5 ≤ (1 + ‖spacetimeDecomp.symm (t, v)‖)^5 := by - apply pow_le_pow_left₀ (by linarith [norm_nonneg v]) h_bracket_ge + apply pow_le_pow_left₀ (by linarith only [h_bracket_pos, norm_nonneg v]) h_bracket_ge calc ‖f (spacetimeDecomp.symm (t, v))‖ ≤ C / (1 + ‖spacetimeDecomp.symm (t, v)‖)^5 := h1 _ ≤ C / (1 + ‖v‖)^5 := by