Plectis Atlas
Search

↑ and ↓ move, Enter opens, Esc closes.

Lean statement

Exact and bounded-time sampling of contingency tables

Lean is a language for mathematical statements and proofs that a computer can verify. This page shows one statement file from OpenAI’s release, possible paper matches and independent reports. The code-like names below identify the definitions or theorems selected by the proof-verification settings.

Theorems selected for verification: OAI.ContingencyTables.boundedSampling OAI.ContingencyTables.exactSampling OAI.ContingencyTables.counting

Lean statement file: ContingencyTables.leanShow on the mapOpenAI’s Lean catalogue does not list this as a main result; the release’s Lean notes for family 115 link it.

The Lean statement

The lines of the Lean statement that state the theorem, then the definitions in the file that it uses.

def BoundedSamplingStatement : Prop :=  ∃ (A : Machine) (C d : ℕ), 0 < C ∧    ∀ (m n : ℕ) (r : Fin m → ℕ) (c : Fin n → ℕ),      (∑ i, r i) = ∑ j, c j → ∀ k : ℕ, 1 ≤ k →        let input := encodeSamplingInput r c k        let t := C * (samplingSize n r k) ^ d        (∀ bits : Fin t → Bool, ∃ X : Table r c, OutputsTable A input bits X.val) ∧        (∑ X : Table r c,          |tableMass A input t X.val - (Fintype.card (Table r c) : ℝ)⁻¹|) / 2 ≤            ((2 : ℝ) ^ k)⁻¹def ExactSamplingStatement : Prop :=  ∃ (A : Machine) (C d : ℕ), 0 < C ∧    ∀ (m n : ℕ) (r : Fin m → ℕ) (c : Fin n → ℕ),      (∑ i, r i) = ∑ j, c j →        let input := encodeMargins r c        let tail : ℕ → ℝ := fun t => 1 - haltMass A input t        (∀ t (bits : Fin t → Bool), (MatchingFPRAS.run A input bits).state = none →          ∃ X : Table r c, OutputsTable A input bits X.val) ∧        (∀ X : Table r c, Tendsto (fun t => tableMass A input t X.val) atTop          (nhds ((Fintype.card (Table r c) : ℝ)⁻¹))) ∧        Tendsto (haltMass A input) atTop (nhds 1) ∧        Summable tail ∧        tsum tail ≤ C * (samplingSize n r 0) ^ ddef CountingStatement : Prop :=  ∃ (A : Machine) (C d : ℕ), 0 < C ∧    ∀ (m n : ℕ), 0 < m → 0 < n →    ∀ (r : Fin m → ℕ) (c : Fin n → ℕ) (b : Fin m → Fin n → ℕ),      (∑ i, r i) = ∑ j, c j →      ∀ ε δ : ℚ, 0 < ε → ε < 1 → 0 < δ → δ < 1 →        let input := encodeCountingInput r c b ε δ        let t := countingTime C d r c b ε δ        (∀ bits : Fin t → Bool, ∃ q : ℚ, 0 ≤ q ∧ MatchingFPRAS.Outputs A input bits q) ∧        (count r c b = 0 → ∀ bits : Fin t → Bool, MatchingFPRAS.Outputs A input bits 0) ∧        ((goodCountingTapes A r c b ε δ t).card : ℚ) / (2 : ℚ) ^ t ≥ 1 - δtheorem boundedSampling : Algorithms.BoundedSamplingStatement := by sorrytheorem exactSampling : Algorithms.ExactSamplingStatement := by sorrytheorem counting : Algorithms.CountingStatement := by sorry

A Lean statement states the theorem and leaves its proof as sorry on purpose. OpenAI’s proof is in a separate solution module, and a program called Comparator checks that proof against this statement.

Definitions needed to read it

