Introduction

Arithmetic is the study of the natural numbers. Most of us learn it as a domain of absolute truths — "you can always add one more" and "every number has a unique factorization." But what if you are only allowed to count up to a polynomial? What theorems survive?

Bounded arithmetic is a family of weak logical theories that answer exactly this question. Instead of allowing full mathematical induction over all formulas, each theory restricts induction to a tightly bounded class of predicates — predicates that correspond to checking membership in a specific complexity class.

The result is a beautiful mirror: the classic complexity ladder (P, NP, the polynomial hierarchy) reappears inside logic as a ladder of theories, each able to prove slightly more than the one below. The foundational hierarchy was introduced by Samuel Buss in 1986, and the study of these theories — called proof complexity — is now central to understanding P vs NP.

Try It: Counting Power Explorer

Each theory in the bounded arithmetic hierarchy can prove statements about numbers, but only using predicates from a matching complexity class. Pick a statement below and see which level of the hierarchy is strong enough to prove it — and which levels fall short.

<p class="hint">Each theory in the bounded arithmetic hierarchy can only prove statements about predicates up to a certain complexity level. Select a statement and explore which theory is strong enough to handle it — and which ones fall short.</p>
<div class="controls">
  <label for="stmt-select">Choose a statement:</label>
  <select id="stmt-select"></select>
</div>
<div class="hierarchy" id="hierarchy"></div>
<div class="detail-box" id="detail-box">
  <div class="detail-title" id="detail-title"></div>
  <div class="detail-body" id="detail-body"></div>
</div>
<div class="btns">
  <button id="btn-check" type="button">Check which theories prove it</button>
  <button id="btn-reset" type="button" class="ghost">Reset</button>
