Download data/lean/OAI/Analysis/C0Absorption/Signs.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 12.3 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/C0Absorption/Signs.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/C0Absorption/Signs.lean
-
curl -L -o Signs.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/C0Absorption/Signs.lean
12.3 kB
| import OAI.Analysis.C0Absorption.Completion | |
| namespace OAI | |
| namespace C0Absorption | |
| open scoped BigOperators NNReal ENNReal | |
| noncomputable section | |
| open Finset | |
| section Signs | |
| def realSign (b : Bool) : β := if b then 1 else -1 | |
| @[simp] theorem realSign_true : realSign true = 1 := rfl | |
| @[simp] theorem realSign_false : realSign false = -1 := rfl | |
| @[simp] theorem abs_realSign (b : Bool) : |realSign b| = 1 := by cases b <;> norm_num | |
| theorem sum_sign_sq (n : β) (a : Fin n β β) : | |
| β Ξ΅ : Fin n β Bool, (β i, realSign (Ξ΅ i) * a i) ^ 2 = | |
| (2 : β) ^ n * β i, a i ^ 2 := by | |
| induction n with | |
| | zero => simp | |
| | succ n ih => | |
| rw [β Fintype.sum_equiv (Fin.consEquiv (fun _ : Fin (n + 1) => Bool)) | |
| (fun p : Bool Γ (Fin n β Bool) => | |
| (β i : Fin (n + 1), realSign ((Fin.consEquiv (fun _ => Bool)) p i) * a i) ^ 2) | |
| (fun Ξ΅ : Fin (n + 1) β Bool => (β i, realSign (Ξ΅ i) * a i) ^ 2) | |
| (fun _ => rfl)] | |
| simp only [Fintype.sum_prod_type, Fin.sum_univ_succ, Fin.consEquiv_apply, | |
| Fin.cons_zero, Fin.cons_succ, Fintype.sum_bool, realSign_true, realSign_false, | |
| one_mul, neg_one_mul] | |
| rw [β Finset.sum_add_distrib] | |
| have heq (x y : β) : (x + y) ^ 2 + (-x + y) ^ 2 = 2 * x ^ 2 + 2 * y ^ 2 := by ring | |
| simp_rw [heq] | |
| rw [Finset.sum_add_distrib, Finset.sum_const, β Finset.mul_sum, ih] | |
| simp only [Finset.card_univ, Fintype.card_fun, Fintype.card_bool, Fintype.card_fin, nsmul_eq_mul, | |
| Nat.cast_pow, Nat.cast_ofNat, pow_succ] | |
| ring | |
| theorem finite_detector_bound {X : Type*} [NormedAddCommGroup X] [NormedSpace β X] | |
| (n : β) (m : Fin n β X) (u : Fin n β X ββ[β] β) | |
| (Ξ± M Ξ΄ : β) (hΞ± : 0 β€ Ξ±) (_hM : 0 β€ M) | |
| (hsum : β Ξ΅ : Fin n β Bool, ββ i, realSign (Ξ΅ i) β’ m iβ β€ M) | |
| (hdual : β x, Ξ± * β k, (u k x) ^ 2 β€ βxβ ^ 2) | |
| (hdetect : β i, Ξ΄ ^ 2 β€ (u i (m i)) ^ 2) : | |
| Ξ± * (n : β) * Ξ΄ ^ 2 β€ M ^ 2 := by | |
| classical | |
| have hdiag : (n : β) * Ξ΄ ^ 2 β€ β k : Fin n, β i : Fin n, (u k (m i)) ^ 2 := by | |
| calc | |
| (n : β) * Ξ΄ ^ 2 = β k : Fin n, Ξ΄ ^ 2 := by simp | |
| _ β€ β k : Fin n, β i : Fin n, (u k (m i)) ^ 2 := by | |
| apply Finset.sum_le_sum | |
| intro k hk | |
| exact (hdetect k).trans (Finset.single_le_sum (fun i _ => sq_nonneg (u k (m i))) (mem_univ k)) | |
| have havg : (2 : β) ^ n * (Ξ± * β k : Fin n, β i : Fin n, (u k (m i)) ^ 2) β€ | |
| (2 : β) ^ n * M ^ 2 := by | |
| calc | |
| (2 : β) ^ n * (Ξ± * β k : Fin n, β i : Fin n, (u k (m i)) ^ 2) = | |
| β Ξ΅ : Fin n β Bool, Ξ± * β k : Fin n, | |
| (u k (β i : Fin n, realSign (Ξ΅ i) β’ m i)) ^ 2 := by | |
| simp only [map_sum, map_smul, smul_eq_mul] | |
| conv_rhs => rw [β Finset.mul_sum, Finset.sum_comm] | |
| simp_rw [sum_sign_sq] | |
| rw [β Finset.mul_sum] | |
| ring | |
| _ β€ β Ξ΅ : Fin n β Bool, M ^ 2 := by | |
| apply Finset.sum_le_sum | |
| intro Ξ΅ hΞ΅ | |
| exact (hdual _).trans (pow_le_pow_leftβ (norm_nonneg _) (hsum Ξ΅) 2) | |
| _ = (2 : β) ^ n * M ^ 2 := by | |
| simp | |
| have ht : Ξ± * (β k : Fin n, β i : Fin n, (u k (m i)) ^ 2) β€ M ^ 2 := | |
| le_of_mul_le_mul_left havg (by positivity) | |
| calc | |
| Ξ± * (n : β) * Ξ΄ ^ 2 = Ξ± * ((n : β) * Ξ΄ ^ 2) := by ring | |
| _ β€ Ξ± * (β k : Fin n, β i : Fin n, (u k (m i)) ^ 2) := | |
| mul_le_mul_of_nonneg_left hdiag hΞ± | |
| _ β€ M ^ 2 := ht | |
| theorem no_infinite_detectors {X : Type*} [NormedAddCommGroup X] [NormedSpace β X] | |
| (m : β β X) (u : β β X ββ[β] β) (Ξ± M Ξ΄ : β) | |
| (hΞ± : 0 < Ξ±) (hM : 0 β€ M) (hΞ΄ : 0 < Ξ΄) | |
| (hsum : β n (Ξ΅ : Fin n β Bool), ββ i, realSign (Ξ΅ i) β’ m iβ β€ M) | |
| (hdual : β n x, Ξ± * β k : Fin n, (u k x) ^ 2 β€ βxβ ^ 2) | |
| (hdetect : β i, Ξ΄ β€ |u i (m i)|) : False := by | |
| have hbound (n : β) : Ξ± * (n : β) * Ξ΄ ^ 2 β€ M ^ 2 := by | |
| apply finite_detector_bound n (fun i => m i) (fun i => u i) Ξ± M Ξ΄ hΞ±.le hM | |
| (hsum n) (hdual n) | |
| intro i | |
| simpa only [sq_abs] using pow_le_pow_leftβ hΞ΄.le (hdetect i) 2 | |
| obtain β¨n, hnβ© := exists_nat_gt (M ^ 2 / (Ξ± * Ξ΄ ^ 2)) | |
| have hpos : 0 < Ξ± * Ξ΄ ^ 2 := mul_pos hΞ± (sq_pos_of_pos hΞ΄) | |
| have hn' : M ^ 2 < (n : β) * (Ξ± * Ξ΄ ^ 2) := (div_lt_iffβ hpos).mp hn | |
| nlinarith [hbound n] | |
| def flipSign {n : β} (i : Fin n) : (Fin n β Bool) β (Fin n β Bool) where | |
| toFun Ξ΅ j := if j = i then !(Ξ΅ j) else Ξ΅ j | |
| invFun Ξ΅ j := if j = i then !(Ξ΅ j) else Ξ΅ j | |
| left_inv Ξ΅ := by funext j; by_cases h : j = i <;> simp [h] | |
| right_inv Ξ΅ := by funext j; by_cases h : j = i <;> simp [h] | |
| @[simp] theorem realSign_not (b : Bool) : realSign (!b) = -realSign b := by | |
| cases b <;> norm_num | |
| theorem signed_sum_sub_flip {X : Type*} [AddCommGroup X] [Module β X] | |
| {n : β} (m : Fin n β X) (Ξ΅ : Fin n β Bool) (i : Fin n) : | |
| (β j, realSign (Ξ΅ j) β’ m j) - (β j, realSign (flipSign i Ξ΅ j) β’ m j) = | |
| (2 * realSign (Ξ΅ i)) β’ m i := by | |
| classical | |
| rw [β Finset.sum_sub_distrib] | |
| rw [Finset.sum_eq_single i] | |
| Β· simp [flipSign, two_mul, add_smul] | |
| Β· intro j hj hji | |
| simp [flipSign, hji] | |
| Β· simp | |
| theorem seminorm_sign_pair {X : Type*} [AddCommGroup X] [Module β X] | |
| (q : Seminorm β X) {n : β} (m : Fin n β X) (Ξ΅ : Fin n β Bool) (i : Fin n) : | |
| 2 * (q (m i)) ^ 2 β€ | |
| (q (β j, realSign (Ξ΅ j) β’ m j)) ^ 2 + | |
| (q (β j, realSign (flipSign i Ξ΅ j) β’ m j)) ^ 2 := by | |
| have heq : q ((β j, realSign (Ξ΅ j) β’ m j) - | |
| (β j, realSign (flipSign i Ξ΅ j) β’ m j)) = 2 * q (m i) := by | |
| rw [signed_sum_sub_flip, map_smul_eq_mul, Real.norm_eq_abs, abs_mul, abs_realSign] | |
| norm_num | |
| have ht := map_add_le_add q | |
| (β j, realSign (Ξ΅ j) β’ m j) (-(β j, realSign (flipSign i Ξ΅ j) β’ m j)) | |
| rw [β sub_eq_add_neg, heq, map_neg_eq_map] at ht | |
| have hp := apply_nonneg q (m i) | |
| have ha := apply_nonneg q (β j, realSign (Ξ΅ j) β’ m j) | |
| have hb := apply_nonneg q (β j, realSign (flipSign i Ξ΅ j) β’ m j) | |
| nlinarith [sq_nonneg (q (β j, realSign (Ξ΅ j) β’ m j) - | |
| q (β j, realSign (flipSign i Ξ΅ j) β’ m j))] | |
| theorem sum_sign_seminorm_sq_ge {X : Type*} [AddCommGroup X] [Module β X] | |
| (q : Seminorm β X) {n : β} (m : Fin n β X) (i : Fin n) : | |
| (2 : β) ^ n * (q (m i)) ^ 2 β€ | |
| β Ξ΅ : Fin n β Bool, (q (β j, realSign (Ξ΅ j) β’ m j)) ^ 2 := by | |
| classical | |
| have h := Finset.sum_le_sum (s := Finset.univ) (fun Ξ΅ _ => seminorm_sign_pair q m Ξ΅ i) | |
| rw [Finset.sum_add_distrib] at h | |
| have heq : (β Ξ΅ : Fin n β Bool, (q (β j, realSign (flipSign i Ξ΅ j) β’ m j)) ^ 2) = | |
| β Ξ΅ : Fin n β Bool, (q (β j, realSign (Ξ΅ j) β’ m j)) ^ 2 := | |
| Fintype.sum_equiv (flipSign i) _ _ (fun _ => rfl) | |
| rw [heq] at h | |
| simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fun, Fintype.card_bool, | |
| Fintype.card_fin, nsmul_eq_mul, Nat.cast_pow, Nat.cast_ofNat] at h | |
| linarith | |
| theorem sum_coordinate_choice_le {X : Type*} [NormedAddCommGroup X] [NormedSpace β X] | |
| (q : β β Seminorm β X) | |
| (hdom : β (s : Finset β) x, β d β s, (q d x) ^ 2 β€ βxβ ^ 2) | |
| (m : β β X) (M : β) | |
| (hsum : β n (Ξ΅ : Fin n β Bool), ββ i, realSign (Ξ΅ i) β’ m iβ β€ M) | |
| (s : Finset β) (index : β β β) : | |
| β d β s, (q d (m (index d))) ^ 2 β€ M ^ 2 := by | |
| classical | |
| let n := s.sup index + 1 | |
| have hlt (d : β) (hd : d β s) : index d < n := | |
| Nat.lt_succ_of_le (Finset.le_sup hd) | |
| have hmain : (2 : β) ^ n * (β d β s, (q d (m (index d))) ^ 2) β€ | |
| (2 : β) ^ n * M ^ 2 := by | |
| calc | |
| (2 : β) ^ n * (β d β s, (q d (m (index d))) ^ 2) = | |
| β d β s, (2 : β) ^ n * (q d (m (index d))) ^ 2 := Finset.mul_sum _ _ _ | |
| _ β€ β d β s, β Ξ΅ : Fin n β Bool, | |
| (q d (β i : Fin n, realSign (Ξ΅ i) β’ m i)) ^ 2 := by | |
| apply Finset.sum_le_sum | |
| intro d hd | |
| exact sum_sign_seminorm_sq_ge (q d) (fun i : Fin n => m i) β¨index d, hlt d hdβ© | |
| _ = β Ξ΅ : Fin n β Bool, β d β s, | |
| (q d (β i : Fin n, realSign (Ξ΅ i) β’ m i)) ^ 2 := Finset.sum_comm | |
| _ β€ β Ξ΅ : Fin n β Bool, M ^ 2 := by | |
| apply Finset.sum_le_sum | |
| intro Ξ΅ hΞ΅ | |
| exact (hdom s _).trans (pow_le_pow_leftβ (norm_nonneg _) (hsum n Ξ΅) 2) | |
| _ = (2 : β) ^ n * M ^ 2 := by simp | |
| exact le_of_mul_le_mul_left hmain (by positivity) | |
| theorem sum_ciSup_le_of_forall_choice {ΞΉ ΞΊ : Type*} [Nonempty ΞΊ] | |
| (a : ΞΉ β ΞΊ β β) (s : Finset ΞΉ) (K : β) | |
| (h : β f : ΞΉ β ΞΊ, β d β s, a d (f d) β€ K) : | |
| β d β s, β¨ k, a d k β€ K := by | |
| classical | |
| induction s using Finset.induction_on generalizing K with | |
| | empty => simpa using h (fun _ => Classical.choice (inferInstance : Nonempty ΞΊ)) | |
| | @insert d s hd ih => | |
| rw [Finset.sum_insert hd] | |
| rw [β le_sub_iff_add_le] | |
| apply ciSup_le | |
| intro k | |
| have ht : (β e β s, β¨ j, a e j) β€ K - a d k := by | |
| apply ih | |
| intro f | |
| have hf := h (Function.update f d k) | |
| rw [Finset.sum_insert hd, Function.update_self] at hf | |
| have heq : (β e β s, a e (Function.update f d k e)) = β e β s, a e (f e) := by | |
| apply Finset.sum_congr rfl | |
| intro e he | |
| rw [Function.update_of_ne (by intro heq; subst e; exact hd he)] | |
| rw [heq] at hf | |
| linarith | |
| linarith | |
| theorem coordinate_envelope_summable {X : Type*} [NormedAddCommGroup X] [NormedSpace β X] | |
| (q : β β Seminorm β X) | |
| (hdom : β (s : Finset β) x, β d β s, (q d x) ^ 2 β€ βxβ ^ 2) | |
| (m : β β X) (M : β) | |
| (hsum : β n (Ξ΅ : Fin n β Bool), ββ i, realSign (Ξ΅ i) β’ m iβ β€ M) : | |
| Summable (fun d => β¨ i : β, (q d (m i)) ^ 2) β§ | |
| (β d i, (q d (m i)) ^ 2 β€ β¨ j : β, (q d (m j)) ^ 2) := by | |
| have hb (d : β) : BddAbove (Set.range (fun i : β => (q d (m i)) ^ 2)) := by | |
| refine β¨M ^ 2, ?_β© | |
| rintro _ β¨i, rflβ© | |
| simpa using sum_coordinate_choice_le q hdom m M hsum {d} (fun _ => i) | |
| have hle (d i : β) : (q d (m i)) ^ 2 β€ β¨ j : β, (q d (m j)) ^ 2 := | |
| le_ciSup (hb d) i | |
| constructor | |
| Β· apply summable_of_sum_le (c := M ^ 2) | |
| Β· intro d | |
| exact (sq_nonneg _).trans (hle d 0) | |
| Β· intro s | |
| apply sum_ciSup_le_of_forall_choice (fun d i => (q d (m i)) ^ 2) | |
| exact fun f => sum_coordinate_choice_le q hdom m M hsum s f | |
| Β· exact hle | |
| theorem square_norm_tendsto_zero {X : Type*} [NormedAddCommGroup X] [NormedSpace β X] | |
| (q : β β Seminorm β X) | |
| (hq : β x, Summable (fun d => (q d x) ^ 2)) | |
| (hnorm : β x, βxβ ^ 2 = β' d, (q d x) ^ 2) | |
| (m : β β X) (M : β) | |
| (hsum : β n (Ξ΅ : Fin n β Bool), ββ i, realSign (Ξ΅ i) β’ m iβ β€ M) | |
| (hzero : β d, Filter.Tendsto (fun i => q d (m i)) Filter.atTop (nhds 0)) : | |
| Filter.Tendsto (fun i => βm iβ ^ 2) Filter.atTop (nhds 0) := by | |
| have hdom (s : Finset β) (x : X) : β d β s, (q d x) ^ 2 β€ βxβ ^ 2 := by | |
| rw [hnorm] | |
| exact Summable.sum_le_tsum s (fun _ _ => sq_nonneg _) (hq x) | |
| obtain β¨hb, hleβ© := coordinate_envelope_summable q hdom m M hsum | |
| have hp (d : β) : Filter.Tendsto (fun i => (q d (m i)) ^ 2) Filter.atTop (nhds 0) := by | |
| simpa using (hzero d).pow 2 | |
| have ht := tendsto_tsum_of_dominated_convergence hb hp | |
| (Filter.Eventually.of_forall fun i d => by | |
| simpa only [Real.norm_of_nonneg (sq_nonneg _)] using hle d i) | |
| simpa only [β hnorm, tsum_zero] using ht | |
| theorem exists_nonzero_coordinate {X : Type*} [NormedAddCommGroup X] [NormedSpace β X] | |
| (q : β β Seminorm β X) | |
| (hq : β x, Summable (fun d => (q d x) ^ 2)) | |
| (hnorm : β x, βxβ ^ 2 = β' d, (q d x) ^ 2) | |
| (m : β β X) (M r : β) (hr : 0 < r) | |
| (hlower : β i, r β€ βm iβ) | |
| (hsum : β n (Ξ΅ : Fin n β Bool), ββ i, realSign (Ξ΅ i) β’ m iβ β€ M) : | |
| β d, Β¬ Filter.Tendsto (fun i => q d (m i)) Filter.atTop (nhds 0) := by | |
| by_contra! h | |
| have ht := square_norm_tendsto_zero q hq hnorm m M hsum h | |
| have hl : r ^ 2 β€ (0 : β) := ge_of_tendsto ht | |
| (Filter.Eventually.of_forall fun i => pow_le_pow_leftβ hr.le (hlower i) 2) | |
| nlinarith [sq_pos_of_pos hr] | |
| end Signs | |
| end | |
| end C0Absorption | |
| end OAI | |