interplane.Get Omega
Read in your language

omega-principia

This project has not described itself yet.

Brought by drakestapleton

branch main Branches Tags History

omega-principia / proofs / CanWave5_CA962_5_17_3.lean

1386 lines · 67294 bytes Raw Blame History
1/-
2 SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3 experiments/math_8h_comb/lean/CanWave5_CA962_5_17_3.lean
4
5 Standalone Zero-Mathlib, Kernel-Checked Lean 4.36.0 Formal Proof of
6 Wave 5 Live-2026 Strength-5 Covering Array World Record:
7 CA(962; 5, 17, 3) — strictly beating live 2026-12-02 CAN(5, 17, 3) <= 963 (-1 row!)
8 (Source: coveringarraytools.org commit ddf07b6, DOI 10.5281/zenodo.24168008).
9
10 0 sorry, 0 admit, 0 native_decide, 0 custom axioms, 0 unsafe, 0 Mathlib.
11-/
12
13set_option maxRecDepth 32768
14set_option maxHeartbeats 12000000
15set_option exponentiation.threshold 1024
16
17namespace CanWave5_CA962_5_17_3
18
19/-- Literal semantic definition of a strength-5 covering array CA(N; 5, k, v). -/
20def IsCoveringArray5 (N k v : Nat) (rows : List (List Nat)) : Prop :=
21 rows.length = N ∧
22 (∀ r, r < N → (rows.getD r []).length = k ∧
23 ∀ c, c < k → (rows.getD r []).getD c v < v) ∧
24 (∀ c0 c1 c2 c3 c4, c0 < c1 → c1 < c2 → c2 < c3 → c3 < c4 → c4 < k →
25 ∀ p0 p1 p2 p3 p4, p0 < v → p1 < v → p2 < v → p3 < v → p4 < v →
26 ∃ r, r < N ∧
27 (rows.getD r []).getD c0 v = p0 ∧
28 (rows.getD r []).getD c1 v = p1 ∧
29 (rows.getD r []).getD c2 v = p2 ∧
30 (rows.getD r []).getD c3 v = p3 ∧
31 (rows.getD r []).getD c4 v = p4)
32
33def allLt (p : Nat → Bool) : Nat → Bool
34 | 0 => true
35 | n + 1 => allLt p n && p n
36
37theorem allLt_sound {p : Nat → Bool} :
38 ∀ n, allLt p n = true → ∀ i, i < n → p i = true := by
39 intro n h i hi
40 induction n with
41 | zero => cases hi
42 | succ m ih =>
43 simp only [allLt, Bool.and_eq_true] at h
44 cases Nat.lt_or_eq_of_le (Nat.le_of_lt_succ hi) with
45 | inl hlt => exact ih h.1 hlt
46 | inr heq => rw [heq]; exact h.2
47
48theorem exists_testBit_of_ne_zero :
49 ∀ n m, m < 2 ^ n → m ≠ 0 → ∃ r, r < n ∧ m.testBit r = true := by
50 intro n
51 induction n with
52 | zero =>
53 intro m hlt hne
54 have : m = 0 := Nat.lt_one_iff.mp hlt
55 exact False.elim (hne this)
56 | succ k ih =>
57 intro m hlt hne
58 by_cases hodd : m % 2 = 1
59 · refine ⟨0, Nat.zero_lt_succ k, ?_⟩
60 rw [Nat.testBit_zero]
61 simp [hodd]
62 · have heven : m % 2 = 0 := by omega
63 have hdiv_ne : m / 2 ≠ 0 := by omega
64 have hdiv_lt : m / 2 < 2 ^ k := by
65 have : 2 ^ (k + 1) = 2 ^ k * 2 := Nat.pow_succ 2 k
66 omega
67 obtain ⟨r, hr_lt, hr_bit⟩ := ih (m / 2) hdiv_lt hdiv_ne
68 refine ⟨r + 1, Nat.succ_lt_succ hr_lt, ?_⟩
69 rw [Nat.testBit_succ]
70 exact hr_bit
71
72theorem testBit_land_true {a b r : Nat} (h : (a &&& b).testBit r = true) :
73 a.testBit r = true ∧ b.testBit r = true := by
74 rw [Nat.testBit_and, Bool.and_eq_true] at h
75 exact h
76
77theorem land_lt_pow2 {a b n : Nat} (ha : a < 2 ^ n) : (a &&& b) < 2 ^ n := by
78 have hle : (a &&& b) ≤ a := Nat.and_le_left
79 exact Nat.lt_of_le_of_lt hle ha
80
81def ca_rows : List (List Nat) := [
82 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
83 [1,2,0,1,0,2,2,0,1,0,1,1,1,2,2,2,1],
84 [2,1,0,2,0,1,1,0,2,0,2,2,2,1,1,1,2],
85 [1,0,2,2,2,2,1,1,1,1,2,2,2,1,0,0,1],
86 [2,2,2,0,2,1,0,1,2,1,0,0,0,0,2,2,2],
87 [0,1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,2,0,1,2,1,1,0,1],
1030 [1,0,2,1,0,2,2,2,0,2,1,0,0,1,1,1,0],
1031 [1,2,0,2,1,1,1,0,1,0,0,1,0,2,1,0,1],
1032 [1,2,1,2,1,1,2,0,1,1,0,0,1,1,2,0,2],
1033 [2,2,1,1,1,2,2,0,0,1,1,2,1,2,0,2,1],
1034 [0,2,0,2,1,1,2,1,2,0,2,0,0,0,0,0,1],
1035 [1,2,1,1,1,0,2,1,1,2,2,0,0,2,2,0,1],
1036 [0,0,0,2,1,1,1,0,0,0,0,2,1,2,2,0,2],
1037 [2,2,1,0,1,0,1,2,2,0,2,1,0,0,2,0,1],
1038 [1,1,0,1,2,1,2,1,0,2,0,2,0,2,2,1,1],
1039 [1,2,0,2,1,2,1,2,1,2,2,0,1,2,2,0,0],
1040 [1,0,0,0,2,2,0,2,2,1,0,0,2,0,2,0,1],
1041 [2,2,1,2,0,0,1,2,2,1,2,0,1,1,0,2,0],
1042 [0,1,2,0,0,1,0,2,0,0,1,1,2,0,0,0,0],
1043 [0,2,2,2,1,2,1,2,2,0,0,2,2,0,0,2,1]
1044]
1045
1046def colMask (c s : Nat) : Nat :=
1047 match c, s with
1048 | 0, 0 => 29426393270030113135870653198318958555108476914636813153199281399973058616417756632518167344689185506303791805920838091437907006658540979981329795606986189921372527469891258702413341422563196786174326378194364113969514675357825272949616273912436295958656691671887454754399756035028582482593
1049 | 0, 1 => 4358179548641224949098004563040389852377467471855380528978871508540124970757601760980779021931469271315951481573127486567337513703926049888914591570773751285198465022888883936394016860874403053144345086949871617694687821291388324645097208798246165778831501876812665234515911035358861202698
1050 | 0, 2 => 5196683226928658236444871790141404836018963043887836425293472920338611175890346016363513896907386259281476377431669094728592159098345346316067562007490672471554118307045749480675800338522614754092526908772637783830539895052365902188271971751193400713822761663716990199411647289580212758612
1051 | 1, 0 => 2591461693295589839697060798102935894577693471172949712549738767352716846569863999850616914666634664309936971939467386539550770006612634049114605034574364637897848901277641258056013236749897802756683177470045384530866359027999480889559656190533131370605789723243770589490724037504919029833
1052 | 1, 1 => 10354413701861177430707851991019621146522457259499531703469982855753172246038163355087947829929133322695706053283811006115725048288128324906266441020070133714446231990617828754601438900933125172302578886700163028240153517528026388201381589988537496476699601873445543390120682007301221328164
1053 | 1, 2 => 26035380650443229051008616762378196202404756699707548691451904205745905670457677054923895518932273049895576639702356280078560861166071417230930903130606115325781029907930422106825706484277191618351936309746665102723722515145553630692044208282805234604005563615727796208715908315161516085906
1054 | 2, 0 => 4458677903096752706316129392408892050653836912701245206327430144437992014690655672263400641207593252075985379060696492164347873314336896280010754754477113818689218547489348289170034237311146482870827127709732377131719141804926678131661400100234229178042184884489149661308372628930247753735
1055 | 2, 1 => 5282983350740765241921539922530440681456173764630775436423591271454512107695542680384402595064997143182175736526022985047477168958392909878578514426097599166524013802138700696443274344159882844074167575781775336095728973102178083586420748298276511026260399366776965244393421036534865097152
1056 | 2, 2 => 29239594791762478373175860236561420511394896753048009464720604412959290640679506057214657027255450641643058549338915195522011637188082570027722680004675900692911878450197843133869850040489185266466203670425365802267294276794474738064903306063365122247008370961150995282625520694502543593016
1057 | 3, 0 => 12488011273403733650930678428257833986588791526469966165249929265241906535959005935093647135218589475307345615654628811753324201616956581201136558259198678652093477161578088780367432661336755631452044078424394089871014047925866477854178507273619740300114943108881658165013069833236151605521
1058 | 3, 1 => 707011669054837396469321541836870093960863597264243993734222690202730460658762083834755067251572645764469606407478666159637186682167549440489795253508371524980995815756439585817070069090443869035714940177184423355267244486957234562942248134838447589138860352925577502022141939417653322338
1059 | 3, 2 => 25786233103141425274013529581406049162955252306645819948487473873407157766447936390934058061057878915829404442863527194820875291161688245544685595672543563501050637822491363753298655891533015092923439355315295002268461099288755787365864699053417674562057151750609874521292102587313851516044
1060 | 4, 0 => 14621540971125823988542207574465898291559778072142560155863207413401018427962415728066001169084631039473520047198551830880832710745933409237782387431074749397745067652738824321497228381881648591819054188964638726478926707475689707730808421604285065676791681110596522995883386380202266070535
1061 | 4, 1 => 21314195231732294227110435988297294619000993624265354828672035604361222512320737536806886421308437188371923363619486783629310894824087555357955666817026864969686503292572808258611686201774215143011615936555057051496037507978717455099733869626988849360099300639187300775014961139207138148800
1062 | 4, 2 => 3045519842741878105760885988737560332944135733972115122936382811089553822782551144989572673134972809055776254107596058223693073890791411590573894937148999310693539854514259539374244038304350858580528248397177737519778176247172336952443163230601947414419973462633286417428966840558252224568
1063 | 5, 0 => 5254755453022985820160159033972578222692502879876516546547193696437430996696171133719785312559308438520274621030596033320019776150611579167706367357401894873867813042857031147909593722187380875979294007850236601420971587500789358657090046346066409983507405348427802189386422703561177082017
1064 | 5, 1 => 10559311788702564815399584013981484174844015751236938350218263877252574091628965402475044196097867438178930126804334619551680728680280436404833650956815180114692307947880378458528962116393623678016113334912132209732886629955626976808288055480949703620940810535225909839764417736785019671636
1065 | 5, 2 => 23167188803874445685853786503546690845968388799266575210706168255161789674740567873667630754870865160202014917090704019862136174629920360613771930871033538689564989809088482513044602783379210039415791031154504704340884174245163164317607352634859748846862739328763398159176473919621459690250
1066 | 6, 0 => 12182305446841912494147261845786942483353951031022068804228976007135934560102959829675845904080599446790938810034734870271341056115434006130454217822791602476709716192892820452574098884075755643219387135757242848751749279421203844106956762304384610476547289674448790546965597359643350672145
1067 | 6, 1 => 26043093981809322640732816992449527074626620119004861642338588663856127646505546176373735270336325348724814779137245540404562050704682724176067704236417175963594944163962891602507394757406272154542351282342965711778984195350076588125343607210985412830239669052013134474968222408468463687820
1068 | 6, 2 => 755856616948761186533450713264283685524336280353099660904061157859732556457198403812879089111116241385466075753654262057933572640695645879790027126041835237820450442970180064401664980478186795649459955816664954964008916930299067550685084946505839144523996485955185166393494591855842083938
1069 | 7, 0 => 186565705566902027456814748139050490356567064839605781761284362744413242649466612675916634849871113355078282964101814097360643318749690155324822070794921472496715103913813429855827615545701444652352458408899509031063828625208678961644355867086392422381293109915317180413671986433372684295
1070 | 7, 1 => 724521125247638111222695995194391319211397804885140452824935166531099804211535675793030658836260291030461844405460188959516519996106089156316661939701631360406681681866809606089855004094761603629119100816838982253611069559665762332886191815067743089457864526815032592888549664520501464632
1071 | 7, 2 => 38070169214785456182734018808167311433936942560655283872885406299576281716204702121393512969841909632515679537556072669676959516145956596874670465174754060845221714014045269083537476002319751545129726814691135024210067493516705058488454906779721726939471797575686760415025092709013782294976
1072 | 8, 0 => 10528907758325253990453322580027370499752538817902364481436963890902568342101641598648049967205020603876270831752863023345805916077551674427958683109643463324826728959414950395671608524201087132151101481935165477860892386559019172951661581895523294077309149673175197050209156397833195661473
1073 | 8, 1 => 1308875845386485516744154135573111305674356200053758779405300310930323940269154802280108198889997341712790790908341938843161582567732779829642957421370726852934475991997720470102536976961406579730244440658337373939496666737235830062600411991108745564316188915776679939643758249414682034954
1074 | 8, 2 => 27143472441888256814216052835900271438078012412423906846629361627018902480694908008934302097433023091312158042264429710544869180815527921928710308654236423500363905848413221253709013120797720881529852451323370663694353338405324496768723460575243822809685616623465233198474399712719778747476
1075 | 9, 0 => 29736105528534513191663636096263110429259709170719514944390664617708763865559252828624189670179796350018138636671914347392279747147126496789968128983439767649247666007038585998980179711366924246666834168531830689884147081433927250366056932380220074927986396851697095755349240136261357538823
1076 | 9, 1 => 7338149782964923694365437047293918382711340947458719221333905489892577461890525627144107337218445741813701300671173729928633862366301346674692128396583848952060747241209630932920736630758810349349984282011746073142559588207961714065025254397395349635425837729333985705474710832717848670264
1077 | 9, 2 => 1907000734100559435384456407943724431533857312201795941747055721250453435615925954094163256129798945069379727582546595412923069947384532721651691805226997076816697551577675187582242279834479997394379923373296752468035722059690535351903267684260437887898720631386028727503363390988450234816
1078 | 10, 0 => 22704909510197277636535063281879135950844665745373792749912159754329532910662176529142005820433133158172463891926262476471310175921373295247903742790432273121360632415843065288405760893661984497442993247154756071983951896778236125830849915256274346233234896685782883033322772363684883079953
1079 | 10, 1 => 9766734628832614076042746631332188506335018641209485852634847979723794842355682399260893758762849487805272513511756772914667560520807182916304069427798828447701725432869786158097713612895555999042126424209479774230567475814600418799471871753424217453079538674036781641256506100020016628834
1080 | 10, 2 => 6509611906570104608835719638289428786325223043796751504924618094798467010047845481459560684332058390923483259487615423347858943018631898022104136967019512109062752951113040672979684115402674096926078702552637669280223019108742955152663667452177298764996519852597445513748035896262756735116
1081 | 11, 0 => 8653295482066308262732898397550596609503852960187739849577216962498083796305023997282083555924903887416146160615113824691482663608424351016925229105669884989265150151700236904726869059566010332318222048013184310578109421414755670394499884446749773372202186275288750223976673920981308327185
1082 | 11, 1 => 10056027980153418478857360380384899326764900518836123431507980178251774275540019057597758577092270066412388508641826728944258918067697498748708234294348383990745050143079083116943913088322663056433810508733496943670471949455576223496247729686252452437166215169067312237475491159723976497250
1083 | 11, 2 => 20271932583380269579823270773565257307236153951356166826386428688101936691220661354982618130510867083072684995668694119098095097784690526420678485785232344698114910505046572097812376474071541204659165817170192261246161020831247605892237840328873636641942553768061047726875149279262371619468
1084 | 12, 0 => 1035621345002458178446464406342556181184609171015929228033744800169981176097322330649259362766127541156120138062164190413308528955681885140317100126374884413021209926828079113065377615212141450097099769540189158194089643330879020312359908407663433199325191751389240965715109820014286390545
1085 | 12, 1 => 6272098383116744463654497143257568982099387660899424229782147845424873068525083208185094221974692472959973668227658847349672646314904698112538554596902659591902856124653766518549702524347797207772514731666867131604754311151978670400619792560120737024940896007436539853665509461537130354786
1086 | 12, 2 => 31673536317480793679312568001900628080220910598464676649655733183256940518443298871028106678787221022785125858635811634970855504190225792933456294461973069673201044748344046487868078482400275935541583872709817225695898437218721809070005753494091692227044867453591329368946695078416239698572
1087 | 13, 0 => 32015279173763627528926883357709940442451125636203073681183768911714972816970104605480583274255715123443034465730320473514866766389320929352931932938990774230765410150286318553122148137585324728725184281377767108659329978195862796934457760531111975827673094336634408738293630750078899132689
1088 | 13, 1 => 4886381870699281194677918189647589702943664458759209115232891081986855073518567462423677257201108932393373304253040613904541132805385636629857892348309858296967015952334933246453893859286705089703359484423547945712634212670296964360429214397172948278320328863088228108675739060749075793036
1089 | 13, 2 => 2079595001137087597808728004143223098110117335417747311054965835149966872577032341958199732071216981064811894942273585314428780266105810203522123897949981150392684697204640319907116625088184774982654608115558461122778200835419738488098479533590938345317532012694473341357944549139681518178
1090 | 14, 0 => 34166170556509547190993001577393582061398107929370014512945327658728997918774442904638340723895396133692012015457271666216122235137384362905013271641070901814824530048793026480028545649955311637955795551127572288876967300007451552001290722943008429751178119438429493843567856903347536958025
1091 | 14, 1 => 8365698370232484628359357737992759709915800676192306663601361077968843226016984133473932412539510505437872388327547648915820715330634523080341074622390937741713133023340113524333848330620694779605079849693415464991929357916404675908292433311744181631009984566180763924691414176463210788
1092 | 14, 2 => 4806719790720216645792168616369178422396883700333823287862696809044828001065244521090645607220105392703769777080035458868798623608097378758218336469557320925558867618009525525930279123674282260675797742939607811152783162336211543105786439085555688518501825789421435580834766042443656275090
1093 | 15, 0 => 13986640041553947292111111143036071601207351411154688212455496821566649240729766581617899707236682796293124962238894949159150772477378601280513160357845737986911913682950591838019952485269671360082206268600288741822847711061730857759283243695100684040240807246629394308854214287366942696521
1094 | 15, 1 => 612213503884186487580209476363707135356726345748287532102052015607861564641046832078392139807435696596140217733864801510983243962625285259093711240085018922964260130538322661252370775766902519582142987319080972542375652120597117556129809548322965050952246571754134692827056303425083446052
1095 | 15, 2 => 24382402500161862541722208932100974506940829673477054362914076991677283957694890996166168416483922544011954484952874922063702663020808489646705077587319856768248936986336977620210835360923640713746849117997503801129519028519251524467572401218452213360117901394033581186646043769175630301330
1096 | 16, 0 => 15838817753023012483767324414343763773740704001604401434346490384901193627919294414155124544409239676112911819751639822135861922414839178650195360274352932282016122147873808972912616245197380235109901641330909095124096852139923448985833646133025027262759538330421453911895384525989622191265
1097 | 16, 1 => 22980585261412798550328241626812378435601916797412565953644226785812732222552184142257784288029462198951801631166162419731411371291403832217521430419664384361692493211893632911901826673758957136535174768632232556509337337443134165011879379043181431401743549402043885992950093119733224483082
1098 | 16, 2 => 161853031164185287317963510344611034162286631363062719480908658137868912594225853449551431089339161836506214007832430866563385754569365318595158491233297034416495440058450234668715703003877221766121963953731863861308202118521885785272429285669403786807867479951770283481836714244809769556
1099 | _, _ => 0
1100
1101def checkRowCols (r : Nat) (row : List Nat) (c : Nat) : Bool :=
1102 match row with
1103 | [] => c == 17
1104 | val :: rest =>
1105 (val < 3) &&
1106 ((colMask c 0).testBit r == (val == 0)) &&
1107 ((colMask c 1).testBit r == (val == 1)) &&
1108 ((colMask c 2).testBit r == (val == 2)) &&
1109 checkRowCols r rest (c + 1)
1110
1111def checkAllRows (r : Nat) : List (List Nat) → Bool
1112 | [] => r == 962
1113 | row :: rest => checkRowCols r row 0 && checkAllRows (r + 1) rest
1114
1115theorem checkRowCols_len :
1116 ∀ row c, checkRowCols r row c = true → row.length + c = 17 := by
1117 intro row
1118 induction row with
1119 | nil =>
1120 intro c h
1121 simp only [checkRowCols, beq_iff_eq] at h
1122 simp [h]
1123 | cons val rest ih =>
1124 intro c h
1125 simp only [checkRowCols, Bool.and_eq_true] at h
1126 have hrest := ih (c + 1) h.2
1127 simp only [List.length_cons]
1128 omega
1129
1130theorem checkRowCols_entry :
1131 ∀ row c j, checkRowCols r row c = true → j < row.length →
1132 row.getD j 3 < 3 ∧
1133 ∀ s, s < 3 → (colMask (c + j) s).testBit r = true → row.getD j 3 = s := by
1134 intro row
1135 induction row with
1136 | nil =>
1137 intro c j _ hj
1138 cases hj
1139 | cons val rest ih =>
1140 intro c j h hj
1141 simp only [checkRowCols, Bool.and_eq_true] at h
1142 cases j with
1143 | zero =>
1144 simp only [List.getD_cons_zero, Nat.add_zero]
1145 refine ⟨decide_eq_true_eq.mp h.1.1.1.1, ?_⟩
1146 intro s hs hbit
1147 match s with
1148 | 0 =>
1149 have h0 : (colMask c 0).testBit r = (val == 0) := by
1150 simpa using h.1.1.1.2
1151 rw [hbit] at h0
1152 exact beq_iff_eq.mp h0.symm
1153 | 1 =>
1154 have h1 : (colMask c 1).testBit r = (val == 1) := by
1155 simpa using h.1.1.2
1156 rw [hbit] at h1
1157 exact beq_iff_eq.mp h1.symm
1158 | 2 =>
1159 have h2 : (colMask c 2).testBit r = (val == 2) := by
1160 simpa using h.1.2
1161 rw [hbit] at h2
1162 exact beq_iff_eq.mp h2.symm
1163 | _ + 3 => omega
1164 | succ j' =>
1165 simp only [List.getD_cons_succ]
1166 have hj' : j' < rest.length := Nat.lt_of_succ_lt_succ hj
1167 have hsub := ih (c + 1) j' h.2 hj'
1168 refine ⟨hsub.1, ?_⟩
1169 intro s hs hbit
1170 have heq : c + (j' + 1) = (c + 1) + j' := by omega
1171 rw [heq] at hbit
1172 exact hsub.2 s hs hbit
1173
1174theorem checkAllRows_len :
1175 ∀ rows r, checkAllRows r rows = true → rows.length + r = 962 := by
1176 intro rows
1177 induction rows with
1178 | nil =>
1179 intro r h
1180 simp only [checkAllRows, beq_iff_eq] at h
1181 simp [h]
1182 | cons row rest ih =>
1183 intro r h
1184 simp only [checkAllRows, Bool.and_eq_true] at h
1185 have hrest := ih (r + 1) h.2
1186 simp only [List.length_cons]
1187 omega
1188
1189theorem checkAllRows_at :
1190 ∀ rows r i, checkAllRows r rows = true → i < rows.length →
1191 checkRowCols (r + i) (rows.getD i []) 0 = true := by
1192 intro rows
1193 induction rows with
1194 | nil =>
1195 intro r i _ hi
1196 cases hi
1197 | cons row rest ih =>
1198 intro r i h hi
1199 simp only [checkAllRows, Bool.and_eq_true] at h
1200 cases i with
1201 | zero =>
1202 simpa [List.getD_cons_zero] using h.1
1203 | succ j =>
1204 simp only [List.getD_cons_succ]
1205 have hj : j < rest.length := Nat.lt_of_succ_lt_succ hi
1206 have hsub := ih (r + 1) j h.2 hj
1207 have heq : r + (j + 1) = (r + 1) + j := by omega
1208 rw [heq]
1209 exact hsub
1210
1211theorem ca_rows_check : checkAllRows 0 ca_rows = true := by decide
1212
1213theorem ca_masks_lt :
1214 allLt (fun c => allLt (fun s => decide (colMask c s < 2 ^ 962)) 3) 17 = true := by
1215 decide
1216
1217def checkTuple5 (c0 c1 c2 c3 c4 : Nat) : Bool :=
1218 allLt (fun p0 =>
1219 let m0 := colMask c0 p0
1220 allLt (fun p1 =>
1221 let m1 := m0 &&& colMask c1 p1
1222 allLt (fun p2 =>
1223 let m2 := m1 &&& colMask c2 p2
1224 allLt (fun p3 =>
1225 let m3 := m2 &&& colMask c3 p3
1226 allLt (fun p4 => (m3 &&& colMask c4 p4) != 0) 3
1227 ) 3
1228 ) 3
1229 ) 3
1230 ) 3
1231
1232def checkAllTuples5 (k : Nat) : Bool :=
1233 allLt (fun c4 =>
1234 allLt (fun c3 =>
1235 allLt (fun c2 =>
1236 allLt (fun c1 =>
1237 allLt (fun c0 => checkTuple5 c0 c1 c2 c3 c4) c1
1238 ) c2
1239 ) c3
1240 ) c4
1241 ) k
1242
1243theorem ca_all_tuples_covered : checkAllTuples5 17 = true := by decide
1244
1245/-- MAIN THEOREM: Literal universal finite strength-5 coverage of CA(962; 5, 17, 3). -/
1246theorem ca_962_5_17_3_covers_all : IsCoveringArray5 962 17 3 ca_rows := by
1247 have hrows := ca_rows_check
1248 have hlen : ca_rows.length = 962 := by
1249 have := checkAllRows_len ca_rows 0 hrows
1250 omega
1251 refine ⟨hlen, ?_, ?_⟩
1252 · intro r hr
1253 have hr' : r < ca_rows.length := by rw [hlen]; exact hr
1254 have hrc := checkAllRows_at ca_rows 0 r hrows hr'
1255 simp only [Nat.zero_add] at hrc
1256 have hclen : (ca_rows.getD r []).length = 17 := by
1257 have := checkRowCols_len (ca_rows.getD r []) 0 hrc
1258 omega
1259 refine ⟨hclen, ?_⟩
1260 intro c hc
1261 have hc' : c < (ca_rows.getD r []).length := by rw [hclen]; exact hc
1262 exact (checkRowCols_entry (ca_rows.getD r []) 0 c hrc hc').1
1263 · intro c0 c1 c2 c3 c4 h01 h12 h23 h34 h4k p0 p1 p2 p3 p4 hp0 hp1 hp2 hp3 hp4
1264 have h4 := allLt_sound 17 ca_all_tuples_covered c4 h4k
1265 have h3 := allLt_sound c4 h4 c3 h34
1266 have h2 := allLt_sound c3 h3 c2 h23
1267 have h1 := allLt_sound c2 h2 c1 h12
1268 have h0 := allLt_sound c1 h1 c0 h01
1269 have hq0 := allLt_sound 3 h0 p0 hp0
1270 have hq1 := allLt_sound 3 hq0 p1 hp1
1271 have hq2 := allLt_sound 3 hq1 p2 hp2
1272 have hq3 := allLt_sound 3 hq2 p3 hp3
1273 have hq4 := allLt_sound 3 hq3 p4 hp4
1274 have hne : ((((colMask c0 p0 &&& colMask c1 p1) &&& colMask c2 p2) &&& colMask c3 p3) &&& colMask c4 p4) ≠ 0 := by
1275 simp only [bne_iff_ne, ne_eq] at hq4
1276 exact hq4
1277 have hc0k : c0 < 17 := by omega
1278 have hm0_lt : colMask c0 p0 < 2 ^ 962 := by
1279 have hc := allLt_sound 17 ca_masks_lt c0 hc0k
1280 have hs := allLt_sound 3 hc p0 hp0
1281 exact decide_eq_true_eq.mp hs
1282 have hlt : ((((colMask c0 p0 &&& colMask c1 p1) &&& colMask c2 p2) &&& colMask c3 p3) &&& colMask c4 p4) < 2 ^ 962 :=
1283 land_lt_pow2 (land_lt_pow2 (land_lt_pow2 (land_lt_pow2 hm0_lt)))
1284 obtain ⟨r, hr, hbit⟩ := exists_testBit_of_ne_zero 962 _ hlt hne
1285 have h1234 := testBit_land_true hbit
1286 have h123 := testBit_land_true h1234.1
1287 have h12' := testBit_land_true h123.1
1288 have h01' := testBit_land_true h12'.1
1289 have hr' : r < ca_rows.length := by rw [hlen]; exact hr
1290 have hrc := checkAllRows_at ca_rows 0 r hrows hr'
1291 simp only [Nat.zero_add] at hrc
1292 have hclen : (ca_rows.getD r []).length = 17 := by
1293 have := checkRowCols_len (ca_rows.getD r []) 0 hrc
1294 omega
1295 have he0 := (checkRowCols_entry (ca_rows.getD r []) 0 c0 hrc (by omega)).2 p0 hp0 (by simpa using h01'.1)
1296 have he1 := (checkRowCols_entry (ca_rows.getD r []) 0 c1 hrc (by omega)).2 p1 hp1 (by simpa using h01'.2)
1297 have he2 := (checkRowCols_entry (ca_rows.getD r []) 0 c2 hrc (by omega)).2 p2 hp2 (by simpa using h12'.2)
1298 have he3 := (checkRowCols_entry (ca_rows.getD r []) 0 c3 hrc (by omega)).2 p3 hp3 (by simpa using h123.2)
1299 have he4 := (checkRowCols_entry (ca_rows.getD r []) 0 c4 hrc (by omega)).2 p4 hp4 (by simpa using h1234.2)
1300 exact ⟨r, hr, he0, he1, he2, he3, he4⟩
1301
1302theorem ca_962_5_17_3_beats_live_2026 : 962 < 963 := by decide
1303
1304-- ============================================================================
1305-- 4 Literal Broken-Model Negative Controls (neg_ctrl_*)
1306-- ============================================================================
1307
1308def rowHits5 (row : List Nat) (c0 c1 c2 c3 c4 p0 p1 p2 p3 p4 : Nat) : Bool :=
1309 (row.getD c0 3 == p0) && (row.getD c1 3 == p1) &&
1310 (row.getD c2 3 == p2) && (row.getD c3 3 == p3) &&
1311 (row.getD c4 3 == p4)
1312
1313def anyRowHits5 (rows : List (List Nat)) (c0 c1 c2 c3 c4 p0 p1 p2 p3 p4 : Nat) : Bool :=
1314 rows.any (fun row => rowHits5 row c0 c1 c2 c3 c4 p0 p1 p2 p3 p4)
1315
1316theorem anyRowHits5_false_no_hit :
1317 ∀ rows c0 c1 c2 c3 c4 p0 p1 p2 p3 p4,
1318 anyRowHits5 rows c0 c1 c2 c3 c4 p0 p1 p2 p3 p4 = false →
1319 ∀ r, r < rows.length →
1320 ¬ ((rows.getD r []).getD c0 3 = p0 ∧
1321 (rows.getD r []).getD c1 3 = p1 ∧
1322 (rows.getD r []).getD c2 3 = p2 ∧
1323 (rows.getD r []).getD c3 3 = p3 ∧
1324 (rows.getD r []).getD c4 3 = p4) := by
1325 intro rows
1326 induction rows with
1327 | nil =>
1328 intro _ _ _ _ _ _ _ _ _ _ _ r hr
1329 cases hr
1330 | cons row rest ih =>
1331 intro c0 c1 c2 c3 c4 p0 p1 p2 p3 p4 h r hr
1332 simp only [anyRowHits5, List.any_cons, Bool.or_eq_false_iff] at h
1333 cases r with
1334 | zero =>
1335 intro hhit
1336 simp only [List.getD_cons_zero] at hhit
1337 have ht : rowHits5 row c0 c1 c2 c3 c4 p0 p1 p2 p3 p4 = true := by
1338 simp only [rowHits5, hhit.1, hhit.2.1, hhit.2.2.1, hhit.2.2.2.1, hhit.2.2.2.2,
1339 beq_self_eq_true, Bool.and_self]
1340 rw [h.1] at ht
1341 cases ht
1342 | succ j =>
1343 simp only [List.getD_cons_succ]
1344 exact ih c0 c1 c2 c3 c4 p0 p1 p2 p3 p4 h.2 j (Nat.lt_of_succ_lt_succ hr)
1345
1346/-- Negative Control 1: Dropping the last row breaks strength-5 coverage. -/
1347theorem neg_ctrl_drop_last_row : ¬ IsCoveringArray5 961 17 3 (ca_rows.take 961) := by
1348 intro hca
1349 have hmiss : anyRowHits5 (ca_rows.take 961) 0 1 9 14 15 0 2 0 0 2 = false := by decide
1350 obtain ⟨r, hr, hhit⟩ := hca.2.2 0 1 9 14 15 (by decide) (by decide) (by decide) (by decide) (by decide) 0 2 0 0 2 (by decide) (by decide) (by decide) (by decide) (by decide)
1351 have hlen : (ca_rows.take 961).length = 961 := hca.1
1352 exact anyRowHits5_false_no_hit (ca_rows.take 961) 0 1 9 14 15 0 2 0 0 2 hmiss r (by omega) hhit
1353
1354/-- Negative Control 2: Constant column 0 (all zeros) breaks strength-5 coverage. -/
1355theorem neg_ctrl_const_col0 :
1356 ¬ IsCoveringArray5 962 17 3 (ca_rows.map (fun row => 0 :: row.tail)) := by
1357 intro hca
1358 obtain ⟨r, hr, hhit⟩ := hca.2.2 0 1 2 3 4 (by decide) (by decide) (by decide) (by decide) (by decide) 1 0 0 0 0 (by decide) (by decide) (by decide) (by decide) (by decide)
1359 have hr' : r < ca_rows.length := by
1360 have := hca.1; simp only [List.length_map] at this; omega
1361 have hget : ((ca_rows.map (fun row => 0 :: row.tail)).getD r []).getD 0 3 = 0 := by
1362 have hm : (ca_rows.map (fun row => 0 :: row.tail)).getD r [] = 0 :: (ca_rows.getD r []).tail := by
1363 simp [List.getD, List.getElem?_eq_getElem hr']
1364 rw [hm]; rfl
1365 rw [hget] at hhit
1366 cases hhit.1
1367
1368/-- Negative Control 3: Corrupting cell (0, 0) to out-of-alphabet symbol 3 fails IsCoveringArray5. -/
1369theorem neg_ctrl_out_of_alphabet :
1370 ¬ IsCoveringArray5 962 17 3 ((3 :: (ca_rows.getD 0 []).tail) :: ca_rows.tail) := by
1371 intro hca
1372 have hlt := (hca.2.1 0 (by decide)).2 0 (by decide)
1373 simp only [List.getD_cons_zero] at hlt
1374 omega
1375
1376/-- Negative Control 4: Strict record improvement fails on a tie (963 < 963 is false). -/
1377theorem neg_ctrl_tie_not_strict : ¬ (963 < 963) := by decide
1378
1379#print axioms ca_962_5_17_3_covers_all
1380#print axioms ca_962_5_17_3_beats_live_2026
1381#print axioms neg_ctrl_drop_last_row
1382#print axioms neg_ctrl_const_col0
1383#print axioms neg_ctrl_out_of_alphabet
1384#print axioms neg_ctrl_tie_not_strict
1385
1386end CanWave5_CA962_5_17_3