AFTD Auto-Formalizing Theoretical Domains

differs_at_one_symm

theoremverified

For any type ι and any functions f, g : ι → ℤˣ taking values in the units of ℤ, if differs_at_one f g holds, then differs_at_one g f holds.

Statement

theorem differs_at_one_symm {ι : Type*} {f g : ι → ℤˣ} (h : differs_at_one f g) : differs_at_one g f
Source
arXiv:2610.03808 Sec. 2.1
Verified
27 Oct 2026
Axioms
propext
Built on 1
  • differs_at_oneTwo functions f and g of type ι → ℤˣ (taking values in the units of ℤ, {+1, -1}) differ at exactly one index if there is a unique index i…
Used by 2
  • chirotope_three_graphThe mutation walk graph of uniform rank-3 chirotopes on Ω is the simple graph whose vertices are uniform rank-3 chirotopes chi :…
  • bruhat_order_three_graphThe higher Bruhat order B(α, 2) is the simple graph whose vertices are rank-3 signotopes u : OrderedTriple α → ℤˣ (subtypes of functions…

Read back from the Lean

For any type ι and any functions f, g : ι → ℤˣ, if f and g differ at exactly one element of ι (i.e., differs_at_one f g), then g and f differ at exactly one element of ι (i.e., differs_at_one g f).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

By definition, two functions differ at exactly one index if there exists a unique index where their values disagree. From the assumption that f and g differ uniquely at index i, the symmetry of inequality implies that g(i) ≠ f(i). Moreover, any index where g and f disagree is also an index where f and g disagree, so uniqueness forces it to be i. Hence g and f also differ at exactly one index.

  1. There is an index i such that f(i) ≠ g(i), and any index where f and g differ is equal to i

    Unfolding the definition of differs_at_one across all hypotheses and the goal rewrites the assumption to ∃! i, f i ≠ g i. We then unpack this uniqueness existential into a witness index i, the inequality f(i) ≠ g(i), and the uniqueness hypothesis that any j with f(j) ≠ g(j) satisfies j = i.

    lines 3–4

    uses differs_at_one

      rw [differs_at_one] at *
      obtain ⟨i, hi, huniq⟩ := h
  2. The index i uniquely witnesses that g and f differ at exactly one index, completing the proof

    We supply i as the witness that g and f differ at exactly one index. By symmetry of equality (via .symm), g(i) ≠ f(i) follows from f(i) ≠ g(i). Similarly, if g(j) ≠ f(j) for some j, then f(j) ≠ g(j) by symmetry, so the uniqueness hypothesis for f and g implies j = i.

    line 5

      exact ⟨i, fun hii => hi hii.symm, fun j hj => huniq j hj.symm⟩
differs_at_one
the property that two functions f and g differ at exactly one index, defined as ∃! i, f i ≠ g i

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

/-- Symmetry of differing at exactly one index. -/theorem differs_at_one_symm {ι : Type*} {f g : ι → ℤˣ} (h : differs_at_one f g) : differs_at_one g f := by  rw [differs_at_one] at *  obtain ⟨i, hi, huniq⟩ := h  exact ⟨i, fun hii => hi hii.symm, fun j hj => huniq j hj.symm⟩
See it in the graphDiscuss this resultChallenge it