diff --git a/research/p104-nine-row-decoder-rigidity/DecoderWall4Data.lean b/research/p104-nine-row-decoder-rigidity/DecoderWall4Data.lean new file mode 100644 index 0000000000..90949f8d5d --- /dev/null +++ b/research/p104-nine-row-decoder-rigidity/DecoderWall4Data.lean @@ -0,0 +1,128 @@ +import Mathlib.Data.List.Basic + +/-! DATA (generated by dw4gen/gen4.py from cards/WILD/REBASET1/G104.npy, lines104.json; certificates from dw4gen/gen2.py). +labs = 9-bit port labels (REBASET1 order); gram = integer Gram G104; bad = the 16 kernel hyperplanes; +cats = catalog of 8-port subsets with an integer adjugate X and d = det, so G[P,P]*X = d*I; +certY = for each non-bad y in 1..511 the catalog index whose 8 ports all lie outside y^perp. -/ + +set_option maxHeartbeats 0 +namespace DW4 +def labs : List ℕ := [11, 19, 35, 131, 259, 13, 21, 37, 69, 133, 261, 41, 73, 265, 49, 145, 161, 193, 321, 385, 14, 22, 38, 70, 134, 26, 74, 138, 50, 146, 274, 194, 322, 386, 28, 44, 140, 84, 148, 276, 100, 292, 196, 324, 388, 56, 88, 152, 168, 296, 200, 328, 392, 112, 176, 304, 208, 336, 400, 224, 352, 416, 508, 506, 502, 494, 478, 446, 382, 254, 505, 501, 493, 477, 445, 381, 253, 499, 475, 443, 379, 251, 487, 471, 439, 375, 247, 463, 431, 367, 239, 415, 351, 223, 319, 191, 81, 98, 164, 262, 268, 273, 280, 290] +/-- row i of (Gram+1), 2 bits per column j (bits 2j,2j+1) -/ +def gramRows : List ℕ := [ + 137225813399786426404825676086972193302600562605387151857504899, + 145065915507400341752703207720094061667196243216713835986904108, + 267312549434603434971633748501982504111169779861535190263632952, + 109807016567203071248677166768037738045588893937178436001420994, + 28354291248755230329672907921368430300381862863581098428159874, + 32649298497742871396346365495725577232511940023442160299978068, + 40690267851395299194713718876566748038519434906613170919618905, + 162936901778598392413644259658455190482492971551434525196347749, + 59996662933645751751097683591598625257458412735504624434522453, + 214182664223208113806666655611565051674265702247279101068706197, + 132729938904760272887662396764895743929058671173681763495445077, + 136723565595038978574837660181148806911091374247162415653654854, + 34586955113542721121777294178219712027663377875837660809288020, + 116111112828671036842178744247950427004935604905581250104088660, + 128682596241386550776470306800307636105083879363991405034014017, + 42699356863875623721541838782122290065736068715154923150468377, + 109304768762455623418689150862214351654079705578953699797570949, + 62005751946126076277925803497154167284675046544046376665371925, + 143458477264573917196930062343823475029882077617643714238633045, + 143529909661254391998327253566884882261947273573789965960172565, + 128682677947423696593314372051647025995534285870406876272089428, + 137527112252458215967479804993736887362247530185352090333037905, + 15280478325255122748549264211848444918273993540530736056309061, + 118220717170207763411095840278705010143308552356460636818134357, + 118149284773527288609698649055643602911243356400314385096594837, + 111313939480973093762361336019109283571746745893910923266495832, + 143630424990310794040416229692083923373103587216127600443368790, + 143558992593630319239019038469022516141038391259981348721829270, + 32649216791705725579502300244386187342061533517026689061902657, + 138732736313556448918509845338043738828758414562119639122579737, + 54065297921530050521647426241512037589823865303213000528927313, + 158039131395806901474893810053075616047697392391011092637483285, + 239491856714254742393898068899744923792904423464608430210744405, + 239563289110935217195295260122806331024969619420754681932283925, + 267312467728566289154789683250643114220719373355119719025557541, + 145065833801363195935859142468754671776745836710298364748828697, + 26316119303898978562153003113675254394074111368847963435653697, + 239965103292663408800038365154770066195772900643057254891013156, + 239893670895982933998641173931708658963707704686911003169473636, + 158440945577535093079636915085039351218500673613313665596212516, + 156532290188074024778053706053343460411989946940694076610483858, + 238056447903202340498455156123074175389262173970437665905284498, + 53663483739801858916904321209548302419020584080910427570198082, + 139134550495284640523252950370007473999561695784422212081308968, + 135187641454930174637305771279279017396292811110654016864998722, + 162434572267813798766812178501292414200533376686794317754422293, + 265374811112766439429358754568148979425567935502724218516247589, + 265303378716085964627961563345087572193502739546577966794708069, + 131194014764651468950130507863025954414260108037173364706788945, + 212646740083099309869134766709695262159467139110770702280050065, + 245996983633835512071577598630055694974563761717686513279804521, + 164544258315387671152573339783386387229356730644089175706543401, + 164472825918707196351176148560324979997291534687942923985003881, + 135087207831910918412060860405419366175586903974731853619877908, + 139234984118303896748497861243867125220267602920344375326429782, + 220687709436751737667502120090536432965474633993941712899690902, + 36294745273351256085951285177010559995233044104414474564604486, + 117747470591799097004955544023679867740440075178011812137865606, + 117818902988479571806352735246741274972505271134158063859405126, + 158541379200554349304881825958899002439206580749235828841333330, + 239994104519002190223886084805568310184413611822833166414594450, + 34185222637851675333878254397595366747310503159950559088634200, + 41092000327086344982612758657191093318872309622500272640272725, + 128783111570442952818559282925506677216240193006329039517210242, + 103373403750339922189238893512127763986445158146662075891975809, + 111414373103992349987606246892968934792452653029833086511616646, + 233661007031195443206536787674857377236426189674654440788345490, + 130720768186242802543990211608000812011391630858724540026520194, + 143458558970611063013774127595162864920332484124059185476708456, + 212244925901371118264391661677731526988663857888468129321320834, + 32749732120762127621591276369585228453217847159364323545098882, + 266910735252875243366890643470018768940366498639232617304903721, + 258869765899222815568523290089177598134359003756061606685262884, + 136623131972019722349592749307289155690385467111240252408534040, + 239563370816972363012139325374145720915420025927170153170359336, + 239491938420291888210742134151084313683354829971023901448819816, + 116211546451690293067423655121810078225641512041503413349209474, + 162535087596870200808901154626491455311689690329131952237618518, + 242003275237519660567558269962463242102080652137790389883519333, + 135187723160967320454149836530618407286743217617069488103074133, + 139134468789247494706408885118668084109111289278006740843233557, + 53663565445839004733748386460887692309470990587325898808273493, + 145166349130419597977948118593953712887902150352635999232024922, + 267412983057622691196878659375842155331875686997457353508753766, + 109778015340864289824829447117239494056948182757402524477839700, + 164544176609350525335729274532046997338906324137673704468467990, + 28253857625735974104427997047508779079675955727658935183039060, + 14878745849564076960650224431224099637921118824643634335655241, + 117818984694516717623196800498080664862955677640573535097480537, + 117747552297836242821799609275019257630890481684427283375941017, + 36294826979388401902795350428349949885683450610829945802679897, + 240065618621719810842127341279969107306929214285394889374209381, + 34256573328495004318431380369317384088925292609681339572098309, + 158541460906591495121725891210238392329656987255651300079408741, + 137196812173447644980977956436173949313959851425611240333923605, + 218649537491895485899982215282843257059166882499208577907184725, + 42627924467195148920144647559060882833670872759008671428928857, + 260907937844079067336043194896870774040666755250794741677769061, + 156603722584754499579450897276404867644055142896840328332023378, + 36696559455079447690694390208974295166036325326717047523333717, + 166481914931187520878004268465880522024508168496484676215853353, + 124152082182323464640546097628791597810943099788752260723729497, + 183850653397638123708957304498418264448295708472980629221446949, + 342432095559207383056444644966601489017938982280538330972569701] +def bad : List ℕ := [7, 25, 42, 52, 67, 76, 82, 97, 104, 127, 137, 162, 266, 289, 448, 491] +/-- ports of catalog entry k, 7 bits each -/ +def catPorts : List ℕ := [58386936064722309, 57669020159544196, 47633505374847747, 58396044642128657, 55501336747757062, 53789874154964225, 57296429102073479, 44246868595148942, 55027141784029456, 58435700912295808, 52721974816130954, 58431093716257666, 47637734865360275, 57704408525835799, 54402203647710618, 54956255492050835, 52726548931151492, 48692537168872448, 54955493902797965, 56046453210484224, 57823402534785292, 58381985531874453, 54419763638111766, 53874094202587909, 52172182497333261, 49299882072887578, 55589533317857922, 53843652550100098, 52717545119829129, 53856498501438213, 34024912989948687, 53873952136972043, 42517817830180486, 57827690178364033, 57199224060512264, 55558889076971139, 58333505847479565, 55031334764910983, 40230728690534662, 57260173101957890, 8492939210719488, 49286862399360397, 50486866560206218, 51014083455075076, 57837319505775754, 56715995178541764, 57221281885995523, 34033814322269708, 54291387006848659, 49255833150032398, 56684269504120964, 56157166231163153, 57849548376723339, 49876062957816201, 40842299789592448, 48745660302529181, 54463881235892366, 47039183896447492, 56724687118376078, 50327744986432898, 52686311322666631, 42549220967760000, 56033154622293641, 47043923375834497, 52189639683164432, 58400377468914944, 54300151699194498, 56733792366723840, 45385894744246785, 56728909849005334, 56693514704586249, 57194030868057754, 55523564279386385, 43049944407754884, 53214005747681164, 56707159561453696, 48759235299116808, 56733442375569947, 39685614939490184, 49197861231116672, 53883511740370180, 52593673409610500, 52119165118727556, 54951161343984384, 47593092886693764, 57278281762410246, 58413700127966977, 44804869945051660, 53878831236580228, 41759832283398917, 49906607377140353, 55013880290543111, 53320181090732038, 50425950529703698, 58422608201046289, 56161696574130825, 48209581784254730, 57300208147235971, 52681911084238084, 49304455919061637, 57211727219427724, 58418134677901184, 58417449399832469, 38009612662082196, 55589397498005511, 53772382613473549, 44809820983397516, 57185408735609986, 48186936294707334, 56161564544196097, 46511729385243652, 57199221629750934, 53843509157284367, 49353385323664657, 46950424036820484, 57300311480194824, 47598040160586642, 55491742002184834, 56724132467444368, 58431258762153100, 56684894193667869, 49849809141728521, 57823536951511424, 53887185501899140, 40581121188151937, 55575827073208328, 51605047140159257, 53276306116759182, 58245160194377096, 55009131352460291, 57202862666909573, 54889697451380486, 52739190697823631, 52159233481611034, 52185552772699531, 27770407914570629, 49902451237489674, 41977342107161229, 48737209679430791, 32154602317120001, 56639911910591247, 50474577398731556, 56652826851854722, 56130872378200201, 56107920590782976, 55004668933622018, 53280696915232651, 45886689013125126, 51037596304427023, 43661621339883401, 43648081440949511, 53289500843875246, 57296254847682574, 57748701703127426, 48732536231006478, 53178614667576839, 54450271025843092, 53882923006724361, 11338681730286082, 56112700895790721, 57850825622197399, 43063279239203861, 56688876978982804, 57300204905090456, 56702695533157549, 23710283757355651, 41959473700816007, 58435490422819081, 56702726098718859, 56729319745688611, 53878977617890048, 19189022958141568, 11892802308882688, 51037559826566659, 40833747241539212, 52052161483589766, 44198149740741506, 48785379316632588, 57859551120820353, 50753836853281024, 57216469939458452, 57823871390401154, 11883797901525248, 56724299415324933, 48763599602304388, 57810760042744723, 51627247851721868, 45355041848792481, 55572051272437894, 55598995521720732, 52136900433745158, 57207948736660866, 57122862930199298, 46506465636518026, 56587375335805087, 56161561024545794] +/-- X (adjugate) of entry k, row-major 8x8, 9 bits each, bias 256 -/ +def catX : List ℕ := [124873339541822922311681178072220999013401736116060252273986806699498463465034035139986271027920499620475052456823292252219819253921372602918031092122367166174077788046360834, 127771748223134402212042259630561695869738594450306703762403676990520975011454793662163853595145860004941572087985107731752097369350328490446967338946652753159265610407478536, 131636296817092867597974412279671384609255133219430571160141412089104171670657674330096566100309720029881383255453314634164623050854821015047577515597883690698576226844541192, 124873343220134840703382924799011001547514472949366765915116976541857866066195629808640691694084672019874018691905728732904618145029778255107048559992985443064312665477349122, 127777412823516994830286195959819442522286057644584692745359007954311314090406857747828361402215321931279081946247558214316977917076451577519822064062523073665561502582703364, 126807500794785473436644501571476979035607760088712505620488009741580691796280069473947319549927971160925732598474229463792206971232733063973906206514249829085405344042189072, 135493242102759061861484954735209080698392494886257759970399313156511798361659676730573695769321684194343003097992034735119249873560439575364092629303904734683146869522170120, 139380511910268041216475441043659568364969748056667503310591905078947893490604897448136908903828168062465996773113172678037308740233259950042315936606920898707973107955663120, 131643844713149462395603256883382249256661189012359042381555452560617612161421743499660534809504380192628952709498585547961905248237130762982453855528008722238329748776423696, 127771744523241839009056699532478565401309440225539654878899415701183812001596582912524129463101543639883966497224653317800062028823855713397382085679813809512037391630729480, 131628734121409454270627752778377145221987236922453491282559360265196486937010587622874780634329637099536562267924860025422227628195971372716710938811650854197431004035154192, 131636282046315223939421276098019299645211363824104335708180004364810327060714797931046366339103939130631083543813756163404737683920685952304360826012731899852304230723485968, 154793256689559256433353235985689546912491857917146391789308210208714903829878601059892382297628688140320936249265300441020892893286268393490105111975028494224613172932903176, 154853639915486298420862370659960584340827773989174879025497270003451757322423725688134263916982738450471972409978968196008144269365956292219912291592114775739660131918545200, 131636282075052365311934635270926809692175902099860083884358945201126177930862601235176294034663168550744802262334772487067115116710725547935812294995444381529781216252920080, 135508367494125888730284208201807116247233998500032162561936603037646431254408377217787198608369983525441949572107543804275410114911161707627433384112754060372878943397740816, 139350261300180205632459647736351166824839181643026378618565756831732698928112707933463961986342541280587636504367353906563869728932235450910404400549735883564913293359456528, 135485723748426244404201477521456784328130130532492196585461849705669859202282304019864115497716173810552073770891936639598016506793057944313866071503565672394143900696183056, 139365386519013907081846800513676214592406536824159106359353906891949465916319162887356633531221807166789147444505869757898214705336201038834604724166772004241025649126539536, 125841359057435440171230099083065805006913337016337779831493551960496794684815533218010798032303095049511864548871709750397997123952057544478195665130194816301699061102279940, 125839472090633612594963968614158581136854922150764734636245622216445383414539983876326629610293066521098520220698239701771691479480928724313159040045052197995012898039659784, 131651377867165335019561270614212927086795346356989931700263209249763569267851809492035067349602492260487501730757009531663177902025094680696152412906421950729188595613180192, 131636282046259207190095614726605180578723912249476418791390864272876587971002170201622887577360258612363071080906984037350565231541559723446333174573731890576866855727788312, 135515871192910151756740309355236174328104204689577024405025698829845711962167839329794494577074096376847095708822386741175129930629387883588142124337942181298262325227290912, 131636282017465939231913032489935504620139489202741102941955810948916385249326754262832877992094357254411490516744703209536512034273944392064293182426169073932548962657632520, 129698359712175856757554793606720315172701164511404338496940525181070245933652034212568501404797311182571264590016306122377023209777542437571827333008729716712925775277979912, 131636282046315553450127956358858936908887757025122380465744201097006724009733796153111554984589813337094261349774601872567724284045195483124180675115404187715574216328872216, 131636282017578631750301731783998703751587466180374711527848702885031853295021522366985583345259995755120045411276150431662968473387211268952029210510313095743581681010999568, 127771744523241839009056697943520699986732196976189439910061435315478304880212896652111384577550660724465948592716589798657869869347956504308026868797749180362632294777872664, 127771744523241839009056702735380359901450585414384303828077218529725669663716638246481582448462802006125966963745818397581539503865754151446218638762974507012084683216384280, 126803719475750874003390372000037179758736597238739278890904038281478933011174259593203206208414044497941768548364555519392579930632253871743920293677349834650266929585060104, 131643829971221213281739925195525906586907708172267867521813934818113769110300621125921514389926478060065977084597889033818900899283646875063376134046398170288206542857695512, 127771744523241839009056705932099676400728269291563204885565490679650363260748233103054963499783618858322736151314361055085308626593041837489781661911945594507858171056501016, 135500849024565190250082144661419509708276198844122756732966773664598121028013251414444040506796880845694580208099340798966679536876962266040899559208526932770428394708005136, 135493256988708899090231760064327597088284035611240572294435963716559734695584358595975172037379972399381926958197666252565858456173276282650267521065950907177059436319605024, 127771744523241839009056696342063729353732996645540669898641401063047444810323839383492814640837315277536728778746686480970843993315794874368097647532193290112476551506436384, 127771744523241839009056697937289420986817846331254379908617880471157060062039942591385573626837979931795887927446629845171263914722856518854550451408217095045944866655830296, 127771744523241839009056694743728459683373887898671115476548304781372918064412858822113493117110549469959906966120379116635024381119902723931374545146485278589628618417242392, 126803715790240748485406910966603309658699051952303445406791097971217870315116533407705840600410983843557595997912891780825453737294451121174173336892778783603085828936565000, 127771729766832711011325989863847835975693091703115790864607738595176406647503989655398988628111245712387513702327999941547732621838849541270261241295539787719616095211094280, 131636296817036631175542622321770601516034580009098583539751725565585885936317559599173913324437022205384106465022435321054606758913882907332840376579721355099434802219188496, 124873341380978895250535180827087300833631269574428558732034093253035068380592185641732883854385151461426877656539332459824783422520932158020020820975306967716019093341079814, 127766079886896246567280030227496128572920006391944108490727081266724254062036793216557467748068864795760411421193333020080234379099288009155890242920610846358975470702821636, 126807497130898197157356335508106517790663171785456089261451800532392530081494407860515303410489724074850636683215507624712370252248018364981646768864724376160882094756727048, 135500834354394287292050892852472178710108230878521496220861985349608614749433256647742321814200396583574430668418733622674799668622007820610693039154652699975594319128166664, 130672038325029139577065730490655130390339054031648089590961477703652048121990175817877197919285298578092881002215784371046209047200606060256009619124055365787413346641914136, 130664486693060415819884868689337153096476481280902557567607120001555441427676770929663900265128500712342021324358616420238634542035902009817071505593376583096623422033754374, 125835701792082008066293094400003312228483137712903020832862384188707474070153411215919485960659405603344269352133098676805815259581514470147280144319898381867102765878210832, 135493256988821372363307205736451737840325371553934010744586889616917522607084408759043460658609011747516445612259188691276375652504457310477670072317922061394668179310117128, 125837581402302176122453089066662489828984712324628759835002001891688781412809795858711421893518638121659606966091829001163547749021195139778775383671610397267306794927128836, 125837585087812356397714638983632770319487864683399062534648375175989856489713692799048796125808147102940161211946645584302593035744280162633968618795160293228384402236637448, 125837585095010618576141468136992072149349367394382038946655616204301929844359234691772898695510690568759946297039176496761286789244486381891436576955738598468972489334192392, 127769853878128120473568590710818012670551862844977835446266647735696346997691785290910389118400825800385782045637451533163369501410636999138611612826554551306928431106225416, 125839475768945558472776720222728368865668737894224068601036480437248440085355292720520686016178078598061459286752806797411171597438858591677335891438323975149068268852611332, 131640048637719684716144891709035457185498234404802457023960484549741997815485090254581559250642192204004120346963522897633747328059227772391413074546832798060334142041753864, 126807486067183480181735875909688757183499980315981384665834777478697411440195737540895472039360375297349837997320231767920530331307532349879285673049060252218925160752873730, 131643837356525735181225159322520962563973422946955543227949288565523478602099924198054246389200649720171011750408462520474780623968536197308129523975205003988641966390901000, 127766079886896136730307970338888805987433600892483429880703068402915053249793336444425322920905438156397930281194343984471681990461506533752432321528820569765265131301371144, 127769872269659621707391428243069856352496149874372196158378491628908632104370441974215850527537337830363224805063547405725178055190321816809667357877764352332907444158720276, 124873341380978895250535182021157645620771186477466207361228863628168039426495062372611983310806057827921535986375093966999009188606092562920877334434676002646498826222962952, 135504578803944232307581283872639450187843230797651767844019194749514637077027124549609307534941624148469294605509917365628130327428818031100025170432568070970260293065241864, 130664475636543850703771333174641200328963375750970870854362476956432987583122969978991693787116888991183563808446850505980584389497649835830246538754207523222733193349299462, 127769846492697231164021245247874953588156301516834051501468831163484859435442211486660499167757358910794822850659068639318153936755283618833016996561606382466880316824487176, 125841362728563128111264422705287476144829521620087130753695091124510808233514547083595313101186797412674077625891355206890998436807024031409874399109117344028766989284147460, 126809384097770457504298419413246547534899534534864606021454908572322641049224432044504965223730470020267196233768623498641783750719471372687353549277310052020267957936584968, 131636296788243582890466164672615526162600723948792905537741966970853488300710946189845166543018132254516456452078670443186821873857990077805214812033325094498152399415406860, 125837588766138306516385288754227577740921708034768905563184405960629057584970360162389153213396630450021329546166259536412917452954131202397938374671514435869230416455138568, 125835698120996497336134394507408568988944470407820498138281326022615758340304753393895769660911071747502475755656920880339609143126586651914674828477224779451397571499656456, 129707787247090852818485632060122263598418680132611823010983664997252342682957848722881596247030790791054180535410079589071151811668848338868735125086100977716662865921441032, 125837588780548944790070460654442745045301400430452715920509199706725512113021373438720808470888159501112988149409104450318320342845778369040699494222465760910720463230598404, 147079292004920911631076885868223300301881724068060067501894799284784733012506795052329636031766504118120656109196661965674618264828281920559795535165961225126503334600114456, 127767970575241659821248670418799371836420019860841930730901366382648852714021528650998024709184814136102218260367446715018730974885652150035064656873853935894224793294208262, 131636282017409812646243801428223126585665551122863770862878055754221538656146766230417027350465523146071194035153646263541058758325804086967785967487293916487646787456332048, 125835701792124185329799951443848931626660289145945175416073231672493795511557605638842306196784875565321087930819918859527411587633542757948559695387492856366824818459409672, 127779288776991829878423429646329678866488761669201756723739158827083910156044914177699466796838878536871171757026956399193824926033383116485697831183152303000214659623157000, 127766087257916552467368509819679253056611960128224180745648894456276617187208688206263793587930007824208501628593633591699999780295278584940855763763841833978067209705621764, 124873341380978895250535182021154585100671607085160762300976838295435299129665727342374985179635093942880639103680657297310747645201033861512026672641086312123924304006614278, 135485723748370228083925671506528847741442132637801906265635441645400074797636643827466916745590494611480885981253596385439317768667579252069724354672762375566964780269965592, 130666373724618565774669702503981776523128635028416648352279817849322474031521693075341559064660852480280585657067569356102545613172881566463226652952361027286176756679182600, 125839479447243362813778371055508799401464296508965503725510079446693400357046449545893353248050115830320065902389333901381952449302594302071225208976615178740992261468323080, 127769853856533279341694212526807737597973979119437894708510091122740940709410951641138826914545861788947571030514141791191332993641315426378063253801562068737533489593319688, 126803719490133366553037776679088152191205715393239545131677580840578590138833816403443142240291959729540882093330274363440094287860595408387388412743514005202129415790264582, 127767970553604613805887848809380708293390815004273295082858060839357456260863820116221019551434041602813417571603129095901468829300249157912675528706461328686099638273049860, 127771751915828895503938219744934794530858281418178338525836377192792024410465379427785269133269224949130928913126025388970135901136110004793581665994971590373149480757361924, 131636252562177543598278677758290492114018416819835894162744720819865933792497081407057103801432415374656007677034941644092397689515544693160004261834386823137082330163839248, 127769861241922101331235985578619120401659152323150440664770642818733231902649285887971168398965616356941002625623613213120462839664439081642034900565391556111226515121371400, 127766079894052221377386030147080756996942073216085064687390215222484868249445935450303605610944406205131202883407531319756002825375668590510344826453837892603957096919731464, 129709685306555260251330542164724541886934014618319500668008096811831046321644643463684547118186833168331972761165545716328651931692930276151201903278029684711126622538955016, 127777412866706567097216683074402418560108877601052500155916911560920665196626001978750002353442001598713602806567133197062383954635463644505392044182617570409247073238646024, 124873341380978895250535180830215146560691392332502541605063958736392410617783420572375454185349336595576576274795192441495679358447274475100857103876893584474756941418722574, 126805602757028544468572719092327160009861708350411301809282450947223182888035266178824263850215797191334719540268828224399938522208843103796390752149300575313203328501022984, 125841362742931561501777396676107927620853241112239652927313394592344473905662090952090905391458922544741408487061604780230971284089597534106015063059048537817552407498981636, 125837588780506712501234105421361445872447024869436646186838712506892197803888705753624814406101120863935766418023083853759803023519423387321422826990976922081470262999122180, 127773620440739505505710865847767707868608535413827187935042347531851282221601273707956061710865884132080557419750334003661846093650553050186330283289282497789692027372962056, 129704005928084453866652107092834245690256720130935682964125799739362349606368107953826838091441208979642376347863961751259732072288971455675690788123300961368952580692116740, 127767959518725204863370841816467510596008251421487182003169704544909137539151228081676802263891354683619822804025648627142793451832935392166661848092652749712779280759520516, 125841370121150239471000745529494457125716166316761844917751114472275851853924024609238356521876868300535016545041145539548021592185594545515786815929629155968790223311210756, 125837596144342952892822562360342062615717827964214193297396738208263402982805209821179325345805629821209122735840324775678709486021247025580307402586968815077292964383423752, 127767970546392375113530926616685375330780426065637441176721928872093789470241397614189649022888025935089186916153016241909687683077102105892262080077732582940757722145091864, 127779296155210425630759055096704574837770483635276516349189139778815147921962786110575957329312346716184584708104547651033859476848586661835272199767298442624446343742620932, 125841362735761417534461713998342642715467017993172543388120222071242961264873554903212983796095872071567491381663232555504456127615401379126348300393581878265678253173897476, 133572306378520318374439142537091319685399123714029460123402226545342752594660051567136924611687067077003807040167067241099608918862554157710338307436474479179674145465172232, 130664464587197539819633662690088775035402872298923144380173606939772915700938227021299903338538851665193970038297919015166146359583086528542450216894761815947812794286604552, 125835709170328721762002700921858108312908900363807325839011851355324158319770428715543852407870072292432758336415363561853044471003099062447267341961816627365485491361811720, 127771751894290428144080064647357442807104415522047789669827774757480195453387974390042287953150257136794223634469007165619485046691290055208347809697696666641711442289625352, 127767970575185423505869846903870759901224810329164541693039996322467868260270763133379139290977309271050185387950670439800423861687586571346142645203345014076701129402610956, 125837592480427503644935663935795798787533636156756516139056992934187137758418295775733723445023177043593447267201614026856460100099089009774415790624929162193042996287633672, 131640033924472010826712526887992907353437374431173057975662184612405900199424960160428691348019273376791703492194477257397398405489372842594767721924981890964781946440384776, 135500804798442585024756186726058592591625615120022204361256093643104201303372311112906226481425056827148097054210361317799193795185172931892114742908476059957836250674762000, 125839475761747296401612354509682659501904519118257516083213807099892377979545519636731653642476022469636953516444791287765603677649438127824008491899451587931998422409285896, 127771744523241839009056696342063729376946408402731617552848830149536023226767104847248077990948670219733606815543905208332851878559237437718926197120749279945375347848118536, 125839475754534920306144514764704914753490202036476448935075187079467623560527828703646676172926605645430726281718756695955745892816546116799757094330305449711950671746563336, 127767955804351652940069589544498988427056549353466568505990650606634631467380028536363802830100878577429039179575761631361950253007102480147508337899328538811362436771878152, 125841359050237123127948472105132776552893222485144428027792408395716506626279813755616571396613024408104140165771995958835247126620600609307364767691572326377104304251207944, 125839479440073219007251635040723745747201805628955819563239032044346349185454589709093117206147073544648288771351005075730043282123338859528475153612081227194732918910615812, 125839472076194883730042488921971463425104515158117259052216326178507323917636482862020499778186811663585097100955685376004713338687557629368093295477725184326740817152180488, 127766087250746436120346660624081308441241062857262120883158130195577664436817147252442639160868489440857342932192875125793570929831666291125926768362724719226971739108540676, 127773620469504408066749555478153337154898401648713418618473483949880188599957616295308064389942229053314809480747192347270083203287531052929955975963864148421732635466924292, 127766079886924282401133499835750491859468772369361090449386333893255780825692116595320623865118400613480961824940711952787007763589809198927661737155425227018860981588198664, 126811278442678215666230151727014890441784415328732483014281188708395524544780697132948210174182687081369375087576099370567552975917813609321547681025419229345617038745927942, 129704005935296775043214924094833937948704204226342048034270893479565672604283333589058986272052919548274233572928498210196895957605907157043548521808192187269142847950554376, 125839479440045155714417021108211942376693132723899382576074788097206460650107189971615185944777884869207892800274707173810845085302491038784271807411704115386278316359678212, 127771744523241839009056694743728459683373887898671776532517094973606847993149962117339661997455851457238026382143022390306015899769152771438286257527758660754963888922030360, 127773635168355557383755850518442111696757296231805702644324301104635870026472896110990627192571293072196885435901149790636136037983418762124290302820304295544812494934638852, 127771744523241839009056697943526809060486135323706153528745936151142482975035472610926703694767307002115568387795879714416653306810230050283042349959904297536729958773293320, 127771751908630605919742483590459111633986809128062771211497546529765908296887453147708359973135920738362751512983413711441821593808146481934333779484565089521301427904447750, 125841362742931616527525889656861925124456674578676103485237329267050426424607607705410627210314217173257009500788215664769827041816483482151799259842075289951265066656600328, 126803715783070577166163051210622546614072194016232330419805252094578115076569475372203811239741270966173674162002274960773852672944752858470863955350910500451436412033696002, 154853728195084813309304666246218123913235193336497389255640496061822379716768727944947220153664479666449365015544879776621197406592544277651817074429066482619544141952057624, 124873341380978895250535180426723049243987247528706447480670042529751939550695504341827231713402735688761154361170542591865322690941939499162993840623293834153785387808586000, 125837592466045038554164654280828708217043222216320320114929575309074521425180754191700833762304690954989939051974831524698884862826731737417397987801823066676767143481180420, 127771737152193414736858623414945486993691833365442038983430574786351800470015205565594265230796889120197018648570669488037173217531246580215224976926701583396752672921615624, 127775507421980061731745058133065966898568951873222751435409728706571244134786402271670653447304504013327875992247823458350519485855065326568717825699024150983736297369241872, 126813158074507311311800650342576262125004311794015117069570263286902239769287754739872018071459143017732725743778885215508651539149869047060917491853857109299148707200104720, 129709674228429960080147653378637780711371703497404640505447764726671328521347479857892527199375108229874691965274211308223725039874134301636491709941188071947944829897541896, 125839472083407232312583707925281186136861205243786161844007856031059658963912805291943564546125722108944561181173422259509706278906102132142185619572963807413250560534642948, 127767970575269778032464565397752805999706671046114920216442573617219911127042777033417962749582276822678762054695623042528491802334361601775618560112650316188186463598412040, 124872399733141839162119345362135629670176591692971992540877447365608366610237877215715404999534818430772145102184270856074353801691684400093241266132156352545053709143244034, 126801843558309444089642691609574907784142384202252405799203857821135381609803010907273435298339757950090587554840656916130705008403487616948550396724317978911128993059179790, 127771744523241839009056695943258821787816867655287431746494460687055225431634691979855278104935843198091477353371337618863083975958129595456967128381867644282768285171325208, 124872397890372703621555578815664350842045131626823248216488630404168543029968087724176342930135983581347489823709454231242367281963398304820048406985635514940742725414812932, 127767966882476953540197583586168322625111245244487304064481480685879486923108232490416664567939992586684920161745588215619233752534001805608841279557147979730719052815013140, 126803730510714747523475340954188126305636365994646082000803878297624218946702271087339063801059753856881105949307405730590452257158668488650537204372156126106196111312161030, 131628748906696095131736113566581835975764739268292909814926587769662580519059125841731952017713885986531417957180763482265696426115241381122424670686894844720319488513410308, 126803712104772662881450620346897826083067575800150992336203891791869314601925662258785800970781297700329869717436677032834038665575012649279056476002193149606261349570181384, 125839472069024767275653426988986797393195958786085909585521149857187140011994011052028270312372432041831318657039760676323432525628193336036497762036804068689019256229200132, 127775514785774097240266065645994538658979741156682381251438968064081994467067720928342246151242067201540701794388092419962730808193383271122657502882669885830400082404051204, 124872399729514590022531356718035412777876046940796292464194647168405468653820353051419257755059058102632987910479997957640956501729364135044599773818528910701635508442891522, 125839472076237115911721129212617274603309492168002324984646050028178889964878458669708079981673979713527107292064164399542702471355444403545808057202756951621700618546186504, 124873341377372720959421692874299130716405931569650442877741725381492518471095442864267173671015775393577988796565899386299685276569073976861354910064957794677242031519433476, 124873339534638746805158277621913376152071252468725523283076865511006973103697101031401637494594720502651051061254715980321434338167656018797095735000136105549462434184298754, 133559108545081671187278248395739579133510049692025976079429004769325788311555537835404294632791477105444807475451858082668193748899864506464420905389414823665224206255783176, 127775514778575697980725206258654866307299002808047846612778541804591875536323853184701952159208888535785586032771605178588613754943287481466698968227825360959240335483075848, 127777420223302230911078707669401884811935444273909626546295014935500634062775934920372050315946989877993881139472023774917688877306838051504005928277558630677987197113729300, 124870514591064285373535781903783574399990306575535190467704596746492405454471728820960683020794865762979881823460853647468533643449243746806771122228663780613908390476120322, 135493242160289142540830911777680735685730736616344508058828133823474975737224456589725838788485296628465208261903439931397811325971687461671635215057140416698215446494707976, 125837588787719088650333176889226739792519207095535060291768529797934474525827570467748122065030211721786462254470104561656419526688571976672057647823276099015293876380502280, 126801836165680265250264084006753556184408694754965322301477764393962338188621681428967497676164550553633134400249777700919121709199915631717843442469717752453120873264184582, 131647618675574174314927768603194362111656982872656803432729088172131733695950888437346569342071290305781798628645239646862031125216023231707711376128060699594450629912299780, 125837588780506767419615386470920264273461178983959098968310426360582655624688767124992082934972980776909321476565232657777093775346302899096140972592894419415309377146063116, 124873339541836995120121204612345157624146359626838390059051123975738924909840158687598252014231773740225152160420878113415612851678629474900077155182871236661094367660736258, 125836641611602688964747374769710135103758484102987439747746066523877460608321135874291465030680516180261340385808083264094999740640703775744719978841373685224231608385928968, 124872397886780602085198512233447107323820985583182327358483032994391425054844644342685572381524752616929066900164710922688061723709486962547033564533759837994162329865288962, 124875226512244942095725658849485203929593599414810028893925711870489656835968670631015501555356261664437998029277970412726797012129857109871918238365699613223064570351713032, 124873341380978895250535180426727628083743744437072347342680218324847146854847258650315270109002258408649927469778862678466093049759844777984056143600966791550731846517123342, 127771744523241839009056697938835058245384560750779917610280061856889886212826547325425045658752958555487040595020199169906315140880581889323296043846140270029677102003521806, 126803734210607283320796748537336285616644677684405997367461655166027077279947951453569905366697212608338694718825611596468644798358929607593080621157311178829165030096898312, 125839475761719150730996324413131375205677218272779432106025509641059499368625457790350004202318266620994634729743461816352233598916022979471232094726729752820960052542833928, 127769846478314766073878727387227640194204645865229542445999288193497799091244204313592929853218112195073169747864146724906023817233201885137458640444361249637959029794928904, 124871450714263347272419297620777856672516923634423655373157548818753854859972351019547176318542245252544049335737759233213297707274585661298451152528847117280749266419713284, 139380423457911236616736416358709788659306253986105437521766251133389234522082423266595698837366633618585488728160907590785601523716595778628192645417705300805503000110039312, 127771744523241839009056699141496293953206213098544749788980063249283469595133720665776101904638507344064686603338971748224107160111955521845863213665942414958377706394360088, 127777401759760100483896416675623528915100887698597876219190403422021446581636775277822522862145645621571024376970357662861169735998104400628831152405910588422803035562052872, 127771751879865730871525666202282727702268155254707812203407137446688805486241317707170239367161213644211190259410727780717904750079406904722190513902057525148433972513079560, 124874284875184245374287604217219189858698164619194022827880558154720327761008308797932780504033326129629358021512281027286880286030837111350017411497813502734067710187143938, 124874284867985983276255247994196938759183950563687171347085680551129124085762524435871623594031594606648350773104464751113571705920941374873012505809142132176751475231948034, 125837592466030979555714421730656608637483245573165573214435751443840318329253908434529473791848684172096979762125515756250916799473743505913171838078890752798391174972438792, 131628719365000326594265443421696821242241080710456518576028776575617724056001471333738072973163727568718868583950962285308190050764262143977396138144724889741044282903619864, 127771748201525584244240901087352474119477250698317018789964062979866001685611159699603811896535716619037241199665362242241250138458872163714305442287113296443467386415350020, 124873341380978895250535180822410757287224620335462389492767421766824580490579008031202567374202325306053108929915416594493828280964280773487603533777096941749789203253821704, 127775525856715139848670154486318253351554900644798862006775978648081797380893267408162793245732984341654624887459490105305542533414378388239580673703469451888206578198906118, 131640055979862971857184051040231523427472473883100464754952753916793805947357942047805811418469975367531027112386658754398700045898631200762333778329760102044318497525337356, 127771744523241839009056695941702517432718906836083782076371096995901898538104969464323650205630087979450986575924522684800352997253420313562926033836551687474134240018962718, 126801828809084491705854474171789982867386742858271886271775990172720853380900707380363767335209556656144869845611824149882178778331391054363116232586454310030181845558756614, 127771737166674293726940972254118147614290514452243679040727803527260873799858167733528077729218881886278840389441737895389464219835313956540254764006176618960006635458260238, 125841362735747358536116229949185603333285326345766829673676103177287193084934610621020872117814502412092535562197931398915476670649703933770365334111990440144624590562388236, 125839472076223029293396057979603542637950777226719262052240960716854092643943655505318687464833366075336491655017740158880552106578889021240081219803534934231206732098046216, 124874288557088265302294042875746386657012344976900953195223335241961037860333702784358940149247411204193631671929587039514101649008137923932172417606034625982169963803573512, 125839468390712821451681404097531876867189734205119778996715221546688171224483154351885654757676499983666322783590046365699911309089914724610375378393279214027512126197337352, 127767974224704266126803125896713385658223831199366211930771803289596537928411014116720045844769550499333626963749721556691571061154303127983956970773270951149963667554042116, 130677691904816099636564019392083118558060282846846074870923644376407492576066738772119274626813737617136642162587058020264643905505406921307962702255883847610694701268206862, 124873341380978895250535180425169784510887816770675125416097087560393467423530594836006366015295965376335490388333619075447995461634595414483141068056221266426492034065499398, 130662614461058952763612751739574606082187234364581824193739136791657019372324834594127151666408737586544040772233068421751031815928239579457546515546538634955047649702707458, 131621186254146017595675921500225484727943167264577348061553361357038766489779639950924800637675504895890555365132432429227323725681958234857273028886449222505350063513010456, 126809395175881588999800478230519326324760994893887002681563222028793346442928320873441110699939282794744474924264415115136419277898105536170758679526338248831085877963911440, 124873341380978895250535180428285444827494721245615093984518011920550381199287343057294199839441841417076188538217897752985740400472843641987927812308901838522442399228227848] +def catD : List ℕ := [1, 4, 16, 1, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 16, 16, 16, 16, 4, 16, 16, 16, 16, 4, 16, 16, 16, 16, 16, 16, 16, 4, 4, 16, 4, 4, 4, 4, 16, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 16, 4, 16, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 4, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 4, 16, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 4, 1, 4, 16, 1, 4, 4, 4, 4, 4, 4, 1, 4, 1, 1, 4, 4, 4, 1, 16, 4, 4, 4, 4, 1, 1, 1, 1, 4, 16, 4, 4, 4, 1, 16, 16, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 1, 4, 4, 16, 4, 4, 16, 4, 4] +/-- (y, catalog index) -/ +def certY : List (ℕ × ℕ) := [(1, 40), (2, 170), (3, 89), (4, 141), (5, 169), (6, 61), (8, 25), (9, 97), (10, 63), (11, 9), (12, 17), (13, 26), (14, 5), (15, 7), (16, 151), (17, 174), (18, 11), (19, 124), (20, 130), (21, 81), (22, 182), (23, 15), (24, 90), (26, 18), (27, 94), (28, 171), (29, 12), (30, 37), (31, 8), (32, 189), (33, 81), (34, 57), (35, 192), (36, 49), (37, 6), (38, 23), (39, 60), (40, 69), (41, 128), (43, 51), (44, 21), (45, 14), (46, 55), (47, 23), (48, 30), (49, 127), (50, 13), (51, 13), (53, 91), (54, 14), (55, 176), (56, 26), (57, 58), (58, 2), (59, 19), (60, 36), (61, 131), (62, 74), (63, 134), (64, 14), (65, 89), (66, 87), (68, 95), (69, 17), (70, 43), (71, 34), (72, 52), (73, 70), (74, 16), (75, 54), (77, 35), (78, 1), (79, 148), (80, 74), (81, 37), (83, 23), (84, 138), (85, 2), (86, 46), (87, 63), (88, 7), (89, 15), (90, 23), (91, 14), (92, 6), (93, 117), (94, 11), (95, 65), (96, 125), (98, 37), (99, 12), (100, 70), (101, 16), (102, 56), (103, 18), (105, 44), (106, 8), (107, 20), (108, 9), (109, 21), (110, 93), (111, 100), (112, 71), (113, 28), (114, 46), (115, 181), (116, 5), (117, 49), (118, 118), (119, 45), (120, 3), (121, 120), (122, 84), (123, 45), (124, 193), (125, 127), (126, 96), (128, 132), (129, 66), (130, 54), (131, 2), (132, 78), (133, 27), (134, 136), (135, 36), (136, 162), (138, 142), (139, 67), (140, 108), (141, 133), (142, 24), (143, 167), (144, 175), (145, 98), (146, 55), (147, 33), (148, 194), (149, 32), (150, 7), (151, 177), (152, 31), (153, 84), (154, 62), (155, 75), (156, 12), (157, 27), (158, 103), (159, 103), (160, 129), (161, 34), (163, 39), (164, 35), (165, 102), (166, 42), (167, 35), (168, 29), (169, 44), (170, 20), (171, 85), (172, 18), (173, 8), (174, 57), (175, 107), (176, 15), (177, 9), (178, 19), (179, 105), (180, 11), (181, 67), (182, 69), (183, 149), (184, 75), (185, 31), (186, 6), (187, 17), (188, 101), (189, 43), (190, 73), (191, 29), (192, 125), (193, 7), (194, 102), (195, 6), (196, 165), (197, 50), (198, 66), (199, 115), (200, 183), (201, 58), (202, 0), (203, 65), (204, 24), (205, 73), (206, 16), (207, 76), (208, 34), (209, 18), (210, 27), (211, 60), (212, 29), (213, 40), (214, 9), (215, 113), (216, 8), (217, 50), (218, 28), (219, 106), (220, 152), (221, 30), (222, 123), (223, 28), (224, 78), (225, 16), (226, 12), (227, 39), (228, 25), (229, 62), (230, 146), (231, 104), (232, 13), (233, 13), (234, 33), (235, 52), (236, 2), (237, 119), (238, 132), (239, 179), (240, 21), (241, 1), (242, 17), (243, 51), (244, 42), (245, 56), (246, 114), (247, 76), (248, 11), (249, 140), (250, 71), (251, 133), (252, 61), (253, 108), (254, 15), (255, 26), (256, 12), (257, 17), (258, 163), (259, 110), (260, 43), (261, 61), (262, 195), (263, 98), (264, 119), (265, 24), (267, 60), (268, 164), (269, 26), (270, 47), (271, 58), (272, 147), (273, 191), (274, 30), (275, 25), (276, 166), (277, 11), (278, 15), (279, 109), (280, 122), (281, 6), (282, 10), (283, 110), (284, 84), (285, 92), (286, 91), (287, 99), (288, 105), (290, 9), (291, 21), (292, 13), (293, 13), (294, 33), (295, 51), (296, 155), (297, 2), (298, 64), (299, 40), (300, 64), (301, 10), (302, 111), (303, 88), (304, 32), (305, 7), (306, 101), (307, 72), (308, 18), (309, 113), (310, 54), (311, 80), (312, 8), (313, 143), (314, 106), (315, 82), (316, 48), (317, 129), (318, 20), (319, 44), (320, 1), (321, 38), (322, 48), (323, 55), (324, 36), (325, 9), (326, 2), (327, 134), (328, 17), (329, 18), (330, 22), (331, 24), (332, 53), (333, 8), (334, 156), (335, 10), (336, 139), (337, 28), (338, 79), (339, 88), (340, 16), (341, 4), (342, 53), (343, 38), (344, 15), (345, 11), (346, 153), (347, 93), (348, 52), (349, 41), (350, 126), (351, 33), (352, 6), (353, 69), (354, 21), (355, 158), (356, 47), (357, 96), (358, 7), (359, 150), (360, 22), (361, 116), (362, 72), (363, 65), (364, 56), (365, 41), (366, 86), (367, 59), (368, 82), (369, 97), (370, 79), (371, 57), (372, 80), (373, 71), (374, 19), (375, 22), (376, 10), (377, 111), (378, 131), (379, 16), (380, 187), (381, 32), (382, 12), (383, 59), (384, 62), (385, 12), (386, 18), (387, 23), (388, 180), (389, 5), (390, 6), (391, 121), (392, 144), (393, 14), (394, 8), (395, 188), (396, 73), (397, 126), (398, 34), (399, 123), (400, 2), (401, 74), (402, 14), (403, 114), (404, 29), (405, 47), (406, 172), (407, 85), (408, 9), (409, 36), (410, 186), (411, 78), (412, 128), (413, 10), (414, 118), (415, 122), (416, 77), (417, 83), (418, 63), (419, 87), (420, 31), (421, 185), (422, 72), (423, 104), (424, 7), (425, 159), (426, 10), (427, 92), (428, 83), (429, 42), (430, 49), (431, 77), (432, 27), (433, 15), (434, 32), (435, 11), (436, 82), (437, 112), (438, 17), (439, 173), (440, 66), (441, 161), (442, 116), (443, 184), (444, 80), (445, 24), (446, 21), (447, 39), (449, 67), (450, 22), (451, 99), (452, 130), (453, 86), (454, 135), (455, 76), (456, 10), (457, 94), (458, 26), (459, 81), (460, 37), (461, 120), (462, 168), (463, 41), (464, 16), (465, 145), (466, 70), (467, 68), (468, 68), (469, 107), (470, 135), (471, 90), (472, 95), (473, 160), (474, 117), (475, 46), (476, 75), (477, 22), (478, 31), (479, 79), (480, 22), (481, 178), (482, 112), (483, 50), (484, 14), (485, 53), (486, 109), (487, 27), (488, 29), (489, 38), (490, 121), (492, 4), (493, 124), (494, 190), (495, 59), (496, 77), (497, 154), (498, 83), (499, 45), (500, 137), (501, 157), (502, 23), (503, 48), (504, 68), (505, 64), (506, 28), (507, 100), (508, 35), (509, 115), (510, 13), (511, 0)] +/-- (a, b, catalog index) for every unordered pair of bad y -/ +def certP : List (ℕ × ℕ × ℕ) := [(7, 25, 3), (7, 42, 0), (7, 52, 0), (7, 67, 8), (7, 76, 4), (7, 82, 2), (7, 97, 0), (7, 104, 0), (7, 127, 0), (7, 137, 3), (7, 162, 8), (7, 266, 0), (7, 289, 4), (7, 448, 20), (7, 491, 4), (25, 42, 1), (25, 52, 3), (25, 67, 3), (25, 76, 2), (25, 82, 3), (25, 97, 3), (25, 104, 1), (25, 127, 5), (25, 137, 5), (25, 162, 5), (25, 266, 5), (25, 289, 5), (25, 448, 1), (25, 491, 3), (42, 52, 1), (42, 67, 6), (42, 76, 1), (42, 82, 3), (42, 97, 1), (42, 104, 19), (42, 127, 2), (42, 137, 1), (42, 162, 1), (42, 266, 6), (42, 289, 4), (42, 448, 25), (42, 491, 0), (52, 67, 6), (52, 76, 3), (52, 82, 2), (52, 97, 2), (52, 104, 0), (52, 127, 0), (52, 137, 5), (52, 162, 1), (52, 266, 20), (52, 289, 2), (52, 448, 1), (52, 491, 0), (67, 76, 7), (67, 82, 30), (67, 97, 0), (67, 104, 0), (67, 127, 0), (67, 137, 0), (67, 162, 3), (67, 266, 0), (67, 289, 2), (67, 448, 1), (67, 491, 0), (76, 82, 2), (76, 97, 6), (76, 104, 0), (76, 127, 7), (76, 137, 5), (76, 162, 1), (76, 266, 2), (76, 289, 19), (76, 448, 1), (76, 491, 20), (82, 97, 4), (82, 104, 2), (82, 127, 0), (82, 137, 3), (82, 162, 1), (82, 266, 9), (82, 289, 4), (82, 448, 3), (82, 491, 3), (97, 104, 4), (97, 127, 0), (97, 137, 5), (97, 162, 4), (97, 266, 11), (97, 289, 1), (97, 448, 1), (97, 491, 0), (104, 127, 0), (104, 137, 4), (104, 162, 0), (104, 266, 0), (104, 289, 4), (104, 448, 1), (104, 491, 0), (127, 137, 25), (127, 162, 19), (127, 266, 12), (127, 289, 2), (127, 448, 0), (127, 491, 0), (137, 162, 1), (137, 266, 5), (137, 289, 2), (137, 448, 1), (137, 491, 3), (162, 266, 7), (162, 289, 1), (162, 448, 1), (162, 491, 3), (266, 289, 4), (266, 448, 0), (266, 491, 0), (289, 448, 4), (289, 491, 0), (448, 491, 10)] + +end DW4 diff --git a/research/p104-nine-row-decoder-rigidity/LICENSE b/research/p104-nine-row-decoder-rigidity/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/p104-nine-row-decoder-rigidity/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/p104-nine-row-decoder-rigidity/NOTICE.md b/research/p104-nine-row-decoder-rigidity/NOTICE.md new file mode 100644 index 0000000000..df87068d0d --- /dev/null +++ b/research/p104-nine-row-decoder-rigidity/NOTICE.md @@ -0,0 +1,8 @@ +Apache-2.0 (see `LICENSE`). Prepared by DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. + +The Lean closure contains, unchanged, the earlier P104 Lean library that the new modules import, including the +Bridge7761 modules that encode facts about PR #7761's graph (Clear1nsight), as shipped in our PR #7796 and carried by +our CERTKIT package. This package states and checks facts ABOUT those constructions and about decoder/network models; +it does not replace or endorse them. `data/frame/` holds the P104 label and frame lists (labels.txt, frames.txt) and the +list of 7-dimensional blocking sections (block.out) from which `FrameCert.lean` is generated. +The new Lean sources, the FrameCert generator and the checks are ours; toolchain and Mathlib pin are those of the earlier Lean packages. diff --git a/research/p104-nine-row-decoder-rigidity/README.md b/research/p104-nine-row-decoder-rigidity/README.md new file mode 100644 index 0000000000..8077f8e031 --- /dev/null +++ b/research/p104-nine-row-decoder-rigidity/README.md @@ -0,0 +1,126 @@ +# P104 decoder: exact nine-row and rank-field controls + +## Scope and attribution + +The data are from CrocSwap/integer-mult-bounds PR #7852 at exact commit +`41beda1d6435760dc99e38bd7e65f36798aad212`, file +`research/p104-lowerbound-toolkit/lean/Nov15/DecoderWall4Data.lean`, Git blob +`90949f8d5dbcdee99974de505018768f4f9f640e` (SHA-256 +`081bf16ed5e19930082ffb58548c6e6cded5c100f15332e797695e0cd07ef8c4`). +The source file is copied intact here; `data.json` extracts only `labs` and +`gramRows`. `control.py` verifies the complete Git blob hash, verifies the +extracted arrays match the source, and independently verifies each finite +identity below. The signed Gram entries use the decoding rule in the pinned +`DecoderWall4Defs.lean`, `((gramRows[i] >> 2j) & 3) - 1`. The 8-frame indexes +are the `F0` frame in `DecoderWall6.lean` and `DF.clique8` in `DecoderFacts.lean`. +The construction and computations below are an independent challenge to a +possible extension, not a claimed correction of those upstream theorems. + +The #7852 source proves rigidity and an associated row-span bound for **exactly +eight** decoder rows; its README leaves broader general-decoder bounds open. +This control shows why that row-by-row conclusion cannot be copied to nine +rows without an extra hypothesis. It is not a counterexample to the source's +eight-row result, `Wall56`, `NetD56`, a legal word, or a kappa result. The +constructed object is a decoder, and no network or legal-word realization is +asserted. + +## Exact construction + +Index the 104 ports from zero. Let `q[i]` be their nine-bit labels, let +`Q[i,j] = parity(q[i] & q[j])`, and let `G` be the pinned signed integer +Gram. With frame + +``` +F = [0, 6, 16, 22, 29, 36, 45, 95], +A[i,k] = G[i,F[k]], x_k = A[:,k]/2. +``` + +The verifier checks every identity below by integer arithmetic: + +- `G[F,F] = 2 I_8` and `A A^T = 2 G`. +- `G[i,i] = 2` and `G[i,j] = 0` whenever `i != j` and `Q[i,j] = 1`. +- Thus `sum_{k=0}^7 x_k x_k^T = G/2` is a rational decoder: its diagonal + entries are one and its live off-diagonal entries are zero. + +Choose `p = 103`, which is outside `F`, and put `e = e_p`. Replace the first +eight decoder terms `(w_k,u_k)=(x_k,x_k)` with + +``` +(w_0,u_0) = (x_0 + e, x_0) +(w_1,u_1) = (x_1 + e, x_1) +(w_k,u_k) = (x_k, x_k) for 2 <= k < 8 +(w_8,u_8) = (e, -x_0 - x_1) +``` + +The net extra contribution is +`e x_0^T + e x_1^T - e (x_0+x_1)^T = 0`, so the **entire** decoder +completion is unchanged, not merely its constrained entries. Every factor +has half-integer entries. The checker separately verifies each factor is +nonzero and no two left factors, or two right factors, are proportional. The +terms can still be jointly recoupled back to eight rows; this example only +excludes a direct row-by-row nine-row extension, including an extension +that merely rules out zero rows and pairwise proportional merges. + +The added row's left/deposit support is exactly `{103}`. Its label is the +nonzero 9-bit integer 290, so its label-span dimension is one. Its complement +contains `F`, whose `G` block is `2 I_8`, and therefore the complement's +signed-Gram rank is at least eight. This explicitly contradicts the +`RigidSet` consequence used in the eight-row proof if one omits the +exactly-eight hypothesis. + +The true decoder row price is the rank over `F_2` of `Q[D_k,S_k]`, where +`D_k`, `S_k` are the exact nonzero supports of the left and right factors. +Exhaustive binary Gaussian elimination gives + +``` +8 rows: [9, 9, 9, 9, 9, 9, 9, 9] total 72 +9 rows: [9, 9, 9, 9, 9, 9, 9, 9, 1] total 73 +``` + +Hence the example stays above 56. It does not disprove a nine-row cost wall. + +## Same support, three different ranks + +For the first original row, `D_0 = S_0 = {i : G[i,0] != 0}`, a set of 49 +ports. On that same 49-by-49 support the checker computes exactly: + +| Matrix | Field | Rank | +|---|---|---:| +| signed integer Gram `G[D_0,D_0]` | rationals | 8 | +| binary label-pairing matrix `Q[D_0,D_0]`, viewed as an integer 0/1 matrix | rationals | 29 | +| that 0/1 label-pairing matrix | `F_2` | 9 | + +The rational ranks use exact `Fraction` elimination; the actual decoder price +uses independent bitwise elimination over `F_2`. For this integer 0/1 matrix, +mod-2 rank is in general at most rational rank, because an odd determinant of +any mod-2 nonsingular minor is nonzero over the rationals. Equality need not +hold, as the displayed 9-versus-29 calculation shows. The signed Gram matrix is +a **different** matrix, so one must also justify any comparison to it; this +example is already 8 versus 9. These finite values are not themselves a +universal lower bound. + +## Replay and negative control + +Run using Python 3.10 or newer, with no external package: + +``` +python3 -I -B research/p104-nine-row-decoder-rigidity/control.py +``` + +All results are asserted before being printed. The script additionally +reverses the sign of the ninth right factor. This changes 40 constrained +entries and the first violated off-diagonal live cell is `(103,0)`, whose +incorrect value is `8/4 = 2`. Thus a missing or reversed cancellation is +caught. The pinned blob is also rehashed, and the extracted arrays are checked +against it on every run. + +## Open next questions + +Can a change of basis remove a dependent term without increasing the +pairing-rank price? Start with the displayed three-term cancellation and +check two-sided support changes around its circuit. A proof of +support-preserving recoupling is needed to use eight-row rigidity. + +Credit DreamingOfClouds for the P104 toolkit, its decoder model and the +pinned E8 data. Clear1nsight prepared the extension test with substantial +OpenAI Codex assistance. The copied source retains its Apache-2.0 notice. diff --git a/research/p104-nine-row-decoder-rigidity/SOURCES.json b/research/p104-nine-row-decoder-rigidity/SOURCES.json new file mode 100644 index 0000000000..5f1320b29e --- /dev/null +++ b/research/p104-nine-row-decoder-rigidity/SOURCES.json @@ -0,0 +1,28 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + } + ], + "external_sources": [ + { + "pr": 7852, + "head": "41beda1d6435760dc99e38bd7e65f36798aad212", + "path": "research/p104-lowerbound-toolkit/lean/Nov15/DecoderWall4Data.lean", + "local": "DecoderWall4Data.lean", + "git_blob": "90949f8d5dbcdee99974de505018768f4f9f640e", + "sha256": "081bf16ed5e19930082ffb58548c6e6cded5c100f15332e797695e0cd07ef8c4" + } + ] +} diff --git a/research/p104-nine-row-decoder-rigidity/TASK.json b/research/p104-nine-row-decoder-rigidity/TASK.json new file mode 100644 index 0000000000..a58440ff04 --- /dev/null +++ b/research/p104-nine-row-decoder-rigidity/TASK.json @@ -0,0 +1,73 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "task_id": "complex-rank-shape-decoder", + "original_card": { + "id": "complex-rank-shape-decoder", + "question": "Can a legal decoder or coframe change improve the full signed moment, including changed helper targets?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "docs/research/recursive-invoice-preflight.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "A source-bound arbitrary-input identity and legal producer/consumer boundary with the complete paid and productive target invoice, including restoration, ownership, native alignment and extra charges. Price under the actual current model; historical ceiling.py assumptions must be established before use. A favorable optimistic relaxation keeps a route open but is not a completed supplier. A scoped local result remains useful; expansion requires the family-level budget gate.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Price one complete changed itinerary with both paid and productive histograms. Check #5693/#5698 for overlap and their exact hypotheses before another coframe search. Use the signed invoice preflight where its boundary contract agrees; an inconclusive concave comparison is not a power crossing. Stop if an optimistic complete budget fails at the chosen target or native delivery remains unspecified.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "coframe", + "signed moment", + "5693", + "5698" + ], + "existing_checks": [ + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "refined", + "actual_scope": "Test eight-row rigidity against one exact nine-row half-integer completion and audit three ranks on its retained support.", + "scope_change_reason": "The assigned independent challenge targets the rank hypothesis of the P104 lower-bound toolkit.", + "bottleneck_link": "A row-span premise must survive rank enlargement before it can be used for a general decoder wall.", + "stop_rule": "Check all 10,816 decoder cells, three exact ranks and a sign mutation on one pinned example.", + "outcome": "negative-result", + "evidence": "README.md, control.py, result.json, pinned data and replay.py.", + "author": "Clear1nsight", + "ai_assistance": "OpenAI Codex derived and independently replayed the finite counterexample.", + "open_questions": [ + { + "question": "Can dependent decoder terms always be removed at no higher price in a useful class?", + "why_it_matters": "The eight-row rigidity would then apply after a justified normalization.", + "first_step": "Check support-changing recouplings of the three modified terms.", + "blocked_by": "Individual support-rank prices can change under recoupling." + } + ] +} diff --git a/research/p104-nine-row-decoder-rigidity/VERIFY.json b/research/p104-nine-row-decoder-rigidity/VERIFY.json new file mode 100644 index 0000000000..743f91c061 --- /dev/null +++ b/research/p104-nine-row-decoder-rigidity/VERIFY.json @@ -0,0 +1,19 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/replay.py" + ], + "timeout_seconds": 30, + "checks": "Authenticate the copied P104 blob, replay both decompositions and their exact ranks, and check that the signed mutation violates the decoder equations." + } + ] +} diff --git a/research/p104-nine-row-decoder-rigidity/control.py b/research/p104-nine-row-decoder-rigidity/control.py new file mode 100644 index 0000000000..63c7b7c878 --- /dev/null +++ b/research/p104-nine-row-decoder-rigidity/control.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python3 +"""Exact arithmetic stress test of rank-tight P104 decoder rigidity. + +Input: data.json extracts labs and gramRows from the pinned PR. Every decoder +coefficient is represented as twice its rational value, so products have a +common denominator 4. No floating point, third-party library or solver. +""" +import argparse +import hashlib +import json +import re +from fractions import Fraction +from pathlib import Path + +DATA = Path(__file__).with_name('data.json') +SOURCE = Path(__file__).with_name('DecoderWall4Data.lean') +FRAME = [0, 6, 16, 22, 29, 36, 45, 95] + + +def gf2_rank(rows): + pivots = {} + for row in rows: + x = row + while x: + p = x.bit_length() - 1 + if p in pivots: + x ^= pivots[p] + else: + pivots[p] = x + break + return len(pivots) + + +def rational_rank(matrix): + a = [[Fraction(x) for x in row] for row in matrix] + m, n = len(a), len(a[0]) if a else 0 + r = 0 + for j in range(n): + pivot = next((i for i in range(r, m) if a[i][j]), None) + if pivot is None: + continue + a[r], a[pivot] = a[pivot], a[r] + for i in range(r + 1, m): + if a[i][j]: + scale = a[i][j] / a[r][j] + for k in range(j, n): + a[i][k] -= scale * a[r][k] + r += 1 + if r == m: + break + return r + + +def main(p, a, b): + data = json.loads(DATA.read_text()) + assert data['source_commit'] == '41beda1d6435760dc99e38bd7e65f36798aad212' + labels = data['labs'] + packed = [int(x) for x in data['gramRows']] + raw = SOURCE.read_bytes() + blob = hashlib.sha1(b'blob ' + str(len(raw)).encode() + b'\0' + raw).hexdigest() + assert blob == data['source_blob'] == '90949f8d5dbcdee99974de505018768f4f9f640e' + source = raw.decode() + def numbers(definition): + body = re.search(r'def ' + definition + r' : List ℕ := \[([\s\S]*?)\]', source) + assert body + return [int(x) for x in re.findall(r'\d+', body.group(1))] + assert labels == numbers('labs') and packed == numbers('gramRows') + n = len(labels) + assert n == len(packed) == 104 + assert 0 <= p < n and p not in FRAME and 0 <= a < b < 8 + gram = [[(packed[i] >> (2*j) & 3) - 1 for j in range(n)] for i in range(n)] + q = [[(labels[i] & labels[j]).bit_count() & 1 for j in range(n)] for i in range(n)] + A = [[gram[i][j] for j in FRAME] for i in range(n)] + assert all(labels[i].bit_count() % 2 == 1 for i in range(n)) + assert all(gram[i][j] == gram[j][i] for i in range(n) for j in range(n)) + assert all(gram[i][j] == (2 if i == j else 0) for i in FRAME for j in FRAME) + assert all(sum(A[i][k]*A[j][k] for k in range(8)) == 2*gram[i][j] + for i in range(n) for j in range(n)) + assert all(gram[i][j] == 0 for i in range(n) for j in range(n) if i != j and q[i][j]) + W0, U0 = [r[:] for r in A], [r[:] for r in A] + W, U = [r[:] + [0] for r in W0], [r[:] + [0] for r in U0] + # W_a <- W_a+e_p, W_b <- W_b+e_p, W_8 <- e_p, + # U_8 <- -(U_a+U_b): exact compensating cancellation. + W[p][a] += 2 + W[p][b] += 2 + W[p][8] = 2 + for i in range(n): + U[i][8] = -U0[i][a] - U0[i][b] + + def product(X, Y): + return [[sum(x*y for x, y in zip(X[i], Y[j])) for j in range(n)] for i in range(n)] + M0, M = product(W0,U0), product(W,U) + assert M == M0 + assert all(M[i][j] == 2*gram[i][j] for i in range(n) for j in range(n)) + assert all(M[i][i] == 4 for i in range(n)) + assert all(M[i][j] == 0 for i in range(n) for j in range(n) if i != j and q[i][j]) + + def analyze(X, Y): + prices=[] + support=[] + for k in range(len(X[0])): + D=[i for i in range(n) if X[i][k] != 0] + S=[i for i in range(n) if Y[i][k] != 0] + rows=[sum(q[i][j] << j for j in S) for i in D] + prices.append(gf2_rank(rows)) + support.append((len(D),len(S))) + return prices,support + + base, base_support=analyze(W0,U0) + changed, support=analyze(W,U) + # Three different matrices/fields on the exact same 49-by-49 support. + # Q is the 0/1 binary label pairing, whereas G is the signed E8 Gram. + s0 = [i for i in range(n) if W0[i][0]] + q0 = [[q[i][j] for j in s0] for i in s0] + g0 = [[gram[i][j] for j in s0] for i in s0] + signed_gram_q_rank = rational_rank(g0) + pairing_q_rank = rational_rank(q0) + pairing_f2_rank = gf2_rank([sum(q[i][j] << j for j in s0) for i in s0]) + assert len(s0) == 49 and (signed_gram_q_rank, pairing_q_rank, pairing_f2_rank) == (8, 29, 9) + assert [i for i in range(n) if W[i][8]] == [p] + assert all(W[FRAME[i]][8] == 0 for i in range(8)) + # The reference frame is a rational rank-8 principal Gram block in its complement. + assert all(gram[i][j] == (2 if i == j else 0) for i in FRAME for j in FRAME) + assert changed[8] <= 1 + # No pair of rank-one terms is a scalar multiple on either factor side. + def proportional(x, y): + return all(x[i]*y[j] == x[j]*y[i] for i in range(n) for j in range(n)) + assert all(any(W[i][k] for i in range(n)) and any(U[i][k] for i in range(n)) for k in range(9)) + assert not any(proportional([r[k] for r in U], [r[l] for r in U]) + for k in range(9) for l in range(k)) + assert not any(proportional([r[k] for r in W], [r[l] for r in W]) + for k in range(9) for l in range(k)) + # Negative control: reverse the compensating factor's sign. + bad=[r[:] for r in U] + for i in range(n): bad[i][8] *= -1 + badM=product(W,bad) + fails=[(i,j,badM[i][j]) for i in range(n) for j in range(n) + if (i==j and badM[i][j]!=4) or (i!=j and q[i][j] and badM[i][j]!=0)] + assert fails + print(json.dumps({'pin':data['source_commit'], 'source_blob':data['source_blob'], + 'p':p,'changed_columns':[a,b],'frame':FRAME, + 'base_row_prices':base,'base_mass':sum(base),'base_support_sizes':base_support, + 'new_row_prices':changed,'new_mass':sum(changed),'new_support_sizes':support, + 'new_deposit_support':[p],'frame_complement_gram':'2 I_8', + 'same_49_by_49_support_ranks':{'signed_gram_over_Q':signed_gram_q_rank, + 'binary_pairing_over_Q':pairing_q_rank, + 'binary_pairing_over_F2':pairing_f2_rank}, + 'equal_completion': True,'all_half_integer':True, + 'all_terms_nonzero_and_no_proportional_pairs':True, + 'bad_sign_violations':len(fails),'bad_first_violation_scaled_by_4':fails[0]}, indent=2)) + +if __name__ == '__main__': + ap=argparse.ArgumentParser() + ap.add_argument('--port',type=int,default=103) + ap.add_argument('--a',type=int,default=0) + ap.add_argument('--b',type=int,default=1) + args=ap.parse_args() + main(args.port,args.a,args.b) diff --git a/research/p104-nine-row-decoder-rigidity/data.json b/research/p104-nine-row-decoder-rigidity/data.json new file mode 100644 index 0000000000..1ecbbcfe5b --- /dev/null +++ b/research/p104-nine-row-decoder-rigidity/data.json @@ -0,0 +1,217 @@ +{ + "source_commit": "41beda1d6435760dc99e38bd7e65f36798aad212", + "source_file": "research/p104-lowerbound-toolkit/lean/Nov15/DecoderWall4Data.lean", + "source_blob": "90949f8d5dbcdee99974de505018768f4f9f640e", + "labs": [ + 11, + 19, + 35, + 131, + 259, + 13, + 21, + 37, + 69, + 133, + 261, + 41, + 73, + 265, + 49, + 145, + 161, + 193, + 321, + 385, + 14, + 22, + 38, + 70, + 134, + 26, + 74, + 138, + 50, + 146, + 274, + 194, + 322, + 386, + 28, + 44, + 140, + 84, + 148, + 276, + 100, + 292, + 196, + 324, + 388, + 56, + 88, + 152, + 168, + 296, + 200, + 328, + 392, + 112, + 176, + 304, + 208, + 336, + 400, + 224, + 352, + 416, + 508, + 506, + 502, + 494, + 478, + 446, + 382, + 254, + 505, + 501, + 493, + 477, + 445, + 381, + 253, + 499, + 475, + 443, + 379, + 251, + 487, + 471, + 439, + 375, + 247, + 463, + 431, + 367, + 239, + 415, + 351, + 223, + 319, + 191, + 81, + 98, + 164, + 262, + 268, + 273, + 280, + 290 + ], + "gramRows": [ + "137225813399786426404825676086972193302600562605387151857504899", + "145065915507400341752703207720094061667196243216713835986904108", + "267312549434603434971633748501982504111169779861535190263632952", + "109807016567203071248677166768037738045588893937178436001420994", + "28354291248755230329672907921368430300381862863581098428159874", + "32649298497742871396346365495725577232511940023442160299978068", + "40690267851395299194713718876566748038519434906613170919618905", + "162936901778598392413644259658455190482492971551434525196347749", + "59996662933645751751097683591598625257458412735504624434522453", + "214182664223208113806666655611565051674265702247279101068706197", + "132729938904760272887662396764895743929058671173681763495445077", + "136723565595038978574837660181148806911091374247162415653654854", + "34586955113542721121777294178219712027663377875837660809288020", + "116111112828671036842178744247950427004935604905581250104088660", + "128682596241386550776470306800307636105083879363991405034014017", + "42699356863875623721541838782122290065736068715154923150468377", + "109304768762455623418689150862214351654079705578953699797570949", + "62005751946126076277925803497154167284675046544046376665371925", + "143458477264573917196930062343823475029882077617643714238633045", + "143529909661254391998327253566884882261947273573789965960172565", + "128682677947423696593314372051647025995534285870406876272089428", + "137527112252458215967479804993736887362247530185352090333037905", + "15280478325255122748549264211848444918273993540530736056309061", + "118220717170207763411095840278705010143308552356460636818134357", + "118149284773527288609698649055643602911243356400314385096594837", + "111313939480973093762361336019109283571746745893910923266495832", + "143630424990310794040416229692083923373103587216127600443368790", + "143558992593630319239019038469022516141038391259981348721829270", + "32649216791705725579502300244386187342061533517026689061902657", + "138732736313556448918509845338043738828758414562119639122579737", + "54065297921530050521647426241512037589823865303213000528927313", + "158039131395806901474893810053075616047697392391011092637483285", + "239491856714254742393898068899744923792904423464608430210744405", + "239563289110935217195295260122806331024969619420754681932283925", + "267312467728566289154789683250643114220719373355119719025557541", + "145065833801363195935859142468754671776745836710298364748828697", + "26316119303898978562153003113675254394074111368847963435653697", + "239965103292663408800038365154770066195772900643057254891013156", + "239893670895982933998641173931708658963707704686911003169473636", + "158440945577535093079636915085039351218500673613313665596212516", + "156532290188074024778053706053343460411989946940694076610483858", + "238056447903202340498455156123074175389262173970437665905284498", + "53663483739801858916904321209548302419020584080910427570198082", + "139134550495284640523252950370007473999561695784422212081308968", + "135187641454930174637305771279279017396292811110654016864998722", + "162434572267813798766812178501292414200533376686794317754422293", + "265374811112766439429358754568148979425567935502724218516247589", + "265303378716085964627961563345087572193502739546577966794708069", + "131194014764651468950130507863025954414260108037173364706788945", + "212646740083099309869134766709695262159467139110770702280050065", + "245996983633835512071577598630055694974563761717686513279804521", + "164544258315387671152573339783386387229356730644089175706543401", + "164472825918707196351176148560324979997291534687942923985003881", + "135087207831910918412060860405419366175586903974731853619877908", + "139234984118303896748497861243867125220267602920344375326429782", + "220687709436751737667502120090536432965474633993941712899690902", + "36294745273351256085951285177010559995233044104414474564604486", + "117747470591799097004955544023679867740440075178011812137865606", + "117818902988479571806352735246741274972505271134158063859405126", + "158541379200554349304881825958899002439206580749235828841333330", + "239994104519002190223886084805568310184413611822833166414594450", + "34185222637851675333878254397595366747310503159950559088634200", + "41092000327086344982612758657191093318872309622500272640272725", + "128783111570442952818559282925506677216240193006329039517210242", + "103373403750339922189238893512127763986445158146662075891975809", + "111414373103992349987606246892968934792452653029833086511616646", + "233661007031195443206536787674857377236426189674654440788345490", + "130720768186242802543990211608000812011391630858724540026520194", + "143458558970611063013774127595162864920332484124059185476708456", + "212244925901371118264391661677731526988663857888468129321320834", + "32749732120762127621591276369585228453217847159364323545098882", + "266910735252875243366890643470018768940366498639232617304903721", + "258869765899222815568523290089177598134359003756061606685262884", + "136623131972019722349592749307289155690385467111240252408534040", + "239563370816972363012139325374145720915420025927170153170359336", + "239491938420291888210742134151084313683354829971023901448819816", + "116211546451690293067423655121810078225641512041503413349209474", + "162535087596870200808901154626491455311689690329131952237618518", + "242003275237519660567558269962463242102080652137790389883519333", + "135187723160967320454149836530618407286743217617069488103074133", + "139134468789247494706408885118668084109111289278006740843233557", + "53663565445839004733748386460887692309470990587325898808273493", + "145166349130419597977948118593953712887902150352635999232024922", + "267412983057622691196878659375842155331875686997457353508753766", + "109778015340864289824829447117239494056948182757402524477839700", + "164544176609350525335729274532046997338906324137673704468467990", + "28253857625735974104427997047508779079675955727658935183039060", + "14878745849564076960650224431224099637921118824643634335655241", + "117818984694516717623196800498080664862955677640573535097480537", + "117747552297836242821799609275019257630890481684427283375941017", + "36294826979388401902795350428349949885683450610829945802679897", + "240065618621719810842127341279969107306929214285394889374209381", + "34256573328495004318431380369317384088925292609681339572098309", + "158541460906591495121725891210238392329656987255651300079408741", + "137196812173447644980977956436173949313959851425611240333923605", + "218649537491895485899982215282843257059166882499208577907184725", + "42627924467195148920144647559060882833670872759008671428928857", + "260907937844079067336043194896870774040666755250794741677769061", + "156603722584754499579450897276404867644055142896840328332023378", + "36696559455079447690694390208974295166036325326717047523333717", + "166481914931187520878004268465880522024508168496484676215853353", + "124152082182323464640546097628791597810943099788752260723729497", + "183850653397638123708957304498418264448295708472980629221446949", + "342432095559207383056444644966601489017938982280538330972569701" + ] +} diff --git a/research/p104-nine-row-decoder-rigidity/replay.py b/research/p104-nine-row-decoder-rigidity/replay.py new file mode 100644 index 0000000000..f5bb33496f --- /dev/null +++ b/research/p104-nine-row-decoder-rigidity/replay.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +"""Replay the exact decoder control and compare its receipt.""" +from pathlib import Path +import json +import subprocess +import sys + +root = Path(__file__).resolve().parent +run = subprocess.run( + [sys.executable, "-I", "-B", str(root / "control.py")], + check=True, + capture_output=True, + text=True, +) +if json.loads(run.stdout) != json.loads((root / "result.json").read_text()): + raise SystemExit("decoder control did not reproduce the frozen receipt") +print("PASS_P104_NINE_ROW_DECODER 10816 cells, masses 72/73, 40 mutation failures") diff --git a/research/p104-nine-row-decoder-rigidity/result.json b/research/p104-nine-row-decoder-rigidity/result.json new file mode 100644 index 0000000000..fa69799f65 --- /dev/null +++ b/research/p104-nine-row-decoder-rigidity/result.json @@ -0,0 +1,132 @@ +{ + "pin": "41beda1d6435760dc99e38bd7e65f36798aad212", + "source_blob": "90949f8d5dbcdee99974de505018768f4f9f640e", + "p": 103, + "changed_columns": [ + 0, + 1 + ], + "frame": [ + 0, + 6, + 16, + 22, + 29, + 36, + 45, + 95 + ], + "base_row_prices": [ + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9 + ], + "base_mass": 72, + "base_support_sizes": [ + [ + 49, + 49 + ], + [ + 49, + 49 + ], + [ + 49, + 49 + ], + [ + 49, + 49 + ], + [ + 49, + 49 + ], + [ + 49, + 49 + ], + [ + 49, + 49 + ], + [ + 49, + 49 + ] + ], + "new_row_prices": [ + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 1 + ], + "new_mass": 73, + "new_support_sizes": [ + [ + 50, + 49 + ], + [ + 49, + 49 + ], + [ + 49, + 49 + ], + [ + 49, + 49 + ], + [ + 49, + 49 + ], + [ + 49, + 49 + ], + [ + 49, + 49 + ], + [ + 49, + 49 + ], + [ + 1, + 71 + ] + ], + "new_deposit_support": [ + 103 + ], + "frame_complement_gram": "2 I_8", + "same_49_by_49_support_ranks": { + "signed_gram_over_Q": 8, + "binary_pairing_over_Q": 29, + "binary_pairing_over_F2": 9 + }, + "equal_completion": true, + "all_half_integer": true, + "all_terms_nonzero_and_no_proportional_pairs": true, + "bad_sign_violations": 40, + "bad_first_violation_scaled_by_4": [ + 103, + 0, + 8 + ] +}