AFTD Auto-Formalizing Theoretical Domains

BoolFourier.card_hypercube

theoremverifiedimported Lean

Cardinality of the Boolean hypercube. For every natural number $n$, the Boolean hypercube $\{0,1\}^n$ has exactly $2^n$ elements.

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
open Finset BooleanAnalysis in
lemma BoolFourier.card_hypercube (n : ℕ) : Fintype.card (hypercube n) = 2 ^ n
Source
TCSlib, `BoolFourier.card_hypercube`
Lean proof
By Prastik Mohanraj, from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Copyright (c) 2026 Prastik Mohanraj. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • BoolFourier.hypercubeThe Boolean hypercube of dimension $n$ is the type $\{0,1\}^n$, defined as an abbreviation for BooleanAnalysis.BoolCube $n$.
  • BooleanAnalysis.BoolCubeThe Boolean hypercube of dimension $n$ is $\{0,1\}^n$, represented as the function type $\mathrm{Fin}\,n \to \mathrm{Bool}$.
Used by 2

Lean source view module on GitHub

set_option relaxedAutoImplicit false inset_option autoImplicit false inopen Finset BooleanAnalysis in/-- Computes the cardinality of the `n`-dimensional Boolean cube. **Source:** [OD14, §1.3]. -/lemma BoolFourier.card_hypercube (n : ℕ) : Fintype.card (hypercube n) = 2 ^ n := by  simp [hypercube, BoolCube, Fintype.card_pi]
See it in the graphDiscuss this resultChallenge it