Two mirrors (squares and doubled squares)

AI-generated · No human mathematician has yet refereed the proof.

Reverse each block of numbers between doubled squares, then each block between squares, and repeat. Lean proves every number below g₂₅ (over 3.4 × 10¹⁸) comes back to itself, and any numbers that never return lie on one orbit.

Let f(n) = A(D(n)), where D reverses each block [2m², 2(m + 1)² − 1] and A reverses each block [s², (s + 1)² − 1]: every return takes a multiple of 4 steps, any two non-periodic numbers lie on one orbit, global periodicity is equivalent to every pronic pairing with another pronic, and Lean certifies all 15 Pell gates through g₁₅ (n < 76,069,501,249), the 450-cycle census on [0, 100,000] and the leak profile on [1, 100,000], plus, as extensions, that every n < g₂₅ comes back and the leak profile on [1, 2,000,000].

Two simple reversals make a reshuffle of all the whole numbers. Every path that has been followed comes back, yet whether every path does is an open question, much like the 3x + 1 problem. The nearest published relative found in the searches logged on the result page is the work of Alwani and Vivaldi (2017) on products of two block mirrors.

Self-contained Pell-gate structure for the squares & doubled-squares map

Walkthrough: 11 of 11 main results in Lean; one clause of Corollary 4, on infinite orbits, is no Lean declaration

Self-contained from elementary integer arithmetic and Pell equations: no external theorem is assumed as an input.

What this paper adds

  • Mod-4 law, Pell gates & pronic pairing: At most one runaway orbit, from the Pell gates; A cycle of four at every Pell level; Global periodicity iff every pronic number pairs up
  • Base range & three neighbour mirrors: Every starting number below 1,681 returns; Triangular blocks with squares; 4m² blocks with squares; Pronic blocks with squares
  • Kernel gate orbits, censuses & leak profile: Gate orbits g₁..g₁₅, censuses, and leak profile in Lean

At most one runaway orbit; periodic iff every pronic pairs (n < g₂₅ verified in Lean)

Every cycle length is divisible by 4, any non-periodic numbers lie on one orbit, global periodicity equals pronic pairing, and Lean proves that every n < g₂₅ comes back and certifies the cycle censuses on [0, 100,000] and the leak profile on [1, 100,000].

