AFTD Auto-Formalizing Theoretical Domains

light_plane_unique_point_outside_line

theoremverified

Let p be a prime, S ⊆ (ℤ/pℤ)³, and let P, v ∈ (ℤ/pℤ)³ with v ≠ 0. Suppose f is a nonzero linear functional such that the affine plane defined by f(x) = f(P) contains the affine line through P in direction v. If S meets the affine line in p - 1 points and meets the plane in p points, then there exists a unique point Q in S on the plane that does not lie on the line.

Statement

theorem light_plane_unique_point_outside_line
    (p : ℕ) [Fact p.Prime]
    (S : Set (Fin 3 → ZMod p))
    (P v : Fin 3 → ZMod p) (hv : v ≠ 0)
    (f : (Fin 3 → ZMod p) →ₗ[ZMod p] ZMod p) (hf : f ≠ 0)
    (hline : affine_line P v ⊆ affine_plane f (f P))
    (hS_line : (S ∩ affine_line P v).ncard = p - 1)
    (hS_plane : (S ∩ affine_plane f (f P)).ncard = p) :
    ∃! Q, Q ∈ S ∩ affine_plane f (f P) ∧ Q ∉ affine_line P v
Source
arXiv:2611.12153 Lemma 2.3 -- The strong cylinder conjecture over prime fields
Verified
11 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • affine_lineFor a natural number p, the affine line in (ZMod p)^3 through a point P in direction v is the set of points x such that x = P + t • v for…
  • affine_planeFor a natural number p, the affine plane defined by a linear functional f on (ZMod p)^3 and scalar c in ZMod p is the fiber {x | f x = c}.

Read back from the Lean

Let $p$ be a prime number (given as a natural number with a Fact p.Prime instance). Let $S \subseteq (\mathbb{Z}/p\mathbb{Z})^3$. Let $P, v \in (\mathbb{Z}/p\mathbb{Z})^3$ with $v \neq 0$, and let $f : (\mathbb{Z}/p\mathbb{Z})^3 \to \mathbb{Z}/p\mathbb{Z}$ be a linear map with $f \neq 0$. Assume: 1. The affine line through $P$ in direction $v$ is contained in the affine plane $\{x \mid f(x) = f(P)\}$; 2. The intersection of $S$ with the affine line through $P$ in direction $v$ has cardinality $p - 1$; 3. The intersection of $S$ with the affine plane $\{x \mid f(x) = f(P)\}$ has cardinality $p$. Then there exists a unique $Q \in (\mathbb{Z}/p\mathbb{Z})^3$ such that $Q \in S$, $f(Q) = f(P)$, and $Q$ does not lie on the affine line through $P$ in direction $v$.

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

The proof computes the number of points of S on the plane H outside the line L as the size of the set difference (S ∩ H) \ (S ∩ L). Because the line is contained in the plane, this difference has size |S ∩ H| - |S ∩ L| = p - (p - 1) = 1. Since the set has cardinality 1, it is a singleton, which is equivalent to the unique existence of such a point Q.

  1. S ∩ affine_line P v ⊆ S ∩ affine_plane f (f P)

    Because the affine line is assumed to be contained in the affine plane (hline), intersecting both sides of this inclusion with S preserves the subset relation.

    lines 11–12

    uses Set.inter_subset_inter_right

      have hsub : S ∩ affine_line P v ⊆ S ∩ affine_plane f (f P) :=
        Set.inter_subset_inter_right S hline
  2. The set difference (S ∩ affine_plane f (f P)) \ (S ∩ affine_line P v) has cardinality 1.

    Because S ∩ affine_line P v is a finite subset of S ∩ affine_plane f (f P), the cardinality of their set difference is the difference of their cardinalities, |S ∩ H| - |S ∩ L|. By hypothesis, these sizes are p and p - 1. Since p is prime, p ≥ 2, so the natural number subtraction p - (p - 1) evaluates to 1.

    lines 13–17

    uses Set.ncard_sdiff, Set.toFinite, Nat.Prime.two_le, Fact.out

      have hcard : ((S ∩ affine_plane f (f P)) \ (S ∩ affine_line P v)).ncard = 1 := by
        rw [Set.ncard_sdiff hsub (Set.toFinite _)]
        rw [hS_plane, hS_line]
        have hp : 2 ≤ p := Nat.Prime.two_le Fact.out
        omega
  3. The set of points {Q ∈ S ∩ affine_plane f (f P) | Q ∉ affine_line P v} is equal to the set difference (S ∩ affine_plane f (f P)) \ (S ∩ affine_line P v).

    By set extensionality, a point x belongs to the left-hand set if and only if x ∈ S, x is on the plane, and x is not on the line. For any point in S, not lying on the line is logically equivalent to not lying in S ∩ affine_line P v, which matches the definition of the set difference.

    lines 18–23

    uses Set.mem_sdiff, Set.mem_inter_iff

      have heq : {Q | Q ∈ S ∩ affine_plane f (f P) ∧ Q ∉ affine_line P v} =
          (S ∩ affine_plane f (f P)) \ (S ∩ affine_line P v) := by
        ext x
        dsimp
        simp only [Set.mem_sdiff, Set.mem_inter_iff]
        tauto
  4. There exists a unique point Q ∈ S ∩ affine_plane f (f P) such that Q ∉ affine_line P v.

    The goal is definitional for asserting unique membership in {Q ∈ S ∩ affine_plane f (f P) | Q ∉ affine_line P v}. Rewriting this set to the set difference (S ∩ H) \ (S ∩ L), the claim follows because any set of cardinality 1 is a singleton, and a singleton set contains a unique element.

    lines 24–26

    uses Set.singleton_iff_unique_mem.mp, Set.ncard_eq_one.mp

      change ∃! Q, Q ∈ {Q | Q ∈ S ∩ affine_plane f (f P) ∧ Q ∉ affine_line P v}
      rw [heq]
      exact Set.singleton_iff_unique_mem.mp (Set.ncard_eq_one.mp hcard)
