|
| 1 | +import Collatz.Exploration.FloorExcursion |
| 2 | + |
| 3 | +/-! Odd-denominator rational Collatz dynamics encoded by natural numerators. |
| 4 | +With a fixed odd denominator d, the odd update on numerators is 3n+d; |
| 5 | +the even update halves an even numerator. All comparisons below are exact |
| 6 | +cross-multiplied rational comparisons. This map is distinct from step. -/ |
| 7 | +namespace Collatz.Exploration.RationalBandObstruction |
| 8 | + |
| 9 | +def denominatorStep (d n : Nat) : Nat := |
| 10 | + if n % 2 = 0 then n / 2 else 3*n+d |
| 11 | + |
| 12 | +def denominatorOrbit (d : Nat) : Nat → Nat → Nat |
| 13 | + | 0, n => n |
| 14 | + | k+1, n => denominatorStep d (denominatorOrbit d k n) |
| 15 | + |
| 16 | +/-- Denominator one recovers the original integer map, including zero. -/ |
| 17 | +theorem denominator_one_step (n : Nat) : denominatorStep 1 n = step n := by |
| 18 | + by_cases hz : n = 0 |
| 19 | + · subst n; decide |
| 20 | + · simp [denominatorStep, step, hz] |
| 21 | + |
| 22 | +theorem denominator_one_orbit (k n : Nat) : denominatorOrbit 1 k n = orbit k n := by |
| 23 | + induction k with |
| 24 | + | zero => rfl |
| 25 | + | succ k ih => |
| 26 | + simp only [denominatorOrbit, ih, denominator_one_step, orbit_succ_steps] |
| 27 | + exact (orbit_step_commute k n).symm |
| 28 | + |
| 29 | +/-- The branch word OEOEEOEE has this affine identity for every fixed offset. -/ |
| 30 | +theorem word_identity (d x0 x1 x2 x3 x4 x5 x6 x7 x8 : Nat) |
| 31 | + (h0 : x1 = 3*x0+d) (h1 : 2*x2 = x1) |
| 32 | + (h2 : x3 = 3*x2+d) (h3 : 2*x4 = x3) (h4 : 2*x5 = x4) |
| 33 | + (h5 : x6 = 3*x5+d) (h6 : 2*x7 = x6) (h7 : 2*x8 = x7) : |
| 34 | + 32*x8 = 27*x0+23*d := by omega |
| 35 | + |
| 36 | +/-- Closure in this word forces the encoding denominator to be divisible by five. -/ |
| 37 | +theorem closure_denominator (d n : Nat) (h : 32*n = 27*n+23*d) : d%5 = 0 := by |
| 38 | + omega |
| 39 | + |
| 40 | +/-- This word's closed encodings are exactly multiples of the primitive pair (5,23). -/ |
| 41 | +theorem closure_classification (d n : Nat) (h : 32*n = 27*n+23*d) : |
| 42 | + ∃ t, d = 5*t ∧ n = 23*t := by |
| 43 | + have hd := closure_denominator d n h |
| 44 | + refine ⟨d/5, ?_, ?_⟩ <;> omega |
| 45 | + |
| 46 | +/-- The rational 23/5 cycle, uniformly encoded at every odd scale. -/ |
| 47 | +theorem scaled_transitions (t : Nat) (ht : t%2 = 1) : |
| 48 | + denominatorStep (5*t) (23*t) = 74*t ∧ |
| 49 | + denominatorStep (5*t) (74*t) = 37*t ∧ |
| 50 | + denominatorStep (5*t) (37*t) = 116*t ∧ |
| 51 | + denominatorStep (5*t) (116*t) = 58*t ∧ |
| 52 | + denominatorStep (5*t) (58*t) = 29*t ∧ |
| 53 | + denominatorStep (5*t) (29*t) = 92*t ∧ |
| 54 | + denominatorStep (5*t) (92*t) = 46*t ∧ |
| 55 | + denominatorStep (5*t) (46*t) = 23*t := by |
| 56 | + simp [denominatorStep, Nat.mul_mod, ht] |
| 57 | + omega |
| 58 | + |
| 59 | +/-- These eight numerator values form a closed invariant set. -/ |
| 60 | +def Member (t n : Nat) : Prop := |
| 61 | + n = 23*t ∨ n = 74*t ∨ n = 37*t ∨ n = 116*t ∨ |
| 62 | + n = 58*t ∨ n = 29*t ∨ n = 92*t ∨ n = 46*t |
| 63 | + |
| 64 | +theorem member_forward {t n : Nat} (ht : t%2 = 1) (h : Member t n) : |
| 65 | + Member t (denominatorStep (5*t) n) := by |
| 66 | + obtain ⟨h0,h1,h2,h3,h4,h5,h6,h7⟩ := scaled_transitions t ht |
| 67 | + rcases h with h | h | h | h | h | h | h | h <;> |
| 68 | + simp_all [Member] |
| 69 | + |
| 70 | +theorem orbit_member (t : Nat) (ht : t%2 = 1) (k : Nat) : |
| 71 | + Member t (denominatorOrbit (5*t) k (23*t)) := by |
| 72 | + induction k with |
| 73 | + | zero => exact Or.inl rfl |
| 74 | + | succ k ih => exact member_forward ht ih |
| 75 | + |
| 76 | +theorem cycle_eight (t : Nat) (ht : t%2 = 1) : |
| 77 | + denominatorOrbit (5*t) 8 (23*t) = 23*t := by |
| 78 | + obtain ⟨h0,h1,h2,h3,h4,h5,h6,h7⟩ := scaled_transitions t ht |
| 79 | + simp only [denominatorOrbit, h0,h1,h2,h3,h4,h5,h6,h7] |
| 80 | + |
| 81 | +/-- The primitive normalized cycle has least positive period eight. -/ |
| 82 | +theorem primitive_period : denominatorOrbit 5 8 23 = 23 ∧ |
| 83 | + ∀ k : Fin 7, denominatorOrbit 5 (k.val+1) 23 ≠ 23 := by decide |
| 84 | + |
| 85 | +/-- The numerator cycle stays in the interval [23t,116t] for all time. -/ |
| 86 | +theorem bounds_all (t : Nat) (ht : t%2 = 1) (k : Nat) : |
| 87 | + 23*t ≤ denominatorOrbit (5*t) k (23*t) ∧ |
| 88 | + denominatorOrbit (5*t) k (23*t) ≤ 116*t := by |
| 89 | + have h := orbit_member t ht k |
| 90 | + rcases h with h | h | h | h | h | h | h | h <;> omega |
| 91 | + |
| 92 | +/-- Its rational minimum is greater than one, and the maximum ratio is 116/23. -/ |
| 93 | +theorem rational_floor_certificate : |
| 94 | + 5 < 23 ∧ (∀ k, 23 ≤ denominatorOrbit 5 k 23 ∧ |
| 95 | + denominatorOrbit 5 k 23 ≤ 116) ∧ denominatorOrbit 5 3 23 = 116 := by |
| 96 | + refine ⟨by decide, ?_, by decide⟩ |
| 97 | + intro k |
| 98 | + simpa using bounds_all 1 (by decide) k |
| 99 | + |
| 100 | +/-- The cycle defeats every rational-interval clock at ratio 51/10. -/ |
| 101 | +theorem band_fifty_one_tenths (k : Nat) : |
| 102 | + 23 ≤ denominatorOrbit 5 k 23 ∧ 10*denominatorOrbit 5 k 23 ≤ 51*23 := by |
| 103 | + have h := bounds_all 1 (by decide) k |
| 104 | + simp only [Nat.mul_one] at h |
| 105 | + omega |
| 106 | + |
| 107 | +/-- It still exits the narrower ratio-five band, at its largest point. -/ |
| 108 | +theorem exits_five_band : 5*23 < denominatorOrbit 5 3 23 := by decide |
| 109 | + |
| 110 | +/-- Even the multiplicative part 81/16 of the integer-floor bound fails here. -/ |
| 111 | +theorem fails_integer_floor_excursion (k : Nat) : |
| 112 | + 16*denominatorOrbit 5 k 23 < 81*23 := by |
| 113 | + have h := bounds_all 1 (by decide) k |
| 114 | + simp only [Nat.mul_one] at h |
| 115 | + omega |
| 116 | + |
| 117 | +/-- A uniform result for arbitrary odd offsets would wrongly exclude this cycle. -/ |
| 118 | +theorem no_offset_band_exit : |
| 119 | + ¬ (∀ d b n : Nat, d%2 = 1 → 1 < b → |
| 120 | + ∃ k, denominatorOrbit d k n < b ∨ |
| 121 | + 116*b < 23*denominatorOrbit d k n) := by |
| 122 | + intro h |
| 123 | + obtain ⟨k,hl | hu⟩ := h 5 23 23 (by decide) (by decide) |
| 124 | + · have hb := bounds_all 1 (by decide) k |
| 125 | + simp only [Nat.mul_one] at hb |
| 126 | + omega |
| 127 | + · have hb := bounds_all 1 (by decide) k |
| 128 | + simp only [Nat.mul_one] at hb |
| 129 | + omega |
| 130 | + |
| 131 | +/-- Changing the denominator changes the odd update; this is no integer cycle. -/ |
| 132 | +theorem ordinary_map_control : step 23 = 70 ∧ denominatorStep 5 23 = 74 := by decide |
| 133 | + |
| 134 | +/-- The corresponding ordinary integer congruence class has an exact descending trace. |
| 135 | +This class was already closed in Strategy/ExcursionMap; this records the fixed clock. -/ |
| 136 | +theorem integer_trace (q : Nat) : |
| 137 | + step (32*q+11) = 96*q+34 ∧ step (96*q+34) = 48*q+17 ∧ |
| 138 | + step (48*q+17) = 144*q+52 ∧ step (144*q+52) = 72*q+26 ∧ |
| 139 | + step (72*q+26) = 36*q+13 ∧ step (36*q+13) = 108*q+40 ∧ |
| 140 | + step (108*q+40) = 54*q+20 ∧ step (54*q+20) = 27*q+10 := by |
| 141 | + have h0 : (32*q+11)%2 = 1 := by omega |
| 142 | + have h1 : (96*q+34)%2 = 0 := by omega |
| 143 | + have h2 : (48*q+17)%2 = 1 := by omega |
| 144 | + have h3 : (144*q+52)%2 = 0 := by omega |
| 145 | + have h4 : (72*q+26)%2 = 0 := by omega |
| 146 | + have h5 : (36*q+13)%2 = 1 := by omega |
| 147 | + have h6 : (108*q+40)%2 = 0 := by omega |
| 148 | + have h7 : (54*q+20)%2 = 0 := by omega |
| 149 | + simp [step, h0,h1,h2,h3,h4,h5,h6,h7] |
| 150 | + omega |
| 151 | + |
| 152 | +theorem integer_eighth_value (q : Nat) : orbit 8 (32*q+11) = 27*q+10 := by |
| 153 | + obtain ⟨h0,h1,h2,h3,h4,h5,h6,h7⟩ := integer_trace q |
| 154 | + simp only [orbit, h0,h1,h2,h3,h4,h5,h6,h7] |
| 155 | + |
| 156 | +theorem integer_strict_descent (q : Nat) : orbit 8 (32*q+11) < 32*q+11 := by |
| 157 | + rw [integer_eighth_value] |
| 158 | + omega |
| 159 | + |
| 160 | +/-- The formal affine return identity, exposing the rational fixed point 23/5. -/ |
| 161 | +theorem integer_return_identity (q : Nat) : |
| 162 | + 32*orbit 8 (32*q+11) = 27*(32*q+11)+23 := by |
| 163 | + rw [integer_eighth_value] |
| 164 | + omega |
| 165 | + |
| 166 | +/-- The word's affine identity enforces the exact integer source residue. -/ |
| 167 | +theorem integer_source_residue (n r : Nat) (h : 32*r = 27*n+23) : n%32 = 11 := by |
| 168 | + omega |
| 169 | + |
| 170 | +theorem integer_descent_of_residue {n : Nat} (h : n%32 = 11) : orbit 8 n < n := by |
| 171 | + have hn : n = 32*(n/32)+11 := by omega |
| 172 | + rw [hn] |
| 173 | + exact integer_strict_descent (n/32) |
| 174 | + |
| 175 | +theorem no_integer_fixed_point (n : Nat) : ¬ (32*n = 27*n+23) := by omega |
| 176 | + |
| 177 | +end Collatz.Exploration.RationalBandObstruction |
0 commit comments