AFTD Auto-Formalizing Theoretical Domains

magic_square_key_guess_success

def

Given dA dB dE : ℕ, Alice's effects A : Fin 3 → (Fin 3 → Bool) → Matrix (Fin dA) (Fin dA) ℂ, a complex matrix ρ indexed by (Fin dA × Fin dB) × Fin dE, and the adversary's family M : (Fin 3 → Bool) → Matrix (Fin dE) (Fin dE) ℂ: magic_square_key_guess_success A ρ M is the real number Σ_{k : Fin 3 → Bool} Re Tr(((A 0 k ⊗ₖ I_{Fin dB}) ⊗ₖ M k) * ρ), Kronecker products grouped left as written, Re the real part of the complex trace. It is the success probability of the adversary's guessing measurement M (outcomes: sign strings) for Alice's key K, her whole answer on row x = 0: Σ_k Tr((A_{k|0} ⊗ I_B ⊗ M_k) ρ).

Statement

noncomputable def magic_square_key_guess_success {dA dB dE : ℕ}
    (A : Fin 3 → (Fin 3 → Bool) → Matrix (Fin dA) (Fin dA) ℂ)
    (ρ : Matrix ((Fin dA × Fin dB) × Fin dE) ((Fin dA × Fin dB) × Fin dE) ℂ)
    (M : (Fin 3 → Bool) → Matrix (Fin dE) (Fin dE) ℂ) : ℝ
Defined in
arXiv:2610.12001 (Exact value and rigidity of the 2x3 magic rectangle), Sec. 6, proof of Theorem 6.1 (the success probability p_M of a guess).
Verified
02 Nov 2026
Axioms
none listed
Used by 4
  • magic_square_strategy_guess_probThe maximum probability p_guess(K | E, x = 0) of an adversary guessing Alice's first row K in a strategy with effects A and state ρ,…
  • magic_square_guess_fn_concaveOnThe function g = magic_square_guess_fn — g(w) is the supremum of the adversary's probability of guessing Alice's complete first-row answer…
  • magic_square_guess_fnmagic_square_guess_fn w is the real supremum (sSup in ℝ) of the set of reals p for which there exist dA dB dE : ℕ, A : Fin 3 → (Fin 3 →…
  • magic_square_guess_fn_ge_linearFor 0 ≤ δ ≤ 1 - β₀, with β₀ = (2 + √(2/3))/3 the magic-square threshold: 1 - g(β₀ + δ) ≤ 3δ / (4(1 - β₀)), where β₀ =…

Read back from the Lean

The definition magic_square_key_guess_success takes implicit natural numbers $d_A, d_B, d_E : ℕ$ and explicit parameters: - $A : \mathrm{Fin}\,3 \to (\mathrm{Fin}\,3 \to \mathrm{Bool}) \to \mathrm{Matrix}(\mathrm{Fin}\,d_A, \mathrm{Fin}\,d_A, \mathbb{C})$, - $\rho : \mathrm{Matrix}((\mathrm{Fin}\,d_A \times \mathrm{Fin}\,d_B) \times \mathrm{Fin}\,d_E, (\mathrm{Fin}\,d_A \times \mathrm{Fin}\,d_B) \times \mathrm{Fin}\,d_E, \mathbb{C})$, - $M : (\mathrm{Fin}\,3 \to \mathrm{Bool}) \to \mathrm{Matrix}(\mathrm{Fin}\,d_E, \mathrm{Fin}\,d_E, \mathbb{C})$. It defines a real number given by the sum over all functions $k : \mathrm{Fin}\,3 \to \mathrm{Bool}$ of the real part of the trace of the matrix product: $$\sum_{k : \mathrm{Fin}\,3 \to \mathrm{Bool}} \mathrm{Re}\left(\mathrm{Tr}\left( \left( (A(0, k) \otimes I_{d_B}) \otimes M(k) \right) \cdot \rho \right)\right)$$ where $I_{d_B}$ is the $d_B \times d_B$ identity matrix over $\mathbb{C}$, $\otimes$ denotes the Kronecker product of matrices, and $\cdot$ is matrix multiplication.

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 probability that the adversary's measurement `M` (outcome: a guessed sign string) guesses Alice's whole answer `K` on row `x = 0`. -/
noncomputable def magic_square_key_guess_success {dA dB dE : ℕ}
    (A : Fin 3 → (Fin 3 → Bool) → Matrix (Fin dA) (Fin dA) ℂ)
    (ρ : Matrix ((Fin dA × Fin dB) × Fin dE) ((Fin dA × Fin dB) × Fin dE) ℂ)
    (M : (Fin 3 → Bool) → Matrix (Fin dE) (Fin dE) ℂ) : ℝ := open scoped Kronecker in
  ∑ k : Fin 3 → Bool,
    (((A 0 k ⊗ₖ (1 : Matrix (Fin dB) (Fin dB) ℂ)) ⊗ₖ M k) * ρ).trace.re
See it in the graphDiscuss this resultChallenge it