</div>
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; color: #222; margin: 0; font-size: 14px; }
.hint { font-size: .88rem; color: #444; margin: 0 0 .7rem; line-height: 1.45; }
.controls { margin-bottom: .8rem; }
label { font-weight: 600; margin-right: .5rem; }
select { font: 14px system-ui, sans-serif; padding: .35rem .5rem; border: 1px solid #aaa;
         border-radius: 6px; background: #f8f9fa; cursor: pointer; max-width: 100%; }
.hierarchy { display: flex; gap: 6px; flex-wrap: wrap; margin: .6rem 0 .8rem; align-items: center; }
.theory { padding: .35rem .7rem; border-radius: 8px; border: 2px solid #cdd9e3;
          background: #e8eef3; font-weight: 700; font-size: .85rem; cursor: pointer;
          transition: all .18s; user-select: none; min-width: 52px; text-align: center; }
.theory:hover { border-color: #1d3557; }
.theory.can-prove { background: #0a7d33; border-color: #087d2f; color: #fff; }
.theory.cannot-prove { background: #e63946; border-color: #c92f3c; color: #fff; }
.theory.unknown { background: #f4a261; border-color: #e07b35; color: #fff; }
.arrow { color: #aaa; font-size: 1.1rem; line-height: 1; }
.detail-box { background: #f0f4f7; border: 1px solid #cdd9e3; border-radius: 8px;
              padding: .6rem .8rem; min-height: 54px; margin-bottom: .7rem; }
.detail-title { font-weight: 700; margin-bottom: .25rem; color: #1d3557; font-size: .9rem; }
.detail-body { font-size: .85rem; line-height: 1.45; color: #333; }
.legend { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .5rem; }
.leg { display: flex; align-items: center; gap: .35rem; font-size: .78rem; }
.leg-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.btns { display: flex; gap: .5rem; flex-wrap: wrap; }
button { font: 600 13px system-ui, sans-serif; padding: .45rem .9rem; border: 1px solid #1d3557;
         background: #1d3557; color: #fff; border-radius: 8px; cursor: pointer; }
button.ghost { background: #fff; color: #1d3557; }
const fmt = (s, v) => s.replace(/%(\w+)%/g, (_, k) => String(v[k] ?? ''));
// Bounded Arithmetic Hierarchy Demo
// The Buss hierarchy: S2^1 ⊆ T2^1 ⊆ S2^2 ⊆ T2^2 ⊆ ...
// Each theory corresponds to a complexity class:
//   S2^1  ↔  P   (polynomial-time predicates, Σ1^b induction)
//   T2^1  ↔  NP ∩ co-NP  (NP predicates, Π1^b induction)
//   S2^2  ↔  Σ2^p  (NP^NP predicates)
//   T2^2  ↔  Π2^p
//   PV    ↔  P  (Cook’s equational theory, same power as S2^1)

const THEORIES = [
  { id: 'PV',   label: 'PV',    level: 0, cls: 'P',         desc: `Cook’s equational theory PV — captures exactly polynomial-time (P) functions. Every provably total function is in P.` },
  { id: 'S21',  label: 'S₂¹',   level: 0, cls: 'P',         desc: `Base theory S₂¹ (Buss 1986) — induction over Σ₁ᵇ formulas. Every provably total function lies in polynomial time (P).` },
  { id: 'T21',  label: 'T₂¹',   level: 1, cls: 'NP∩co-NP', desc: `Theory T₂¹ — adds Π₁ᵇ induction. Captures NP ∩ co-NP: problems whose YES and NO answers are both polynomially checkable.` },
  { id: 'S22',  label: 'S₂²',   level: 2, cls: 'Σ₂ᵖ',       desc: `Theory S₂² — Σ₂ᵇ induction. Mirrors Σ₂ᵖ = NP^NP, problems solvable in NP with an NP oracle.` },
  { id: 'T22',  label: 'T₂²',   level: 3, cls: 'Π₂ᵖ',       desc: `Theory T₂² — Π₂ᵇ induction. Mirrors Π₂ᵖ = co-NP^NP.` },
  { id: 'S2',   label: 'S₂',    level: 4, cls: 'PH',        desc: `Full theory S₂ = ∪ Sᵢ² — union of all finite levels. Captures the entire polynomial hierarchy (PH).` },
];

// Statements with their minimum theory level needed, and whether the separation is known
const STATEMENTS = [
  {
    id: 'sort',
    label: `Every finite list has a sorted permutation`,
    minLevel: 0,
    known: true,
    explanation: `Sorting is in P (e.g., merge sort runs in O(n log n)). The existence of a sorted permutation is provable in PV and S₂¹ using Σ₁ᵇ induction — a polynomial-time witness can be constructed explicitly.`
  },
  {
    id: 'pigeonhole',
    label: `Pigeonhole: n+1 pigeons in n holes ⟹ some hole has ≥ 2`,
    minLevel: 1,
    known: true,
    explanation: `The pigeonhole principle (PHP) is a classic benchmark. It is NOT provable in PV or S₂¹ — Paris & Wilkie (1985) showed PHP requires Π₁ᵇ induction. It IS provable in T₂¹ and above. The separation S₂¹ < T₂¹ on PHP is one of the few known results.`
  },
  {
    id: 'sat-np',
    label: `SAT is in NP (a satisfying assignment is polynomially verifiable)`,
    minLevel: 1,
    known: true,
    explanation: `The statement that a satisfying assignment can be verified in polynomial time is captured by NP ∩ co-NP reasoning. T₂¹ can formalize this because it has Π₁ᵇ induction, which lets it reason about both NP witnesses and co-NP co-witnesses.`
  },
  {
    id: 'sigma2',
    label: `Every Σ₂ᵖ problem reduces to Σ₂-SAT`,
    minLevel: 2,
    known: true,
    explanation: `Reasoning about reductions at the second level of the polynomial hierarchy requires Σ₂ᵇ induction — the strength of S₂². Lower theories lack the quantifier alternation needed to express these reductions internally.`
  },
  {
    id: 'p-neq-np',
    label: 'P ≠ NP',
    minLevel: 5,
    known: false,
    explanation: `Nobody knows which theory (if any finite level) proves P ≠ NP. In fact, proving P ≠ NP likely requires a fundamentally new technique. It may not be provable even in S₂ without non-relativizing methods, making it independent of the current bounded arithmetic framework.`
  },
  {
    id: 's21-neq-t21',
    label: `S₂¹ ≠ T₂¹ (the base separation)`,
    minLevel: 5,
    known: false,
    explanation: `The conjecture that S₂¹ is strictly weaker than T₂¹ is widely believed but unproven. Proving it would imply P ≠ NP. We know PHP separates them as a statement (PHP unprovable in S₂¹), but the full structural separation — that the two theories prove different sentences — remains open.`
  },
];

const MAX_LEVEL = 4; // 0..4 correspond to THEORIES indices

function buildUI() {
  const sel = document.getElementById('stmt-select');
  STATEMENTS.forEach((s, i) => {
    const opt = document.createElement('option');
    opt.value = i;
    opt.textContent = s.label;
    sel.appendChild(opt);
  });

  const hier = document.getElementById('hierarchy');
  THEORIES.forEach((t, i) => {
    if (i > 0) {
      const arr = document.createElement('span');
      arr.className = 'arrow';
      arr.textContent = '⊆';
      hier.appendChild(arr);
    }
    const div = document.createElement('div');
    div.className = 'theory';
    div.id = 'theory-' + t.id;
    div.textContent = t.label;
    div.title = t.cls;
    div.addEventListener('click', () => showTheoryDetail(t));
    hier.appendChild(div);
  });

  // Legend
  const leg = document.createElement('div');
  leg.className = 'legend';
  leg.innerHTML = "\n    " + `<div class="leg"><div class="leg-dot" style="background:#0a7d33"></div> Proves it</div>
    <div class="leg"><div class="leg-dot" style="background:#e63946"></div> Cannot prove it</div>
    <div class="leg"><div class="leg-dot" style="background:#f4a261"></div> Unknown / open</div>
    <div class="leg"><div class="leg-dot" style="background:#e8eef3;border:1px solid #cdd9e3"></div> Not checked yet</div>` + "\n  ";
  document.getElementById('hierarchy').parentNode.insertBefore(leg, document.getElementById('detail-box'));
}

function showTheoryDetail(t) {
  document.getElementById('detail-title').textContent = fmt(`%label% — complexity class: %cls%`, { label: t.label, cls: t.cls });
  document.getElementById('detail-body').textContent = t.desc;
}

function checkStatement() {
  const idx = parseInt(document.getElementById('stmt-select').value);
  const stmt = STATEMENTS[idx];

  THEORIES.forEach((t, i) => {
    const el = document.getElementById('theory-' + t.id);
    el.classList.remove('can-prove', 'cannot-prove', 'unknown');
    if (!stmt.known) {
      el.classList.add('unknown');
    } else if (t.level >= stmt.minLevel) {
      el.classList.add('can-prove');
    } else {
      el.classList.add('cannot-prove');
    }
  });

  document.getElementById('detail-title').textContent = '"' + stmt.label + '"';
  document.getElementById('detail-body').textContent = stmt.explanation;

  // Console output for verification
  console.log(`Statement:`, stmt.label);
  console.log(`Known result:`, stmt.known);
  if (stmt.known) {
    console.log(`Minimum level needed:`, stmt.minLevel,
      '| First theory to prove it:', THEORIES.find(t => t.level >= stmt.minLevel)?.label);
  } else {
    console.log(`Status: OPEN — separation not yet proved`);
  }
}

function reset() {
  THEORIES.forEach(t => {
    const el = document.getElementById('theory-' + t.id);
    el.classList.remove('can-prove', 'cannot-prove', 'unknown');
  });
  document.getElementById('detail-title').textContent = '';
  document.getElementById('detail-body').textContent = `Click "Check which theories prove it" to see results.`;
}

document.getElementById('btn-check').addEventListener('click', checkStatement);
document.getElementById('btn-reset').addEventListener('click', reset);

buildUI();
document.getElementById('detail-body').textContent = `Select a statement above and click the button to explore the hierarchy.`;
Result
Console

Notice the pattern: polynomial-time predicates live in S21S_2^1 (the base theory corresponding to P), NP predicates live in T21T_2^1 (matching NP ∩\cap co-NP), and higher levels shadow Σ2p,Π2p\Sigma_2^p, \Pi_2^p and so on. Just as in P vs NP, we strongly believe these theories form a strict hierarchy, but no one has proved the separations.

The Real Complexity

How hard is it to understand bounded arithmetic? In a very precise sense, as hard as the biggest open problem in computer science.

  • The Buss hierarchy (1986). Samuel Buss defined a sequence of theories S21⊆T21⊆S22⊆T22⊆⋯S_2^1 \subseteq T_2^1 \subseteq S_2^2 \subseteq T_2^2 \subseteq \cdots where each S2iS_2^i (resp. T2iT_2^i) allows induction over Σib\Sigma_i^b (resp. Πib\Pi_i^b) predicates — exactly the bounded formulas that capture the ii-th level of the polynomial hierarchy Σip\Sigma_i^p.
  • Status: open. We do not know whether these theories are genuinely distinct. It is widely believed they form a strict hierarchy, but no separation proof exists. Proving S21⊊T21S_2^1 \subsetneq T_2^1 would already be a landmark result — it would imply P ≠\neq NP or at minimum a major structural insight about the polynomial hierarchy.
  • The Witnessing Theorem. Buss proved that every function provably total in S21S_2^1 is computable in polynomial time (P), and every function provably total in T21T_2^1 is in FNP (polynomial-time verifiable). This is the formal bridge: the theorems of a bounded theory perfectly capture the computations of the matching complexity class.
  • Cook–Nguyen (2010). A later landmark — the book Logical Foundations of Proof Complexity by Stephen Cook and Phuong Nguyen — extended the framework with a single base theory V⁰ for AC⁰ and a whole two-sorted hierarchy matching each level of NC and the log-space classes, making the mirror between logic and complexity almost perfectly clean.

This is an open problem — the separations are as conjectured, not proven. But the framework is already enormously useful: it gives a formal language for asking what kind of reasoning is truly needed to prove a given computational fact.

Where It Matters

"What can be proved with only polynomial-time reasoning?" turns out to be one of the most practically loaded questions in logic:

  • Proof complexity: every propositional proof system (Resolution, Frege, Extended Frege…) corresponds to a fragment of bounded arithmetic. Understanding proof length is equivalent to asking which bounded theory proves the relevant tautology. This is the main lens for attacking P vs NP from the logical side.
  • Cryptographic hardness: one-way functions, pseudorandom generators and public-key cryptography rest on the assumption that certain problems have no polynomial-time solutions. Bounded arithmetic gives a logical home for these assumptions — if S21=T21S_2^1 = T_2^1 (theories collapse), the cryptographic world would crumble.
  • Automated reasoning: SAT solvers and automated theorem provers implicitly work inside fragments of bounded arithmetic. Understanding the limits of these fragments explains why some tautologies are hard to find short proofs for — and guides the design of better proof strategies.
  • Feasible mathematics: the field asks which classical theorems of number theory, combinatorics and analysis can be proved without non-constructive existence arguments. Bounded arithmetic is its formal framework — a theorem provable in S21S_2^1 is one whose proof can be turned into a polynomial-time algorithm.

The hierarchy also illuminates integer programming and SAT: the reason short proofs of NP-hardness reductions are so elusive is precisely that they require induction axioms beyond the base theory.

Conclusion

Bounded arithmetic is the place where mathematical logic and computational complexity shake hands. By restricting induction to bounded predicates, Buss's 1986 hierarchy created a formal mirror of the polynomial-time universe — a ladder of theories, each provably total function in S2iS_2^i landing exactly in the matching complexity class.

The hierarchy is conjectured to be strict, but every attempted separation runs into the same wall as P vs NP. That is not a coincidence: the two questions are deeply intertwined, and progress on one would almost certainly illuminate the other.

So the next time you wonder whether a mathematical proof is truly efficient, ask which bounded theory it lives in. The answer tells you not just how hard the computation is, but how much logical power the reasoning actually consumed.

Share this article

Pick a channel — or use your device's native share sheet.

Comments

Loading comments...

https://www.kipuhub.com/en/article/bounded-arithmetic/Content licensed under CC BY-NC 4.0.