@@ -210,25 +210,25 @@ Knuth gives explicit descriptions of the three cycles' behavior, which we record
210210-- Cycle 0 rules
211211
212212/-- Cycle 0 bumps i when s = 0 and j = −1. -/
213- theorem claudeDir_cycle0_s0_j {m : ℕ} [NeZero m] (hm : 1 < m) (v : Vertex m)
213+ theorem claudeDir_cycle0_s0_j {m : ℕ} [NeZero m] (_hm : 1 < m) (v : Vertex m)
214214 (hs : fiber v = 0 ) (hj : v.2 .1 = -1 ) :
215215 claudeDir v 0 = 0 := by
216216 simp [claudeDir, hs, hj]
217217
218218/-- Cycle 0 bumps k when s = 0 and j ≠ −1. -/
219- theorem claudeDir_cycle0_s0_nj {m : ℕ} [NeZero m] (hm : 1 < m) (v : Vertex m)
219+ theorem claudeDir_cycle0_s0_nj {m : ℕ} [NeZero m] (_hm : 1 < m) (v : Vertex m)
220220 (hs : fiber v = 0 ) (hj : v.2 .1 ≠ -1 ) :
221221 claudeDir v 0 = 2 := by
222222 simp [claudeDir, hs, hj]
223223
224224/-- Cycle 0 bumps j when 0 < s < m−1 and i ≠ −1. -/
225- theorem claudeDir_cycle0_mid_ni {m : ℕ} [NeZero m] (hm : 1 < m) (v : Vertex m)
225+ theorem claudeDir_cycle0_mid_ni {m : ℕ} [NeZero m] (_hm : 1 < m) (v : Vertex m)
226226 (hs0 : fiber v ≠ 0 ) (hs1 : fiber v ≠ -1 ) (hi : v.1 ≠ -1 ) :
227227 claudeDir v 0 = 1 := by
228228 simp [claudeDir, hs0, hs1, hi]
229229
230230/-- Cycle 0 bumps k when 0 < s < m−1 and i = −1. -/
231- theorem claudeDir_cycle0_mid_i {m : ℕ} [NeZero m] (hm : 1 < m) (v : Vertex m)
231+ theorem claudeDir_cycle0_mid_i {m : ℕ} [NeZero m] (_hm : 1 < m) (v : Vertex m)
232232 (hs0 : fiber v ≠ 0 ) (hs1 : fiber v ≠ -1 ) (hi : v.1 = -1 ) :
233233 claudeDir v 0 = 2 := by
234234 simp [claudeDir, hs0, hs1, hi]
@@ -260,7 +260,7 @@ theorem claudeDir_cycle1_s0 {m : ℕ} [NeZero m] (hm : 1 < m) (v : Vertex m)
260260 split_ifs <;> simp_all
261261
262262/-- Cycle 1 bumps i when 0 < s < m−1. -/
263- theorem claudeDir_cycle1_mid {m : ℕ} [NeZero m] (hm : 1 < m) (v : Vertex m)
263+ theorem claudeDir_cycle1_mid {m : ℕ} [NeZero m] (_hm : 1 < m) (v : Vertex m)
264264 (hs0 : fiber v ≠ 0 ) (hs1 : fiber v ≠ -1 ) :
265265 claudeDir v 1 = 0 := by
266266 simp [claudeDir, hs0, hs1]
@@ -284,25 +284,25 @@ theorem claudeDir_cycle1_s1_ni {m : ℕ} [NeZero m] (hm : 1 < m) (v : Vertex m)
284284-- Cycle 2 rules
285285
286286/-- Cycle 2 bumps i when s = 0 and j ≠ −1. -/
287- theorem claudeDir_cycle2_s0_nj {m : ℕ} [NeZero m] (hm : 1 < m) (v : Vertex m)
287+ theorem claudeDir_cycle2_s0_nj {m : ℕ} [NeZero m] (_hm : 1 < m) (v : Vertex m)
288288 (hs : fiber v = 0 ) (hj : v.2 .1 ≠ -1 ) :
289289 claudeDir v 2 = 0 := by
290290 simp [claudeDir, hs, hj]
291291
292292/-- Cycle 2 bumps k when s = 0 and j = −1. -/
293- theorem claudeDir_cycle2_s0_j {m : ℕ} [NeZero m] (hm : 1 < m) (v : Vertex m)
293+ theorem claudeDir_cycle2_s0_j {m : ℕ} [NeZero m] (_hm : 1 < m) (v : Vertex m)
294294 (hs : fiber v = 0 ) (hj : v.2 .1 = -1 ) :
295295 claudeDir v 2 = 2 := by
296296 simp [claudeDir, hs, hj]
297297
298298/-- Cycle 2 bumps k when 0 < s < m−1 and i ≠ −1. -/
299- theorem claudeDir_cycle2_mid_ni {m : ℕ} [NeZero m] (hm : 1 < m) (v : Vertex m)
299+ theorem claudeDir_cycle2_mid_ni {m : ℕ} [NeZero m] (_hm : 1 < m) (v : Vertex m)
300300 (hs0 : fiber v ≠ 0 ) (hs1 : fiber v ≠ -1 ) (hi : v.1 ≠ -1 ) :
301301 claudeDir v 2 = 2 := by
302302 simp [claudeDir, hs0, hs1, hi]
303303
304304/-- Cycle 2 bumps j when 0 < s < m−1 and i = −1. -/
305- theorem claudeDir_cycle2_mid_i {m : ℕ} [NeZero m] (hm : 1 < m) (v : Vertex m)
305+ theorem claudeDir_cycle2_mid_i {m : ℕ} [NeZero m] (_hm : 1 < m) (v : Vertex m)
306306 (hs0 : fiber v ≠ 0 ) (hs1 : fiber v ≠ -1 ) (hi : v.1 = -1 ) :
307307 claudeDir v 2 = 1 := by
308308 simp [claudeDir, hs0, hs1, hi]
@@ -346,22 +346,22 @@ theorem claudeStep_fst_of_dir_ne_zero {m : ℕ} [NeZero m] (c : Fin 3) (v : Vert
346346 (h : claudeDir v c ≠ 0 ) : (claudeStep c v).1 = v.1 := by
347347 simp only [claudeStep]
348348 have : claudeDir v c = 1 ∨ claudeDir v c = 2 := by omega
349- rcases this with h1 | h1 <;> simp [claudeStep, h1, bumpAt]
349+ rcases this with h1 | h1 <;> simp [h1, bumpAt]
350350
351351theorem claudeStep_snd_fst_of_dir_ne_one {m : ℕ} [NeZero m] (c : Fin 3 ) (v : Vertex m)
352352 (h : claudeDir v c ≠ 1 ) : (claudeStep c v).2 .1 = v.2 .1 := by
353353 simp only [claudeStep]
354354 have : claudeDir v c = 0 ∨ claudeDir v c = 2 := by omega
355- rcases this with h1 | h1 <;> simp [claudeStep, h1, bumpAt]
355+ rcases this with h1 | h1 <;> simp [h1, bumpAt]
356356
357357theorem claudeStep_snd_snd_of_dir_ne_two {m : ℕ} [NeZero m] (c : Fin 3 ) (v : Vertex m)
358358 (h : claudeDir v c ≠ 2 ) : (claudeStep c v).2 .2 = v.2 .2 := by
359359 simp only [claudeStep]
360360 have : claudeDir v c = 0 ∨ claudeDir v c = 1 := by omega
361- rcases this with h1 | h1 <;> simp [claudeStep, h1, bumpAt]
361+ rcases this with h1 | h1 <;> simp [h1, bumpAt]
362362
363363/-- For cycle 0, i only changes when s = 0 and j = -1. -/
364- theorem claudeStep_fst_cycle0 {m : ℕ} [NeZero m] (hm : 1 < m) (v : Vertex m)
364+ theorem claudeStep_fst_cycle0 {m : ℕ} [NeZero m] (_hm : 1 < m) (v : Vertex m)
365365 (h : ¬(fiber v = 0 ∧ v.2 .1 = -1 )) : (claudeStep 0 v).1 = v.1 := by
366366 apply claudeStep_fst_of_dir_ne_zero
367367 push_neg at h
@@ -383,7 +383,7 @@ Proof sketch: On a finite type, injective ↔ bijective. For injectivity, if
383383- If same direction: `bumpAt b` is injective, so `u = v`.
384384- If different directions: the fiber equality `fiber u = fiber v` forces the same branch
385385 conditions, contradicting the direction difference. -/
386- theorem claudeStep_bijective {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m) (c : Fin 3 ) :
386+ theorem claudeStep_bijective {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m) (c : Fin 3 ) :
387387 Function.Bijective (claudeStep c : Vertex m → Vertex m) := by
388388 rw [← Finite.injective_iff_bijective]
389389 intro u v heq
@@ -407,10 +407,10 @@ theorem claudeStep_bijective {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m) (c
407407 show fiber u = fiber v from hf] at hfst hsnd)
408408 all_goals (fin_cases c <;> simp_all [bumpAt])
409409 · by_cases hs1 : fiber v = -1
410- · simp only [hs0, hs1, ite_false , ite_true]
410+ · simp only [hs1, ite_true]
411411 by_cases hui : u.1 = 0 <;> by_cases hvi : v.1 = 0 <;>
412412 simp only [hui, hvi, ite_true, ite_false]
413- all_goals (simp only [hui, hvi, ite_true, ite_false, claudeDir, hs0, hs1, hn1,
413+ all_goals (simp only [hui, hvi, ite_true, ite_false, claudeDir, hs1, hn1,
414414 show fiber u = fiber v from hf] at hfst hsnd)
415415 all_goals (fin_cases c <;> simp_all [bumpAt])
416416 · simp only [hs0, hs1, ite_false]
@@ -538,7 +538,7 @@ private theorem claudeStep0_iter_bumpK {m : ℕ} [NeZero m] (hm' : 1 < m)
538538
539539/-- Return map for cycle 0, generic case: j ≠ −1, 0 < i < m−1.
540540After m steps, (i, j, −i−j) ↦ (i, j−1, −i−(j−1)). -/
541- private theorem returnMap0_generic {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
541+ private theorem returnMap0_generic {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m)
542542 (i j : ZMod m) (hi0 : i ≠ 0 ) (hi1 : i ≠ -1 ) (hj : j ≠ -1 ) :
543543 (claudeStep 0 )^[m] (i, j, -i - j) = (i, j - 1 , -(i + (j - 1 ))) := by
544544 -- Decompose m = 1 + (m-2) + 1
@@ -556,12 +556,12 @@ private theorem returnMap0_generic {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 <
556556 simp only [fiber, zmod_natCast_m_sub_two (by omega : 2 ≤ m)]; ring
557557 have hdir3 : claudeDir (i, j + ((m - 2 : ℕ) : ZMod m), -i - j + 1 ) 0 = 1 :=
558558 claudeDir_cycle0_s1_i hm' _ hfib_last hi0
559- simp only [claudeStep, hdir3, bumpAt ]
560- refine Prod.ext rfl (Prod.ext ?_ ?_) <;> rw [zmod_natCast_m_sub_two (by omega)] <;> ring
559+ simp only [hdir3]
560+ refine Prod.ext rfl (Prod.ext ?_ ?_) <;> ( rw [zmod_natCast_m_sub_two (by omega)]; try ring)
561561
562562/-- Return map for cycle 0, i = 0 case: j ≠ −1.
563563After m steps, (0, j, −j) ↦ (0, j−2, −(j−2)). -/
564- private theorem returnMap0_i0 {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
564+ private theorem returnMap0_i0 {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m)
565565 (j : ZMod m) (hj : j ≠ -1 ) :
566566 (claudeStep 0 )^[m] ((0 : ZMod m), j, -j) = ((0 : ZMod m), j - 2 , -(j - 2 )) := by
567567 rw [iterate_three_phases _ m (by omega)]
@@ -580,12 +580,12 @@ private theorem returnMap0_i0 {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
580580 simp only [fiber, zmod_natCast_m_sub_two (by omega : 2 ≤ m)]; ring
581581 have hdir3 : claudeDir ((0 : ZMod m), j + ((m - 2 : ℕ) : ZMod m), -j + 1 ) 0 = 2 :=
582582 claudeDir_cycle0_s1_ni hm' _ hfib_last rfl
583- simp only [claudeStep, hdir3, bumpAt ]
584- refine Prod.ext rfl (Prod.ext ?_ ?_) <;> rw [zmod_natCast_m_sub_two (by omega)] <;> ring
583+ simp only [hdir3]
584+ refine Prod.ext rfl (Prod.ext ?_ ?_) <;> ( rw [zmod_natCast_m_sub_two (by omega)]; try ring)
585585
586586/-- Return map for cycle 0, i = m−1 case: j ≠ −1.
587587After m steps, (−1, j, 1−j) ↦ (−1, j+1, −j). -/
588- private theorem returnMap0_im1 {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
588+ private theorem returnMap0_im1 {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m)
589589 (j : ZMod m) (hj : j ≠ -1 ) :
590590 (claudeStep 0 )^[m] ((-1 : ZMod m), j, 1 - j) = ((-1 : ZMod m), j + 1 , -j) := by
591591 rw [iterate_three_phases _ m (by omega)]
@@ -604,12 +604,12 @@ private theorem returnMap0_im1 {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
604604 intro h; exact absurd (neg_eq_zero.mp h) (zmod_one_ne_zero hm')
605605 have hdir3 : claudeDir ((-1 : ZMod m), j, 1 - j + 1 + ((m - 2 : ℕ) : ZMod m)) 0 = 1 :=
606606 claudeDir_cycle0_s1_i hm' _ hfib_last hi0
607- simp only [claudeStep, hdir3, bumpAt ]
608- refine Prod.ext rfl (Prod.ext ?_ ?_) <;> rw [zmod_natCast_m_sub_two (by omega)] <;> ring
607+ simp only [hdir3]
608+ refine Prod.ext rfl (Prod.ext ?_ ?_) <;> ( rw [zmod_natCast_m_sub_two (by omega)]; try ring)
609609
610610/-- Return map for cycle 0, transition case: j = −1, i+1 ≠ −1, i+1 ≠ 0.
611611After m steps, (i, −1, 1−i) ↦ (i+1, −2, 1−i). -/
612- private theorem returnMap0_transition {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
612+ private theorem returnMap0_transition {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m)
613613 (i : ZMod m) (hi1 : i + 1 ≠ -1 ) (hi1_ne0 : i + 1 ≠ 0 ) :
614614 (claudeStep 0 )^[m] (i, -1 , 1 - i) = (i + 1 , -2 , 1 - i) := by
615615 rw [iterate_three_phases _ m (by omega)]
@@ -627,27 +627,27 @@ private theorem returnMap0_transition {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1
627627 simp only [fiber, zmod_natCast_m_sub_two (by omega : 2 ≤ m)]; ring
628628 have hdir3 : claudeDir (i + 1 , -1 + ((m - 2 : ℕ) : ZMod m), 1 - i) 0 = 1 :=
629629 claudeDir_cycle0_s1_i hm' _ hfib_last hi1_ne0
630- simp only [claudeStep, hdir3, bumpAt ]
631- refine Prod.ext rfl (Prod.ext ?_ ?_) <;> rw [zmod_natCast_m_sub_two (by omega)] <;> ring
630+ simp only [hdir3]
631+ refine Prod.ext rfl (Prod.ext ?_ ?_) <;> ( rw [zmod_natCast_m_sub_two (by omega)]; try ring)
632632
633633/-- Return map for cycle 0, transition to last block: j = −1, i = m−2.
634634After m steps, (−2, −1, 3−m) ↦ (−1, 0, 1). -/
635- private theorem returnMap0_transition_to_last {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m) :
635+ private theorem returnMap0_transition_to_last {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m) :
636636 (claudeStep 0 )^[m] ((-2 : ZMod m), -1 , 3 - (m : ZMod m)) =
637637 ((-1 : ZMod m), 0 , 1 ) := by
638638 rw [iterate_three_phases _ m (by omega)]
639639 -- Phase 1: bump i (j = -1). Note: (m : ZMod m) = 0
640640 have hm0 : (m : ZMod m) = 0 := ZMod.natCast_self m
641641 have hfib0 : fiber ((-2 : ZMod m), -1 , 3 - (m : ZMod m)) = 0 := by
642- simp [fiber, hm0 ]; ring
642+ simp [fiber]; ring
643643 have hj : ((-2 : ZMod m), (-1 : ZMod m), 3 - (m : ZMod m)).2 .1 = -1 := rfl
644644 have hdir1 : claudeDir ((-2 : ZMod m), -1 , 3 - (m : ZMod m)) 0 = 0 :=
645645 claudeDir_cycle0_s0_j hm' _ hfib0 hj
646646 simp only [claudeStep, hdir1, bumpAt]
647647 -- After phase 1: (-1, -1, 3 - (m : ZMod m)) = (-1, -1, 3)
648648 -- Phase 2: m-2 steps, bump k (i = -1)
649649 have hfib1 : fiber ((-1 : ZMod m), -1 , 3 - (m : ZMod m)) = ((1 : ℕ) : ZMod m) := by
650- simp [fiber, hm0 ]; ring
650+ simp [fiber]; ring
651651 rw [show (-2 : ZMod m) + 1 = -1 from by ring]
652652 rw [claudeStep0_iter_bumpK hm' (-1 ) (3 - (m : ZMod m)) (m - 2 ) 1 (by omega) (by omega) hfib1]
653653 -- Phase 3: bump j (i = -1 ≠ 0 at fiber m-1)
@@ -657,13 +657,13 @@ private theorem returnMap0_transition_to_last {m : ℕ} [NeZero m] (hm : Odd m)
657657 intro h; exact absurd (neg_eq_zero.mp h) (zmod_one_ne_zero hm')
658658 have hdir3 : claudeDir ((-1 : ZMod m), -1 , 3 - (m : ZMod m) + ((m - 2 : ℕ) : ZMod m)) 0 = 1 :=
659659 claudeDir_cycle0_s1_i hm' _ hfib_last hi0
660- simp only [claudeStep, hdir3, bumpAt ]
660+ simp only [hdir3]
661661 refine Prod.ext rfl (Prod.ext ?_ ?_) <;>
662662 simp only [zmod_natCast_m_sub_two (by omega : 2 ≤ m), hm0] <;> ring
663663
664664/-- Return map for cycle 0, wrap case: j = −1, i = m−1.
665665After m steps, (−1, −1, 2) ↦ (0, −3, 3). -/
666- private theorem returnMap0_wrap {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m) :
666+ private theorem returnMap0_wrap {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m) :
667667 (claudeStep 0 )^[m] ((-1 : ZMod m), -1 , 2 ) = ((0 : ZMod m), -3 , 3 ) := by
668668 rw [iterate_three_phases _ m (by omega)]
669669 -- Phase 1: bump i (j = -1)
@@ -684,8 +684,8 @@ private theorem returnMap0_wrap {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
684684 simp only [fiber, zmod_natCast_m_sub_two (by omega : 2 ≤ m)]; ring
685685 have hdir3 : claudeDir ((0 : ZMod m), -1 + ((m - 2 : ℕ) : ZMod m), 2 ) 0 = 2 :=
686686 claudeDir_cycle0_s1_ni hm' _ hfib_last rfl
687- simp only [claudeStep, hdir3, bumpAt ]
688- refine Prod.ext rfl (Prod.ext ?_ ?_) <;> rw [zmod_natCast_m_sub_two (by omega)] <;> ring
687+ simp only [hdir3]
688+ refine Prod.ext rfl (Prod.ext ?_ ?_) <;> ( rw [zmod_natCast_m_sub_two (by omega)]; try ring)
689689
690690/-- Iterating the return map within a generic block: j decreases by 1 each step. -/
691691private theorem returnMap0_generic_iter {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
@@ -796,7 +796,7 @@ private theorem claudeStep1_iter_bumpI {m : ℕ} [NeZero m] (hm' : 1 < m)
796796
797797/-- Return map for cycle 1, i ≠ 2 case.
798798After m steps, (i, j, −i−j) ↦ (i−2, j+1, 1−i−j). -/
799- private theorem returnMap1_ne2 {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
799+ private theorem returnMap1_ne2 {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m)
800800 (i j : ZMod m) (hi : i ≠ 2 ) :
801801 (claudeStep 1 )^[m] (i, j, -i - j) = (i - 2 , j + 1 , -i - j + 1 ) := by
802802 rw [iterate_three_phases _ m (by omega)]
@@ -819,12 +819,12 @@ private theorem returnMap1_ne2 {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
819819 _ = 2 := by ring
820820 have hdir3 : claudeDir (i + ((m - 2 : ℕ) : ZMod m), j + 1 , -i - j) 1 = 2 :=
821821 claudeDir_cycle1_s1_i hm' _ hfib_last hi2
822- simp only [claudeStep, hdir3, bumpAt ]
823- refine Prod.ext ?_ (Prod.ext rfl ?_) <;> rw [zmod_natCast_m_sub_two (by omega)] <;> ring
822+ simp only [hdir3]
823+ refine Prod.ext ?_ (Prod.ext rfl ?_) <;> ( rw [zmod_natCast_m_sub_two (by omega)]; try ring)
824824
825825/-- Return map for cycle 1, i = 2 case.
826826After m steps, (2, j, −2−j) ↦ (0, j+2, −2−j). -/
827- private theorem returnMap1_eq2 {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
827+ private theorem returnMap1_eq2 {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m)
828828 (j : ZMod m) :
829829 (claudeStep 1 )^[m] ((2 : ZMod m), j, -2 - j) = ((0 : ZMod m), j + 2 , -2 - j) := by
830830 rw [iterate_three_phases _ m (by omega)]
@@ -843,8 +843,8 @@ private theorem returnMap1_eq2 {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
843843 rw [zmod_natCast_m_sub_two (by omega : 2 ≤ m)]; ring
844844 have hdir3 : claudeDir ((2 : ZMod m) + ((m - 2 : ℕ) : ZMod m), j + 1 , -2 - j) 1 = 1 :=
845845 claudeDir_cycle1_s1_ni hm' _ hfib_last hi0
846- simp only [claudeStep, hdir3, bumpAt ]
847- refine Prod.ext ?_ (Prod.ext ?_ rfl) <;> rw [zmod_natCast_m_sub_two (by omega)] <;> ring
846+ simp only [hdir3]
847+ refine Prod.ext ?_ (Prod.ext ?_ rfl) <;> ( rw [zmod_natCast_m_sub_two (by omega)]; try ring)
848848
849849/-- Iterating the cycle 1 return map within a round: R₁^[ k ] (0, n, −n) = (−2k, n+k, k−n). -/
850850private theorem returnMap1_ne2_iter {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
@@ -965,7 +965,7 @@ private theorem claudeStep2_iter_bumpJ {m : ℕ} [NeZero m] (hm' : 1 < m)
965965
966966/-- Return map for cycle 2, generic case: j ≠ -1, i ≠ -2.
967967After m steps, (i, j, −i−j) ↦ (i+2, j, −(i+2)−j). -/
968- private theorem returnMap2_generic {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
968+ private theorem returnMap2_generic {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m)
969969 (i j : ZMod m) (hj : j ≠ -1 ) (hi : i ≠ -2 ) :
970970 (claudeStep 2 )^[m] (i, j, -i - j) = (i + 2 , j, -(i + 2 ) - j) := by
971971 rw [iterate_three_phases _ m (by omega)]
@@ -986,12 +986,12 @@ private theorem returnMap2_generic {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 <
986986 simp only [fiber, zmod_natCast_m_sub_two (by omega : 2 ≤ m)]; ring
987987 have hdir3 : claudeDir (i + 1 , j, -i - j + ((m - 2 : ℕ) : ZMod m)) 2 = 0 :=
988988 claudeDir_cycle2_s1 hm' _ hfib_last
989- simp only [claudeStep, hdir3, bumpAt ]
990- refine Prod.ext ?_ (Prod.ext rfl ?_) <;> rw [zmod_natCast_m_sub_two (by omega)] <;> ring
989+ simp only [hdir3]
990+ refine Prod.ext ?_ (Prod.ext rfl ?_) <;> ( rw [zmod_natCast_m_sub_two (by omega)]; try ring)
991991
992992/-- Return map for cycle 2, wrap case: j ≠ -1, i = -2.
993993After m steps, (−2, j, 2−j) ↦ (0, j−2, −(j−2)). -/
994- private theorem returnMap2_wrap {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
994+ private theorem returnMap2_wrap {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m)
995995 (j : ZMod m) (hj : j ≠ -1 ) :
996996 (claudeStep 2 )^[m] ((-2 : ZMod m), j, 2 - j) = ((0 : ZMod m), j - 2 , -(j - 2 )) := by
997997 rw [iterate_three_phases _ m (by omega)]
@@ -1008,12 +1008,12 @@ private theorem returnMap2_wrap {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
10081008 simp only [fiber, zmod_natCast_m_sub_two (by omega : 2 ≤ m)]; ring
10091009 have hdir3 : claudeDir ((-1 : ZMod m), j + ((m - 2 : ℕ) : ZMod m), 2 - j) 2 = 0 :=
10101010 claudeDir_cycle2_s1 hm' _ hfib_last
1011- simp only [claudeStep, hdir3, bumpAt ]
1012- refine Prod.ext ?_ (Prod.ext ?_ ?_) <;> rw [zmod_natCast_m_sub_two (by omega)] <;> ring
1011+ simp only [hdir3]
1012+ refine Prod.ext ?_ (Prod.ext ?_ ?_) <;> ( rw [zmod_natCast_m_sub_two (by omega)]; try ring)
10131013
10141014/-- Return map for cycle 2, transition case: j = -1, i ≠ -1.
10151015After m steps, (i, −1, 1−i) ↦ (i+1, −1, −i). -/
1016- private theorem returnMap2_transition {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
1016+ private theorem returnMap2_transition {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m)
10171017 (i : ZMod m) (hi : i ≠ -1 ) :
10181018 (claudeStep 2 )^[m] (i, -1 , 1 - i) = (i + 1 , -1 , -i) := by
10191019 rw [iterate_three_phases _ m (by omega)]
@@ -1030,12 +1030,12 @@ private theorem returnMap2_transition {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1
10301030 simp only [fiber, zmod_natCast_m_sub_two (by omega : 2 ≤ m)]; ring
10311031 have hdir3 : claudeDir (i, -1 , 2 - i + ((m - 2 : ℕ) : ZMod m)) 2 = 0 :=
10321032 claudeDir_cycle2_s1 hm' _ hfib_last
1033- simp only [claudeStep, hdir3, bumpAt ]
1034- refine Prod.ext ?_ (Prod.ext rfl ?_) <;> rw [zmod_natCast_m_sub_two (by omega)] <;> ring
1033+ simp only [hdir3]
1034+ refine Prod.ext ?_ (Prod.ext rfl ?_) <;> ( rw [zmod_natCast_m_sub_two (by omega)]; try ring)
10351035
10361036/-- Return map for cycle 2, transition wrap: j = -1, i = -1.
10371037After m steps, (−1, −1, 2) ↦ (0, −3, 3). -/
1038- private theorem returnMap2_transition_wrap {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m) :
1038+ private theorem returnMap2_transition_wrap {m : ℕ} [NeZero m] (_hm : Odd m) (hm' : 1 < m) :
10391039 (claudeStep 2 )^[m] ((-1 : ZMod m), -1 , 2 ) = ((0 : ZMod m), -3 , 3 ) := by
10401040 rw [iterate_three_phases _ m (by omega)]
10411041 -- Phase 1: j = -1, bump k → (-1, -1, 3)
@@ -1051,8 +1051,8 @@ private theorem returnMap2_transition_wrap {m : ℕ} [NeZero m] (hm : Odd m) (hm
10511051 simp only [fiber, zmod_natCast_m_sub_two (by omega : 2 ≤ m)]; ring
10521052 have hdir3 : claudeDir ((-1 : ZMod m), -1 + ((m - 2 : ℕ) : ZMod m), 3 ) 2 = 0 :=
10531053 claudeDir_cycle2_s1 hm' _ hfib_last
1054- simp only [claudeStep, hdir3, bumpAt ]
1055- refine Prod.ext ?_ (Prod.ext ?_ ?_) <;> rw [zmod_natCast_m_sub_two (by omega)] <;> ring
1054+ simp only [hdir3]
1055+ refine Prod.ext ?_ (Prod.ext ?_ ?_) <;> ( rw [zmod_natCast_m_sub_two (by omega)]; try ring)
10561056
10571057/-- 2 * (t : ℕ) ≠ -2 in ZMod m when t < m - 1. -/
10581058private theorem two_mul_ne_neg_two {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m)
@@ -1133,8 +1133,7 @@ private theorem returnMap2_jblock {m : ℕ} [NeZero m] (hm : Odd m) (hm' : 1 < m
11331133 ((0 : ZMod m), j - 2 , -(j - 2 )) := by
11341134 by_cases hj : j = -1
11351135 · subst hj
1136- simp only [neg_neg, show (-1 : ZMod m) - 2 = -3 from by ring,
1137- show -((-1 : ZMod m) - 2 ) = 3 from by ring]
1136+ simp only [neg_neg, show (-1 : ZMod m) - 2 = -3 from by ring]
11381137 exact returnMap2_jblock_eq hm hm'
11391138 · exact returnMap2_jblock_ne hm hm' j hj
11401139
0 commit comments