Download data/lean/OAI/Combinatorics/ContingencyTables/Dense/DenseBooleanWalk.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.48 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/ContingencyTables/Dense/DenseBooleanWalk.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/ContingencyTables/Dense/DenseBooleanWalk.lean
-
curl -L -o DenseBooleanWalk.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/ContingencyTables/Dense/DenseBooleanWalk.lean
2.48 kB
| import OAI.Combinatorics.ContingencyTables.Dense.DenseBooleanStep | |
| import OAI.Combinatorics.ContingencyTables.Dense.DenseFiniteWalk | |
| import OAI.Combinatorics.ContingencyTables.Machines.FiniteWordWalk | |
| namespace OAI | |
| /-! # The dense bin draw as one bounded unbiased Boolean word -/ | |
| namespace ContingencyTables.GridBoundary | |
| open scoped BigOperators Classical | |
| open ResidualMixture FirstSuccess FairBits | |
| noncomputable section | |
| def gridWordEquiv (n k : β) : (Fin (n * k) β Bool) β (Fin n β Fin k β Bool) := | |
| (Equiv.arrowCongr finProdFinEquiv.symm (Equiv.refl Bool)).trans (Equiv.curry _ _ _) | |
| variable {I J : Type*} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] | |
| variable {q : β} | |
| def denseBooleanWalk (R : Option I β β) (P : Option J β β) (d : β) | |
| (e : I Γ J β Fin q) (a : Grid (I := Fin q) (4 * d ^ 8)) (n : β) | |
| (bits : Fin (n * denseStepBits d) β Bool) : Grid (I := Fin q) (4 * d ^ 8) := | |
| wordWalk (denseBitStep R P d e) a n (gridWordEquiv n (denseStepBits d) bits) | |
| def denseBooleanWalkLaw (R : Option I β β) (P : Option J β β) (d : β) | |
| (e : I Γ J β Fin q) (a : Grid (I := Fin q) (4 * d ^ 8)) (n : β) : | |
| RationalLaw (Grid (I := Fin q) (4 * d ^ 8)) := | |
| mapLaw (uniformLaw (Ξ± := Fin (n * denseStepBits d) β Bool)) (denseBooleanWalk R P d e a n) | |
| /-- Exactly n*(q_bin+8d^5) unbiased bits give the rational n-step law. -/ | |
| theorem denseBooleanWalkLaw_eq (R : Option I β β) (P : Option J β β) | |
| (d : β) (hd : 14 β€ d) (hR : β i, d ^ 12 β€ R i) (hP : β j, d ^ 12 β€ P j) | |
| (hRmax : β i, R (some i) β€ R none) (hPmax : β j, P (some j) β€ P none) | |
| (hdimR : Fintype.card (Option I) β€ d) (hdimP : Fintype.card (Option J) β€ d) | |
| (hfree : Fintype.card (I Γ J) β€ d) (htotal : β i, R i = β j, P j) | |
| (e : I Γ J β Fin q) (a : Grid (I := Fin q) (4 * d ^ 8)) (n : β) : | |
| denseBooleanWalkLaw R P d e a n = rationalWalkLaw R P d hd hfree e n a := by | |
| have hk : (fun s => mapLaw (uniformLaw (Ξ± := Fin (denseStepBits d) β Bool)) (denseBitStep R P d e s)) = | |
| finiteDenseStepLaw R P d e := funext (denseBitStepLaw_eq_finite R P d e) | |
| unfold denseBooleanWalkLaw denseBooleanWalk | |
| rw [β map_equiv (gridWordEquiv n (denseStepBits d)), uniform_equiv] | |
| change wordWalkLaw (denseBitStep R P d e) a n = _ | |
| rw [wordWalkLaw_eq, hk] | |
| exact finiteDenseWalkLaw_eq R P d hd hR hP hRmax hPmax hdimR hdimP hfree htotal e a n | |
| end | |
| end ContingencyTables.GridBoundary | |
| end OAI | |