AFTD Auto-Formalizing Theoretical Domains

strictMajority

def

The strict Majority function on n Boolean inputs, returning true if strictly more than n/2 inputs are true, and false otherwise.

Statement

def strictMajority (n : ℕ) (x : Fin n → Bool) : Bool
Defined in
arXiv:2610.19174 Section 4.2
Verified
23 Oct 2026
Axioms
none listed
Used by 2
  • strictMajority_all_zerosFor any natural number n, evaluating the strict Majority function on the all-zeros input yields false.
  • strictMajority_all_onesFor any integer n > 0, evaluating the strict Majority function on the all-ones input yields true.

Read back from the Lean

Given a natural number n and a sequence of booleans x : Fin n → Bool, strictMajority n x is the boolean value indicating whether the number of indices i : Fin n for which x i = true is strictly greater than n / 2 (specifically, whether n < 2 * card {i : Fin n | x i = true}).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The strict Majority function on n Boolean inputs, outputting true iff strictly more than n/2 inputs are true. -/
def strictMajority (n : ℕ) (x : Fin n → Bool) : Bool := decide (n < 2 * (Finset.univ.filter (fun i => x i = true)).card)
See it in the graphDiscuss this resultChallenge it