Download data/lean/OAI/Geometry/HyperbolicGroups/Concentration.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.53 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/HyperbolicGroups/Concentration.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/HyperbolicGroups/Concentration.lean
-
curl -L -o Concentration.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/HyperbolicGroups/Concentration.lean
6.53 kB
| import Mathlib | |
| import OAI.Geometry.HyperbolicGroups.Moment | |
| import OAI.Geometry.HyperbolicGroups.Cost | |
| namespace OAI | |
| section | |
| section | |
| noncomputable section | |
| open scoped BigOperators | |
| namespace HyperbolicObstruction | |
| namespace TableModel | |
| variable {F R A : Type*} [Fintype F] [Fintype R] [Fintype A] | |
| [DecidableEq F] [DecidableEq R] [DecidableEq A] | |
| lemma powerProbability_mem {N : β} (hN : 1 β€ N) {c : β} (hc : 0 β€ c) : | |
| N ^ (-c) β Set.Icc (0 : β) 1 := by | |
| constructor | |
| Β· exact (Real.rpow_pos_of_pos (by linarith) _).le | |
| Β· simpa using Real.rpow_le_rpow_of_exponent_le hN (show -c β€ 0 by linarith) | |
| lemma powerProbability_pos {N : β} (hN : 1 β€ N) (c : β) : 0 < N ^ (-c) := | |
| Real.rpow_pos_of_pos (by linarith) _ | |
| omit [Fintype R] [DecidableEq R] in | |
| lemma inverse_cost_product {N : β} (hN : 1 β€ N) (c : R β β) (hc : β r, 0 β€ c r) | |
| (J : Finset R) : | |
| (β r β J, ((N ^ (-c r))β»ΒΉ - 1)) β€ N ^ (β r β J, c r) := by | |
| have hN0 : 0 < N := by linarith | |
| have he (r : R) : (N ^ (-c r))β»ΒΉ = N ^ (c r) := by | |
| rw [Real.rpow_neg hN0.le, inv_inv] | |
| simp_rw [he] | |
| rw [Real.rpow_sum_of_pos hN0] | |
| apply Finset.prod_le_prodβ | |
| Β· intro r _ | |
| exact sub_nonneg.mpr (Real.one_le_rpow hN (hc r)) | |
| Β· intro r _ | |
| linarith | |
| omit [Fintype R] [DecidableEq R] in | |
| lemma cost_term_bound {N Ξ΅ : β} (hN : 1 β€ N) (c : R β β) (hc : β r, 0 β€ c r) | |
| (support : R β Finset F) (I : Finset F) (J : Finset R) | |
| (gap : Ξ΅ β€ ((J.biUnion support \ I).card : β) - β r β J, c r) : | |
| N ^ (Fintype.card F - (J.biUnion support βͺ I).card) * | |
| (β r β J, ((N ^ (-c r))β»ΒΉ - 1)) β€ | |
| N ^ (Fintype.card F - I.card) * N ^ (-Ξ΅) := by | |
| have hN0 : 0 < N := by linarith | |
| have hi := Finset.card_le_univ I | |
| have hu := Finset.card_le_univ (J.biUnion support βͺ I) | |
| have hcard := Finset.card_union_add_card_inter (J.biUnion support) I | |
| have hs := Finset.card_sdiff_add_card_inter (J.biUnion support) I | |
| have he : (Fintype.card F - (J.biUnion support βͺ I).card) + | |
| (J.biUnion support \ I).card = Fintype.card F - I.card := by omega | |
| have he' : ((Fintype.card F - (J.biUnion support βͺ I).card : β) : β) + | |
| (J.biUnion support \ I).card = (Fintype.card F - I.card : β) := by exact_mod_cast he | |
| calc | |
| _ β€ N ^ (Fintype.card F - (J.biUnion support βͺ I).card) * N ^ (β r β J, c r) := | |
| mul_le_mul_of_nonneg_left (inverse_cost_product hN c hc J) (by positivity) | |
| _ = N ^ (((Fintype.card F - (J.biUnion support βͺ I).card : β) : β) + β r β J, c r) := by | |
| rw [Real.rpow_add hN0, Real.rpow_natCast] | |
| _ β€ N ^ (((Fintype.card F - I.card : β) : β) + -Ξ΅) := | |
| Real.rpow_le_rpow_of_exponent_le hN (by linarith) | |
| _ = _ := by rw [Real.rpow_add hN0, Real.rpow_natCast] | |
| /-- A uniform, explicit finite relative-variance bound for pinned master matches. | |
| No numerical values of the pinned letters occur in this bound. -/ | |
| theorem variance_pinned_power [Nonempty A] (support : R β Finset F) (c : R β β) | |
| (hc : β r, 0 β€ c r) (I : Finset F) (ΞΎ : F β A) {Ξ΅ : β} | |
| (gap : β J : Finset R, J.Nonempty β | |
| Ξ΅ β€ ((J.biUnion support \ I).card : β) - β r β J, c r) : | |
| let N : β := Fintype.card A | |
| let hp := fun r => powerProbability_mem (show 1 β€ N by change (1 : β) β€ Fintype.card A; exact_mod_cast (show 1 β€ Fintype.card A from Fintype.card_pos)) (hc r) | |
| let ΞΌ := law support (fun r => N ^ (-c r)) hp | |
| let X := fun w => (candidateCount support (pinCandidates I ΞΎ) w : β) | |
| ΞΌ.variance X β€ Fintype.card (Finset R) * N ^ (-Ξ΅) * ΞΌ.expect X ^ 2 := by | |
| classical | |
| dsimp only | |
| have hn : (1 : β) β€ Fintype.card A := by | |
| exact_mod_cast (show 1 β€ Fintype.card A from Fintype.card_pos) | |
| let p (r : R) := (Fintype.card A : β) ^ (-c r) | |
| let hp := fun r => powerProbability_mem hn (hc r) | |
| change (law support p hp).variance _ β€ _ | |
| rw [variance_pinCount support p hp (fun r => powerProbability_pos hn (c r)), | |
| expect_candidateCount, card_pinCandidates] | |
| have hs : (β J β (Finset.univ : Finset (Finset R)).erase β , | |
| (Fintype.card A : β) ^ (Fintype.card F - (J.biUnion support βͺ I).card) * | |
| β r β J, ((p r)β»ΒΉ - 1)) β€ | |
| Fintype.card (Finset R) * (Fintype.card A : β) ^ (Fintype.card F - I.card) * | |
| (Fintype.card A : β) ^ (-Ξ΅) := by | |
| calc | |
| _ β€ β _J β (Finset.univ : Finset (Finset R)).erase β , | |
| (Fintype.card A : β) ^ (Fintype.card F - I.card) * (Fintype.card A : β) ^ (-Ξ΅) := by | |
| apply Finset.sum_le_sum | |
| intro J hJ | |
| exact cost_term_bound hn c hc support I J | |
| (gap J (Finset.nonempty_iff_ne_empty.mpr (Finset.mem_erase.mp hJ).1)) | |
| _ β€ β _J : Finset R, | |
| (Fintype.card A : β) ^ (Fintype.card F - I.card) * (Fintype.card A : β) ^ (-Ξ΅) := | |
| Finset.sum_le_sum_of_subset_of_nonneg (Finset.erase_subset _ _) | |
| (fun _ _ _ => by positivity) | |
| _ = _ := by simp; ring | |
| calc | |
| _ β€ (β r, p r) ^ 2 * (Fintype.card A : β) ^ (Fintype.card F - I.card) * | |
| (Fintype.card (Finset R) * (Fintype.card A : β) ^ (Fintype.card F - I.card) * | |
| (Fintype.card A : β) ^ (-Ξ΅)) := mul_le_mul_of_nonneg_left hs (by positivity) | |
| _ = _ := by dsimp [p]; ring | |
| end TableModel | |
| namespace IncidenceTemplate | |
| /-- Source single-copy concentration, also for every singleton-pinned count, | |
| with a common actual-parameter half-unit margin. -/ | |
| theorem master_variance_bound {A : Type*} [Fintype A] [Nonempty A] [DecidableEq A] | |
| {Ξ± Ξ² Ξ΄ : β} (ha : 0 β€ Ξ±) (hb : 7 * Ξ± β€ Ξ²) (hd : 0 β€ Ξ΄) | |
| (hsmall : Ξ² + 90 * Ξ΄ β€ 1 / 2) (I : Finset Field) (hI : I.card β€ 1) (ΞΎ : Field β A) : | |
| let N : β := Fintype.card A | |
| let c := actualRowCost Ξ± Ξ² Ξ΄ | |
| let hp := fun r => TableModel.powerProbability_mem | |
| (show 1 β€ N by change (1 : β) β€ Fintype.card A; exact_mod_cast (show 1 β€ Fintype.card A from Fintype.card_pos)) (actualRowCost_nonneg ha hb hd r) | |
| let ΞΌ := TableModel.law rowSupport (fun r => N ^ (-c r)) hp | |
| let X := fun w => (TableModel.candidateCount rowSupport (TableModel.pinCandidates I ΞΎ) w : β) | |
| ΞΌ.variance X β€ Fintype.card (Finset Row) * N ^ (-(1 / 2 : β)) * ΞΌ.expect X ^ 2 := by | |
| apply TableModel.variance_pinned_power rowSupport (actualRowCost Ξ± Ξ² Ξ΄) | |
| (actualRowCost_nonneg ha hb hd) I ΞΎ | |
| intro J hJ | |
| have hh := actual_pinned_overlap ha hb hd hJ I hI | |
| linarith | |
| end IncidenceTemplate | |
| end HyperbolicObstruction | |
| end | |
| end | |
| section | |
| end | |
| end | |
| end OAI | |