AFTD Auto-Formalizing Theoretical Domains

prioritized_borel_encoding_decode_state

theoremverified

Decoding a valid one-hot state code recovers the original state.

Statement

theorem prioritized_borel_encoding_decode_state {Q : Type} [Fintype Q] (G : PrioritizedBorelGame Q 3) (q : Q) : enc1385Decode G (enc1385StateCode q) = q
Source
Phase-state encoding for arXiv:2611.10136, Conjecture 19.
Verified
17 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 3
  • enc1385GameGiven a finite-state three-priority tree game, construct a phase-state game that encodes each original direction followed by a one-hot…
  • prioritized_borel_encoding_state_code_injectiveDistinct states have distinct one-hot bit codes.
  • PrioritizedBorelGameA structure PrioritizedBorelGame (Q : Type*) (k : ℕ) representing a prioritized Borel game with state space Q and k priorities, with…
Used by 2

The proof, explained

The decoding function enc1385Decode inspects whether the input bitstring encodes some state; if so, it selects a witness via Classical.choose, and otherwise falls back to the initial state. The state q itself witnesses that its code is valid, so the decoder reduces to the chosen witness. Because state encoding is injective, this chosen witness must be q.

  1. There exists a state whose code is enc1385StateCode q.

    Working under classical logic, q itself trivially witnesses that enc1385StateCode q is the encoding of some state r, since enc1385StateCode q = enc1385StateCode q by reflexivity.

    lines 2–3

      classical
      have h : ∃ r : Q, enc1385StateCode r = enc1385StateCode q := ⟨q,rfl⟩
  2. The expression enc1385Decode G (enc1385StateCode q) evaluates to Classical.choose h.

    Unfolding the definition of enc1385Decode reveals a dependent conditional that checks whether a valid state code exists. Because hypothesis h provides this existential witness, dif_pos reduces the conditional to the positive branch, which extracts the witness via Classical.choose.

    lines 4–5

    uses dif_pos

      unfold enc1385Decode
      rw [dif_pos h]
  3. Classical.choose h = q, completing the proof.

    By Classical.choose_spec, the chosen state satisfies enc1385StateCode (Classical.choose h) = enc1385StateCode q. Because enc1385StateCode is injective (prioritized_borel_encoding_state_code_injective), the decoded state must equal q.

    line 6

    uses prioritized_borel_encoding_state_code_injective, Classical.choose_spec

      exact prioritized_borel_encoding_state_code_injective (Classical.choose_spec h)
dif_pos
If a condition c holds, a dependent conditional `if hc : c then t else e` reduces to the 'then' branch t hc.
Classical.choose_spec
Given an existential statement ∃ x, p x, the witness Classical.choose h satisfies the predicate p.
prioritized_borel_encoding_state_code_injective
The state encoding function enc1385StateCode is injective: distinct states have distinct bitstring codes.

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_decode_state {Q : Type} [Fintype Q] (G : PrioritizedBorelGame Q 3) (q : Q) : enc1385Decode G (enc1385StateCode q) = q := by  classical  have h : ∃ r : Q, enc1385StateCode r = enc1385StateCode q := ⟨q,rfl⟩  unfold enc1385Decode  rw [dif_pos h]  exact prioritized_borel_encoding_state_code_injective (Classical.choose_spec h)
See it in the graphDiscuss this resultChallenge it