Download lean/OAI/LinearAlgebra/MatrixFields/Certificates/SparseContraction.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 119 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/LinearAlgebra/MatrixFields/Certificates/SparseContraction.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/LinearAlgebra/MatrixFields/Certificates/SparseContraction.lean
-
curl -L -o SparseContraction.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/LinearAlgebra/MatrixFields/Certificates/SparseContraction.lean
119 kB
| import Mathlib | |
| import OAI.LinearAlgebra.MatrixFields.Entropy.InitialEntropy | |
| namespace OAI | |
| namespace MatrixAllFields | |
| open scoped BigOperators Topology Polynomial | |
| section | |
| noncomputable section | |
| namespace MatrixMultiplication.AllFieldInitialEntropyCertificate | |
| open AllFieldParameters AllFieldCertificates AllFieldCertificates.Replay | |
| open scoped BigOperators | |
| def exponentialCoefficients : List ℚ := | |
| (List.range 17).map (fun j => 1 / (Nat.factorial j : ℚ)) | |
| lemma exponential_polynomial_cast (n : ℤ) : | |
| (((∑ j ∈ Finset.range 17, ((n : ℚ) / 640000) ^ j / | |
| Nat.factorial j : ℚ) : ℝ)) = | |
| polynomial (((n : ℚ) / 640000 : ℚ) : ℝ) exponentialCoefficients := by | |
| simp only [Rat.cast_sum, Rat.cast_div, Rat.cast_pow, Rat.cast_natCast] | |
| norm_num [Finset.sum_range_succ, exponentialCoefficients, List.range_succ, | |
| polynomial, List.map_append] | |
| ring | |
| lemma weight_enclosed_of_trace (n : ℤ) (trace : List Ball) | |
| (b₁ b₂ b₃ b₄ b₅ b₆ : Ball) | |
| (hp : checkPolynomial (.exact ((n : ℚ) / 640000)) | |
| exponentialCoefficients trace = true) | |
| (h₁ : contains (.mul (traceHead trace) (traceHead trace)) b₁ = true) | |
| (h₂ : contains (.mul b₁ b₁) b₂ = true) | |
| (h₃ : contains (.mul b₂ b₂) b₃ = true) | |
| (h₄ : contains (.mul b₃ b₃) b₄ = true) | |
| (h₅ : contains (.mul b₄ b₄) b₅ = true) | |
| (h₆ : contains (.mul b₅ b₅) b₆ = true) : | |
| b₆.Encloses (weight n : ℝ) := by | |
| have p := checkPolynomial_sound (Ball.exact_sound ((n : ℚ) / 640000)) | |
| exponentialCoefficients trace hp | |
| rw [← exponential_polynomial_cast] at p | |
| have p₁ := contains_sound (Ball.mul_sound p p) h₁ | |
| have p₂ := contains_sound (Ball.mul_sound p₁ p₁) h₂ | |
| have p₃ := contains_sound (Ball.mul_sound p₂ p₂) h₃ | |
| have p₄ := contains_sound (Ball.mul_sound p₃ p₃) h₄ | |
| have p₅ := contains_sound (Ball.mul_sound p₄ p₄) h₅ | |
| have p₆ := contains_sound (Ball.mul_sound p₅ p₅) h₆ | |
| convert p₆ using 1 | |
| simp only [weight, Rat.cast_pow] | |
| ring | |
| def weightTrace0 : List Ball := [ | |
| ⟨(45822469347703230916837028446061 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(95761729883054217060631522574569 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1518032241603819172753264716571 / 3125000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3261876795622354777174156430543 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4095003862446164503471876088913 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(205341225223953618638702205277 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(137176467343829037379890181127 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(19626959451965561090978938867 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1228161761087584971721304317 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(54637558371312300664525013 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(27340322092271316640462777 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2487117682933565567802199 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(103687562373860905549233 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(15959542323714148962659 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(285109727917665106419 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(76054635388880697247 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare0_1 : Ball := ⟨(83987947884848086426829976722031 / 100000000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare0_2 : Ball := ⟨(70539753899079581546921669791051 / 100000000000000000000000000000000), (3 / 50000000000000000000000000000000)⟩ | |
| def weightSquare0_3 : Ball := ⟨(49758568801427130276705189494043 / 100000000000000000000000000000000), (1 / 10000000000000000000000000000000)⟩ | |
| def weightSquare0_4 : Ball := ⟨(12379575845831786800610165591697 / 50000000000000000000000000000000), (11 / 100000000000000000000000000000000)⟩ | |
| def weightSquare0_5 : Ball := ⟨(61301559249080719838295497489 / 1000000000000000000000000000000), (7 / 100000000000000000000000000000000)⟩ | |
| def weightSquare0_6 : Ball := ⟨(375788116636855394790068879267 / 100000000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_0 : weightSquare0_6.Encloses (weight (-55839) : ℝ) := by | |
| exact weight_enclosed_of_trace (-55839) weightTrace0 weightSquare0_1 weightSquare0_2 weightSquare0_3 weightSquare0_4 weightSquare0_5 weightSquare0_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace1 : List Ball := [ | |
| ⟨(47255022421610958409873827160341 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(97229191696542968020629859555673 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(49072067803428631784511439365999 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16434031762616588480302150310221 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(164802101549160184047696785151 / 4000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(825553916487359822440105826453 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(137776428077124469979954185547 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(9851051824020091619644825781 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2464686157317462422255187163 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(137012571857256431690259327 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(13708263777035553765322303 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2493473966999507375380809 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(103932227199065796269981 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3198903658586015670193 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(571385949173744347803 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(76201768611384910161 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare1_1 : Ball := ⟨(89321485762678176318205827626583 / 100000000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare1_2 : Ball := ⟨(1595665563770464030669190950117 / 2000000000000000000000000000000), (7 / 100000000000000000000000000000000)⟩ | |
| def weightSquare1_3 : Ball := ⟨(31826857392536410151645281386261 / 50000000000000000000000000000000), (3 / 25000000000000000000000000000000)⟩ | |
| def weightSquare1_4 : Ball := ⟨(810359081187879632371486932441 / 2000000000000000000000000000000), (17 / 100000000000000000000000000000000)⟩ | |
| def weightSquare1_5 : Ball := ⟨(16417046011591612337241268965321 / 100000000000000000000000000000000), (7 / 50000000000000000000000000000000)⟩ | |
| def weightSquare1_6 : Ball := ⟨(2695193997467160660436803279809 / 100000000000000000000000000000000), (3 / 50000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_1 : weightSquare1_6.Encloses (weight (-36137) : ℝ) := by | |
| exact weight_enclosed_of_trace (-36137) weightTrace1 weightSquare1_1 weightSquare1_2 weightSquare1_3 weightSquare1_4 weightSquare1_5 weightSquare1_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace2 : List Ball := [ | |
| ⟨(19462084945085296406442948535709 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(98649101709384577877389230656831 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(24774339675450460154475682836493 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16553683043349819604053296423209 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(518006181749542381171965125597 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(103695169558496726647696312179 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(138349773272399157380263337543 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(308966483173666977262623271 / 1562500000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2472665918923664623838816993 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(137411862870134171885457943 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3436146482162016182737377 / 12500000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩, | |
| ⟨(2499530900421064933309269 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(208330586210581940821979 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(125217395867685532157 / 781250000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(143124148124781859341 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(19085332337372655453 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare2_1 : Ball := ⟨(94693187602428936210099773718353 / 100000000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare2_2 : Ball := ⟨(44833998891544005922143607529859 / 50000000000000000000000000000000), (7 / 100000000000000000000000000000000)⟩ | |
| def weightSquare2_3 : Ball := ⟨(10050437283034845758507319035581 / 12500000000000000000000000000000), (13 / 100000000000000000000000000000000)⟩ | |
| def weightSquare2_4 : Ball := ⟨(64647225331338785478344935394587 / 100000000000000000000000000000000), (11 / 50000000000000000000000000000000)⟩ | |
| def weightSquare2_5 : Ball := ⟨(41792637430408911418759860943933 / 100000000000000000000000000000000), (29 / 100000000000000000000000000000000)⟩ | |
| def weightSquare2_6 : Ball := ⟨(2183280679237019972788253432353 / 12500000000000000000000000000000), (1 / 4000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_2 : weightSquare2_6.Encloses (weight (-17449) : ℝ) := by | |
| exact weight_enclosed_of_trace (-17449) weightTrace2 weightSquare2_1 weightSquare2_2 weightSquare2_3 weightSquare2_4 weightSquare2_5 weightSquare2_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace3 : List Ball := [ | |
| ⟨(99722261409261526095071612219837 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(99861066332934437727060774889811 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(49953678046044862180395545236147 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(8327542284069720378328946310521 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(26027187701631258446683248593 / 625000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(832947202036967261967421765977 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(27766744907223109458809337961 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(9917187015432196825563880161 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2479392505329480885756231427 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(55099313563992663293648747 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(27550353220886312747669859 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2504630327938123105603659 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(208722914534389897186987 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(8027927063567209908089 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(229372382000523736751 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(76458344396867462343 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare3_1 : Ball := ⟨(99445294205770906125170809966217 / 100000000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare3_2 : Ball := ⟨(9889366539672332554869689802191 / 10000000000000000000000000000000), (7 / 100000000000000000000000000000000)⟩ | |
| def weightSquare3_3 : Ball := ⟨(24449892638997681165967353683633 / 25000000000000000000000000000000), (7 / 50000000000000000000000000000000)⟩ | |
| def weightSquare3_4 : Ball := ⟨(23911890002340519753388331266581 / 25000000000000000000000000000000), (7 / 25000000000000000000000000000000)⟩ | |
| def weightSquare3_5 : Ball := ⟨(45742278678722600142174067342087 / 50000000000000000000000000000000), (11 / 20000000000000000000000000000000)⟩ | |
| def weightSquare3_6 : Ball := ⟨(83694242348876807273467974770337 / 100000000000000000000000000000000), (51 / 50000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_3 : weightSquare3_6.Encloses (weight (-1780) : ℝ) := by | |
| exact weight_enclosed_of_trace (-1780) weightTrace3 weightSquare3_1 weightSquare3_2 weightSquare3_3 weightSquare3_4 weightSquare3_5 weightSquare3_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace4 : List Ball := [ | |
| ⟨(50911410227239288182312346605491 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(20181733256055512038055594758737 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(50302432261710796797673490870941 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(8371103169920852457012116486571 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2090882745092313740543310965499 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(104481089995403957581214526993 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(34812028439039215519527827849 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(19886161668670775979789845573 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(621286427138617212332161333 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(276071808085179654271380119 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(27602641726950831010849701 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2508987275976284863517391 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(52264509050953876130863 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16079789645021142467363 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1148457507801906020393 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(76557974095447743761 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare4_1 : Ball := ⟨(1036788676530498075661364538317 / 1000000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare4_2 : Ball := ⟨(107493075978186177125241613635047 / 100000000000000000000000000000000), (1 / 12500000000000000000000000000000)⟩ | |
| def weightSquare4_3 : Ball := ⟨(14443451729065132700277449317601 / 12500000000000000000000000000000), (9 / 50000000000000000000000000000000)⟩ | |
| def weightSquare4_4 : Ball := ⟨(133512510623894125738161773133231 / 100000000000000000000000000000000), (21 / 50000000000000000000000000000000)⟩ | |
| def weightSquare4_5 : Ball := ⟨(11140994058184651120224401477951 / 6250000000000000000000000000000), (113 / 100000000000000000000000000000000)⟩ | |
| def weightSquare4_6 : Ball := ⟨(317751676427534595662029560374059 / 100000000000000000000000000000000), (101 / 25000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_4 : weightSquare4_6.Encloses (weight (11561) : ℝ) := by | |
| exact weight_enclosed_of_trace (11561) weightTrace4 weightSquare4_1 weightSquare4_2 weightSquare4_3 weightSquare4_4 weightSquare4_5 weightSquare4_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace5 : List Ball := [ | |
| ⟨(103600813901653687360089808813237 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(101789792272895755762256079526159 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(12648708642372832242092434813847 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16815111505055235854974961283079 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2098160259909105135099570549999 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(167654293436288924565226478201 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(17449236212407383366781122517 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4982337882474756504311598923 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(31124271600418638659055071 / 1250000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(276551176671687180049383751 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(27646203019880523641287881 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2512616138364183427012361 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4186741947709709968707 / 2000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(8049858753420616865717 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(574892862468114940523 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(76640711328831368513 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare5_1 : Ball := ⟨(13416410801356349903607034777723 / 12500000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare5_2 : Ball := ⟨(115200050426080854395202845284257 / 100000000000000000000000000000000), (7 / 100000000000000000000000000000000)⟩ | |
| def weightSquare5_3 : Ball := ⟨(132710516181715716422850695559233 / 100000000000000000000000000000000), (9 / 50000000000000000000000000000000)⟩ | |
| def weightSquare5_4 : Ball := ⟨(176120811052174290165929815923193 / 100000000000000000000000000000000), (49 / 100000000000000000000000000000000)⟩ | |
| def weightSquare5_5 : Ball := ⟨(62037080171351355194935848106531 / 20000000000000000000000000000000), (87 / 50000000000000000000000000000000)⟩ | |
| def weightSquare5_6 : Ball := ⟨(962149829046668872508647133711623 / 100000000000000000000000000000000), (27 / 2500000000000000000000000000000)⟩ | |
| lemma weight_enclosed_5 : weightSquare5_6.Encloses (weight (22640) : ℝ) := by | |
| exact weight_enclosed_of_trace (22640) weightTrace5 weightSquare5_1 weightSquare5_2 weightSquare5_3 weightSquare5_4 weightSquare5_5 weightSquare5_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace6 : List Ball := [ | |
| ⟨(52496907097213613827039425021221 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(102476628332481265185663204667291 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(50822179453251562101591990094477 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16871708672598427120010057088159 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(84152163522076882223784705499 / 2000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(840148968827547918893289383799 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(69930850267688450018787230643 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(159702309542728519984293019 / 800000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2493653488700243236021188337 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(276922068313722247860040669 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(27679898912162961846196791 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(503084522465855867187777 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(26194110004123274166153 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3223024873382905372317 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(46032498729593238173 / 4000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(9588068402869008441 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare6_1 : Ball := ⟨(11023701019093908391497969098631 / 10000000000000000000000000000000), (1 / 25000000000000000000000000000000)⟩ | |
| def weightSquare6_2 : Ball := ⟨(121521984158372074423106444564011 / 100000000000000000000000000000000), (1 / 10000000000000000000000000000000)⟩ | |
| def weightSquare6_3 : Ball := ⟨(18459490792234541766581018912859 / 12500000000000000000000000000000), (1 / 4000000000000000000000000000000)⟩ | |
| def weightSquare6_4 : Ball := ⟨(218081792197498771472088623185963 / 100000000000000000000000000000000), (3 / 4000000000000000000000000000000)⟩ | |
| def weightSquare6_5 : Ball := ⟨(237798340440365180199344472936997 / 50000000000000000000000000000000), (41 / 12500000000000000000000000000000)⟩ | |
| def weightSquare6_6 : Ball := ⟨(226192202864767271537325845748747 / 10000000000000000000000000000000), (39 / 1250000000000000000000000000000)⟩ | |
| lemma weight_enclosed_6 : weightSquare6_6.Encloses (weight (31188) : ℝ) := by | |
| exact weight_enclosed_of_trace (31188) weightTrace6 weightSquare6_1 weightSquare6_2 weightSquare6_3 weightSquare6_4 weightSquare6_5 weightSquare6_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace7 : List Ball := [ | |
| ⟨(13238388542478214491069816710213 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(102925303898300024346667979534741 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(25485209971305104433142398821633 / 50000000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩, | |
| ⟨(8454286069948186469498114558423 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4214954748496148057251911685369 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(841370296775696005405701232473 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(140035844466856609575439150853 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4996131128333977017996839571 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(499213144876440899368362439 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(27716305853430552915679447 / 10000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(27701789454298507636100787 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2517245580029807777294919 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(41938605269701210777891 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16125129745665541975627 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1151479177264804137941 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(38372970988705270699 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare7_1 : Ball := ⟨(11216315596903581711527855028257 / 10000000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare7_2 : Ball := ⟨(125805735569342550503356966593139 / 100000000000000000000000000000000), (1 / 12500000000000000000000000000000)⟩ | |
| def weightSquare7_3 : Ball := ⟨(158270831021433413898498261129081 / 100000000000000000000000000000000), (21 / 100000000000000000000000000000000)⟩ | |
| def weightSquare7_4 : Ball := ⟨(31312069940268911822779912641567 / 12500000000000000000000000000000), (67 / 100000000000000000000000000000000)⟩ | |
| def weightSquare7_5 : Ball := ⟨(125497052664869372826269098660877 / 20000000000000000000000000000000), (337 / 100000000000000000000000000000000)⟩ | |
| def weightSquare7_6 : Ball := ⟨(393737755689224923790566075091771 / 10000000000000000000000000000000), (423 / 10000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_7 : weightSquare7_6.Encloses (weight (36731) : ℝ) := by | |
| exact weight_enclosed_of_trace (36731) weightTrace7 weightSquare7_1 weightSquare7_2 weightSquare7_3 weightSquare7_4 weightSquare7_5 weightSquare7_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace8 : List Ball := [ | |
| ⟨(53107840245772877522502511762089 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(103076607534767528536346359585271 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(5102036178196093237793563948317 / 10000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3384196825616027372211588988827 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(131794605971792912907148072173 / 3125000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(420890623113675921432978149363 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(70047213901119971249691626091 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2498979428084996990116058961 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2496876982418733363454750399 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(34655512160242955405574419 / 12500000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩, | |
| ⟨(27709150025502850262332103 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(62946462422495109382441 / 2500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(41948028645634175042909 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16128493345257602942617 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(28792582462514276983 / 2500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(76759847269274455947 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare8_1 : Ball := ⟨(28204426955705333720136269142093 / 25000000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare8_2 : Ball := ⟨(31819587995988705552098445079421 / 25000000000000000000000000000000), (7 / 100000000000000000000000000000000)⟩ | |
| def weightSquare8_3 : Ball := ⟨(161997788837514964265321695821339 / 100000000000000000000000000000000), (19 / 100000000000000000000000000000000)⟩ | |
| def weightSquare8_4 : Ball := ⟨(52486567176488175914387270062549 / 20000000000000000000000000000000), (63 / 100000000000000000000000000000000)⟩ | |
| def weightSquare8_5 : Ball := ⟨(344354966746500746353077958219731 / 50000000000000000000000000000000), (83 / 25000000000000000000000000000000)⟩ | |
| def weightSquare8_6 : Ball := ⟨(592901715614918174080204664509561 / 12500000000000000000000000000000), (2287 / 50000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_8 : weightSquare8_6.Encloses (weight (38593) : ℝ) := by | |
| exact weight_enclosed_of_trace (38593) weightTrace8 weightSquare8_1 weightSquare8_2 weightSquare8_3 weightSquare8_4 weightSquare8_5 weightSquare8_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace9 : List Ball := [ | |
| ⟨(105769353286979812971192319657867 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(12857213854765865443628769642581 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(50948101186729931232361150203779 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16903024110177614037303920285779 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(842769869335374211420370584613 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(52574160131711393877303756643 / 6250000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(140009649991401748572542612153 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(19981255379359022718212237153 / 100000000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩, | |
| ⟨(62392573665020423810114129 / 2500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(277126818288917152811301887 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(27698497726817026655144159 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(39327679210857430103861 / 1562500000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(104835977052347421176833 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16123625401104954019783 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(287844734674196536367 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(38369860594472552971 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare9_1 : Ball := ⟨(699197255921621710400340726909 / 625000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare9_2 : Ball := ⟨(31288115372052849022082108910093 / 25000000000000000000000000000000), (1 / 12500000000000000000000000000000)⟩ | |
| def weightSquare9_3 : Ball := ⟨(783156930827911832787526073193 / 500000000000000000000000000000), (21 / 100000000000000000000000000000000)⟩ | |
| def weightSquare9_4 : Ball := ⟨(61333477830379467923854252642317 / 25000000000000000000000000000000), (67 / 100000000000000000000000000000000)⟩ | |
| def weightSquare9_5 : Ball := ⟨(601887280443143949422394537773243 / 100000000000000000000000000000000), (33 / 10000000000000000000000000000000)⟩ | |
| def weightSquare9_6 : Ball := ⟨(3622682983592438129289817987640667 / 100000000000000000000000000000000), (3973 / 100000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_9 : weightSquare9_6.Encloses (weight (35898) : ℝ) := by | |
| exact weight_enclosed_of_trace (35898) weightTrace9 weightSquare9_1 weightSquare9_2 weightSquare9_3 weightSquare9_4 weightSquare9_5 weightSquare9_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace10 : List Ball := [ | |
| ⟨(104643817941585644011055002692351 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(102304343486104167397858997043291 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(6345650025415076652394745911099 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16857530898254533759977249142099 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2102390764796993902426298307757 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(839678918917955610443536100733 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(6989733183295338113197086393 / 5000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3990884012883817837828762809 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(623181153966461295253418909 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(138414630349275657661540399 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(6917866971559857065203159 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2514720451697499889277579 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(209498895670714520474879 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16111270073369578912207 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(287638905637475131677 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3067543529976875711 / 4000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare10_1 : Ball := ⟨(109503286333917215300234963650589 / 100000000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare10_2 : Ball := ⟨(23981939435855721532382233715047 / 20000000000000000000000000000000), (1 / 12500000000000000000000000000000)⟩ | |
| def weightSquare10_3 : Ball := ⟨(143783354776262960787841124947381 / 100000000000000000000000000000000), (1 / 5000000000000000000000000000000)⟩ | |
| def weightSquare10_4 : Ball := ⟨(206736531107167007786767430192403 / 100000000000000000000000000000000), (59 / 100000000000000000000000000000000)⟩ | |
| def weightSquare10_5 : Ball := ⟨(427399932942246318664573400014931 / 100000000000000000000000000000000), (49 / 20000000000000000000000000000000)⟩ | |
| def weightSquare10_6 : Ball := ⟨(913353513395183249684030644938607 / 50000000000000000000000000000000), (419 / 20000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_10 : weightSquare10_6.Encloses (weight (29051) : ℝ) := by | |
| exact weight_enclosed_of_trace (29051) weightTrace10 weightSquare10_1 weightSquare10_2 weightSquare10_3 weightSquare10_4 weightSquare10_5 weightSquare10_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace11 : List Ball := [ | |
| ⟨(51457318287274132865276567057379 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1014503403334361270220267489773 / 1000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(50482287126726561924028897888317 / 100000000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩, | |
| ⟨(3357412966824382785429865106037 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1047680795825287522555360752867 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(418670001796633248356362121959 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(69730488017545672562413193419 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3982550427688823527492235683 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1244049333538284529198387107 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(69091744539850108590769427 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(5525893169158403393733513 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2511221947893666302852981 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(209229889795857520126909 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(8046031081551623817853 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1149275510972162029753 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(76608950208370987967 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare11_1 : Ball := ⟨(105914224212713475942880094061453 / 100000000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare11_2 : Ball := ⟨(56089114452904707614563249114169 / 50000000000000000000000000000000), (7 / 100000000000000000000000000000000)⟩ | |
| def weightSquare11_3 : Ball := ⟨(62919775202220875163649729179661 / 50000000000000000000000000000000), (17 / 100000000000000000000000000000000)⟩ | |
| def weightSquare11_4 : Ball := ⟨(9897245278745022430232851573857 / 6250000000000000000000000000000), (11 / 25000000000000000000000000000000)⟩ | |
| def weightSquare11_5 : Ball := ⟨(250765988115560030064146963919903 / 100000000000000000000000000000000), (7 / 5000000000000000000000000000000)⟩ | |
| def weightSquare11_6 : Ball := ⟨(314417903977865971190225770587881 / 50000000000000000000000000000000), (703 / 100000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_11 : weightSquare11_6.Encloses (weight (18387) : ℝ) := by | |
| exact weight_enclosed_of_trace (18387) weightTrace11 weightSquare11_1 weightSquare11_2 weightSquare11_3 weightSquare11_4 weightSquare11_5 weightSquare11_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace12 : List Ball := [ | |
| ⟨(50299565702744265076996558074139 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(50149633731710606664346630250871 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(10019941228855690837754994565271 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16691585754174909970175937448921 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2085824745654684049952040366639 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(834163685934846265222339166067 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(69503749014945907528607500637 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1241005922081361949527725719 / 6250000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1240902916616263466583660047 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(55147578719850151178826729 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(13786145698506878875057519 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(250645847183754706694749 / 10000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(208863538519519027742349 / 100000000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩, | |
| ⟨(16065898544688539931839 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1147531528860113200627 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(7650018722732584753 / 10000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare12_1 : Ball := ⟨(50600926197693743461694777077217 / 50000000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare12_2 : Ball := ⟨(20483629856515592049753749622719 / 20000000000000000000000000000000), (7 / 100000000000000000000000000000000)⟩ | |
| def weightSquare12_3 : Ball := ⟨(5244738651234212176799626520019 / 5000000000000000000000000000000), (3 / 20000000000000000000000000000000)⟩ | |
| def weightSquare12_4 : Ball := ⟨(110029134079000252453786194910311 / 100000000000000000000000000000000), (1 / 3125000000000000000000000000000)⟩ | |
| def weightSquare12_5 : Ball := ⟨(60532051730873073663919899910177 / 50000000000000000000000000000000), (71 / 100000000000000000000000000000000)⟩ | |
| def weightSquare12_6 : Ball := ⟨(29313034293992750986222098316009 / 20000000000000000000000000000000), (173 / 100000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_12 : weightSquare12_6.Encloses (weight (3823) : ℝ) := by | |
| exact weight_enclosed_of_trace (3823) weightTrace12 weightSquare12_1 weightSquare12_2 weightSquare12_3 weightSquare12_4 weightSquare12_5 weightSquare12_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace13 : List Ball := [ | |
| ⟨(97749308384307458995717295526927 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(386212440059808669826807686367 / 390625000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(620284354280447813487395038807 / 1250000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(16572246608625983214041733343471 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(207388417688370545953590935703 / 5000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(166036382119894000421479712647 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(138438502963314708257138641127 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1978495383124961248679789739 / 10000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(309237476945452854929631139 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(274947171450935846495308899 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3437549805329453114224957 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1250233374430986093929039 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(208402594317235319799913 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(8016485665633495607099 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(286334057844721094857 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(15272567399497273009 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare13_1 : Ball := ⟨(95549272896104404998317042425221 / 100000000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare13_2 : Ball := ⟨(91296635509742318701678139152337 / 100000000000000000000000000000000), (7 / 100000000000000000000000000000000)⟩ | |
| def weightSquare13_3 : Ball := ⟨(41675378276993710444793986953517 / 50000000000000000000000000000000), (7 / 50000000000000000000000000000000)⟩ | |
| def weightSquare13_4 : Ball := ⟨(34736743090610384990883814056083 / 50000000000000000000000000000000), (3 / 12500000000000000000000000000000)⟩ | |
| def weightSquare13_5 : Ball := ⟨(24132826410861366426580373032961 / 50000000000000000000000000000000), (7 / 20000000000000000000000000000000)⟩ | |
| def weightSquare13_6 : Ball := ⟨(23295732423070716039874970270233 / 100000000000000000000000000000000), (17 / 50000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_13 : weightSquare13_6.Encloses (weight (-14569) : ℝ) := by | |
| exact weight_enclosed_of_trace (-14569) weightTrace13 weightSquare13_1 weightSquare13_2 weightSquare13_3 weightSquare13_4 weightSquare13_5 weightSquare13_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace14 : List Ball := [ | |
| ⟨(9397419149312240765671878406229 / 10000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(96955889088939538910397682022679 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(23916046352232353441792145211 / 48828125000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3282178827443733390859812092909 / 20000000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩, | |
| ⟨(4115406748962183626188354016423 / 100000000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩, | |
| ⟨(412388718459236045682322206297 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(34416317034840072279521000559 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2461023229140385701538388279 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(492627540295271625210502361 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(68467532913805441181202433 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(27402422922560608218237489 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2492297689867778508766373 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(207773912733602071421357 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(15988047386627809666029 / 100000000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩, | |
| ⟨(571170154415164387469 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(38087296400995144381 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare14_1 : Ball := ⟨(88311486667860398901944158266739 / 100000000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare14_2 : Ball := ⟨(77989186774876849812044262325737 / 100000000000000000000000000000000), (7 / 100000000000000000000000000000000)⟩ | |
| def weightSquare14_3 : Ball := ⟨(60823132538066261346053024041467 / 100000000000000000000000000000000), (3 / 25000000000000000000000000000000)⟩ | |
| def weightSquare14_4 : Ball := ⟨(1156079203669742114596957224833 / 3125000000000000000000000000000), (1 / 6250000000000000000000000000000)⟩ | |
| def weightSquare14_5 : Ball := ⟨(3421488960403622578089278590681 / 25000000000000000000000000000000), (13 / 100000000000000000000000000000000)⟩ | |
| def weightSquare14_6 : Ball := ⟨(117065867061638619900413203703 / 6250000000000000000000000000000), (1 / 25000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_14 : weightSquare14_6.Encloses (weight (-39776) : ℝ) := by | |
| exact weight_enclosed_of_trace (-39776) weightTrace14 weightSquare14_1 weightSquare14_2 weightSquare14_3 weightSquare14_4 weightSquare14_5 weightSquare14_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace15 : List Ball := [ | |
| ⟨(94147322024652654828833510491163 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(97044248516044896355939512038323 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(49009817859248311627512106727623 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1641837841548993622447410991039 / 10000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(823381940790235157278803689397 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(206257164476878098440948109979 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(137701235103513169711025747113 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(19692689326920054765335269601 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2463638768430057590648224087 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(273920293962133881870515871 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(27406987350225809089504263 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1246339178279343493885119 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(207803214433657946794709 / 100000000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩, | |
| ⟨(1998767697855936571617 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(114247998713503541457 / 10000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(76183390027455214293 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare15_1 : Ball := ⟨(44318591222068234326289200916567 / 50000000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩ | |
| def weightSquare15_2 : Ball := ⟨(61379297747149485991007624471 / 78125000000000000000000000000), (1 / 25000000000000000000000000000000)⟩ | |
| def weightSquare15_3 : Ball := ⟨(1928918114269813742751307284463 / 3125000000000000000000000000000), (1 / 12500000000000000000000000000000)⟩ | |
| def weightSquare15_4 : Ball := ⟨(2381264058597257105709481658969 / 6250000000000000000000000000000), (11 / 100000000000000000000000000000000)⟩ | |
| def weightSquare15_5 : Ball := ⟨(14516271402923727674314000842103 / 100000000000000000000000000000000), (9 / 100000000000000000000000000000000)⟩ | |
| def weightSquare15_6 : Ball := ⟨(2107221354433412088486138736011 / 100000000000000000000000000000000), (1 / 25000000000000000000000000000000)⟩ | |
| lemma weight_enclosed_15 : weightSquare15_6.Encloses (weight (-38598) : ℝ) := by | |
| exact weight_enclosed_of_trace (-38598) weightTrace15 weightSquare15_1 weightSquare15_2 weightSquare15_3 weightSquare15_4 weightSquare15_5 weightSquare15_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightTrace16 : List Ball := [ | |
| ⟨(96363397544038665735902571610653 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3926818916509623635941208316487 / 4000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(24694139865151464166961931335581 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3302690843648775656223451075217 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(165439458394777402989072424451 / 4000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(82821546947141128907996775141 / 10000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(69078641632151769912138780799 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(19749772217589986559441937981 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(154374259625197756705469647 / 6250000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(274555792962808879841926837 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1373240124245016613661353 / 5000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(249749928356493009833667 / 10000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(52043563214049462922493 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(8008328294019073421673 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(228849664429048117677 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(38147293777383269777 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4779477332387385297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def weightSquare16_1 : Ball := ⟨(5803690241394023222060139461611 / 6250000000000000000000000000000), (3 / 100000000000000000000000000000000)⟩ | |
| def weightSquare16_2 : Ball := ⟨(17245604054042734355635644885209 / 20000000000000000000000000000000), (7 / 100000000000000000000000000000000)⟩ | |
| def weightSquare16_3 : Ball := ⟨(116176116870630935339684428353 / 156250000000000000000000000000), (13 / 100000000000000000000000000000000)⟩ | |
| def weightSquare16_4 : Ball := ⟨(11056652395428657424319758888073 / 20000000000000000000000000000000), (21 / 100000000000000000000000000000000)⟩ | |
| def weightSquare16_5 : Ball := ⟨(30562390548334567074915733474673 / 100000000000000000000000000000000), (3 / 12500000000000000000000000000000)⟩ | |
| def weightSquare16_6 : Ball := ⟨(2335149290072325198800662941033 / 25000000000000000000000000000000), (1 / 6250000000000000000000000000000)⟩ | |
| lemma weight_enclosed_16 : weightSquare16_6.Encloses (weight (-23708) : ℝ) := by | |
| exact weight_enclosed_of_trace (-23708) weightTrace16 weightSquare16_1 weightSquare16_2 weightSquare16_3 weightSquare16_4 weightSquare16_5 weightSquare16_6 | |
| (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) (by decide +kernel) | |
| def weightBall : Fin 17 → Ball := (Matrix.vecCons (weightSquare0_6) (Matrix.vecCons (weightSquare1_6) (Matrix.vecCons (weightSquare2_6) (Matrix.vecCons (weightSquare3_6) (Matrix.vecCons (weightSquare4_6) (Matrix.vecCons (weightSquare5_6) (Matrix.vecCons (weightSquare6_6) (Matrix.vecCons (weightSquare7_6) (Matrix.vecCons (weightSquare8_6) (Matrix.vecCons (weightSquare9_6) (Matrix.vecCons (weightSquare10_6) (Matrix.vecCons (weightSquare11_6) (Matrix.vecCons (weightSquare12_6) (Matrix.vecCons (weightSquare13_6) (Matrix.vecCons (weightSquare14_6) (Matrix.vecCons (weightSquare15_6) (Matrix.vecCons (weightSquare16_6) Matrix.vecEmpty))))))))))))))))) | |
| lemma weightBall_sound (k : Fin 17) : | |
| (weightBall k).Encloses (weight (initialInteger k.val) : ℝ) := by | |
| fin_cases k | |
| · exact weight_enclosed_0 | |
| · exact weight_enclosed_1 | |
| · exact weight_enclosed_2 | |
| · exact weight_enclosed_3 | |
| · exact weight_enclosed_4 | |
| · exact weight_enclosed_5 | |
| · exact weight_enclosed_6 | |
| · exact weight_enclosed_7 | |
| · exact weight_enclosed_8 | |
| · exact weight_enclosed_9 | |
| · exact weight_enclosed_10 | |
| · exact weight_enclosed_11 | |
| · exact weight_enclosed_12 | |
| · exact weight_enclosed_13 | |
| · exact weight_enclosed_14 | |
| · exact weight_enclosed_15 | |
| · exact weight_enclosed_16 | |
| def sourceWeightBall (k : ℕ) : Ball := weightBall ⟨k % 17, Nat.mod_lt _ (by decide)⟩ | |
| lemma sourceWeightBall_sound (k : ℕ) (hk : k < 17) : | |
| (sourceWeightBall k).Encloses (weight (initialInteger k) : ℝ) := by | |
| simpa only [sourceWeightBall, Nat.mod_eq_of_lt hk] using weightBall_sound ⟨k,hk⟩ | |
| def listSumBall {α : Type*} (xs : List α) (b : α → Ball) : Ball := | |
| xs.foldr (fun x a => .add (b x) a) (.exact 0) | |
| lemma listSumBall_sound {α : Type*} (xs : List α) (b : α → Ball) (v : α → ℝ) | |
| (h : ∀ x ∈ xs, (b x).Encloses (v x)) : | |
| (listSumBall xs b).Encloses ((xs.map v).sum) := by | |
| induction xs with | |
| | nil => simpa [listSumBall] using Ball.exact_sound 0 | |
| | cons x xs ih => | |
| simpa only [listSumBall, List.foldr_cons, List.map_cons, List.sum_cons] using | |
| Ball.add_sound (h x (by simp)) (ih (fun y hy => h y (by simp [hy]))) | |
| def finSumBall : (n : ℕ) → (Fin n → Ball) → Ball | |
| | 0, _ => .exact 0 | |
| | n+1, b => .add (b 0) (finSumBall n (fun i => b i.succ)) | |
| lemma finSumBall_sound (n : ℕ) (b : Fin n → Ball) (v : Fin n → ℝ) | |
| (h : ∀ i, (b i).Encloses (v i)) : | |
| (finSumBall n b).Encloses (∑ i, v i) := by | |
| induction n with | |
| | zero => simpa [finSumBall] using Ball.exact_sound 0 | |
| | succ n ih => | |
| rw [Fin.sum_univ_succ] | |
| exact Ball.add_sound (h 0) (ih _ _ (fun i => h i.succ)) | |
| def initialRawBall (s : Shape) : Ball := | |
| .mul (.exact (initialMultiplicity s)) | |
| (.mul (sourceWeightBall (s 0)) | |
| (.mul (sourceWeightBall (s 1)) (sourceWeightBall (s 2)))) | |
| lemma initial_shape_bound : ∀ s ∈ sortedInitial, ∀ i : Fin 3, s i < 17 := by | |
| decide +kernel | |
| lemma initialRawBall_sound (s : Shape) (hs : s ∈ sortedInitial) : | |
| (initialRawBall s).Encloses (initialWeight s : ℝ) := by | |
| have h := Ball.mul_sound (Ball.exact_sound (initialMultiplicity s : ℚ)) | |
| (Ball.mul_sound (sourceWeightBall_sound (s 0) (initial_shape_bound s hs 0)) | |
| (Ball.mul_sound (sourceWeightBall_sound (s 1) (initial_shape_bound s hs 1)) | |
| (sourceWeightBall_sound (s 2) (initial_shape_bound s hs 2)))) | |
| simpa only [initialRawBall, initialWeight, Rat.cast_mul, Rat.cast_prod, | |
| Fin.prod_univ_succ, Fin.prod_univ_zero, mul_one, Fin.succ_zero_eq_one, | |
| Fin.succ_one_eq_two] using h | |
| def initialDenominatorBall : Ball := listSumBall sortedInitial initialRawBall | |
| lemma initialDenominatorBall_sound : | |
| initialDenominatorBall.Encloses ((sortedInitial.map initialWeight).sum : ℝ) := by | |
| have h := listSumBall_sound sortedInitial initialRawBall | |
| (fun s => (initialWeight s : ℝ)) initialRawBall_sound | |
| simpa only [initialDenominatorBall, Rat.cast_list_sum, List.map_map, | |
| Function.comp_def] using h | |
| lemma initialDenominatorBall_positive : 0 < initialDenominatorBall.lower := by | |
| decide +kernel | |
| def initialLawBall (s : Shape) : Ball := | |
| .mul (initialRawBall s) (.inv initialDenominatorBall) | |
| lemma initialLawBall_sound (s : Shape) (hs : s ∈ sortedInitial) : | |
| (initialLawBall s).Encloses (initialLaw s : ℝ) := by | |
| have h := Ball.mul_sound (initialRawBall_sound s hs) | |
| (Ball.inv_sound initialDenominatorBall_sound initialDenominatorBall_positive) | |
| simpa only [initialLawBall, initialLaw, hs, ite_true, Rat.cast_div, | |
| div_eq_mul_inv, Rat.cast_mul, Rat.cast_inv] using h | |
| def initialMarginalBall (k : Fin 17) : Ball := | |
| finSumBall sortedInitial.length (fun g => | |
| .mul (initialLawBall (sortedInitial.get g)) | |
| (.exact ((∑ w : Fin 3, if sortedInitial.get g w = k.val then (1 : ℚ) else 0) / 3))) | |
| lemma initialMarginalBall_sound (k : Fin 17) : | |
| (initialMarginalBall k).Encloses (AllFieldInitialEntropy.nativeInitialMarginal k) := by | |
| apply finSumBall_sound | |
| intro g | |
| have h := Ball.mul_sound (initialLawBall_sound (sortedInitial.get g) (List.get_mem _ _)) | |
| (Ball.exact_sound ((∑ w : Fin 3, if sortedInitial.get g w = k.val then (1 : ℚ) else 0) / 3)) | |
| convert h using 1 | |
| simp only [Rat.cast_div, Rat.cast_sum, apply_ite, Rat.cast_one, | |
| Rat.cast_zero, Rat.cast_ofNat, mul_div_assoc] | |
| def roundedMarginal : Fin 17 → Ball := (Matrix.vecCons (⟨(37824257369353410027720060279 / 50000000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(32277877294971248510635537179 / 6250000000000000000000000000000), (1 / 20000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(1311429618383774862762137339319 / 50000000000000000000000000000000), (1 / 5000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(8221633968389025907864338663411 / 100000000000000000000000000000000), (3 / 5000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(3458333166749295114800388945299 / 20000000000000000000000000000000), (1 / 781250000000000000000000000000)⟩) (Matrix.vecCons (⟨(24885489904708998392039676962479 / 100000000000000000000000000000000), (181 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(24112146157967309906901428396197 / 100000000000000000000000000000000), (91 / 50000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(3779863608787839049947557982127 / 25000000000000000000000000000000), (111 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(5764358674456721497871303174559 / 100000000000000000000000000000000), (43 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(1226948071890256520646842010821 / 100000000000000000000000000000000), (1 / 10000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(151656043521920341821121947439 / 100000000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(2239268756742155430560743707 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(484478437366253348343232821 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(3038569022328601883975409 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(7930177818229705654311 / 6250000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(14180164171909061741993 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(4381963528820193732059 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩) Matrix.vecEmpty))))))))))))))))) | |
| lemma marginal_containment_0 : contains (initialMarginalBall 0) (roundedMarginal 0) = true := by | |
| decide +kernel | |
| lemma marginal_containment_1 : contains (initialMarginalBall 1) (roundedMarginal 1) = true := by | |
| decide +kernel | |
| lemma marginal_containment_2 : contains (initialMarginalBall 2) (roundedMarginal 2) = true := by | |
| decide +kernel | |
| lemma marginal_containment_3 : contains (initialMarginalBall 3) (roundedMarginal 3) = true := by | |
| decide +kernel | |
| lemma marginal_containment_4 : contains (initialMarginalBall 4) (roundedMarginal 4) = true := by | |
| decide +kernel | |
| lemma marginal_containment_5 : contains (initialMarginalBall 5) (roundedMarginal 5) = true := by | |
| decide +kernel | |
| lemma marginal_containment_6 : contains (initialMarginalBall 6) (roundedMarginal 6) = true := by | |
| decide +kernel | |
| lemma marginal_containment_7 : contains (initialMarginalBall 7) (roundedMarginal 7) = true := by | |
| decide +kernel | |
| lemma marginal_containment_8 : contains (initialMarginalBall 8) (roundedMarginal 8) = true := by | |
| decide +kernel | |
| lemma marginal_containment_9 : contains (initialMarginalBall 9) (roundedMarginal 9) = true := by | |
| decide +kernel | |
| lemma marginal_containment_10 : contains (initialMarginalBall 10) (roundedMarginal 10) = true := by | |
| decide +kernel | |
| lemma marginal_containment_11 : contains (initialMarginalBall 11) (roundedMarginal 11) = true := by | |
| decide +kernel | |
| lemma marginal_containment_12 : contains (initialMarginalBall 12) (roundedMarginal 12) = true := by | |
| decide +kernel | |
| lemma marginal_containment_13 : contains (initialMarginalBall 13) (roundedMarginal 13) = true := by | |
| decide +kernel | |
| lemma marginal_containment_14 : contains (initialMarginalBall 14) (roundedMarginal 14) = true := by | |
| decide +kernel | |
| lemma marginal_containment_15 : contains (initialMarginalBall 15) (roundedMarginal 15) = true := by | |
| decide +kernel | |
| lemma marginal_containment_16 : contains (initialMarginalBall 16) (roundedMarginal 16) = true := by | |
| decide +kernel | |
| lemma roundedMarginal_sound (k : Fin 17) : | |
| (roundedMarginal k).Encloses (AllFieldInitialEntropy.nativeInitialMarginal k) := by | |
| apply contains_sound (initialMarginalBall_sound k) | |
| fin_cases k | |
| · exact marginal_containment_0 | |
| · exact marginal_containment_1 | |
| · exact marginal_containment_2 | |
| · exact marginal_containment_3 | |
| · exact marginal_containment_4 | |
| · exact marginal_containment_5 | |
| · exact marginal_containment_6 | |
| · exact marginal_containment_7 | |
| · exact marginal_containment_8 | |
| · exact marginal_containment_9 | |
| · exact marginal_containment_10 | |
| · exact marginal_containment_11 | |
| · exact marginal_containment_12 | |
| · exact marginal_containment_13 | |
| · exact marginal_containment_14 | |
| · exact marginal_containment_15 | |
| · exact marginal_containment_16 | |
| def logTwoTrace : List Ball := [ | |
| ⟨(20794415416798359282516957915099 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(35748693755926167713263106179463 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(5434560950833877354841988903793 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3128838846003916954862320107311 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3056579874686922885058244064393 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2007375097745844772419357263631 / 20000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4256848790190598288526447522607 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(7392508992661538424245286176159 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1633145233488461454551893896359 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(1463012983749094267437633302527 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(662505795291976835048297229793 / 12500000000000000000000000000000), (1 / 50000000000000000000000000000000)⟩, | |
| ⟨(2421637201939737490310128843981 / 50000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4459034852306579173408406148187 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(4131313670759212560675655333689 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(240530606468723732046722791867 / 6250000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(450240571609440969944458529469 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(84626577284090520093573740141 / 2500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3192840549545314506413819178039 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(3021279231622116272010086888069 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2867188760274722123766457668297 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(340971970693677773852649492219 / 12500000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2598762377749677766171251244647 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(2458628841607565011820330969267 / 100000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩, | |
| ⟨(531914893617021276595744680851 / 25000000000000000000000000000000), (1 / 100000000000000000000000000000000)⟩] | |
| def logTwoBall : Ball := ⟨(6931471805599453094172319305033 / 10000000000000000000000000000000), (21175823683 / 100000000000000000000000000000000)⟩ | |
| lemma logTwoBall_sound : logTwoBall.Encloses (Real.log 2) := by | |
| have h := normalizedLogBall_sound (m := 2) (trace := logTwoTrace) | |
| (by norm_num) (by norm_num) (by decide +kernel) | |
| exact contains_sound h (by decide +kernel) | |
| def marginalLogWitness : Fin 17 → LogWitness := (Matrix.vecCons (⟨-11, 37824257369353410027720060279, 24414062500000000000000000000⟩) (Matrix.vecCons (⟨-8, 32277877294971248510635537179, 24414062500000000000000000000⟩) (Matrix.vecCons (⟨-6, 1311429618383774862762137339319, 781250000000000000000000000000⟩) (Matrix.vecCons (⟨-4, 8221633968389025907864338663411, 6250000000000000000000000000000⟩) (Matrix.vecCons (⟨-3, 3458333166749295114800388945299, 2500000000000000000000000000000⟩) (Matrix.vecCons (⟨-3, 24885489904708998392039676962479, 12500000000000000000000000000000⟩) (Matrix.vecCons (⟨-3, 24112146157967309906901428396197, 12500000000000000000000000000000⟩) (Matrix.vecCons (⟨-3, 3779863608787839049947557982127, 3125000000000000000000000000000⟩) (Matrix.vecCons (⟨-5, 5764358674456721497871303174559, 3125000000000000000000000000000⟩) (Matrix.vecCons (⟨-7, 1226948071890256520646842010821, 781250000000000000000000000000⟩) (Matrix.vecCons (⟨-10, 151656043521920341821121947439, 97656250000000000000000000000⟩) (Matrix.vecCons (⟨-14, 2239268756742155430560743707, 1220703125000000000000000000⟩) (Matrix.vecCons (⟨-18, 484478437366253348343232821, 381469726562500000000000000⟩) (Matrix.vecCons (⟨-23, 3038569022328601883975409, 2980232238769531250000000⟩) (Matrix.vecCons (⟨-30, 31720711272918822617244, 23283064365386962890625⟩) (Matrix.vecCons (⟨-33, 28360328343818123483986, 23283064365386962890625⟩) (Matrix.vecCons (⟨-35, 35055708230561549856472, 23283064365386962890625⟩) Matrix.vecEmpty))))))))))))))))) | |
| def marginalLogBall : Fin 17 → Ball := (Matrix.vecCons (⟨(-359341382912849805381766834083483 / 50000000000000000000000000000000), (254109886839 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-526595466063060246707895328811773 / 100000000000000000000000000000000), (38116482823 / 20000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-182045257575976223204856091760809 / 50000000000000000000000000000000), (9264422909 / 6250000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-249840121706468106425374731856733 / 100000000000000000000000000000000), (13234889893 / 12500000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-175494554427421837074873290309581 / 100000000000000000000000000000000), (5293955967 / 6250000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-139088528712395736536901400948077 / 100000000000000000000000000000000), (84703295459 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-27782314111222943517224434997 / 19531250000000000000000000000), (84703295487 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-7556751592875787652219540186071 / 4000000000000000000000000000000), (42351647733 / 50000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-142673814156440611744929044763629 / 50000000000000000000000000000000), (31763735711 / 25000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-440064034235271909031072697214261 / 100000000000000000000000000000000), (169406590279 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-649131037985310617044853658780989 / 100000000000000000000000000000000), (29116757729 / 12500000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-113716727348098189960178186941083 / 12500000000000000000000000000000), (317637364177 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-305940195463298290399109426509441 / 25000000000000000000000000000000), (6286575881 / 1562500000000000000000000000000)⟩) (Matrix.vecCons (⟨(-1592299969457533467596519841341019 / 100000000000000000000000000000000), (508227995949 / 100000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-81940687367260669107912929811931 / 4000000000000000000000000000000), (32861933139 / 5000000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-2267659192418886369231475949409093 / 100000000000000000000000000000000), (90878763719 / 12500000000000000000000000000000)⟩) (Matrix.vecCons (⟨(-1192546955237440450086597482595127 / 50000000000000000000000000000000), (392575236187 / 50000000000000000000000000000000)⟩) Matrix.vecEmpty))))))))))))))))) | |
| lemma marginalLogBall_sound (k : Fin 17) : | |
| (marginalLogBall k).Encloses (Real.log (AllFieldInitialEntropy.nativeInitialMarginal k)) := by | |
| apply checkLog_sound logTwoBall_sound (roundedMarginal_sound k) | |
| (w := marginalLogWitness k) | |
| fin_cases k <;> decide +kernel | |
| def totalMarginalBall : Ball := ⟨(99999999999999999999999999999989 / 100000000000000000000000000000000), (3 / 400000000000000000000000000000)⟩ | |
| lemma totalMarginalBall_sound : | |
| totalMarginalBall.Encloses (∑ k, AllFieldInitialEntropy.nativeInitialMarginal k) := by | |
| apply contains_sound (finSumBall_sound 17 roundedMarginal | |
| AllFieldInitialEntropy.nativeInitialMarginal roundedMarginal_sound) | |
| decide +kernel | |
| def totalLogWitness : LogWitness := ⟨-1, 99999999999999999999999999999989, 50000000000000000000000000000000⟩ | |
| def totalLogBall : Ball := ⟨(-11 / 100000000000000000000000000000000), (10587912029 / 25000000000000000000000000000000)⟩ | |
| lemma totalLogBall_sound : | |
| totalLogBall.Encloses (Real.log (∑ k, AllFieldInitialEntropy.nativeInitialMarginal k)) := by | |
| exact checkLog_sound logTwoBall_sound totalMarginalBall_sound | |
| (w := totalLogWitness) (by decide +kernel) | |
| def entropySumBall : Ball := | |
| finSumBall 17 (fun k => .neg (.mul (roundedMarginal k) (marginalLogBall k))) | |
| lemma entropySumBall_sound : | |
| entropySumBall.Encloses (MatrixMultiplication.Foundation.finiteEntropy | |
| AllFieldInitialEntropy.nativeInitialMarginal) := by | |
| apply finSumBall_sound | |
| intro k | |
| have h := Ball.neg_sound (Ball.mul_sound (roundedMarginal_sound k) | |
| (marginalLogBall_sound k)) | |
| convert h using 1 | |
| unfold MatrixMultiplication.Foundation.entropyTerm | |
| ring | |
| def initialEntropyRawBall : Ball := .add | |
| (.mul totalMarginalBall totalLogBall) entropySumBall | |
| lemma initialEntropyRawBall_sound : | |
| initialEntropyRawBall.Encloses AllFieldInitialEntropy.nativeH0 := by | |
| exact Ball.add_sound (Ball.mul_sound totalMarginalBall_sound totalLogBall_sound) | |
| entropySumBall_sound | |
| def initialEntropyBall : Ball := ⟨(92057368710548199998533979957297 / 50000000000000000000000000000000), (2107346571 / 1562500000000000000000000000000)⟩ | |
| theorem nativeH0_enclosed : initialEntropyBall.Encloses AllFieldInitialEntropy.nativeH0 := by | |
| exact contains_sound initialEntropyRawBall_sound (by decide +kernel) | |
| theorem nativeH0_strict_bounds : | |
| (184114737421096399996 : ℝ) / 100000000000000000000 < AllFieldInitialEntropy.nativeH0 ∧ | |
| AllFieldInitialEntropy.nativeH0 < (184114737421096399998 : ℝ) / 100000000000000000000 := by | |
| obtain ⟨hl,hu⟩ := Ball.bounds nativeH0_enclosed | |
| norm_num [initialEntropyBall, Ball.lower, Ball.upper] at hl hu ⊢ | |
| constructor <;> linarith | |
| end MatrixMultiplication.AllFieldInitialEntropyCertificate | |
| end | |
| end | |
| end MatrixAllFields | |
| namespace MatrixAllFields | |
| open scoped BigOperators Topology Polynomial | |
| section | |
| noncomputable section | |
| namespace MatrixMultiplication.AllFieldVolumeCertificate | |
| open AllFieldParameters AllFieldCertificates AllFieldCertificates.Replay | |
| open AllFieldInitialEntropyCertificate AllFieldTerminalRates | |
| open scoped BigOperators | |
| def zeroLeafShape (k : Fin 9) : Shape := shape 0 k.val (16-k.val) | |
| def zeroLeafCoefficient (k : Fin 9) : ℕ := | |
| Contractions.coefficients[shapeMax (zeroLeafShape k)]?.getD 0 | |
| lemma zeroLeafShape_mem (k : Fin 9) : zeroLeafShape k ∈ sortedInitial := by | |
| revert k | |
| decide +kernel | |
| lemma initialZeroShapes : sortedInitial.filter (fun g => !positive g) = | |
| List.ofFn zeroLeafShape := by | |
| decide +kernel | |
| lemma nativeS0_eq_sum : S0 = ∑ k : Fin 9, | |
| (initialLaw (zeroLeafShape k) : ℝ) * initialRate (zeroLeafShape k) := by | |
| rw [S0, initialZeroShapes, List.map_ofFn, List.sum_ofFn] | |
| rfl | |
| def leafLogWitness0 : LogWitness := ⟨0, 1, 1⟩ | |
| def leafRateBall0 : Ball := ⟨0, (10587911841 / 50000000000000000000000000000000)⟩ | |
| lemma leafRateBall0_sound : leafRateBall0.Encloses | |
| (initialRate (zeroLeafShape 0)) := by | |
| have hc : (Ball.exact (zeroLeafCoefficient 0 : ℚ)).Encloses | |
| (zeroLeafCoefficient 0 : ℝ) := by | |
| simpa using Ball.exact_sound (zeroLeafCoefficient 0 : ℚ) | |
| exact checkLog_sound logTwoBall_sound hc (w := leafLogWitness0) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def leafLogWitness1 : LogWitness := ⟨5, 5, 4⟩ | |
| def leafRateBall1 : Ball := ⟨(368887945411393630285245474282633 / 100000000000000000000000000000000), (127054942097 / 100000000000000000000000000000000)⟩ | |
| lemma leafRateBall1_sound : leafRateBall1.Encloses | |
| (initialRate (zeroLeafShape 1)) := by | |
| have hc : (Ball.exact (zeroLeafCoefficient 1 : ℚ)).Encloses | |
| (zeroLeafCoefficient 1 : ℝ) := by | |
| simpa using Ball.exact_sound (zeroLeafCoefficient 1 : ℚ) | |
| exact checkLog_sound logTwoBall_sound hc (w := leafLogWitness1) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def leafLogWitness2 : LogWitness := ⟨9, 177, 128⟩ | |
| def leafRateBall2 : Ball := ⟨(164061102342342994021143953374117 / 25000000000000000000000000000000), (21175823683 / 10000000000000000000000000000000)⟩ | |
| lemma leafRateBall2_sound : leafRateBall2.Encloses | |
| (initialRate (zeroLeafShape 2)) := by | |
| have hc : (Ball.exact (zeroLeafCoefficient 2 : ℚ)).Encloses | |
| (zeroLeafCoefficient 2 : ℝ) := by | |
| simpa using Ball.exact_sound (zeroLeafCoefficient 2 : ℚ) | |
| exact checkLog_sound logTwoBall_sound hc (w := leafLogWitness2) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def leafLogWitness3 : LogWitness := ⟨12, 455, 256⟩ | |
| def leafRateBall3 : Ball := ⟨(889288614119073165342852571257363 / 100000000000000000000000000000000), (275285707879 / 100000000000000000000000000000000)⟩ | |
| lemma leafRateBall3_sound : leafRateBall3.Encloses | |
| (initialRate (zeroLeafShape 3)) := by | |
| have hc : (Ball.exact (zeroLeafCoefficient 3 : ℚ)).Encloses | |
| (zeroLeafCoefficient 3 : ℝ) := by | |
| simpa using Ball.exact_sound (zeroLeafCoefficient 3 : ℚ) | |
| exact checkLog_sound logTwoBall_sound hc (w := leafLogWitness3) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def leafLogWitness4 : LogWitness := ⟨15, 23989, 16384⟩ | |
| def leafRateBall4 : Ball := ⟨(269462446287246686158044077687313 / 25000000000000000000000000000000), (21175823683 / 6250000000000000000000000000000)⟩ | |
| lemma leafRateBall4_sound : leafRateBall4.Encloses | |
| (initialRate (zeroLeafShape 4)) := by | |
| have hc : (Ball.exact (zeroLeafCoefficient 4 : ℚ)).Encloses | |
| (zeroLeafCoefficient 4 : ℝ) := by | |
| simpa using Ball.exact_sound (zeroLeafCoefficient 4 : ℚ) | |
| exact checkLog_sound logTwoBall_sound hc (w := leafLogWitness4) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def leafLogWitness5 : LogWitness := ⟨17, 26355, 16384⟩ | |
| def leafRateBall5 : Ball := ⟨(9577230336694643113727840367767 / 781250000000000000000000000000), (190582413147 / 50000000000000000000000000000000)⟩ | |
| lemma leafRateBall5_sound : leafRateBall5.Encloses | |
| (initialRate (zeroLeafShape 5)) := by | |
| have hc : (Ball.exact (zeroLeafCoefficient 5 : ℚ)).Encloses | |
| (zeroLeafCoefficient 5 : ℝ) := by | |
| simpa using Ball.exact_sound (zeroLeafCoefficient 5 : ℚ) | |
| exact checkLog_sound logTwoBall_sound hc (w := leafLogWitness5) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def leafLogWitness6 : LogWitness := ⟨19, 38941, 32768⟩ | |
| def leafRateBall6 : Ball := ⟨(1334239168137038775559946496265297 / 100000000000000000000000000000000), (423516473659 / 100000000000000000000000000000000)⟩ | |
| lemma leafRateBall6_sound : leafRateBall6.Encloses | |
| (initialRate (zeroLeafShape 6)) := by | |
| have hc : (Ball.exact (zeroLeafCoefficient 6 : ℚ)).Encloses | |
| (zeroLeafCoefficient 6 : ℝ) := by | |
| simpa using Ball.exact_sound (zeroLeafCoefficient 6 : ℚ) | |
| exact checkLog_sound logTwoBall_sound hc (w := leafLogWitness6) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def leafLogWitness7 : LogWitness := ⟨20, 152675, 131072⟩ | |
| def leafRateBall7 : Ball := ⟨(43798463436784910719256790204483 / 3125000000000000000000000000000), (222346148671 / 50000000000000000000000000000000)⟩ | |
| lemma leafRateBall7_sound : leafRateBall7.Encloses | |
| (initialRate (zeroLeafShape 7)) := by | |
| have hc : (Ball.exact (zeroLeafCoefficient 7 : ℚ)).Encloses | |
| (zeroLeafCoefficient 7 : ℝ) := by | |
| simpa using Ball.exact_sound (zeroLeafCoefficient 7 : ℚ) | |
| exact checkLog_sound logTwoBall_sound hc (w := leafLogWitness7) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def leafLogWitness8 : LogWitness := ⟨20, 1542195, 1048576⟩ | |
| def leafRateBall8 : Ball := ⟨(1424871728425409722017918230467949 / 100000000000000000000000000000000), (222346148671 / 50000000000000000000000000000000)⟩ | |
| lemma leafRateBall8_sound : leafRateBall8.Encloses | |
| (initialRate (zeroLeafShape 8)) := by | |
| have hc : (Ball.exact (zeroLeafCoefficient 8 : ℚ)).Encloses | |
| (zeroLeafCoefficient 8 : ℝ) := by | |
| simpa using Ball.exact_sound (zeroLeafCoefficient 8 : ℚ) | |
| exact checkLog_sound logTwoBall_sound hc (w := leafLogWitness8) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def leafRateBall : Fin 9 → Ball := (Matrix.vecCons (leafRateBall0) (Matrix.vecCons (leafRateBall1) (Matrix.vecCons (leafRateBall2) (Matrix.vecCons (leafRateBall3) (Matrix.vecCons (leafRateBall4) (Matrix.vecCons (leafRateBall5) (Matrix.vecCons (leafRateBall6) (Matrix.vecCons (leafRateBall7) (Matrix.vecCons (leafRateBall8) Matrix.vecEmpty))))))))) | |
| lemma leafRateBall_sound (k : Fin 9) : | |
| (leafRateBall k).Encloses (initialRate (zeroLeafShape k)) := by | |
| fin_cases k | |
| · exact leafRateBall0_sound | |
| · exact leafRateBall1_sound | |
| · exact leafRateBall2_sound | |
| · exact leafRateBall3_sound | |
| · exact leafRateBall4_sound | |
| · exact leafRateBall5_sound | |
| · exact leafRateBall6_sound | |
| · exact leafRateBall7_sound | |
| · exact leafRateBall8_sound | |
| def initialVolumeRawBall : Ball := finSumBall 9 (fun k => | |
| .mul (initialLawBall (zeroLeafShape k)) (leafRateBall k)) | |
| lemma initialVolumeRawBall_sound : initialVolumeRawBall.Encloses S0 := by | |
| rw [nativeS0_eq_sum] | |
| apply finSumBall_sound | |
| intro k | |
| exact Ball.mul_sound (initialLawBall_sound _ (zeroLeafShape_mem k)) | |
| (leafRateBall_sound k) | |
| def initialVolumeBall : Ball := ⟨(3170407140796466915468826036527 / 100000000000000000000000000000000), (249845433 / 25000000000000000000000000000000)⟩ | |
| theorem nativeS0_enclosed : initialVolumeBall.Encloses S0 := by | |
| exact contains_sound initialVolumeRawBall_sound (by decide +kernel) | |
| theorem nativeS0_strict_bounds : | |
| (3170407140796466915 : ℝ) / 100000000000000000000 < S0 ∧ S0 < (3170407140796466916 : ℝ) / 100000000000000000000 := by | |
| obtain ⟨hl,hu⟩ := Ball.bounds nativeS0_enclosed | |
| norm_num [initialVolumeBall, Ball.lower, Ball.upper] at hl hu ⊢ | |
| constructor <;> linarith | |
| end MatrixMultiplication.AllFieldVolumeCertificate | |
| end | |
| end | |
| end MatrixAllFields | |
| namespace MatrixAllFields | |
| open scoped BigOperators Topology Polynomial | |
| section | |
| noncomputable section | |
| namespace MatrixMultiplication.NativeNumerics | |
| open AllFieldParameters AllFieldHistory AllFieldCertificates AllFieldCertificates.Replay | |
| open AllFieldInitialEntropyCertificate | |
| open scoped BigOperators | |
| lemma splitWeight_three_enclosed (parents : List Shape) (data : List ℤ) | |
| (s u : Shape) (n₀ n₁ n₂ : ℤ) (b₀ b₁ b₂ : Ball) | |
| (hsig : splitSignature parents data s u = (Matrix.vecCons (n₀) (Matrix.vecCons (n₁) (Matrix.vecCons (n₂) Matrix.vecEmpty)))) | |
| (h₀ : b₀.Encloses (weight n₀ : ℝ)) | |
| (h₁ : b₁.Encloses (weight n₁ : ℝ)) | |
| (h₂ : b₂.Encloses (weight n₂ : ℝ)) : | |
| (Ball.mul b₀ (Ball.mul b₁ b₂)).Encloses (splitWeight parents data s u : ℝ) := by | |
| convert Ball.mul_sound h₀ (Ball.mul_sound h₁ h₂) using 1 | |
| simp [splitWeight, hsig, Fin.prod_univ_succ] | |
| lemma list_cast_enclosed {A : Type*} (xs : List A) (b : A → Ball) (v : A → ℚ) | |
| (h : ∀ a ∈ xs, (b a).Encloses (v a : ℝ)) : | |
| (listSumBall xs b).Encloses ((xs.map v).sum : ℝ) := by | |
| simpa only [Rat.cast_list_sum, List.map_map, Function.comp_def] using | |
| listSumBall_sound xs b (fun a => (v a : ℝ)) h | |
| lemma product_fin6_enclosed (bs : Fin 6 → Fin 6 → Ball) (v : PairSlot → ℝ) | |
| (h : ∀ i j, (bs i j).Encloses (v (i,j))) : | |
| (finSumBall 6 (fun i => finSumBall 6 (bs i))).Encloses (∑ s : PairSlot, v s) := by | |
| rw [Fintype.sum_prod_type] | |
| exact finSumBall_sound 6 _ _ (fun i => finSumBall_sound 6 _ _ (h i)) | |
| lemma entropyTerm_ball {p : ℝ} {b l : Ball} (hb : b.Encloses p) | |
| (hl : l.Encloses (Real.log p)) : | |
| (Ball.mul (Ball.neg b) l).Encloses (Foundation.entropyTerm p) := | |
| Ball.mul_sound (Ball.neg_sound hb) hl | |
| lemma entropyTerm_zero_ball {p : ℝ} (hp : (Ball.exact 0).Encloses p) : | |
| (Ball.exact 0).Encloses (Foundation.entropyTerm p) := by | |
| have hb := Ball.bounds hp | |
| have h : p = 0 := by norm_num [Ball.lower, Ball.upper, Ball.exact] at hb; linarith | |
| simp only [h, Foundation.entropyTerm, neg_zero, zero_mul] | |
| simpa only [Rat.cast_zero] using Ball.exact_sound 0 | |
| lemma log_exact_one_ball {p : ℝ} (hp : (Ball.exact 1).Encloses p) : | |
| (Ball.exact 0).Encloses (Real.log p) := by | |
| have hb := Ball.bounds hp | |
| have h : p = 1 := by norm_num [Ball.lower, Ball.upper, Ball.exact] at hb; linarith | |
| rw [h, Real.log_one] | |
| simpa only [Rat.cast_zero] using Ball.exact_sound 0 | |
| end MatrixMultiplication.NativeNumerics | |
| end | |
| end | |
| end MatrixAllFields | |
| namespace MatrixAllFields | |
| open scoped BigOperators Topology Polynomial | |
| section | |
| noncomputable section | |
| namespace MatrixMultiplication.NativeNumerics | |
| open AllFieldParameters AllFieldHistory AllFieldCertificates AllFieldCertificates.Replay | |
| open AllFieldInitialEntropyCertificate AllFieldNativeCapacity | |
| open scoped BigOperators | |
| lemma forall_fin6 {P : Fin 6 → Prop} (h0 : P 0) (h1 : P 1) (h2 : P 2) | |
| (h3 : P 3) (h4 : P 4) (h5 : P 5) : ∀ i, P i := by | |
| intro i | |
| fin_cases i <;> assumption | |
| lemma forall_fin3 {P : Fin 3 → Prop} (h0 : P 0) (h1 : P 1) (h2 : P 2) : ∀ i, P i := by | |
| intro i | |
| fin_cases i <;> assumption | |
| lemma exact_rat_enclosed {q r : ℚ} (h : q = r) : (Ball.exact q).Encloses (r : ℝ) := by | |
| rw [h] | |
| exact Ball.exact_sound r | |
| def pairSumBall (bs : PairSlot → Ball) : Ball := | |
| finSumBall 6 (fun i => finSumBall 6 (fun j => bs (i,j))) | |
| lemma pairSumBall_sound (bs : PairSlot → Ball) (v : PairSlot → ℝ) | |
| (h : ∀ a, (bs a).Encloses (v a)) : | |
| (pairSumBall bs).Encloses (∑ a, v a) := by | |
| exact product_fin6_enclosed _ _ (fun i j => h (i,j)) | |
| def doublePairSumBall (bs : PairSlot × PairSlot → Ball) : Ball := | |
| pairSumBall fun i => pairSumBall fun j => bs (i,j) | |
| lemma doublePairSumBall_sound (bs : PairSlot × PairSlot → Ball) | |
| (v : PairSlot × PairSlot → ℝ) (h : ∀ a, (bs a).Encloses (v a)) : | |
| (doublePairSumBall bs).Encloses (∑ a, v a) := by | |
| rw [Fintype.sum_prod_type] | |
| exact pairSumBall_sound _ _ (fun i => pairSumBall_sound _ _ (fun j => h (i,j))) | |
| lemma entropyFin_enclosed (n : ℕ) (p : Fin n → ℝ) (bs : Fin n → Ball) | |
| (h : ∀ i, (bs i).Encloses (Foundation.entropyTerm (p i))) : | |
| (finSumBall n bs).Encloses (Foundation.finiteEntropy p) := | |
| finSumBall_sound n _ _ h | |
| lemma entropyPair_enclosed (p : PairSlot → ℝ) (bs : PairSlot → Ball) | |
| (h : ∀ i, (bs i).Encloses (Foundation.entropyTerm (p i))) : | |
| (pairSumBall bs).Encloses (Foundation.finiteEntropy p) := | |
| pairSumBall_sound _ _ h | |
| lemma entropyDoublePair_enclosed (p : PairSlot × PairSlot → ℝ) | |
| (bs : PairSlot × PairSlot → Ball) | |
| (h : ∀ i, (bs i).Encloses (Foundation.entropyTerm (p i))) : | |
| (doublePairSumBall bs).Encloses (Foundation.finiteEntropy p) := | |
| doublePairSumBall_sound _ _ h | |
| lemma homogeneous_enclosed {A : Type*} [Fintype A] (p : A → ℝ) | |
| {b e : Ball} (hb : b.Encloses (Foundation.entropyTerm (∑ a, p a))) | |
| (he : e.Encloses (Foundation.finiteEntropy p)) : | |
| (Ball.add (Ball.neg b) e).Encloses (homogeneousEntropy p) := by | |
| convert Ball.add_sound (Ball.neg_sound hb) he using 1 | |
| simp only [homogeneousEntropy, Foundation.entropyTerm, neg_mul, neg_neg] | |
| instance designatedDecidable (priority : Placement) (position : Fin 3) (u : Shape) : | |
| Decidable (designated priority position u) := by | |
| unfold designated | |
| infer_instance | |
| def marginalBall (support : List Shape) (p : Shape → Ball) (side : Fin 3) (k : Fin 17) : Ball := | |
| listSumBall support fun u => if u side = k.val then p u else .exact 0 | |
| lemma marginalBall_sound (support : List Shape) (bs : Shape → Ball) (p : Shape → ℝ) | |
| (h : ∀ u ∈ support, (bs u).Encloses (p u)) (side : Fin 3) (k : Fin 17) : | |
| (marginalBall support bs side k).Encloses (marginal support p side k) := by | |
| apply listSumBall_sound | |
| intro u hu | |
| by_cases hk : u side = k.val | |
| · simpa only [hk, ite_true] using h u hu | |
| · simpa only [hk, ite_false, Rat.cast_zero] using Ball.exact_sound 0 | |
| def pairLawBall {A : Type*} (support : List Shape) (s : Shape) (p : Shape → Ball) | |
| (q : Shape → A → Ball) (ij : A × A) : Ball := | |
| listSumBall support fun u => .mul (.mul (p u) (q u ij.1)) (q (complement s u) ij.2) | |
| lemma pairLawBall_sound {A : Type*} [Fintype A] (support : List Shape) (s : Shape) | |
| (bs : Shape → Ball) (p : Shape → ℝ) (bq : Shape → A → Ball) (q : Shape → A → ℝ) | |
| (hp : ∀ u ∈ support, (bs u).Encloses (p u)) | |
| (hq : ∀ u a, (bq u a).Encloses (q u a)) (ij : A × A) : | |
| (pairLawBall support s bs bq ij).Encloses (pairLaw support s p q ij) := by | |
| apply listSumBall_sound | |
| intro u hu | |
| exact Ball.mul_sound (Ball.mul_sound (hp u hu) (hq u ij.1)) (hq _ ij.2) | |
| lemma pairLawBall_sound_on {A : Type*} [Fintype A] (support : List Shape) (s : Shape) | |
| (bs : Shape → Ball) (p : Shape → ℝ) (bq : Shape → A → Ball) (q : Shape → A → ℝ) | |
| (hp : ∀ u ∈ support, (bs u).Encloses (p u)) | |
| (hq : ∀ u ∈ support, ∀ a, (bq u a).Encloses (q u a)) | |
| (hcq : ∀ u ∈ support, ∀ a, (bq (complement s u) a).Encloses (q (complement s u) a)) | |
| (ij : A × A) : | |
| (pairLawBall support s bs bq ij).Encloses (pairLaw support s p q ij) := by | |
| apply listSumBall_sound | |
| intro u hu | |
| exact Ball.mul_sound (Ball.mul_sound (hp u hu) (hq u hu ij.1)) (hcq u hu ij.2) | |
| def residualBall {A : Type*} (support : List Shape) (p : Shape → Ball) | |
| (priority : Placement) (position : Fin 3) (q : Shape → A → Ball) | |
| (k : Fin 17) (a : A) : Ball := | |
| listSumBall support fun u => | |
| if ¬ designated priority position u ∧ u (priority position) = k.val | |
| then .mul (p u) (q u a) else .exact 0 | |
| lemma residualBall_sound {A : Type*} [Fintype A] (support : List Shape) | |
| (bs : Shape → Ball) (p : Shape → ℝ) (priority : Placement) (position : Fin 3) | |
| (bq : Shape → A → Ball) (q : Shape → A → ℝ) | |
| (hp : ∀ u ∈ support, (bs u).Encloses (p u)) | |
| (hq : ∀ u a, (bq u a).Encloses (q u a)) (k : Fin 17) (a : A) : | |
| (residualBall support bs priority position bq k a).Encloses | |
| (residualLaw support p priority position q k a) := by | |
| apply listSumBall_sound | |
| intro u hu | |
| by_cases hk : ¬ designated priority position u ∧ u (priority position) = k.val | |
| · simpa only [ite_eq_left hk] using Ball.mul_sound (hp u hu) (hq u a) | |
| · simpa only [hk, ite_false, Rat.cast_zero] using Ball.exact_sound 0 | |
| lemma residualBall_sound_on {A : Type*} [Fintype A] (support : List Shape) | |
| (bs : Shape → Ball) (p : Shape → ℝ) (priority : Placement) (position : Fin 3) | |
| (bq : Shape → A → Ball) (q : Shape → A → ℝ) | |
| (hp : ∀ u ∈ support, (bs u).Encloses (p u)) | |
| (hq : ∀ u ∈ support, ∀ a, (bq u a).Encloses (q u a)) (k : Fin 17) (a : A) : | |
| (residualBall support bs priority position bq k a).Encloses | |
| (residualLaw support p priority position q k a) := by | |
| apply listSumBall_sound | |
| intro u hu | |
| by_cases hk : ¬ designated priority position u ∧ u (priority position) = k.val | |
| · simpa only [ite_eq_left hk] using Ball.mul_sound (hp u hu) (hq u hu a) | |
| · simpa only [hk, ite_false, Rat.cast_zero] using Ball.exact_sound 0 | |
| def singletonBall (support : List Shape) (p : Shape → Ball) | |
| (priority : Placement) (position : Fin 3) (e : Shape → Ball) : Ball := | |
| listSumBall support fun u => | |
| if designated priority position u then .mul (p u) (e u) else .exact 0 | |
| lemma singletonBall_sound {A : Type*} [Fintype A] (support : List Shape) | |
| (bs : Shape → Ball) (p : Shape → ℝ) (priority : Placement) (position : Fin 3) | |
| (be : Shape → Ball) (q : Shape → A → ℝ) | |
| (hp : ∀ u ∈ support, (bs u).Encloses (p u)) | |
| (he : ∀ u ∈ support, designated priority position u → | |
| (be u).Encloses (homogeneousEntropy (q u))) : | |
| (singletonBall support bs priority position be).Encloses | |
| (singletonEntropy support p priority position q) := by | |
| apply listSumBall_sound | |
| intro u hu | |
| by_cases hk : designated priority position u | |
| · simpa only [hk, ite_true] using Ball.mul_sound (hp u hu) (he u hu hk) | |
| · simpa only [hk, ite_false, Rat.cast_zero] using Ball.exact_sound 0 | |
| end MatrixMultiplication.NativeNumerics | |
| end | |
| end | |
| end MatrixAllFields | |
| namespace MatrixAllFields | |
| open scoped BigOperators Topology Polynomial | |
| section | |
| noncomputable section | |
| namespace MatrixMultiplication.NativeNumerics | |
| open AllFieldParameters AllFieldHistory AllFieldCertificates AllFieldCertificates.Replay | |
| open AllFieldInitialEntropyCertificate AllFieldNativeCapacity | |
| open scoped BigOperators | |
| def logN1 : Ball := .exact 0 | |
| lemma logN1_sound : logN1.Encloses (Real.log ((1 : ℝ))) := by | |
| exact log_exact_one_ball ((by convert Ball.exact_sound (1 : ℚ) using 1; norm_num)) | |
| def logN2Witness : LogWitness := ⟨1, 1, 1⟩ | |
| def logN2 : Ball := ⟨(6931471805599453094172319305033 / 10000000000000000000000000000000), (8470329473 / 20000000000000000000000000000000)⟩ | |
| lemma logN2_sound : logN2.Encloses (Real.log ((2 : ℝ))) := by | |
| exact checkLog_sound logTwoBall_sound ((by convert Ball.exact_sound (2 : ℚ) using 1; norm_num)) (w := logN2Witness) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def logN4Witness : LogWitness := ⟨2, 1, 1⟩ | |
| def logN4 : Ball := ⟨(6931471805599453094172319305033 / 5000000000000000000000000000000), (7940933881 / 12500000000000000000000000000000)⟩ | |
| lemma logN4_sound : logN4.Encloses (Real.log ((4 : ℝ))) := by | |
| exact checkLog_sound logTwoBall_sound ((by convert Ball.exact_sound (4 : ℚ) using 1; norm_num)) (w := logN4Witness) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def logN5Witness : LogWitness := ⟨2, 5, 4⟩ | |
| def logN5 : Ball := ⟨(40235947810852509365018973782911 / 25000000000000000000000000000000), (63527471049 / 100000000000000000000000000000000)⟩ | |
| lemma logN5_sound : logN5.Encloses (Real.log ((5 : ℝ))) := by | |
| exact checkLog_sound logTwoBall_sound ((by convert Ball.exact_sound (5 : ℚ) using 1; norm_num)) (w := logN5Witness) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def logN7Witness : LogWitness := ⟨2, 7, 4⟩ | |
| def logN7 : Ball := ⟨(194591014905531330510535236152357 / 100000000000000000000000000000000), (7940933881 / 12500000000000000000000000000000)⟩ | |
| lemma logN7_sound : logN7.Encloses (Real.log ((7 : ℝ))) := by | |
| exact checkLog_sound logTwoBall_sound ((by convert Ball.exact_sound (7 : ℚ) using 1; norm_num)) (w := logN7Witness) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def logN10Witness : LogWitness := ⟨3, 5, 4⟩ | |
| def logN10 : Ball := ⟨(115129254649702284200899544090987 / 50000000000000000000000000000000), (21175823683 / 25000000000000000000000000000000)⟩ | |
| lemma logN10_sound : logN10.Encloses (Real.log ((10 : ℝ))) := by | |
| exact checkLog_sound logTwoBall_sound ((by convert Ball.exact_sound (10 : ℚ) using 1; norm_num)) (w := logN10Witness) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def logN20Witness : LogWitness := ⟨4, 5, 4⟩ | |
| def logN20 : Ball := ⟨(18723326709712443708970142577019 / 6250000000000000000000000000000), (21175823683 / 20000000000000000000000000000000)⟩ | |
| lemma logN20_sound : logN20.Encloses (Real.log ((20 : ℝ))) := by | |
| exact checkLog_sound logTwoBall_sound ((by convert Ball.exact_sound (20 : ℚ) using 1; norm_num)) (w := logN20Witness) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def logN25Witness : LogWitness := ⟨4, 25, 16⟩ | |
| def logN25 : Ball := ⟨(321887582486820074920151790263287 / 100000000000000000000000000000000), (52939559207 / 50000000000000000000000000000000)⟩ | |
| lemma logN25_sound : logN25.Encloses (Real.log ((25 : ℝ))) := by | |
| exact checkLog_sound logTwoBall_sound ((by convert Ball.exact_sound (25 : ℚ) using 1; norm_num)) (w := logN25Witness) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def logN50Witness : LogWitness := ⟨5, 25, 16⟩ | |
| def logN50 : Ball := ⟨(391202300542814605861874983313617 / 100000000000000000000000000000000), (127054942097 / 100000000000000000000000000000000)⟩ | |
| lemma logN50_sound : logN50.Encloses (Real.log ((50 : ℝ))) := by | |
| exact checkLog_sound logTwoBall_sound ((by convert Ball.exact_sound (50 : ℚ) using 1; norm_num)) (w := logN50Witness) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def logN100Witness : LogWitness := ⟨6, 25, 16⟩ | |
| def logN100 : Ball := ⟨(460517018598809136803598176363947 / 100000000000000000000000000000000), (7411538289 / 5000000000000000000000000000000)⟩ | |
| lemma logN100_sound : logN100.Encloses (Real.log ((100 : ℝ))) := by | |
| exact checkLog_sound logTwoBall_sound ((by convert Ball.exact_sound (100 : ℚ) using 1; norm_num)) (w := logN100Witness) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def logN250Witness : LogWitness := ⟨7, 125, 64⟩ | |
| def logN250 : Ball := ⟨(552146091786224643321950874544283 / 100000000000000000000000000000000), (21175823683 / 12500000000000000000000000000000)⟩ | |
| lemma logN250_sound : logN250.Encloses (Real.log ((250 : ℝ))) := by | |
| exact checkLog_sound logTwoBall_sound ((by convert Ball.exact_sound (250 : ℚ) using 1; norm_num)) (w := logN250Witness) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def logN625Witness : LogWitness := ⟨9, 625, 512⟩ | |
| def logN625 : Ball := ⟨(321887582486820074920151780715543 / 50000000000000000000000000000000), (211758236829 / 100000000000000000000000000000000)⟩ | |
| lemma logN625_sound : logN625.Encloses (Real.log ((625 : ℝ))) := by | |
| exact checkLog_sound logTwoBall_sound ((by convert Ball.exact_sound (625 : ℚ) using 1; norm_num)) (w := logN625Witness) (by | |
| simp only [checkLog, Bool.and_eq_true] | |
| exact ⟨by decide +kernel, by decide +kernel⟩) | |
| def multLogs (a : PairSlot) : Ball := | |
| match a.1.val, a.2.val with | |
| | 0, 0 => logN1 | |
| | 0, 1 => logN10 | |
| | 0, 2 => logN25 | |
| | 0, 3 => logN2 | |
| | 0, 4 => logN10 | |
| | 0, 5 => logN1 | |
| | 1, 0 => logN10 | |
| | 1, 1 => logN100 | |
| | 1, 2 => logN250 | |
| | 1, 3 => logN20 | |
| | 1, 4 => logN100 | |
| | 1, 5 => logN10 | |
| | 2, 0 => logN25 | |
| | 2, 1 => logN250 | |
| | 2, 2 => logN625 | |
| | 2, 3 => logN50 | |
| | 2, 4 => logN250 | |
| | 2, 5 => logN25 | |
| | 3, 0 => logN2 | |
| | 3, 1 => logN20 | |
| | 3, 2 => logN50 | |
| | 3, 3 => logN4 | |
| | 3, 4 => logN20 | |
| | 3, 5 => logN2 | |
| | 4, 0 => logN10 | |
| | 4, 1 => logN100 | |
| | 4, 2 => logN250 | |
| | 4, 3 => logN20 | |
| | 4, 4 => logN100 | |
| | 4, 5 => logN10 | |
| | 5, 0 => logN1 | |
| | 5, 1 => logN10 | |
| | 5, 2 => logN25 | |
| | 5, 3 => logN2 | |
| | 5, 4 => logN10 | |
| | 5, 5 => logN1 | |
| | _, _ => (.exact 0) | |
| lemma multLogs_sound (a : PairSlot) : | |
| (multLogs a).Encloses (Real.log (AllFieldParameters.multiplicity a.1 * AllFieldParameters.multiplicity a.2 : ℕ)) := by | |
| rcases a with ⟨i,j⟩ | |
| revert j i | |
| apply forall_fin6 | |
| · apply forall_fin6 | |
| · have he : AllFieldParameters.multiplicity 0 * AllFieldParameters.multiplicity 0 = 1 := by decide +kernel | |
| change (multLogs (0,0)).Encloses (Real.log (AllFieldParameters.multiplicity 0 * AllFieldParameters.multiplicity 0 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN1_sound | |
| · have he : AllFieldParameters.multiplicity 0 * AllFieldParameters.multiplicity 1 = 10 := by decide +kernel | |
| change (multLogs (0,1)).Encloses (Real.log (AllFieldParameters.multiplicity 0 * AllFieldParameters.multiplicity 1 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN10_sound | |
| · have he : AllFieldParameters.multiplicity 0 * AllFieldParameters.multiplicity 2 = 25 := by decide +kernel | |
| change (multLogs (0,2)).Encloses (Real.log (AllFieldParameters.multiplicity 0 * AllFieldParameters.multiplicity 2 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN25_sound | |
| · have he : AllFieldParameters.multiplicity 0 * AllFieldParameters.multiplicity 3 = 2 := by decide +kernel | |
| change (multLogs (0,3)).Encloses (Real.log (AllFieldParameters.multiplicity 0 * AllFieldParameters.multiplicity 3 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN2_sound | |
| · have he : AllFieldParameters.multiplicity 0 * AllFieldParameters.multiplicity 4 = 10 := by decide +kernel | |
| change (multLogs (0,4)).Encloses (Real.log (AllFieldParameters.multiplicity 0 * AllFieldParameters.multiplicity 4 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN10_sound | |
| · have he : AllFieldParameters.multiplicity 0 * AllFieldParameters.multiplicity 5 = 1 := by decide +kernel | |
| change (multLogs (0,5)).Encloses (Real.log (AllFieldParameters.multiplicity 0 * AllFieldParameters.multiplicity 5 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN1_sound | |
| · apply forall_fin6 | |
| · have he : AllFieldParameters.multiplicity 1 * AllFieldParameters.multiplicity 0 = 10 := by decide +kernel | |
| change (multLogs (1,0)).Encloses (Real.log (AllFieldParameters.multiplicity 1 * AllFieldParameters.multiplicity 0 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN10_sound | |
| · have he : AllFieldParameters.multiplicity 1 * AllFieldParameters.multiplicity 1 = 100 := by decide +kernel | |
| change (multLogs (1,1)).Encloses (Real.log (AllFieldParameters.multiplicity 1 * AllFieldParameters.multiplicity 1 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN100_sound | |
| · have he : AllFieldParameters.multiplicity 1 * AllFieldParameters.multiplicity 2 = 250 := by decide +kernel | |
| change (multLogs (1,2)).Encloses (Real.log (AllFieldParameters.multiplicity 1 * AllFieldParameters.multiplicity 2 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN250_sound | |
| · have he : AllFieldParameters.multiplicity 1 * AllFieldParameters.multiplicity 3 = 20 := by decide +kernel | |
| change (multLogs (1,3)).Encloses (Real.log (AllFieldParameters.multiplicity 1 * AllFieldParameters.multiplicity 3 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN20_sound | |
| · have he : AllFieldParameters.multiplicity 1 * AllFieldParameters.multiplicity 4 = 100 := by decide +kernel | |
| change (multLogs (1,4)).Encloses (Real.log (AllFieldParameters.multiplicity 1 * AllFieldParameters.multiplicity 4 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN100_sound | |
| · have he : AllFieldParameters.multiplicity 1 * AllFieldParameters.multiplicity 5 = 10 := by decide +kernel | |
| change (multLogs (1,5)).Encloses (Real.log (AllFieldParameters.multiplicity 1 * AllFieldParameters.multiplicity 5 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN10_sound | |
| · apply forall_fin6 | |
| · have he : AllFieldParameters.multiplicity 2 * AllFieldParameters.multiplicity 0 = 25 := by decide +kernel | |
| change (multLogs (2,0)).Encloses (Real.log (AllFieldParameters.multiplicity 2 * AllFieldParameters.multiplicity 0 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN25_sound | |
| · have he : AllFieldParameters.multiplicity 2 * AllFieldParameters.multiplicity 1 = 250 := by decide +kernel | |
| change (multLogs (2,1)).Encloses (Real.log (AllFieldParameters.multiplicity 2 * AllFieldParameters.multiplicity 1 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN250_sound | |
| · have he : AllFieldParameters.multiplicity 2 * AllFieldParameters.multiplicity 2 = 625 := by decide +kernel | |
| change (multLogs (2,2)).Encloses (Real.log (AllFieldParameters.multiplicity 2 * AllFieldParameters.multiplicity 2 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN625_sound | |
| · have he : AllFieldParameters.multiplicity 2 * AllFieldParameters.multiplicity 3 = 50 := by decide +kernel | |
| change (multLogs (2,3)).Encloses (Real.log (AllFieldParameters.multiplicity 2 * AllFieldParameters.multiplicity 3 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN50_sound | |
| · have he : AllFieldParameters.multiplicity 2 * AllFieldParameters.multiplicity 4 = 250 := by decide +kernel | |
| change (multLogs (2,4)).Encloses (Real.log (AllFieldParameters.multiplicity 2 * AllFieldParameters.multiplicity 4 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN250_sound | |
| · have he : AllFieldParameters.multiplicity 2 * AllFieldParameters.multiplicity 5 = 25 := by decide +kernel | |
| change (multLogs (2,5)).Encloses (Real.log (AllFieldParameters.multiplicity 2 * AllFieldParameters.multiplicity 5 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN25_sound | |
| · apply forall_fin6 | |
| · have he : AllFieldParameters.multiplicity 3 * AllFieldParameters.multiplicity 0 = 2 := by decide +kernel | |
| change (multLogs (3,0)).Encloses (Real.log (AllFieldParameters.multiplicity 3 * AllFieldParameters.multiplicity 0 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN2_sound | |
| · have he : AllFieldParameters.multiplicity 3 * AllFieldParameters.multiplicity 1 = 20 := by decide +kernel | |
| change (multLogs (3,1)).Encloses (Real.log (AllFieldParameters.multiplicity 3 * AllFieldParameters.multiplicity 1 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN20_sound | |
| · have he : AllFieldParameters.multiplicity 3 * AllFieldParameters.multiplicity 2 = 50 := by decide +kernel | |
| change (multLogs (3,2)).Encloses (Real.log (AllFieldParameters.multiplicity 3 * AllFieldParameters.multiplicity 2 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN50_sound | |
| · have he : AllFieldParameters.multiplicity 3 * AllFieldParameters.multiplicity 3 = 4 := by decide +kernel | |
| change (multLogs (3,3)).Encloses (Real.log (AllFieldParameters.multiplicity 3 * AllFieldParameters.multiplicity 3 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN4_sound | |
| · have he : AllFieldParameters.multiplicity 3 * AllFieldParameters.multiplicity 4 = 20 := by decide +kernel | |
| change (multLogs (3,4)).Encloses (Real.log (AllFieldParameters.multiplicity 3 * AllFieldParameters.multiplicity 4 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN20_sound | |
| · have he : AllFieldParameters.multiplicity 3 * AllFieldParameters.multiplicity 5 = 2 := by decide +kernel | |
| change (multLogs (3,5)).Encloses (Real.log (AllFieldParameters.multiplicity 3 * AllFieldParameters.multiplicity 5 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN2_sound | |
| · apply forall_fin6 | |
| · have he : AllFieldParameters.multiplicity 4 * AllFieldParameters.multiplicity 0 = 10 := by decide +kernel | |
| change (multLogs (4,0)).Encloses (Real.log (AllFieldParameters.multiplicity 4 * AllFieldParameters.multiplicity 0 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN10_sound | |
| · have he : AllFieldParameters.multiplicity 4 * AllFieldParameters.multiplicity 1 = 100 := by decide +kernel | |
| change (multLogs (4,1)).Encloses (Real.log (AllFieldParameters.multiplicity 4 * AllFieldParameters.multiplicity 1 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN100_sound | |
| · have he : AllFieldParameters.multiplicity 4 * AllFieldParameters.multiplicity 2 = 250 := by decide +kernel | |
| change (multLogs (4,2)).Encloses (Real.log (AllFieldParameters.multiplicity 4 * AllFieldParameters.multiplicity 2 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN250_sound | |
| · have he : AllFieldParameters.multiplicity 4 * AllFieldParameters.multiplicity 3 = 20 := by decide +kernel | |
| change (multLogs (4,3)).Encloses (Real.log (AllFieldParameters.multiplicity 4 * AllFieldParameters.multiplicity 3 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN20_sound | |
| · have he : AllFieldParameters.multiplicity 4 * AllFieldParameters.multiplicity 4 = 100 := by decide +kernel | |
| change (multLogs (4,4)).Encloses (Real.log (AllFieldParameters.multiplicity 4 * AllFieldParameters.multiplicity 4 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN100_sound | |
| · have he : AllFieldParameters.multiplicity 4 * AllFieldParameters.multiplicity 5 = 10 := by decide +kernel | |
| change (multLogs (4,5)).Encloses (Real.log (AllFieldParameters.multiplicity 4 * AllFieldParameters.multiplicity 5 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN10_sound | |
| · apply forall_fin6 | |
| · have he : AllFieldParameters.multiplicity 5 * AllFieldParameters.multiplicity 0 = 1 := by decide +kernel | |
| change (multLogs (5,0)).Encloses (Real.log (AllFieldParameters.multiplicity 5 * AllFieldParameters.multiplicity 0 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN1_sound | |
| · have he : AllFieldParameters.multiplicity 5 * AllFieldParameters.multiplicity 1 = 10 := by decide +kernel | |
| change (multLogs (5,1)).Encloses (Real.log (AllFieldParameters.multiplicity 5 * AllFieldParameters.multiplicity 1 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN10_sound | |
| · have he : AllFieldParameters.multiplicity 5 * AllFieldParameters.multiplicity 2 = 25 := by decide +kernel | |
| change (multLogs (5,2)).Encloses (Real.log (AllFieldParameters.multiplicity 5 * AllFieldParameters.multiplicity 2 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN25_sound | |
| · have he : AllFieldParameters.multiplicity 5 * AllFieldParameters.multiplicity 3 = 2 := by decide +kernel | |
| change (multLogs (5,3)).Encloses (Real.log (AllFieldParameters.multiplicity 5 * AllFieldParameters.multiplicity 3 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN2_sound | |
| · have he : AllFieldParameters.multiplicity 5 * AllFieldParameters.multiplicity 4 = 10 := by decide +kernel | |
| change (multLogs (5,4)).Encloses (Real.log (AllFieldParameters.multiplicity 5 * AllFieldParameters.multiplicity 4 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN10_sound | |
| · have he : AllFieldParameters.multiplicity 5 * AllFieldParameters.multiplicity 5 = 1 := by decide +kernel | |
| change (multLogs (5,5)).Encloses (Real.log (AllFieldParameters.multiplicity 5 * AllFieldParameters.multiplicity 5 : ℕ)) | |
| rw [he] | |
| simpa only [multLogs, Fin.coe_ofNat_eq_mod, Nat.reduceMod, Nat.cast_ofNat, Nat.cast_one] using logN1_sound | |
| end MatrixMultiplication.NativeNumerics | |
| end | |
| end | |
| end MatrixAllFields | |
| namespace MatrixAllFields | |
| open scoped BigOperators Topology Polynomial | |
| section | |
| noncomputable section | |
| namespace MatrixMultiplication.NativeNumerics | |
| open AllFieldParameters AllFieldHistory AllFieldCertificates AllFieldCertificates.Replay | |
| open AllFieldInitialEntropyCertificate AllFieldNativeCapacity | |
| open scoped BigOperators | |
| def sparseTripleBall (a b c : Ball) : Ball := | |
| if b = .exact 0 ∨ c = .exact 0 then .exact 0 else .mul (.mul a b) c | |
| lemma sparseTripleBall_eq (a b c : Ball) : | |
| sparseTripleBall a b c = .mul (.mul a b) c := by | |
| unfold sparseTripleBall | |
| split_ifs with h | |
| · rcases h with h | h | |
| · subst b | |
| cases a | |
| cases c | |
| simp [Ball.mul, Ball.exact] | |
| · subst c | |
| cases a | |
| cases b | |
| simp [Ball.mul, Ball.exact] | |
| · rfl | |
| def sparsePairLawBall {A : Type*} (support : List Shape) (s : Shape) (p : Shape → Ball) | |
| (q : Shape → A → Ball) (ij : A × A) : Ball := | |
| listSumBall support fun u => sparseTripleBall (p u) (q u ij.1) (q (complement s u) ij.2) | |
| lemma sparsePairLawBall_eq {A : Type*} (support : List Shape) (s : Shape) | |
| (p : Shape → Ball) (q : Shape → A → Ball) (ij : A × A) : | |
| sparsePairLawBall support s p q ij = pairLawBall support s p q ij := by | |
| simp only [sparsePairLawBall, sparseTripleBall_eq, pairLawBall] | |
| lemma sparsePairLawBall_sound_on {A : Type*} [Fintype A] (support : List Shape) (s : Shape) | |
| (bs : Shape → Ball) (p : Shape → ℝ) (bq : Shape → A → Ball) (q : Shape → A → ℝ) | |
| (hp : ∀ u ∈ support, (bs u).Encloses (p u)) | |
| (hq : ∀ u ∈ support, ∀ a, (bq u a).Encloses (q u a)) | |
| (hcq : ∀ u ∈ support, ∀ a, (bq (complement s u) a).Encloses (q (complement s u) a)) | |
| (ij : A × A) : | |
| (sparsePairLawBall support s bs bq ij).Encloses (pairLaw support s p q ij) := by | |
| rw [sparsePairLawBall_eq] | |
| exact pairLawBall_sound_on support s bs p bq q hp hq hcq ij | |
| end MatrixMultiplication.NativeNumerics | |
| end | |
| end | |
| end MatrixAllFields | |
| end OAI | |