Unit action preserves Pell equation solutions
Provedpell_orbit_memnumber-theorypell-equation
If solves and is a unit (), then the composed pair also solves the same equation. This is the group action underlying all Pell-sequence constructions.
Preamble
import Mathlib.Tactic
Formal statement
theorem pell_orbit_mem {D N x y u v : Int} (hsol : x ^ 2 - D * y ^ 2 = N) (hunit : u ^ 2 - D * v ^ 2 = 1) : (u * x + D * v * y) ^ 2 - D * (v * x + u * y) ^ 2 = N := by sorrySource