ComparatorChallenges/ContingencyTables.lean

GitHub source file

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

  1. abbrev OAI.MatchingFPRAS.Symbol line 7

    Also declared: ComparatorChallenges/MatchingFPRAS.lean:25 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:25 (same declaration text).

  2. def OAI.MatchingFPRAS.encodeNat Binary numeral followed by a delimiter line 10

    Source 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.

    1. 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

  3. def OAI.MatchingFPRAS.encodeInt line 13

    Also declared: ComparatorChallenges/MatchingFPRAS.lean:31 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:31 (same declaration text).

  4. def OAI.MatchingFPRAS.encodeRat A rational encoded by its reduced numerator and positive denominator line 17

    Source documentation

    A rational encoded by its reduced numerator and positive denominator.

    L4DEL explanation

    A rational encoded by its reduced numerator and positive denominator.

    1. 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

  5. structure OAI.MatchingFPRAS.RandomMachine A uniform randomized Post-Turing machine: a single finite transition table line 20

    Source 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.

    1. 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
    …
  6. structure OAI.MatchingFPRAS.Configuration line 25

    Also declared: ComparatorChallenges/MatchingFPRAS.lean:50 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:50 (same declaration text).

  7. def OAI.MatchingFPRAS.tick A halted configuration is absorbing line 31

    Source 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.

    1. 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

  8. def OAI.MatchingFPRAS.initial line 41

    Also declared: ComparatorChallenges/MatchingFPRAS.lean:66 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:66 (same declaration text).

  9. def OAI.MatchingFPRAS.run Bounded execution on a finite prefix of the random tape line 45

    Source documentation

    Bounded execution on a finite prefix of the random tape.

    L4DEL explanation

    Bounded execution on a finite prefix of the random tape.

    1. 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

  10. def OAI.MatchingFPRAS.Outputs line 49

    Also declared: ComparatorChallenges/MatchingFPRAS.lean:74 (same declaration text), OAI/Combinatorics/MatchingCount/Model.lean:74 (same declaration text).

  11. def OAI.ContingencyTables.HasMargins line 61

    Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:23 (same declaration text).

  12. def OAI.ContingencyTables.Table line 64

    Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:27 (same declaration text).

  13. def OAI.ContingencyTables.BoundedTable line 66

    Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:30 (same declaration text).

  14. theorem OAI.ContingencyTables.entry_le_row line 69

    Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:38 (same declaration text).

  15. theorem OAI.ContingencyTables.entry_le_total line 74

    Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:43 (same declaration text).

  16. instance OAI.ContingencyTables.table_finite line 78

    Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:48 (same declaration text).

  17. instance OAI.ContingencyTables.table_fintype line 87

    Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:57 (same declaration text).

  18. instance OAI.ContingencyTables.boundedTable_fintype line 90

    Also declared: OAI/Combinatorics/ContingencyTables/Model.lean:60 (same declaration text).

  19. abbrev OAI.ContingencyTables.Algorithms.Machine line 103

    Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:20 (same declaration text).

  20. abbrev OAI.ContingencyTables.Algorithms.Symbol line 104

    Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:21 (same declaration text).

  21. def OAI.ContingencyTables.Algorithms.encodeMatrix line 106

    Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:23 (same declaration text).

  22. def OAI.ContingencyTables.Algorithms.encodeMargins line 109

    Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:26 (same declaration text).

  23. def OAI.ContingencyTables.Algorithms.encodeSamplingInput line 114

    Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:31 (same declaration text).

  24. def OAI.ContingencyTables.Algorithms.encodeCountingInput line 117

    Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:34 (same declaration text).

  25. theorem OAI.ContingencyTables.Algorithms.alphabetSize_neZero The tape alphabet has positive cardinality line 122

    Source documentation

    The tape alphabet has positive cardinality.

    L4DEL explanation

    The tape alphabet has positive cardinality.

    1. 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
  26. def OAI.ContingencyTables.Algorithms.OutputsTable A halted tape contains the row-major binary matrix encoding line 125

    Source documentation

    A halted tape contains the row-major binary matrix encoding.

    L4DEL explanation

    A halted tape contains the row-major binary matrix encoding.

    1. 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

  27. def OAI.ContingencyTables.Algorithms.tableMass line 132

    Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:49 (same declaration text).

  28. def OAI.ContingencyTables.Algorithms.haltMass line 138

    Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:55 (same declaration text).

  29. def OAI.ContingencyTables.Algorithms.samplingSize line 143

    Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:60 (same declaration text).

  30. def OAI.ContingencyTables.Algorithms.BoundedSamplingStatement Paper 200-01, Theorem main(i): bounded runtime on every random tape and total variation at most 2⁻ᵏ, with freely varying dimensions line 148

    Source 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.

    1. 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 :=
    …
  31. def OAI.ContingencyTables.Algorithms.ExactSamplingStatement Documented declaration: ExactSamplingStatement line 162

    Source 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.

    1. 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 :=
    …
  32. def OAI.ContingencyTables.Algorithms.count line 176

    Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:93 (same declaration text).

  33. def OAI.ContingencyTables.Algorithms.countingTime line 179

    Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:96 (same declaration text).

  34. def OAI.ContingencyTables.Algorithms.goodCountingTapes line 184

    Also declared: OAI/Combinatorics/ContingencyTables/AlgorithmStatements.lean:101 (same declaration text).

  35. def OAI.ContingencyTables.Algorithms.CountingStatement Paper 200-02, Theorem main line 194

    Source 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.

    1. 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 :=
    …
  36. theorem OAI.ContingencyTables.boundedSampling Challenge statement: Sampling and counting contingency tables with arbitrary margins sorry line 211

    Source 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.

    1. This is an exact comparator target linked by the pinned repository's formalization note for this result.
    2. 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

  37. theorem OAI.ContingencyTables.exactSampling Challenge statement: Sampling and counting contingency tables with arbitrary margins sorry line 214

    Source 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.

    1. This is an exact comparator target linked by the pinned repository's formalization note for this result.
    2. 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

  38. theorem OAI.ContingencyTables.counting Challenge statement: Sampling and counting contingency tables with arbitrary margins sorry line 217

    Source 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.

    1. This is an exact comparator target linked by the pinned repository's formalization note for this result.
    2. 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