Set.inter_subset_inter_right
For any sets s, t, u, if s ⊆ t, then u ∩ s ⊆ u ∩ t.
Set.ncard_sdiff
If s ⊆ t and s is finite, then |t \ s| = |t| - |s|.
Set.toFinite
Any subset of a finite type (or a set with a finite instance) is finite.
Nat.Prime.two_le
Every prime natural number is at least 2.
Fact.out
Extracts the underlying proposition from a Fact typeclass instance.
Set.mem_sdiff
An element x belongs to s \ t if and only if x ∈ s and x ∉ t.
Set.mem_inter_iff
An element x belongs to a ∩ b if and only if x ∈ a and x ∈ b.
Set.ncard_eq_one.mp
If a set has cardinality 1, then it is a singleton {a} for some element a.
Set.singleton_iff_unique_mem.mp
If a set is a singleton, then there exists a unique element belonging to it.

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

/-- A light plane containing an affine line meeting S in p - 1 points contains a unique point of S outside that line. -/theorem light_plane_unique_point_outside_line    (p : ℕ) [Fact p.Prime]    (S : Set (Fin 3 → ZMod p))    (P v : Fin 3 → ZMod p) (hv : v ≠ 0)    (f : (Fin 3 → ZMod p) →ₗ[ZMod p] ZMod p) (hf : f ≠ 0)    (hline : affine_line P v ⊆ affine_plane f (f P))    (hS_line : (S ∩ affine_line P v).ncard = p - 1)    (hS_plane : (S ∩ affine_plane f (f P)).ncard = p) :    ∃! Q, Q ∈ S ∩ affine_plane f (f P) ∧ Q ∉ affine_line P v := by  have hsub : S ∩ affine_line P v ⊆ S ∩ affine_plane f (f P) :=    Set.inter_subset_inter_right S hline  have hcard : ((S ∩ affine_plane f (f P)) \ (S ∩ affine_line P v)).ncard = 1 := by    rw [Set.ncard_sdiff hsub (Set.toFinite _)]    rw [hS_plane, hS_line]    have hp : 2 ≤ p := Nat.Prime.two_le Fact.out    omega  have heq : {Q | Q ∈ S ∩ affine_plane f (f P) ∧ Q ∉ affine_line P v} =      (S ∩ affine_plane f (f P)) \ (S ∩ affine_line P v) := by    ext x    dsimp    simp only [Set.mem_sdiff, Set.mem_inter_iff]    tauto  change ∃! Q, Q ∈ {Q | Q ∈ S ∩ affine_plane f (f P) ∧ Q ∉ affine_line P v}  rw [heq]  exact Set.singleton_iff_unique_mem.mp (Set.ncard_eq_one.mp hcard)
See it in the graphDiscuss this resultChallenge it