11 of 11 main results proved in Lean with no outside assumption (Proposition 12's gate orbits and censuses included), but for one clause of Corollary 4, that f has at most one infinite orbit, which also uses that a periodic number has a finite orbit and which no declaration of this Lean project states.

Listed as open in the paper

  • Whether every starting number under the squares and doubled-squares mirror map is periodic (zero infinite orbits) remains open.
  • Whether the cycle through the k-th Pell level always pairs two pronic numbers within O(k) places of sₖ.

Adjacent prior work (not used as inputs)

  • Alwani & Vivaldi (2017/2018): The nearest published relative found in the searches logged. Their planar lattice return map factors into two block mirrors with equal growth rates; the growth ratio of A and D is √2.
  • Coll et al. (2010, 2012); Eppstein (2022): Finite block-reversal compositions appear as meander permutations of seaweed Lie algebras (Coll and coauthors); Eppstein counts bounces in mirror mazes in polynomial time.
  • Curien et al. (2017); Lu (2026): Lu studies random pairs of infinite integer sets; Curien et al. prove that the random infinite noodle has at most one infinite path.

Steps, a gate and a cycle of four

The doubled-square blocks are [0, 1], [2, 7], [8, 17], [18, 31], …, and the square blocks are [0], [1, 3], [4, 8], [9, 15], [16, 24], …. Reversing a block from a to b sends n to a + b − n.

One step from 2: 2 is in the block [2, 7], so D(2) = 2 + 7 − 2 = 7. Then 7 is in the block [4, 8], so A(7) = 4 + 8 − 7 = 5. So f(2) = 5.

The path of 0 is 0 → 3 → 6 → 1 → 0. It comes back after 4 steps. The path of 2 comes back after 28 steps, and 28 = 4 × 7.

The number 8 is a Pell level: 8 = 2·2² and 9 = 3² are one apart. Of the numbers 0 to 7, only 5 steps to 8 or above, since f(5) = A(D(5)) = A(4) = 8. Of the numbers from 8 up, only 17 steps back below 8, since f(17) = A(8) = 4. The gate lemma proves there is no other.

At the same level, 56 = 7·8 and 90 = 9·10 are pronic, and 56 → 79 → 90 → 65 → 56 is a cycle of four steps.

Two mirrors and one reshuffle

A reverses each block between consecutive squares, and D reverses each block between consecutive doubled squares. Each mirror undoes itself, so one step f = A after D can be run backwards, and f reshuffles the whole numbers. A number comes back if some number of steps, at least one, returns it to itself.

  • Every step can be undone
  • The square mirror A
  • The doubled-square mirror D
  • One step: mirror D, then mirror A
  • One step backwards
  • Coming back
  • Pronic numbers
  • Which square block holds n
  • The formula for A inside a block
  • A stays in its block
  • A keeps the square root
  • A undoes itself

    A(A(n)) = n for every n.

  • A never crosses a square

    For every n and s, A(n) < s² exactly when n < s².

  • Which doubled-square block holds n
  • The formula for D inside a block
  • D stays in its block
  • D keeps the block number
  • D undoes itself

    D(D(n)) = n for every n.

  • D never crosses a doubled square

    For every n and m, D(n) < 2m² exactly when n < 2m².

  • The reshuffle steps by f
  • The reverse reshuffle steps by f⁻¹
  • The reshuffle to the power −1 steps by f⁻¹
  • k steps of the reshuffle are k steps of f
  • k steps of the reshuffle are k steps of f, with k written as an integer
  • A turns a forward step into a backward one
  • A turns a backward step into a forward one
  • A reverses the direction of every path

    For every integer z and every n, A(fᶻ(n)) = f⁻ᶻ(A(n)). A negative power means steps backwards.

  • A trapped path comes back

    For any reshuffle e of the whole numbers, if every forward step from n stays below some bound B, then n comes back under e.

Every step moves by 3 more than a multiple of 4

A fixes exactly the pronic numbers s·(s + 1), and D fixes nothing. If n lies in the doubled-square block that starts at 2m², and D(n) in the square block that starts at s², one step changes n by 2s(s + 1) − (2m + 1)², which is 3 more than a multiple of 4. After L steps the change is 3L more than a multiple of 4, so a return needs L to be a multiple of 4. Also, a square never equals a doubled square above 0, so the two kinds of block never start at the same place above 0.

  • Every return takes a multiple of 4 steps

    For every n and L, if fᴸ(n) = n then 4 divides L.

    theorem TwoMirrors.cycle_length_dvd_four (n : ℕ) (L : ℕ) (h : f^[L] n = n) :
      4 ∣ L
  • Each step moves by 3 more than a multiple of 4

    For every n, f(n) − n leaves remainder 3 when divided by 4.

  • f moves every number
  • L steps move by 3L, up to multiples of 4

    For every n and L, fᴸ(n) − n and 3L leave the same remainder when divided by 4.

  • A fixes exactly the pronic numbers

    A(n) = n exactly when n is pronic.

  • D moves every number

    D(n) ≠ n for every n.

  • A square is never a doubled square

    For all whole numbers s and m with m > 0, s² ≠ 2m².

One way in and one way out at each Pell level

Take whole numbers s, m ≥ 1 with s² and 2m² one apart, and let g be the smaller of the two; the Pell levels 1, 8, 49, 288, 1681, … are of this kind. Exactly one number below g steps to g or above, and exactly one number from g up steps back below g. The proof splits on which of s² and 2m² is larger. A path that comes in below g through one door can only leave through the other, so both doors lie on the path through g.

  • The gate lemma

    Let s, m ≥ 1 with s² − 2m² equal to 1 or −1, and let g be the smaller of s² and 2m². Exactly one number x below g has f(x) ≥ g, exactly one number y ≥ g has f(y) < g, and both lie on the path through g.

    theorem TwoMirrors.pell_gate_lemma {s : ℕ} {m : ℕ} (hs : 1 ≤ s) (hm : 1 ≤ m) (hpell : ↑s ^ 2 - 2 * ↑m ^ 2 = 1 ∨ ↑s ^ 2 - 2 * ↑m ^ 2 = -1) :
      have g := min (s ^ 2) (2 * m ^ 2);
    (∃! x, x < g ∧ g ≤ f x) ∧
      (∃! y, g ≤ y ∧ f y < g) ∧
        (∀ x < g, g ≤ f x → ∃ z, (fEquiv ^ z) x = g) ∧ ∀ (y : ℕ), g ≤ y → f y < g → ∃ z, (fEquiv ^ z) y = g
  • The Pell pairs
  • The s of a Pell pair
  • The m of a Pell pair
  • The Pell levels
  • The starting s
  • The starting m
  • The step for s
  • The step for m
  • Every s is at least 1
  • Every m is at least 1
  • The Pell identity

    For every k, sₖ² − 2mₖ² = (−1)ᵏ⁺¹.

  • Every Pell pair is one apart
  • The Pell levels keep growing
  • There is always a higher Pell level

    For every N there is a k with gₖ > N.

  • The Pell levels 1, 8, 49, 288 and 1681
  • The gate when s² is one more than 2m²

    Let s, m ≥ 1 with s² = 2m² + 1, and let g = 2m². The only number below g that f sends to g or above is x₀ = D((s − 1)²), and f(x₀) = g. The only number from g up that f sends below g is y₀ = D(g), and f(y₀) = (s − 1)².

  • The gate when 2m² is one more than s²

    Let s, m ≥ 1 with 2m² = s² + 1, and let g = s². The only number below g that f sends to g or above is x₀ = 2(m − 1)², with D(x₀) = g and f(x₀) = A(g). The only number from g up that f sends below g is g itself.

  • In through one door, out through the other

    Let e be a reshuffle of the whole numbers and g a number. Suppose x₀ is the only number below g that e sends to g or above, and y₀ ≥ g is the only number from g up that e sends below g. Then stepping forward from e(y₀) reaches x₀ after some number of steps.

At most one path can run off

A number that is not on the path through a Pell level g never crosses g, in either direction. If it lies below g, its path is trapped in finitely many numbers, so it comes back. Hence a number below g that never comes back lies on the path through g. Because the Pell levels grow without end, any two numbers that never come back lie on one path. And all the numbers below g come back if and only if g itself comes back.

  • At most one path runs off

    If neither a nor b comes back under f, then some number of steps forwards or backwards takes a to b.

    theorem TwoMirrors.at_most_one_infinite_orbit {a : ℕ} {b : ℕ} (ha : ¬IsPeriodic f a) (hb : ¬IsPeriodic f b) :
      ∃ z, (fEquiv ^ z) a = b
  • Everything below a Pell level comes back exactly when the level does

    Let s, m ≥ 1 with s² − 2m² equal to 1 or −1, and let g be the smaller of s² and 2m². Every number below g comes back under f if and only if g comes back under f.

    theorem TwoMirrors.all_below_periodic_iff_gate_periodic {s : ℕ} {m : ℕ} (hs : 1 ≤ s) (hm : 1 ≤ m) (hpell : ↑s ^ 2 - 2 * ↑m ^ 2 = 1 ∨ ↑s ^ 2 - 2 * ↑m ^ 2 = -1) :
      have g := min (s ^ 2) (2 * m ^ 2);
    (∀ n < g, IsPeriodic f n) ↔ IsPeriodic f g
  • Off the path through a Pell level, a number never crosses it

    Let s, m and g be as in the gate lemma, and let n be a number that is not on the path through g. If n < g, every number on the path of n is below g. If n ≥ g, every number on it is at least g.

  • A number below a Pell level that never comes back is on the level's path

    Let s, m and g be as in the gate lemma. If a < g and a never comes back under f, then a lies on the path through g.

  • Coming back passes along a path

    If some number of steps forwards or backwards takes a to b, and a comes back under f, then b comes back under f.

  • One path, one answer
  • The conjecture is about the Pell levels alone

    Every whole number comes back under f if and only if every Pell level comes back under f.

Pronic numbers pair up

Walk from a pronic number p by D, then A, then D, and so on. Say p pairs if the walk reaches a second pronic number. Since A reverses the direction of the path and fixes p, p pairs exactly when p comes back. A path that never comes back holds exactly one pronic number, so at most one pronic number fails to pair, and every number comes back if and only if every pronic number pairs. At every Pell level g, the walk from the pronic number (g − 1)·g reaches the pronic number (g + 1)·(g + 2) after three swaps, D, A and D, so it pairs.

  • Every number comes back exactly when every pronic number pairs

    Every whole number comes back under f if and only if every pronic number pairs with a second pronic number.

    theorem TwoMirrors.all_periodic_iff_every_pronic_pairs :
      (∀ (n : ℕ), IsPeriodic f n) ↔ ∀ (p : ℕ), IsPronic p → PronicPairs p
  • A cycle of four at every Pell level

    Let s, m ≥ 1 with s² − 2m² equal to 1 or −1, let g be the smaller of s² and 2m², and let p₀ = (g − 1)·g and p₁ = (g + 1)·(g + 2). Both are pronic, the swaps D, A, D take p₀ to p₁, f²(p₀) = p₁, f⁴(p₀) = p₀, and p₀ < D(p₀) < f(p₀) < p₁.

  • The alternating walk
  • The walk starts at n
  • An even number of swaps is a number of steps
  • An odd number of swaps ends with D
  • Pairing
  • Returning backwards counts too
  • A pronic number pairs exactly when it comes back

    If p is pronic, then p pairs if and only if p comes back under f.

  • The mirror image of a path that runs off also runs off
  • A path that runs off holds exactly one pronic number

    If a never comes back under f, then exactly one pronic number lies on the path of a.

  • At most one pronic number fails to pair

    If p₁ and p₂ are pronic and neither pairs, then p₁ = p₂.

  • A product identity at a Pell level

    If s² − 2m² is 1 or −1 and g is the smaller of s² and 2m², then 2(s·m)² = g·(g + 1).

  • The cycle of four at each indexed level
  • The cycle 56, 79, 90, 65 at the level 8

Every number below 1,681, through g₁₅, and up to g₂₅

Lean follows the gate orbits of 1, 8, 49, 288 and 1,681 back to their starts, and the gate reduction at 1,681 gives every number below it. Verified Euclidean meander block-folding and binary leak engines then certify all 15 Pell gate orbits g₁..g₁₅ (making every n below 76,069,501,249 periodic), the exact 450-cycle A ∘ D census and 727-cycle A ∘ B census on [0, 100,000], the exact leak profile on [1, 100,000], and, as extensions, that every n < g₂₅ = 3,441,313,796,169,221,281 comes back and the leak profile on [1, 2,000,000].

  • Extensions: periodicity below g₂₅ and leak on [1, 2,000,000]

    Certifies every n < g₂₅ = 3,441,313,796,169,221,281 is periodic and proves the exact leak profile (1 ≤ leak ≤ 2,258) across [1, 2,000,000].

  • Exact leak profile on [1, 100,000]

    Proves 1 ≤ leak(x) ≤ 496 on [1, 100,000] with maximum 496 at 99,954, and leak(x) = 1 at precisely the 14 Pell-gate points g_k and g_k + 1 (k = 1..7).

  • Exact Pell gate orbits g₁ through g₁₅

    Certifies exact period, minimum, maximum, and pronic pair for every Pell gate from g₁ = 1 to g₁₅ = 76,069,501,249, so every smaller integer is periodic.

  • All 15 gate orbits, cycle censuses, and leak profile in Lean

    Proves inside Lean all 15 Pell gate orbits through g₁₅ (periodicity below 76,069,501,249), the 450 A ∘ D cycles and 727 A ∘ B cycles on [0, 100,000], and the exact leak profile on [1, 100,000].

  • Every number below 1681 comes back

    Every n < 1681 comes back under f.

  • Every number below 288 comes back
  • A fast square-root routine
  • The fast square root is right

    For every fuel k and every n < 4ᵏ, the routine with fuel k gives ⌊√n⌋.

  • The square mirror, computed fast
  • The doubled-square mirror, computed fast
  • One step, computed fast
  • The fast square mirror is right
  • The fast doubled-square mirror is right
  • The fast step is right
  • A path checker
  • The path checker can be trusted

    For every number of steps L, start a and target b, if the checker answers yes, then fᴸ(a) = b.

  • Some values of A
  • Some values of D
  • 1 returns in 4 steps
  • 8 returns in 28 steps
  • 49 returns in 28 steps
  • 288 returns in 128 steps
  • 1681 returns in 92 steps
  • The level 1 comes back
  • The level 8 comes back
  • The level 49 comes back
  • The level 288 comes back
  • The level 1681 comes back

Three neighbouring pairs of mirrors, settled

Keep A and change the other mirror. With blocks at the triangular numbers, infinitely many squares are also triangular, so they are walls neither mirror crosses and every number comes back. With blocks at the pronic numbers, a simple score rises by exactly 1 at every step, so no number ever comes back. With blocks at 4m², every 4m² = (2m)² is a wall and every number comes back.

  • With triangular blocks, every number comes back

    Every whole number comes back under the step n ↦ A(B(n)).

  • With pronic blocks, no number comes back

    No whole number comes back under the step n ↦ A(C(n)).

  • With blocks at 4m², every number comes back

    Every whole number comes back under the step n ↦ A(M₄(n)).

  • The triangular numbers
  • Which triangular block holds n
  • The triangular mirror B
  • Twice a triangular number
  • The next triangular number
  • The triangular numbers keep growing
  • The triangular block index is right
  • The formula for B inside a block
  • B stays in its block
  • B undoes itself
  • B never crosses a triangular number

    For every n and t, B(n) < T(t) exactly when n < T(t).

  • Squares that are triangular

    For every k, (sₖ·mₖ)² = T(gₖ).

  • Square triangular numbers as large as you like

    For every N there are s and t with s² > N and s² = T(t).

  • A after B, as a reshuffle
  • The s-th pronic number
  • Which pronic block holds n
  • The pronic mirror C
  • The pronic block index is right
  • The formula for C inside a block
  • C stays in its block
  • C undoes itself
  • The score φ
  • One step of A after C, in a formula

    Write n = s² + d with s = ⌊√n⌋. If s ≤ d, then A(C(n)) = (s + 1)² + d + 2. If d < s, then A(C(n)) = (s − 1)² + d.

  • Each step raises the score by 1

    φ(A(C(n))) = φ(n) + 1 for every n.

  • L steps raise the score by L
  • The mirror M₄ with blocks at 4m²
  • Which 4m² block holds n
  • The formula for M₄ inside a block
  • M₄ stays in its block
  • M₄ never crosses a number 4m²

    For every n and m, M₄(n) < 4m² exactly when n < 4m².

  • A after M₄, as a reshuffle
Short

Watch on YouTube ↗