Download data/lean/OAI/Combinatorics/ContingencyTables/Dense/DenseIndexedCounts.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.9 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/ContingencyTables/Dense/DenseIndexedCounts.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/ContingencyTables/Dense/DenseIndexedCounts.lean
-
curl -L -o DenseIndexedCounts.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/ContingencyTables/Dense/DenseIndexedCounts.lean
2.9 kB
| import OAI.Combinatorics.ContingencyTables.Dense.DenseCandidateCounts | |
| import OAI.Combinatorics.ContingencyTables.Transport.IndexedTableLaw | |
| import OAI.Combinatorics.ContingencyTables.Machines.VectorRetryProgram | |
| namespace OAI | |
| /-! # Complete indexed integer law of a bounded dense draw -/ | |
| namespace ContingencyTables.DensePrograms | |
| open MatchingFPRAS MatchingFPRAS.TreeTyped GridBoundary | |
| open scoped BigOperators Classical | |
| noncomputable section | |
| theorem candidateCounts_indexed {m n d : β} (R : Option (Fin m) β β) | |
| (P : Option (Fin n) β β) (hd : 14β€d) (hq : m*nβ€d) | |
| (hR : β i,d^12β€R i) (hP : β j,d^12β€P j) (htotal : β i,R i=β j,P j) | |
| (h : β) (cap : List Bool) | |
| (hcap : β j : Fin (m*n),FairBits.offsetBitLength | |
| (integerWidth R P d (finProdFinEquiv.symm j)) h dβ€cap.length) : | |
| candidateCounts ((tabulateDenseWalk ((marginCode R,marginCode P),(d,h)),cap), | |
| ((marginCode R,marginCode P),(d,h)))= | |
| List.ofFn (fun k => (IndexedTableLaw.law R P (le_refl (β i,R i)) | |
| ((denseTrialCounts R P d hd hR hP finProdFinEquiv h | |
| (canonicalOrigin (m*n) d (by omega))).push | |
| (trialSuccess R P d finProdFinEquiv htotal))).count (some k)) := by | |
| unfold candidateCounts | |
| rw [completionCandidates_code R P htotal,List.map_ofFn] | |
| apply congrArg List.ofFn | |
| funext k | |
| simp only [Function.comp_apply] | |
| rw [candidateCount_actual R P hd hq hR hP h cap hcap, | |
| IndexedTableLaw.count_some R P htotal] | |
| unfold IndexedTableLaw.tableAt | |
| simp_rw [denseTrial_success_count R P d hd hR hP finProdFinEquiv htotal] | |
| /-- Full retry numerators are obtained by the polynomial binary vector | |
| recurrence, after the accepted-trial vector has been tabulated once. -/ | |
| theorem denseRetryVector_actual {m n d : β} (R : Option (Fin m) β β) | |
| (P : Option (Fin n) β β) (hd : 14β€d) (hq : m*nβ€d) | |
| (hR : β i,d^12β€R i) (hP : β j,d^12β€P j) (htotal : β i,R i=β j,P j) | |
| (h : β) (cap xs : List Bool) | |
| (hcap : β j : Fin (m*n),FairBits.offsetBitLength | |
| (integerWidth R P d (finProdFinEquiv.symm j)) h dβ€cap.length) | |
| (fallback : Table R P) : | |
| VectorRetryPrograms.counts ((xs,2^denseTrialBits R P d finProdFinEquiv h), | |
| (candidateCounts ((tabulateDenseWalk ((marginCode R,marginCode P),(d,h)),cap), | |
| ((marginCode R,marginCode P),(d,h))), | |
| (IndexedTableLaw.index R P (le_refl (β i,R i)) fallback).val))= | |
| List.ofFn (((IndexedTableLaw.law R P (le_refl (β i,R i)) | |
| ((denseTrialCounts R P d hd hR hP finProdFinEquiv h | |
| (canonicalOrigin (m*n) d (by omega))).push | |
| (trialSuccess R P d finProdFinEquiv htotal))).retry | |
| (IndexedTableLaw.index R P (le_refl (β i,R i)) fallback) xs.length).count) := by | |
| rw [candidateCounts_indexed R P hd hq hR hP htotal h cap hcap] | |
| exact VectorRetryPrograms.counts_actual _ xs _ | |
| end | |
| end ContingencyTables.DensePrograms | |
| end OAI | |