ComparatorChallenges/ContingencyTables.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: OpenAI's pinned repository says an unreleased internal model produced the manuscripts and supporting proof artifacts. The collection builds on the mathematics community's accumulated problems, results, language, and formal libraries; each manuscript's BibTeX and bibliography are the authority for individual scholarly credit.
Project sources: Pinned openai/math documentation, Pinned formalization catalogue
38 declarations, 3 contain sorry, 0 declared as axioms
- abbrev
OAI.MatchingFPRAS.Symbolline 7Also declared: ComparatorChallenges/MatchingFPRAS.lean:25 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:25 (same declaration text).
- def
OAI.MatchingFPRAS.encodeNatBinary numeral followed by a delimiter line 10Source documentation
Binary numeral followed by a delimiter. Tape blank is 0; bits use 1 and 2.
L4DEL explanation
Binary numeral followed by a delimiter. Tape blank is 0; bits use 1 and 2.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: ComparatorChallenges/MatchingFPRAS.lean:28 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:28 (same declaration text).
def encodeNat (n : ℕ) : List Symbol := …
Mentions: OAI.MatchingFPRAS.Symbol
- def
OAI.MatchingFPRAS.encodeIntline 13Also declared: ComparatorChallenges/MatchingFPRAS.lean:31 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:31 (same declaration text).
- def
OAI.MatchingFPRAS.encodeRatA rational encoded by its reduced numerator and positive denominator line 17Source documentation
A rational encoded by its reduced numerator and positive denominator.
L4DEL explanation
A rational encoded by its reduced numerator and positive denominator.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: ComparatorChallenges/MatchingFPRAS.lean:35 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:35 (same declaration text).
def encodeRat (q : ℚ) : List Symbol := encodeInt q.num ++ encodeNat q.den
Mentions: OAI.MatchingFPRAS.Symbol, OAI.MatchingFPRAS.encodeInt, OAI.MatchingFPRAS.encodeNat
- structure
OAI.MatchingFPRAS.RandomMachineA uniform randomized Post-Turing machine: a single finite transition table line 20Source documentation
A uniform randomized Post-Turing machine: a single finite transition table.
L4DEL explanation
A uniform randomized Post-Turing machine: a single finite transition table.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: ComparatorChallenges/MatchingFPRAS.lean:45 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:45 (same declaration text).
structure RandomMachine where …
- structure
OAI.MatchingFPRAS.Configurationline 25Also declared: ComparatorChallenges/MatchingFPRAS.lean:50 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:50 (same declaration text).
- def
OAI.MatchingFPRAS.tickA halted configuration is absorbing line 31Source documentation
A halted configuration is absorbing. Each nonhalting tick is exactly one write or one move, or the detection of halt.
L4DEL explanation
A halted configuration is absorbing. Each nonhalting tick is exactly one write or one move, or the detection of halt.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: ComparatorChallenges/MatchingFPRAS.lean:56 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:56 (same declaration text).
def tick (A : RandomMachine) (c : Configuration A) (bit : Bool) : Configuration A := …
Mentions: OAI.MatchingFPRAS.RandomMachine, OAI.MatchingFPRAS.Configuration
- def
OAI.MatchingFPRAS.initialline 41Also declared: ComparatorChallenges/MatchingFPRAS.lean:66 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:66 (same declaration text).
- def
OAI.MatchingFPRAS.runBounded execution on a finite prefix of the random tape line 45Source documentation
Bounded execution on a finite prefix of the random tape.
L4DEL explanation
Bounded execution on a finite prefix of the random tape.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: ComparatorChallenges/MatchingFPRAS.lean:70 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:70 (same declaration text).
def run (A : RandomMachine) (input : List Symbol) {t : ℕ} (bits : Fin t → Bool) : Configuration A := …Mentions: OAI.MatchingFPRAS.RandomMachine, OAI.MatchingFPRAS.Symbol, OAI.MatchingFPRAS.Configuration
- def
OAI.MatchingFPRAS.Outputsline 49Also declared: ComparatorChallenges/MatchingFPRAS.lean:74 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:74 (same declaration text).
- def
OAI.ContingencyTables.HasMarginsline 61Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:23 (same declaration text).
- def
OAI.ContingencyTables.Tableline 64Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:27 (same declaration text).
- def
OAI.ContingencyTables.BoundedTableline 66Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:30 (same declaration text).
- theorem
OAI.ContingencyTables.entry_le_rowline 69Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:38 (same declaration text).
- theorem
OAI.ContingencyTables.entry_le_totalline 74Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:43 (same declaration text).
- instance
OAI.ContingencyTables.table_finiteline 78Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:48 (same declaration text).
- instance
OAI.ContingencyTables.table_fintypeline 87Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:57 (same declaration text).
- instance
OAI.ContingencyTables.boundedTable_fintypeline 90Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:60 (same declaration text).
- abbrev
OAI.ContingencyTables.Algorithms.Machineline 103Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:20 (same declaration text).
- abbrev
OAI.ContingencyTables.Algorithms.Symbolline 104Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:21 (same declaration text).
- def
OAI.ContingencyTables.Algorithms.encodeMatrixline 106Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:23 (same declaration text).
- def
OAI.ContingencyTables.Algorithms.encodeMarginsline 109Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:26 (same declaration text).
- def
OAI.ContingencyTables.Algorithms.encodeSamplingInputline 114Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:31 (same declaration text).
- def
OAI.ContingencyTables.Algorithms.encodeCountingInputline 117Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:34 (same declaration text).
- theorem
OAI.ContingencyTables.Algorithms.alphabetSize_neZeroThe tape alphabet has positive cardinality line 122Source documentation
The tape alphabet has positive cardinality.
L4DEL explanation
The tape alphabet has positive cardinality.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:39 (same declaration text).
theorem alphabetSize_neZero : NeZero (8 : ℕ) := inferInstance
- def
OAI.ContingencyTables.Algorithms.OutputsTableA halted tape contains the row-major binary matrix encoding line 125Source documentation
A halted tape contains the row-major binary matrix encoding.
L4DEL explanation
A halted tape contains the row-major binary matrix encoding.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:42 (same declaration text).
def OutputsTable (A : Machine) (input : List Symbol) {t m n : ℕ} (bits : Fin t → Bool) (X : Fin m → Fin n → ℕ) : Prop := …Mentions: OAI.ContingencyTables.Algorithms.Machine, OAI.ContingencyTables.Algorithms.Symbol
- def
OAI.ContingencyTables.Algorithms.tableMassline 132Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:49 (same declaration text).
- def
OAI.ContingencyTables.Algorithms.haltMassline 138Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:55 (same declaration text).
- def
OAI.ContingencyTables.Algorithms.samplingSizeline 143Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:60 (same declaration text).
- def
OAI.ContingencyTables.Algorithms.BoundedSamplingStatementPaper 200-01, Theorem main(i): bounded runtime on every random tape and total variation at most2⁻ᵏ, with freely varying dimensions line 148Source documentation
Paper 200-01, Theorem main(i): bounded runtime on every random tape and total variation at most
2⁻ᵏ, with freely varying dimensions.L4DEL explanation
Paper 200-01, Theorem main(i): bounded runtime on every random tape and total variation at most
2⁻ᵏ, with freely varying dimensions.- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:65 (same declaration text).
def BoundedSamplingStatement : Prop := …
- def
OAI.ContingencyTables.Algorithms.ExactSamplingStatementDocumented declaration: ExactSamplingStatement line 162Source documentation
Paper 200-01, Theorem main(ii): every halted output is feasible, each table has limiting mass
1/|Ω|, termination has probability one, and the expected number of bit operations is bounded by a uniform polynomial.L4DEL explanation
Paper 200-01, Theorem main(ii): every halted output is feasible, each table has limiting mass
1/|Ω|, termination has probability one, and the expected number of bit operations is bounded by a uniform polynomial.- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:79 (same declaration text).
def ExactSamplingStatement : Prop := …
- def
OAI.ContingencyTables.Algorithms.countline 176Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:93 (same declaration text).
- def
OAI.ContingencyTables.Algorithms.countingTimeline 179Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:96 (same declaration text).
- def
OAI.ContingencyTables.Algorithms.goodCountingTapesline 184Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:101 (same declaration text).
- def
OAI.ContingencyTables.Algorithms.CountingStatementPaper 200-02, Theorem main line 194Source documentation
Paper 200-02, Theorem main. The input length includes the rational accuracy parameters, and infeasible inputs always produce exactly zero.
L4DEL explanation
Paper 200-02, Theorem main. The input length includes the rational accuracy parameters, and infeasible inputs always produce exactly zero.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:111 (same declaration text).
def CountingStatement : Prop := …
- theorem
OAI.ContingencyTables.boundedSamplingChallenge statement: Sampling and counting contingency tables with arbitrary margins sorry line 211Source documentation
An almost-uniform sampler with polynomial cost on every execution.
L4DEL explanation
The formalization gives an exact uniform sampler for nonnegative integer contingency tables with arbitrary prescribed row and column sums having equal totals. It terminates almost surely, every halted output is feasible, and each table has exactly the uniform limiting probability. Expected bit complexity is polynomial in the dimensions and the binary length of the margins. It also gives a sampler with a fixed polynomial time bound on every execution whose total-variation error is at most $2^{-k}$ for requested precision $k\ge1$. The same Comparator file includes the companion approximation scheme for counting tables with individual cell bounds. The formalization gives a fully polynomial randomized approximation scheme for counting nonnegative integer matrices with prescribed row sums, column sums, and individual entry bounds. Both dimensions may vary, the margins and bounds are binary encoded, and zero entry bounds are allowed. For rational $0<\varepsilon,\delta<1$, the algorithm returns a nonnegative estimate with relative error at most $\varepsilon$ with probability at least $1-\delta$, and returns zero on every execution when no table exists. The running time is polynomial in the encoded input size, $\varepsilon^{-1}$, and $\log(\delta^{-1})$ on every random tape. The same Comparator file also contains the companion sampling results for tables without cell bounds.
- This is an exact comparator target linked by the pinned repository's formalization note for this result.
- The repository's comparator configuration selects OAI.Combinatorics.ContingencyTables.UnconditionalMain as the released solution module checked against this declaration.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Distinct definitions of this name: OAI/Combinatorics/ContingencyTables/UnconditionalMain.lean:19 (same statement text; different proof or body). Qualify references as OAI.ContingencyTables.boundedSampling@path.
theorem boundedSampling : Algorithms.BoundedSamplingStatement := by sorry
Mentions: OAI.ContingencyTables.Algorithms.BoundedSamplingStatement
- theorem
OAI.ContingencyTables.exactSamplingChallenge statement: Sampling and counting contingency tables with arbitrary margins sorry line 214Source documentation
Exact uniform sampling in polynomial expected bit time.
L4DEL explanation
The formalization gives an exact uniform sampler for nonnegative integer contingency tables with arbitrary prescribed row and column sums having equal totals. It terminates almost surely, every halted output is feasible, and each table has exactly the uniform limiting probability. Expected bit complexity is polynomial in the dimensions and the binary length of the margins. It also gives a sampler with a fixed polynomial time bound on every execution whose total-variation error is at most $2^{-k}$ for requested precision $k\ge1$. The same Comparator file includes the companion approximation scheme for counting tables with individual cell bounds. The formalization gives a fully polynomial randomized approximation scheme for counting nonnegative integer matrices with prescribed row sums, column sums, and individual entry bounds. Both dimensions may vary, the margins and bounds are binary encoded, and zero entry bounds are allowed. For rational $0<\varepsilon,\delta<1$, the algorithm returns a nonnegative estimate with relative error at most $\varepsilon$ with probability at least $1-\delta$, and returns zero on every execution when no table exists. The running time is polynomial in the encoded input size, $\varepsilon^{-1}$, and $\log(\delta^{-1})$ on every random tape. The same Comparator file also contains the companion sampling results for tables without cell bounds.
- This is an exact comparator target linked by the pinned repository's formalization note for this result.
- The repository's comparator configuration selects OAI.Combinatorics.ContingencyTables.UnconditionalMain as the released solution module checked against this declaration.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Distinct definitions of this name: OAI/Combinatorics/ContingencyTables/UnconditionalMain.lean:24 (same statement text; different proof or body). Qualify references as OAI.ContingencyTables.exactSampling@path.
theorem exactSampling : Algorithms.ExactSamplingStatement := by sorry
Mentions: OAI.ContingencyTables.Algorithms.ExactSamplingStatement
- theorem
OAI.ContingencyTables.countingChallenge statement: Sampling and counting contingency tables with arbitrary margins sorry line 217Source documentation
A cell-bounded FPRAS, with zero output on every infeasible execution.
L4DEL explanation
The formalization gives an exact uniform sampler for nonnegative integer contingency tables with arbitrary prescribed row and column sums having equal totals. It terminates almost surely, every halted output is feasible, and each table has exactly the uniform limiting probability. Expected bit complexity is polynomial in the dimensions and the binary length of the margins. It also gives a sampler with a fixed polynomial time bound on every execution whose total-variation error is at most $2^{-k}$ for requested precision $k\ge1$. The same Comparator file includes the companion approximation scheme for counting tables with individual cell bounds. The formalization gives a fully polynomial randomized approximation scheme for counting nonnegative integer matrices with prescribed row sums, column sums, and individual entry bounds. Both dimensions may vary, the margins and bounds are binary encoded, and zero entry bounds are allowed. For rational $0<\varepsilon,\delta<1$, the algorithm returns a nonnegative estimate with relative error at most $\varepsilon$ with probability at least $1-\delta$, and returns zero on every execution when no table exists. The running time is polynomial in the encoded input size, $\varepsilon^{-1}$, and $\log(\delta^{-1})$ on every random tape. The same Comparator file also contains the companion sampling results for tables without cell bounds.
- This is an exact comparator target linked by the pinned repository's formalization note for this result.
- The repository's comparator configuration selects OAI.Combinatorics.ContingencyTables.UnconditionalMain as the released solution module checked against this declaration.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Distinct definitions of this name: OAI/Combinatorics/ContingencyTables/UnconditionalMain.lean:29 (same statement text; different proof or body). Qualify references as OAI.ContingencyTables.counting@path.
theorem counting : Algorithms.CountingStatement := by sorry …
Mentions: OAI.ContingencyTables.Algorithms.CountingStatement