Local definitions the statement names, followed through the definitions they name in turn. The match is by name in the source text, so a name reached only through notation can be missed; the full file is below.

  • abbreviation OAI.MatchingFPRAS.Symbol line 7

    abbrev Symbol := Fin 8
  • definition OAI.MatchingFPRAS.encodeNat line 10

    def encodeNat (n : ℕ) : List Symbol :=  (Nat.bits n).map (fun b => if b then 2 else 1) ++ [3]
  • definition OAI.MatchingFPRAS.encodeInt line 13

    def encodeInt (z : ℤ) : List Symbol :=  (if z < 0 then [5] else [4]) ++ encodeNat z.natAbs
  • definition OAI.MatchingFPRAS.encodeRat line 17

    def encodeRat (q : ℚ) : List Symbol := encodeInt q.num ++ encodeNat q.den
  • structure OAI.MatchingFPRAS.RandomMachine line 20

    structure RandomMachine where  states : ℕ  transition : Fin (states + 1) → Symbol → Bool →    Option (Fin (states + 1) × Turing.TM0.Stmt Symbol)
  • structure OAI.MatchingFPRAS.Configuration line 25

    structure Configuration (A : RandomMachine) where  state : Option (Fin (A.states + 1))  tape : Turing.Tape Symbol
  • definition OAI.MatchingFPRAS.tick line 31

    def tick (A : RandomMachine) (c : Configuration A) (bit : Bool) : Configuration A :=  match c.state with  | none => c  | some s => match A.transition s c.tape.head bit with    | none => ⟨none, c.tape⟩    | some (s', action) =>      ⟨some s', match action with        | .move d => c.tape.move d        | .write a => c.tape.write a⟩
  • definition OAI.MatchingFPRAS.initial line 41

    def initial (A : RandomMachine) (input : List Symbol) : Configuration A :=  ⟨some 0, Turing.Tape.mk₁ input⟩
  • definition OAI.MatchingFPRAS.run line 45

    def run (A : RandomMachine) (input : List Symbol) {t : ℕ}    (bits : Fin t → Bool) : Configuration A :=  (List.ofFn bits).foldl (tick A) (initial A input)
  • definition OAI.MatchingFPRAS.Outputs line 49

    def Outputs (A : RandomMachine) (input : List Symbol) {t : ℕ}    (bits : Fin t → Bool) (q : ℚ) : Prop :=  (run A input bits).state = none ∧    (run A input bits).tape.right₀ = Turing.ListBlank.mk (encodeRat q)
  • definition OAI.ContingencyTables.HasMargins line 61

    def HasMargins (X : I → J → ℕ) (r : I → ℕ) (c : J → ℕ) : Prop :=  (∀ i, ∑ j, X i j = r i) ∧ (∀ j, ∑ i, X i j = c j)
  • definition OAI.ContingencyTables.Table line 64

    def Table (r : I → ℕ) (c : J → ℕ) := {X : I → J → ℕ // HasMargins X r c}
  • definition OAI.ContingencyTables.BoundedTable line 66

    def BoundedTable (r : I → ℕ) (c : J → ℕ) (b : I → J → ℕ) :=  {X : Table r c // ∀ i j, X.val i j ≤ b i j}
  • abbreviation OAI.ContingencyTables.Algorithms.Machine line 103

    abbrev Machine := MatchingFPRAS.RandomMachine
  • definition OAI.ContingencyTables.Algorithms.encodeMatrix line 106

    def encodeMatrix {m n : ℕ} (X : Fin m → Fin n → ℕ) : List Symbol :=  ((List.ofFn fun i => (List.ofFn fun j => MatchingFPRAS.encodeNat (X i j)).flatten)).flatten
  • definition OAI.ContingencyTables.Algorithms.encodeMargins line 109

    def encodeMargins {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ) : List Symbol :=  MatchingFPRAS.encodeNat m ++ MatchingFPRAS.encodeNat n ++    (List.ofFn fun i => MatchingFPRAS.encodeNat (r i)).flatten ++    (List.ofFn fun j => MatchingFPRAS.encodeNat (c j)).flatten
  • definition OAI.ContingencyTables.Algorithms.encodeSamplingInput line 114

    def encodeSamplingInput {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ) (k : ℕ) : List Symbol :=  encodeMargins r c ++ MatchingFPRAS.encodeNat k
  • definition OAI.ContingencyTables.Algorithms.encodeCountingInput line 117

    def encodeCountingInput {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ)    (b : Fin m → Fin n → ℕ) (ε δ : ℚ) : List Symbol :=  encodeMargins r c ++ encodeMatrix b ++ MatchingFPRAS.encodeRat ε ++ MatchingFPRAS.encodeRat δ
  • definition OAI.ContingencyTables.Algorithms.OutputsTable line 125

    def OutputsTable (A : Machine) (input : List Symbol) {t m n : ℕ}    (bits : Fin t → Bool) (X : Fin m → Fin n → ℕ) : Prop :=  (MatchingFPRAS.run A input bits).state = none ∧    @Turing.Tape.right₀ MatchingFPRAS.Symbol (@Fin.instInhabited 8 alphabetSize_neZero)      (MatchingFPRAS.run A input bits).tape =    @Turing.ListBlank.mk Symbol (@Fin.instInhabited 8 alphabetSize_neZero) (encodeMatrix X)
  • definition OAI.ContingencyTables.Algorithms.tableMass line 132

    noncomputable def tableMass (A : Machine) (input : List Symbol) (t : ℕ)    {m n : ℕ} (X : Fin m → Fin n → ℕ) : ℝ := by  classical  exact ((Finset.univ.filter fun bits : Fin t → Bool => OutputsTable A input bits X).card : ℝ) /    (2 : ℝ) ^ t
  • definition OAI.ContingencyTables.Algorithms.haltMass line 138

    noncomputable def haltMass (A : Machine) (input : List Symbol) (t : ℕ) : ℝ := by  classical  exact ((Finset.univ.filter fun bits : Fin t → Bool =>      (MatchingFPRAS.run A input bits).state = none).card : ℝ) / (2 : ℝ) ^ t
  • definition OAI.ContingencyTables.Algorithms.samplingSize line 143

    def samplingSize (n : ℕ) {m : ℕ} (r : Fin m → ℕ) (k : ℕ) : ℕ :=  m + n + Nat.clog 2 ((∑ i, r i) + 1) + k + 1
  • definition OAI.ContingencyTables.Algorithms.count line 176

    noncomputable def count {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ)    (b : Fin m → Fin n → ℕ) : ℕ := Fintype.card (BoundedTable r c b)
  • definition OAI.ContingencyTables.Algorithms.countingTime line 179

    def countingTime (C d : ℕ) {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ)    (b : Fin m → Fin n → ℕ) (ε δ : ℚ) : ℕ :=  C * ((encodeCountingInput r c b ε δ).length + ⌈ε⁻¹⌉₊ +    Nat.clog 2 ⌈δ⁻¹⌉₊ + 1) ^ d

1 more definitions are reached the same way; the full file lists them.

Possible paper match, with no recorded review

Atlas selected this possible match by comparing words in the Lean statement with every statement in the family. No review of whether the statements mean the same thing is recorded.

Words of the Lean statement, its names split into words, that also appear in the theorem: randomized, including, binary, zero, input, length, rational, execution and twelve more. Found in the paper’s title, which its main theorem states: fpras, cell and tables.

Statements in An FPRAS for Cell-Bounded Contingency Tables come first because the release’s name for this Lean statement shares words with that paper’s title.

Theorem 1.1 of An FPRAS for Cell-Bounded Contingency Tables

Theorem

There is one randomized algorithm with the following guarantee. Given (r,c,b) as above and rational \varepsilon,\delta\in(0,1), it outputs a nonnegative rational \widehat Z such that

\P\bigl((1-\varepsilon)Z(r,c,b)\le \widehat Z \le(1+\varepsilon)Z(r,c,b)\bigr)\ge1-\delta.

If \Omega(r,c,b) is empty, the output is zero on every execution. The algorithm uses independent unbiased bits, and one fixed polynomial in L, \varepsilon^{-1}, and \log(\delta^{-1}) bounds its total bit operations on every execution, where L is the total binary input length, including the accuracy parameters. No counting or sampling oracle is required.

Section 1, Introduction Read it in the paper TeX source, line 21
Show the TeX
There is one randomized algorithm with the following guarantee. Given
$(r,c,b)$ as above and rational $\varepsilon,\delta\in(0,1)$, it outputs
a nonnegative rational $\widehat Z$ such that
\[
 \P\bigl((1-\varepsilon)Z(r,c,b)\le \widehat Z
                  \le(1+\varepsilon)Z(r,c,b)\bigr)\ge1-\delta.
\]
If $\Omega(r,c,b)$ is empty, the output is zero on every execution.
The algorithm uses independent unbiased bits, and one fixed polynomial
in $L$, $\varepsilon^{-1}$, and $\log(\delta^{-1})$ bounds its total bit
operations on every execution, where $L$ is the total binary input
length, including the accuracy parameters. No counting or sampling
oracle is required.

Other possible paper matches, closest wording first

  • Corollary 8.1 of An FPRAS for Cell-Bounded Contingency Tables. Words of the Lean statement, its names split into words, that also appear in the theorem: including, binary, zero, input, length, rational and 13 more.
  • Proposition 6.1 of An FPRAS for Cell-Bounded Contingency Tables. Words of the Lean statement, its names split into words, that also appear in the theorem: encoding, cost, randomized, length, rational, count and eight more.
  • Theorem 1.1 of Exact Uniform Sampling of Contingency Tables with Arbitrary Margins. Words of the Lean statement, its names split into words, that also appear in the theorem: dimension, expected, random, time, margin, almost and twelve more. Found in the paper’s title, which its main theorem states: sampling. Shared only with the release’s name for the Lean statement or OpenAI’s note on it: whose.
  • Theorem 5.1 of Exact Uniform Sampling of Contingency Tables with Arbitrary Margins. Words of the Lean statement, its names split into words, that also appear in the theorem: rows, always, single, time, margin, variation and nine more. Shared only with the release’s name for the Lean statement or OpenAI’s note on it: whose.
  • Theorem 6.4 of Exact Uniform Sampling of Contingency Tables with Arbitrary Margins. Words of the Lean statement, its names split into words, that also appear in the theorem: expected, random, time, almost, exactly, sampling and five more.
  • Theorem 6.2 of Exact Uniform Sampling of Contingency Tables with Arbitrary Margins. Words of the Lean statement, its names split into words, that also appear in the theorem: number, almost, operations, feasible, sampling, table and four more.

How Atlas selects possible matches: it compares words in the Lean statement with every statement in the family. It also splits Lean names into words. The release’s label and note receive less weight; a main theorem wins a close match. If the Lean wording yields no clear match, Atlas uses the catalogue description. This selects passages to compare; it does not establish that they mean the same thing.

Reported Comparator runs

two independent groups report that Comparator accepted runs for this Lean statement file: Carlos Toledo’s cert-machine; MathVet. Each group reports its own Comparator run for this statement file. Atlas has not repeated the runs.

For a configured theorem, Comparator tests whether OpenAI’s proof proves the exact Lean statement. Some files instead configure definitions for comparison by name and type. Acceptance does not establish that the statement means the same thing as the paper’s theorem.

Carlos Toledo’s cert-machine

How they ran it, in their words

Every Comparator challenge re-run on Linux with nanoda switched on, decided by a preregistered rule; every family’s challenge statements read against OpenAI’s headline, clause by clause. Decider: Comparator (leanprover/comparator d03acab1 = tag v4.34.0, built with the release’s toolchain v4.34.1), lean4export 076e8e57, landrun 811cfff5, nanoda_lib 3a240721 — on GitHub’s Linux runners (.github/workflows/openai-math-kernel.yml), one j…

  • Accepted Their term: “CERTIFIED”.

    Re-run through Comparator with the independent nanoda kernel switched on: Lean’s kernel and nanoda both accept OpenAI’s solution.

    Reported 10 October 2026, at the release version shown here. Original verification report

MathVet

How they ran it, in their words

An independent, model-assisted, pre-referee reading of each family’s challenge statements against its headline claim under a published rubric (PROTOCOL.md), with its own Comparator runs per challenge. Its protocol describes a planned error-rate study; this import does not establish that the study has been completed.

  • Accepted Their term: “comparator-pass”.

    Re-run through Comparator: accepted.

    Reported 8 October 2026, at the release version shown here. Original verification report

What an accepted Comparator run would establish

If Comparator is run under this configuration and accepts, the solution proves the configured theorem using only the allowed axioms, and the Lean kernel accepts every step.

This configuration lists no definition holes, so every definition the statement uses is compared as it is written in this file.

Allowed axioms: propext, Quot.sound, Classical.choice

Acceptance leaves open whether the Lean statement means the same thing as the paper’s theorem, whether the paper’s other claims are correct, and whether the result is new. Those questions require comparing the definitions and statements, reviewing the paper’s arguments, and reading the earlier literature.

Do family 115’s Lean statements express the advertised result?

These assessments compare all the family’s Lean statements with the whole result OpenAI describes in its catalogue. They do not assess this statement alone. Each group uses its own published rules.

MathVet and cert-machine agree on how much of the advertised result the Lean statements express.

  • MathVet

    Finds the whole advertised result stated or implied Their term: “full”.

    The challenge statements imply the headline claim after unpacking definitions or one routine step. Their record

    Their note: None material; counting statement assumes equal row/column totals (unequal totals, which also admit no table, are not required to output 0).

    Definitions the group asks readers to compare with the paper: Machine model is the hand-rolled RandomMachine (single-tape Post-Turing table over Fin 8, one fair coin per tick) shared with the matching FPRAS file; 'expected polynomial time' is tsum (1 - haltMass t), 'uniform' is tableMass → 1/card (Table r c), 'almost uniform' is total variation (∑ |tableMass - 1/card|)/2; OutputsTable uses an explicit @Fin.instInhabited 8 alphabetSize_neZero instance hack

  • Carlos Toledo’s cert-machine

    Finds the whole advertised result stated or implied Their term: “MATCHES”.

    The challenge statements state the headline as OpenAI wrote it. Their record

Read the complete assessments on the family page.

OpenAI’s own note on what this Lean statement covers

“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.”

An AI agent drafted an interpretation of that note, classifying this statement as “states a paper’s theorem as the paper does”. No human review of the draft is recorded.

Supporting material

The complete Lean statement file

221 lines, copied from release version fd4aeeb. A name defined in this file links to its line; pointing at the name shows its definition.

Declared in this fileOpenAI’s library at fd4aeebOther linked names open the current documentation for Mathlib, Lean’s mathematical library.

Links in the file: 105 to its own declarations, 134 to Mathlib’s documentation. 38 declared names also link to the same declaration in OpenAI’s library. 3 identifiers stay plain because they resolve to no single declaration: variables Lean binds automatically, notation, or names the scan of the pinned sources did not find. 3 of them could name more than one declaration. OpenAI uses Mathlib version d13f23b. The linked documentation describes the current version, so names that have since changed may be missing there.

import Mathlibnamespace OAInamespace MatchingFPRASabbrev Symbol := Fin 8/-- Binary numeral followed by a delimiter. Tape blank is 0; bits use 1 and 2. -/def encodeNat (n : ℕ) : List Symbol :=  (Nat.bits n).map (fun b => if b then 2 else 1) ++ [3]def encodeInt (z : ℤ) : List Symbol :=  (if z < 0 then [5] else [4]) ++ encodeNat z.natAbs/-- A rational encoded by its reduced numerator and positive denominator. -/def encodeRat (q : ℚ) : List Symbol := encodeInt q.num ++ encodeNat q.den/-- A uniform randomized Post-Turing machine: a single finite transition table. -/structure RandomMachine where  states : ℕ  transition : Fin (states + 1) → Symbol → Bool →    Option (Fin (states + 1) × Turing.TM0.Stmt Symbol)structure Configuration (A : RandomMachine) where  state : Option (Fin (A.states + 1))  tape : Turing.Tape Symbol/-- A halted configuration is absorbing. Each nonhalting tick is exactly onewrite or one move, or the detection of halt. -/def tick (A : RandomMachine) (c : Configuration A) (bit : Bool) : Configuration A :=  match c.state with  | none => c  | some s => match A.transition s c.tape.head bit with    | none => ⟨none, c.tape⟩    | some (s', action) =>      ⟨some s', match action with        | .move d => c.tape.move d        | .write a => c.tape.write a⟩def initial (A : RandomMachine) (input : List Symbol) : Configuration A :=  ⟨some 0, Turing.Tape.mk₁ input⟩/-- Bounded execution on a finite prefix of the random tape. -/def run (A : RandomMachine) (input : List Symbol) {t : ℕ}    (bits : Fin t → Bool) : Configuration A :=  (List.ofFn bits).foldl (tick A) (initial A input)def Outputs (A : RandomMachine) (input : List Symbol) {t : ℕ}    (bits : Fin t → Bool) (q : ℚ) : Prop :=  (run A input bits).state = none ∧    (run A input bits).tape.right₀ = Turing.ListBlank.mk (encodeRat q)end MatchingFPRASnamespace ContingencyTablesopen Finsetvariable {I J : Type*} [Fintype I] [Fintype J]def HasMargins (X : I → J → ℕ) (r : I → ℕ) (c : J → ℕ) : Prop :=  (∀ i, ∑ j, X i j = r i) ∧ (∀ j, ∑ i, X i j = c j)def Table (r : I → ℕ) (c : J → ℕ) := {X : I → J → ℕ // HasMargins X r c}def BoundedTable (r : I → ℕ) (c : J → ℕ) (b : I → J → ℕ) :=  {X : Table r c // ∀ i j, X.val i j ≤ b i j}theorem entry_le_row {X : I → J → ℕ} {r : I → ℕ} {c : J → ℕ}    (h : HasMargins X r c) (i : I) (j : J) : X i j ≤ r i := by  rw [← h.1 i]  exact single_le_sum (fun _ _ => Nat.zero_le _) (mem_univ j)theorem entry_le_total {X : I → J → ℕ} {r : I → ℕ} {c : J → ℕ}    (h : HasMargins X r c) (i : I) (j : J) : X i j ≤ ∑ i, r i :=  (entry_le_row h i j).trans (single_le_sum (fun _ _ => Nat.zero_le _) (mem_univ i))instance table_finite (r : I → ℕ) (c : J → ℕ) : Finite (Table r c) := by  let encode : Table r c → I → J → Fin ((∑ i, r i) + 1) :=    fun X i j => ⟨X.val i j, Nat.lt_succ_of_le (entry_le_total X.property i j)⟩  apply Finite.of_injective encode  intro X Y h  apply Subtype.ext  funext i j  exact congrArg Fin.val (congrFun (congrFun h i) j)noncomputable instance table_fintype (r : I → ℕ) (c : J → ℕ) : Fintype (Table r c) :=  Fintype.ofFinite _noncomputable instance boundedTable_fintype (r : I → ℕ) (c : J → ℕ) (b : I → J → ℕ) :    Fintype (BoundedTable r c b) := by  classical  unfold BoundedTable  infer_instanceend ContingencyTablesnamespace ContingencyTables.Algorithmsopen scoped BigOperatorsopen Filterabbrev Machine := MatchingFPRAS.RandomMachineabbrev Symbol := MatchingFPRAS.Symboldef encodeMatrix {m n : ℕ} (X : Fin m → Fin n → ℕ) : List Symbol :=  ((List.ofFn fun i => (List.ofFn fun j => MatchingFPRAS.encodeNat (X i j)).flatten)).flattendef encodeMargins {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ) : List Symbol :=  MatchingFPRAS.encodeNat m ++ MatchingFPRAS.encodeNat n ++    (List.ofFn fun i => MatchingFPRAS.encodeNat (r i)).flatten ++    (List.ofFn fun j => MatchingFPRAS.encodeNat (c j)).flattendef encodeSamplingInput {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ) (k : ℕ) : List Symbol :=  encodeMargins r c ++ MatchingFPRAS.encodeNat kdef encodeCountingInput {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ)    (b : Fin m → Fin n → ℕ) (ε δ : ℚ) : List Symbol :=  encodeMargins r c ++ encodeMatrix b ++ MatchingFPRAS.encodeRat ε ++ MatchingFPRAS.encodeRat δ/-- The tape alphabet has positive cardinality. -/theorem alphabetSize_neZero : NeZero (8 : ℕ) := inferInstance/-- A halted tape contains the row-major binary matrix encoding. -/def OutputsTable (A : Machine) (input : List Symbol) {t m n : ℕ}    (bits : Fin t → Bool) (X : Fin m → Fin n → ℕ) : Prop :=  (MatchingFPRAS.run A input bits).state = none ∧    @Turing.Tape.right₀ MatchingFPRAS.Symbol (@Fin.instInhabited 8 alphabetSize_neZero)      (MatchingFPRAS.run A input bits).tape =    @Turing.ListBlank.mk Symbol (@Fin.instInhabited 8 alphabetSize_neZero) (encodeMatrix X)noncomputable def tableMass (A : Machine) (input : List Symbol) (t : ℕ)    {m n : ℕ} (X : Fin m → Fin n → ℕ) : ℝ := by  classical  exact ((Finset.univ.filter fun bits : Fin t → Bool => OutputsTable A input bits X).card : ℝ) /    (2 : ℝ) ^ tnoncomputable def haltMass (A : Machine) (input : List Symbol) (t : ℕ) : ℝ := by  classical  exact ((Finset.univ.filter fun bits : Fin t → Bool =>      (MatchingFPRAS.run A input bits).state = none).card : ℝ) / (2 : ℝ) ^ tdef samplingSize (n : ℕ) {m : ℕ} (r : Fin m → ℕ) (k : ℕ) : ℕ :=  m + n + Nat.clog 2 ((∑ i, r i) + 1) + k + 1/-- Paper 200-01, Theorem main(i): bounded runtime on every random tapeand total variation at most `2⁻ᵏ`, with freely varying dimensions. -/def BoundedSamplingStatement : Prop :=  ∃ (A : Machine) (C d : ℕ), 0 < C ∧    ∀ (m n : ℕ) (r : Fin m → ℕ) (c : Fin n → ℕ),      (∑ i, r i) = ∑ j, c j → ∀ k : ℕ, 1 ≤ k →        let input := encodeSamplingInput r c k        let t := C * (samplingSize n r k) ^ d        (∀ bits : Fin t → Bool, ∃ X : Table r c, OutputsTable A input bits X.val) ∧        (∑ X : Table r c,          |tableMass A input t X.val - (Fintype.card (Table r c) : ℝ)⁻¹|) / 2 ≤            ((2 : ℝ) ^ k)⁻¹/-- Paper 200-01, Theorem main(ii): every halted output is feasible, eachtable has limiting mass `1/|Ω|`, termination has probability one, and theexpected number of bit operations is bounded by a uniform polynomial. -/def ExactSamplingStatement : Prop :=  ∃ (A : Machine) (C d : ℕ), 0 < C ∧    ∀ (m n : ℕ) (r : Fin m → ℕ) (c : Fin n → ℕ),      (∑ i, r i) = ∑ j, c j →        let input := encodeMargins r c        let tail : ℕ → ℝ := fun t => 1 - haltMass A input t        (∀ t (bits : Fin t → Bool), (MatchingFPRAS.run A input bits).state = none →          ∃ X : Table r c, OutputsTable A input bits X.val) ∧        (∀ X : Table r c, Tendsto (fun t => tableMass A input t X.val) atTop          (nhds ((Fintype.card (Table r c) : ℝ)⁻¹))) ∧        Tendsto (haltMass A input) atTop (nhds 1) ∧        Summable tail ∧        tsum tail ≤ C * (samplingSize n r 0) ^ dnoncomputable def count {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ)    (b : Fin m → Fin n → ℕ) : ℕ := Fintype.card (BoundedTable r c b)def countingTime (C d : ℕ) {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ)    (b : Fin m → Fin n → ℕ) (ε δ : ℚ) : ℕ :=  C * ((encodeCountingInput r c b ε δ).length + ⌈ε⁻¹⌉₊ +    Nat.clog 2 ⌈δ⁻¹⌉₊ + 1) ^ dnoncomputable def goodCountingTapes (A : Machine) {m n : ℕ}    (r : Fin m → ℕ) (c : Fin n → ℕ) (b : Fin m → Fin n → ℕ)    (ε δ : ℚ) (t : ℕ) : Finset (Fin t → Bool) := by  classical  exact Finset.univ.filter fun bits => ∃ q : ℚ,    MatchingFPRAS.Outputs A (encodeCountingInput r c b ε δ) bits q ∧      (1 - ε) * count r c b ≤ q ∧ q ≤ (1 + ε) * count r c b/-- Paper 200-02, Theorem main. The input length includes the rationalaccuracy parameters, and infeasible inputs always produce exactly zero. -/def CountingStatement : Prop :=  ∃ (A : Machine) (C d : ℕ), 0 < C ∧    ∀ (m n : ℕ), 0 < m → 0 < n →    ∀ (r : Fin m → ℕ) (c : Fin n → ℕ) (b : Fin m → Fin n → ℕ),      (∑ i, r i) = ∑ j, c j →      ∀ ε δ : ℚ, 0 < ε → ε < 1 → 0 < δ → δ < 1 →        let input := encodeCountingInput r c b ε δ        let t := countingTime C d r c b ε δ        (∀ bits : Fin t → Bool, ∃ q : ℚ, 0 ≤ q ∧ MatchingFPRAS.Outputs A input bits q) ∧        (count r c b = 0 → ∀ bits : Fin t → Bool, MatchingFPRAS.Outputs A input bits 0) ∧        ((goodCountingTapes A r c b ε δ t).card : ℚ) / (2 : ℚ) ^ t ≥ 1 - δend ContingencyTables.Algorithmsnamespace ContingencyTables/-- An almost-uniform sampler with polynomial cost on every execution. -/theorem boundedSampling : Algorithms.BoundedSamplingStatement := by sorry/-- Exact uniform sampling in polynomial expected bit time. -/theorem exactSampling : Algorithms.ExactSamplingStatement := by sorry/-- A cell-bounded FPRAS, with zero output on every infeasible execution. -/theorem counting : Algorithms.CountingStatement := by sorryend ContingencyTablesend OAI
Every extracted statement of the accompanying papers

The statements the atlas extracted automatically from each accompanying paper’s TeX source, with links to the full sources.

Exact Uniform Sampling of Contingency Tables with Arbitrary Margins

Theorem

For arbitrary nonnegative integer margins of equal total, the following algorithms exist in the model of unbiased random bits and bit operations.

  1. (i)

    Given an integer k\ge1, a bounded-time algorithm outputs a table in \Omega(r,c) whose law is within 2^{-k} in total variation of the uniform law. Its running time is polynomial in m,n,\log(N+1),k.

  2. (ii)

    An algorithm outputs an exactly uniform table in \Omega(r,c), terminates almost surely, and has expected running time polynomial in m,n,\log(N+1).

The polynomials are uniform over all margin vectors. No positivity, sparsity, balance, or fixed-dimension hypothesis is imposed.

Section 1, Introduction Read it in the paper TeX source, line 18
Show the TeX
For arbitrary nonnegative integer margins of equal total, the following
algorithms exist in the model of unbiased random bits and bit operations.
\begin{enumerate}[label=\textup{(\roman*)}]
 \item Given an integer $k\ge1$, a bounded-time algorithm outputs a table
 in $\Omega(r,c)$ whose law is within $2^{-k}$ in total variation of the
 uniform law. Its running time is polynomial in
 $m,n,\log(N+1),k$.
 \item An algorithm outputs an exactly uniform table in $\Omega(r,c)$,
 terminates almost surely, and has expected running time polynomial in
 $m,n,\log(N+1)$.
\end{enumerate}
The polynomials are uniform over all margin vectors. No positivity,
sparsity, balance, or fixed-dimension hypothesis is imposed.

An FPRAS for Cell-Bounded Contingency Tables

Theorem

There is one randomized algorithm with the following guarantee. Given (r,c,b) as above and rational \varepsilon,\delta\in(0,1), it outputs a nonnegative rational \widehat Z such that

\P\bigl((1-\varepsilon)Z(r,c,b)\le \widehat Z \le(1+\varepsilon)Z(r,c,b)\bigr)\ge1-\delta.

If \Omega(r,c,b) is empty, the output is zero on every execution. The algorithm uses independent unbiased bits, and one fixed polynomial in L, \varepsilon^{-1}, and \log(\delta^{-1}) bounds its total bit operations on every execution, where L is the total binary input length, including the accuracy parameters. No counting or sampling oracle is required.

Section 1, Introduction Read it in the paper TeX source, line 21
Show the TeX
There is one randomized algorithm with the following guarantee. Given
$(r,c,b)$ as above and rational $\varepsilon,\delta\in(0,1)$, it outputs
a nonnegative rational $\widehat Z$ such that
\[
 \P\bigl((1-\varepsilon)Z(r,c,b)\le \widehat Z
                  \le(1+\varepsilon)Z(r,c,b)\bigr)\ge1-\delta.
\]
If $\Omega(r,c,b)$ is empty, the output is zero on every execution.
The algorithm uses independent unbiased bits, and one fixed polynomial
in $L$, $\varepsilon^{-1}$, and $\log(\delta^{-1})$ bounds its total bit
operations on every execution, where $L$ is the total binary input
length, including the accuracy parameters. No counting or sampling
oracle is required.
Configuration and file facts
OpenAI’s Lean catalogue
OpenAI’s Lean catalogue does not list this as a main result; the release’s Lean notes for family 115 link it.
Solution module
OAI.Combinatorics.ContingencyTables.UnconditionalMain
Allowed axioms
propext, Quot.sound, Classical.choiceThe axioms this configuration allows a proof to use. A replay shows which of them a proof uses.
Imports
Mathlib
Imports from outside Mathlib
None
Local vocabulary
32 local vocabulary declarations
Lines of Lean, without comments or blank lines
139
Second proof-verification program (nanoda)
Off in OpenAI's configuration.

Statement comparison

A shareable summary of this page: the proposed paper match, what the Lean statement expresses, and which reviews are recorded.

Plectis Atlas

Exact and bounded-time sampling of contingency tables

Family 115: Sampling and counting contingency tables with arbitrary margins

Candidate pairing

Theorem

There is one randomized algorithm with the following guarantee. Given (r,c,b) as above and rational \varepsilon,\delta\in(0,1), it outputs a nonnegative rational \widehat Z such that

\P\bigl((1-\varepsilon)Z(r,c,b)\le \widehat Z \le(1+\varepsilon)Z(r,c,b)\bigr)\ge1-\delta.

If \Omega(r,c,b) is empty, the output is zero on every execution. The algorithm uses independent unbiased bits, and one fixed polynomial in L, \varepsilon^{-1}, and \log(\delta^{-1}) bounds its total bit operations on every execution, where L is the total binary input length, including the accuracy parameters. No counting or sampling oracle is required.

An FPRAS for Cell-Bounded Contingency Tables

TeX label thm:main, build/sections/introduction.tex, line 21

The Lean statement says

def BoundedSamplingStatement : Prop :=  ∃ (A : Machine) (C d : ℕ), 0 < C ∧    ∀ (m n : ℕ) (r : Fin m → ℕ) (c : Fin n → ℕ),      (∑ i, r i) = ∑ j, c j → ∀ k : ℕ, 1 ≤ k →        let input := encodeSamplingInput r c k        let t := C * (samplingSize n r k) ^ d        (∀ bits : Fin t → Bool, ∃ X : Table r c, OutputsTable A input bits X.val) ∧        (∑ X : Table r c,          |tableMass A input t X.val - (Fintype.card (Table r c) : ℝ)⁻¹|) / 2 ≤            ((2 : ℝ) ^ k)⁻¹def ExactSamplingStatement : Prop :=  ∃ (A : Machine) (C d : ℕ), 0 < C ∧    ∀ (m n : ℕ) (r : Fin m → ℕ) (c : Fin n → ℕ),      (∑ i, r i) = ∑ j, c j →        let input := encodeMargins r c        let tail : ℕ → ℝ := fun t => 1 - haltMass A input t        (∀ t (bits : Fin t → Bool), (MatchingFPRAS.run A input bits).state = none →          ∃ X : Table r c, OutputsTable A input bits X.val) ∧

A Lean statement states the theorem and leaves its proof as sorry on purpose. OpenAI’s proof is in a separate solution module, and a program called Comparator checks that proof against this statement.

Atlas selected this possible match because the two statements share words. No review of whether they mean the same thing is recorded.two independent groups report that Comparator accepted runs for this file at the release version shown here.Statement review: none recorded

32 local vocabulary declarationsAllowed axioms: propext, Quot.sound, Classical.choiceopenai/math at fd4aeebwcook04.github.io/plectis-atlas/statements/ContingencyTables.html

Recorded comparisons with the paper

Atlas records no contributed comparison of this statement with the paper.

Contributed Comparator run reports

Atlas records no contributed report of running Comparator for this statement file.

Compare this statement with the paperShare a Comparator run reportSuggest a change