AFTD Auto-Formalizing Theoretical Domains

two_species_purity

deforiginal

Given a natural number k and real parameters tau and alpha, letting S = (Fin k -> Bool) * (Fin k -> Bool) with half-system energy e(s) = sum_{j in Fin k} (if s.1 j then 1 else -1) + alpha * sum_{j in Fin k} (if s.2 j then 1 else -1) and unnormalized bipartite filter matrix M(s_A, s_B) = exp(-tau^2 * (e(s_A) + e(s_B))^2 / 4), two_species_purity(k, tau, alpha) is the purity ratio Tr((M M^T)^2) / (Tr(M M^T))^2.

Statement

noncomputable def two_species_purity (k : ℕ) (τ α : ℝ) : ℝ
Related work
arXiv:2405.02158
Verified
01 Nov 2026
Axioms
none listed

Read back from the Lean

Given $k \in \mathbb{N}$ and $\tau, \alpha \in \mathbb{R}$, two_species_purity k τ α defines the real number $\operatorname{tr}(R^2) / (\operatorname{tr} R)^2$, where: 1. Let $S = (\operatorname{Fin} k \to \operatorname{Bool}) \times (\operatorname{Fin} k \to \operatorname{Bool})$. 2. For any configuration $s = (s_1, s_2) \in S$, let $$e(s) = \left(\sum_{j \in \operatorname{Fin} k} (\text{if } s_1(j) \text{ then } 1 \text{ else } -1)\right) + \alpha \left(\sum_{j \in \operatorname{Fin} k} (\text{if } s_2(j) \text{ then } 1 \text{ else } -1)\right)$$ 3. $M$ is the matrix indexed by $S \times S$ with entries $$M(s_A, s_B) = \exp\left(-\frac{\tau^2 (e(s_A) + e(s_B))^2}{4}\right)$$ 4. $R = M M^T$ is the matrix product of $M$ and its transpose. 5. The result is the normalized purity $\operatorname{tr}(R^2) / (\operatorname{tr} R)^2$.

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

/-- Bipartite entanglement purity of the two-species energy-filtered state on 4k qubits. -/
noncomputable def two_species_purity (k : ℕ) (τ α : ℝ) : ℝ :=
  let M : Matrix ((Fin k → Bool) × (Fin k → Bool)) ((Fin k → Bool) × (Fin k → Bool)) ℝ :=
    fun sA sB =>
      let eA := (∑ j : Fin k, if sA.1 j then (1 : ℝ) else (-1 : ℝ)) +
        α * (∑ j : Fin k, if sA.2 j then (1 : ℝ) else (-1 : ℝ))
      let eB := (∑ j : Fin k, if sB.1 j then (1 : ℝ) else (-1 : ℝ)) +
        α * (∑ j : Fin k, if sB.2 j then (1 : ℝ) else (-1 : ℝ))
      Real.exp (- (τ^2 * (eA + eB)^2 / 4))
  let R := M * M.transpose
  (R * R).trace / (R.trace)^2
See it in the graphDiscuss this resultChallenge it