AFTD Auto-Formalizing Theoretical Domains

comparison_phi2

def

The real quadratic evaluation vector phi_2(x) : comparison_feature2 n → ℝ of a strict order x (a permutation of Fin n giving the ranks): at Sum.inl i it is phi_1(x) i (so 1 at the constant coordinate and d_e(x) at a linear one), and at the quadratic coordinate of a two-element edge set {e, f} it is the product d_e(x) * d_f(x).

Statement

def comparison_phi2 {n : ℕ} (x : Equiv.Perm (Fin n)) : comparison_feature2 n → ℝ
Defined in
arXiv:2610.34762 (Quantum ordinal selection with two comparisons), Section 3.1, the notation before Lemma 1
Verified
08 Nov 2026
Axioms
none listed
Built on 4
  • comparison_feature2The type indexing the orthonormal coordinate basis of the formal quadratic feature space F_2 = span{1, d_e, d_e d_f}: the sum type of…
  • comparison_phi1The real linear evaluation vector phi_1(x) : comparison_feature1 n → ℝ of a strict order x (a permutation of Fin n giving the ranks): its…
  • comparison_edgeThe type of edges of the label set [n] = Fin n: the subtype of pairs (a, b) in Fin n × Fin n with a < b, each unordered edge {a, b} being…
  • comparison_signThe real-valued comparison sign d_e(x) of a strict order. A strict order on the labels Fin n is given by a permutation x : Equiv.Perm (Fin…
Used by 4
  • comparison_pi_ord_mulVec_phi2Pi_ord fixes the quadratic evaluation vector phi_2(x) of every strict order x: U_triangle^T phi_2(x) = 0 by the triangle relations, hence…
  • comparison_eval_matrixThe real evaluation matrix of F_2 on strict orders, with rows indexed by the permutations x of Fin n (strict orders given by ranks) and…
  • comparison_eval_ker_le_span_kappaEvery formal quadratic feature vector c in F_2 that evaluates to zero on every strict order (<phi_2(x), c> = 0 for all permutations x of…
  • quadratic_comparison_evaluation_kernel_and_projectorLet n >= 3, N = C(n,2), nu_triangle = C(n,3). Strict orders on [n] are given by permutations x of Fin n (x i = rank of label i); for an…

Read back from the Lean

For an implicit natural number $n$ and a permutation $x$ of Fin n, comparison_phi2 x is a function from comparison_feature2 n to ℝ. Its value on an input is defined by cases: - On Sum.inl i (where $i : \text{Option (comparison\_edge } n\text{)}$): - if $i = \text{none}$, it returns $1$; - if $i = \text{some } e$, it returns comparison_sign x e, which is $1$ if $x(e.1.1) < x(e.1.2)$ and $-1$ otherwise. - On Sum.inr s (where $s$ is a subtype consisting of a 2-element Finset of comparison_edge n), it returns the product $\prod_{e \in s.1} \text{comparison\_sign } x\ e$.

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 real quadratic evaluation vector phi_2(x) : comparison_feature2 n → ℝ of a strict order x (a permutation of Fin n giving the ranks): at `Sum.inl i` it is phi_1(x) i (so 1 at the constant coordinate and d_e(x) at a linear one), and at the quadratic coordinate of a two-element edge set {e, f} it is the product d_e(x) * d_f(x). -/
def comparison_phi2 {n : ℕ} (x : Equiv.Perm (Fin n)) : comparison_feature2 n → ℝ
  | Sum.inl i => comparison_phi1 x i
  | Sum.inr s => ∏ e ∈ s.1, comparison_sign x e
See it in the graphDiscuss this resultChallenge it