AFTD Auto-Formalizing Theoretical Domains

prioritized_borel_encoding_state_code_length

theoremverified

The one-hot code of a state has length equal to the number of states.

Statement

theorem prioritized_borel_encoding_state_code_length {Q : Type} [Fintype Q] (q : Q) : (enc1385StateCode q).length = Fintype.card Q
Source
Phase-state encoding for arXiv:2611.10136, Conjecture 19.
Verified
17 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • enc1385GameGiven a finite-state three-priority tree game, construct a phase-state game that encodes each original direction followed by a one-hot…
Used by 6

The proof, explained

The theorem states that the one-hot encoding of any state q in a finite type Q has length equal to the number of states |Q|. The encoding `enc1385StateCode` is defined by tabulating an indicator function over `Fin (Fintype.card Q)` using `List.ofFn`. Unfolding this definition allows the simplifier to reduce the length of the list directly to `Fintype.card Q`.

  1. The length of the state code of q equals the cardinality of Q. automation

    Unfolding the definition of `enc1385StateCode` reveals that it constructs a list of length `Fintype.card Q` by applying `List.ofFn` to an indicator function on `Fin (Fintype.card Q)`. The simplifier evaluates the length of this tabulated list to `Fintype.card Q`, directly completing the proof.

    line 2

    uses enc1385StateCode

      simp [enc1385StateCode]
enc1385StateCode
the one-hot encoding of a state q in a finite type Q as a list of booleans, constructed by tabulating over Fin (Fintype.card Q)

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem prioritized_borel_encoding_state_code_length {Q : Type} [Fintype Q] (q : Q) : (enc1385StateCode q).length = Fintype.card Q := by  simp [enc1385StateCode]
See it in the graphDiscuss this resultChallenge it