File size: 4,992 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | import OAI.NumberTheory.TwoPoint.Walks.ColumnPatternRecovery
import OAI.NumberTheory.TwoPoint.Walks.ColumnBudget
namespace OAI
/-! A fixed finite universe for every column with the proved numerical budget. -/
namespace TwoPointCorrelations
open Filter
noncomputable def columnBudgetCap (N : β) (L : β) : β :=
min N β66 * L ^ (0.92 : β)ββ
noncomputable abbrev BudgetColumnCode (N : β) (L : β) :=
BoundedColumnDecoderCode N (columnBudgetCap N L) (columnBudgetCap N L) (columnBudgetCap N L)
noncomputable def decodeBudgetColumnPattern {n N : β} {L : β} (hn : n β€ N)
(code : BudgetColumnCode N L) : Fin n β Fin n β Bool :=
decodeColumnPrefixPattern hn code.2.2.2
/-- The cap depends only on the common scale and forest size, not on the
numerical coefficients, the prime values, or the number of regular lines. -/
theorem budget_column_code_of_counts {n N S O I : β} {L : β}
(hn : n β€ N) (hS : S β€ N) (hO : O β€ N) (hI : I β€ N)
(hcost : ((2 * S + O + I : β) : β) β€ 66 * L ^ (0.92 : β))
(code : ColumnDecoderCode N S O I) :
β full : BudgetColumnCode N L,
decodeBudgetColumnPattern hn full = decodeColumnPrefixPattern hn code := by
have htotal : 2 * S + O + I β€ β66 * L ^ (0.92 : β)ββ := Nat.le_floor hcost
have hs : S < columnBudgetCap N L + 1 := by
unfold columnBudgetCap
omega
have ho : O < columnBudgetCap N L + 1 := by
unfold columnBudgetCap
omega
have hi : I < columnBudgetCap N L + 1 := by
unfold columnBudgetCap
omega
exact β¨β¨β¨S, hsβ©, β¨O, hoβ©, β¨I, hiβ©, codeβ©, rflβ©
/-- All permitted counts are included simultaneously. The factor 264 is
absorbed only into the large-scale threshold; the exponential constant 64
is the same for every column and every choice of numerical coefficients. -/
theorem eventually_budget_column_code_card :
βαΆ L : β in atTop, β k N : β,
L / 2 β€ (k : β) β (k : β) β€ L β 1 β€ N β N β€ 4 * k β
(Fintype.card (BudgetColumnCode N L) : β) β€ Real.exp (64 * k) := by
filter_upwards [eventually_bounded_column_code_exponential 264 (by norm_num),
eventually_ge_atTop (0 : β)] with L h hL
intro k N hklo hkhi hN hNk
have hc : columnBudgetCap N L β€ N := Nat.min_le_left _ _
have hfloor : (columnBudgetCap N L : β) β€ 66 * L ^ (0.92 : β) := by
have hf := Nat.floor_le (show 0 β€ 66 * L ^ (0.92 : β) by positivity)
have hm : (columnBudgetCap N L : β) β€ β66 * L ^ (0.92 : β)ββ := by
exact_mod_cast (Nat.min_le_right N β66 * L ^ (0.92 : β)ββ)
exact hm.trans hf
apply h k N _ _ _ hklo hkhi hN hNk hc hc hc
push_cast
nlinarith
theorem card_budget_column_patterns {n N : β} {L : β} (hn : n β€ N) :
Nat.card (Set.range (@decodeBudgetColumnPattern n N L hn)) β€
Fintype.card (BudgetColumnCode N L) := by
let f := @decodeBudgetColumnPattern n N L hn
have hr := Nat.card_le_card_of_surjective
(fun c => (β¨f c, c, rflβ© : Set.range f)) (by
rintro β¨_, c, rflβ©
exact β¨c, rflβ©)
simpa only [Nat.card_eq_fintype_card] using hr
noncomputable abbrev BudgetColumnArrayCode (J N : β) (L : β) :=
Fin J β BudgetColumnCode N L
noncomputable instance budgetColumnArrayFintype (J N : β) (L : β) :
Fintype (BudgetColumnArrayCode J N L) := by
classical
letI : Fintype (BudgetColumnCode N L) := inferInstance
exact Pi.instFintype
noncomputable def decodeBudgetColumnArray {n J N : β} {L : β} (hn : n β€ N)
(code : BudgetColumnArrayCode J N L) : Fin J β Fin n β Fin n β Bool :=
fun j => decodeBudgetColumnPattern hn (code j)
theorem budget_column_array_cover {n J N : β} {L : β} (hn : n β€ N)
(pattern : Fin J β Fin n β Fin n β Bool)
(h : β j, β code : BudgetColumnCode N L, decodeBudgetColumnPattern hn code = pattern j) :
β code : BudgetColumnArrayCode J N L, decodeBudgetColumnArray hn code = pattern := by
classical
choose code hc using h
exact β¨code, funext hcβ©
/-- The full column pattern array has cost exponential in `J*k`, with
one universal finite set for all numerical assignments. -/
theorem eventually_budget_column_array_card :
βαΆ L : β in atTop, β k J N : β,
L / 2 β€ (k : β) β (k : β) β€ L β 1 β€ N β N β€ 4 * k β
(Fintype.card (BudgetColumnArrayCode J N L) : β) β€ Real.exp (64 * k * J) := by
filter_upwards [eventually_budget_column_code_card] with L h
intro k J N hklo hkhi hN hNk
let : Fintype (BudgetColumnCode N L) := inferInstance
have hc := h k N hklo hkhi hN hNk
calc
_ = (Fintype.card (BudgetColumnCode N L) : β) ^ J := by
simp only [BudgetColumnArrayCode, Fintype.card_fun, Fintype.card_fin, Nat.cast_pow]
_ β€ (Real.exp (64 * k)) ^ J := pow_le_pow_leftβ (by positivity) hc J
_ = Real.exp (64 * k * J) := by
rw [β Real.exp_nat_mul]
congr 1
ring
end TwoPointCorrelations
end OAI
|