rw [Function.iterate_eq_iterate_iff_of_lt_minimalPeriod] at heq
case left
a b : ℕ
heq : next^[a] (0, 0) = next^[b] (0, 0)
⊢ a = b
case left
a b : ℕ
heq : a = b
⊢ a = b

case left.hm
a b : ℕ
heq : next^[a] (0, 0) = next^[b] (0, 0)
⊢ a < Function.minimalPeriod next (0, 0)

case left.hn
a b : ℕ
heq : next^[a] (0, 0) = next^[b] (0, 0)
⊢ b < Function.minimalPeriod next (0, 0)