Theorem: SetTheory.PGame.grundyValue_nim_add_nim
File: Mathlib/SetTheory/Game/Nim.lean

tactic: induction' n using Nat.strong_induction_on with n hn generalizing m
state_before: n m : ℕ
⊢ (nim ↑n + nim ↑m).grundyValue = ↑(n ^^^ m)
state_after: case h
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
⊢ (nim ↑n + nim ↑m).grundyValue = ↑(n ^^^ m)

tactic: induction' m using Nat.strong_induction_on with m hm
state_before: case h
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
⊢ (nim ↑n + nim ↑m).grundyValue = ↑(n ^^^ m)
state_after: case h.h
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
⊢ (nim ↑n + nim ↑m).grundyValue = ↑(n ^^^ m)

tactic: rw [grundyValue_eq_mex_left]
state_before: case h.h
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
⊢ (nim ↑n + nim ↑m).grundyValue = ↑(n ^^^ m)
state_after: case h.h
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
⊢ (mex fun i => ((nim ↑n + nim ↑m).moveLeft i).grundyValue) = ↑(n ^^^ m)

tactic: refine (Ordinal.mex_le_of_ne.{u, u} fun i => ?_).antisymm
  (Ordinal.le_mex_of_forall fun ou hu => ?_)
state_before: case h.h
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
⊢ (mex fun i => ((nim ↑n + nim ↑m).moveLeft i).grundyValue) = ↑(n ^^^ m)
state_after: case h.h.refine_1
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
⊢ ((nim ↑n + nim ↑m).moveLeft i).grundyValue ≠ ↑(n ^^^ m)

case h.h.refine_2
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
ou : Ordinal.{u}
hu : ou < ↑(n ^^^ m)
⊢ ∃ i, ((nim ↑n + nim ↑m).moveLeft i).grundyValue = ou

tactic: refine fun a => leftMovesNimRecOn a fun ok hk => ?_
state_before: case h.h.refine_1.hr
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
⊢ ∀ (i : (nim ↑m).LeftMoves), ((nim ↑n + nim ↑m).moveLeft (toLeftMovesAdd (Sum.inr i))).grundyValue ≠ ↑(n ^^^ m)
state_after: case h.h.refine_1.hr
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
ok : Ordinal.{u}
hk : ok < ↑m
⊢ ((nim ↑n + nim ↑m).moveLeft (toLeftMovesAdd (Sum.inr (toLeftMovesNim ⟨ok, hk⟩)))).grundyValue ≠ ↑(n ^^^ m)

tactic: obtain ⟨k, rfl⟩ := Ordinal.lt_omega.1 (hk.trans (Ordinal.nat_lt_omega _))
state_before: case h.h.refine_1.hr
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
ok : Ordinal.{u}
hk : ok < ↑m
⊢ ((nim ↑n + nim ↑m).moveLeft (toLeftMovesAdd (Sum.inr (toLeftMovesNim ⟨ok, hk⟩)))).grundyValue ≠ ↑(n ^^^ m)
state_after: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : ↑k < ↑m
⊢ ((nim ↑n + nim ↑m).moveLeft (toLeftMovesAdd (Sum.inr (toLeftMovesNim ⟨↑k, hk⟩)))).grundyValue ≠ ↑(n ^^^ m)

tactic: simp only [add_moveLeft_inl, add_moveLeft_inr, moveLeft_nim', Equiv.symm_apply_apply]
state_before: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : ↑k < ↑m
⊢ ((nim ↑n + nim ↑m).moveLeft (toLeftMovesAdd (Sum.inr (toLeftMovesNim ⟨↑k, hk⟩)))).grundyValue ≠ ↑(n ^^^ m)
state_after: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : ↑k < ↑m
⊢ (nim ↑n + nim ↑k).grundyValue ≠ ↑(n ^^^ m)

tactic: rw [natCast_lt] at hk
state_before: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : ↑k < ↑m
⊢ (nim ↑n + nim ↑k).grundyValue ≠ ↑(n ^^^ m)
state_after: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : k < m
⊢ (nim ↑n + nim ↑k).grundyValue ≠ ↑(n ^^^ m)

tactic: first
| rw [hn _ hk]
| rw [hm _ hk]
state_before: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : k < m
⊢ (nim ↑n + nim ↑k).grundyValue ≠ ↑(n ^^^ m)
state_after: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : k < m
⊢ ↑(n ^^^ k) ≠ ↑(n ^^^ m)

tactic: refine fun h => hk.ne ?_
state_before: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : k < m
⊢ ↑(n ^^^ k) ≠ ↑(n ^^^ m)
state_after: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : k < m
h : ↑(n ^^^ k) = ↑(n ^^^ m)
⊢ k = m

tactic: rw [Ordinal.natCast_inj] at h
state_before: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : k < m
h : ↑(n ^^^ k) = ↑(n ^^^ m)
⊢ k = m
state_after: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : k < m
h : n ^^^ k = n ^^^ m
⊢ k = m

tactic: first
| rwa [Nat.xor_left_inj] at h
| rwa [Nat.xor_right_inj] at h
state_before: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : k < m
h : n ^^^ k = n ^^^ m
⊢ k = m
state_after: no goals

tactic: rw [hn _ hk]
state_before: case h.h.refine_1.hl.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑n).LeftMoves
k : ℕ
hk : k < n
⊢ (nim ↑k + nim ↑m).grundyValue ≠ ↑(n ^^^ m)
state_after: case h.h.refine_1.hl.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑n).LeftMoves
k : ℕ
hk : k < n
⊢ ↑(k ^^^ m) ≠ ↑(n ^^^ m)

tactic: rw [hm _ hk]
state_before: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : k < m
⊢ (nim ↑n + nim ↑k).grundyValue ≠ ↑(n ^^^ m)
state_after: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : k < m
⊢ ↑(n ^^^ k) ≠ ↑(n ^^^ m)

tactic: rwa [Nat.xor_left_inj] at h
state_before: case h.h.refine_1.hl.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑n).LeftMoves
k : ℕ
hk : k < n
h : k ^^^ m = n ^^^ m
⊢ k = n
state_after: no goals

tactic: rwa [Nat.xor_right_inj] at h
state_before: case h.h.refine_1.hr.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
i : (nim ↑n + nim ↑m).LeftMoves
a : (nim ↑m).LeftMoves
k : ℕ
hk : k < m
h : n ^^^ k = n ^^^ m
⊢ k = m
state_after: no goals

tactic: obtain ⟨u, rfl⟩ := Ordinal.lt_omega.1 (hu.trans (Ordinal.nat_lt_omega _))
state_before: case h.h.refine_2
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
ou : Ordinal.{u}
hu : ou < ↑(n ^^^ m)
⊢ ∃ i, ((nim ↑n + nim ↑m).moveLeft i).grundyValue = ou
state_after: case h.h.refine_2.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : ↑u < ↑(n ^^^ m)
⊢ ∃ i, ((nim ↑n + nim ↑m).moveLeft i).grundyValue = ↑u

tactic: replace hu := Ordinal.natCast_lt.1 hu
state_before: case h.h.refine_2.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : ↑u < ↑(n ^^^ m)
⊢ ∃ i, ((nim ↑n + nim ↑m).moveLeft i).grundyValue = ↑u
state_after: case h.h.refine_2.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
⊢ ∃ i, ((nim ↑n + nim ↑m).moveLeft i).grundyValue = ↑u

tactic: cases' Nat.lt_xor_cases hu with h h
state_before: case h.h.refine_2.intro
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
⊢ ∃ i, ((nim ↑n + nim ↑m).moveLeft i).grundyValue = ↑u
state_after: case h.h.refine_2.intro.inl
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
h : u ^^^ m < n
⊢ ∃ i, ((nim ↑n + nim ↑m).moveLeft i).grundyValue = ↑u

case h.h.refine_2.intro.inr
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
h : u ^^^ n < m
⊢ ∃ i, ((nim ↑n + nim ↑m).moveLeft i).grundyValue = ↑u

tactic: refine ⟨toLeftMovesAdd (Sum.inl <| toLeftMovesNim ⟨_, Ordinal.natCast_lt.2 h⟩), ?_⟩
state_before: case h.h.refine_2.intro.inl
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
h : u ^^^ m < n
⊢ ∃ i, ((nim ↑n + nim ↑m).moveLeft i).grundyValue = ↑u
state_after: case h.h.refine_2.intro.inl
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
h : u ^^^ m < n
⊢ ((nim ↑n + nim ↑m).moveLeft (toLeftMovesAdd (Sum.inl (toLeftMovesNim ⟨↑(u ^^^ m), ⋯⟩)))).grundyValue = ↑u

tactic: simp [Nat.xor_cancel_right, hn _ h]
state_before: case h.h.refine_2.intro.inl
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
h : u ^^^ m < n
⊢ ((nim ↑n + nim ↑m).moveLeft (toLeftMovesAdd (Sum.inl (toLeftMovesNim ⟨↑(u ^^^ m), ⋯⟩)))).grundyValue = ↑u
state_after: no goals

tactic: refine ⟨toLeftMovesAdd (Sum.inr <| toLeftMovesNim ⟨_, Ordinal.natCast_lt.2 h⟩), ?_⟩
state_before: case h.h.refine_2.intro.inr
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
h : u ^^^ n < m
⊢ ∃ i, ((nim ↑n + nim ↑m).moveLeft i).grundyValue = ↑u
state_after: case h.h.refine_2.intro.inr
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
h : u ^^^ n < m
⊢ ((nim ↑n + nim ↑m).moveLeft (toLeftMovesAdd (Sum.inr (toLeftMovesNim ⟨↑(u ^^^ n), ⋯⟩)))).grundyValue = ↑u

tactic: have : n ^^^ (u ^^^ n) = u := by rw [Nat.xor_comm u, Nat.xor_cancel_left]
state_before: case h.h.refine_2.intro.inr
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
h : u ^^^ n < m
⊢ ((nim ↑n + nim ↑m).moveLeft (toLeftMovesAdd (Sum.inr (toLeftMovesNim ⟨↑(u ^^^ n), ⋯⟩)))).grundyValue = ↑u
state_after: case h.h.refine_2.intro.inr
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
h : u ^^^ n < m
this : n ^^^ (u ^^^ n) = u
⊢ ((nim ↑n + nim ↑m).moveLeft (toLeftMovesAdd (Sum.inr (toLeftMovesNim ⟨↑(u ^^^ n), ⋯⟩)))).grundyValue = ↑u

tactic: simpa [hm _ h] using this
state_before: case h.h.refine_2.intro.inr
n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
h : u ^^^ n < m
this : n ^^^ (u ^^^ n) = u
⊢ ((nim ↑n + nim ↑m).moveLeft (toLeftMovesAdd (Sum.inr (toLeftMovesNim ⟨↑(u ^^^ n), ⋯⟩)))).grundyValue = ↑u
state_after: no goals

tactic: rw [Nat.xor_comm u, Nat.xor_cancel_left]
state_before: n : ℕ
hn : ∀ m < n, ∀ (m_1 : ℕ), (nim ↑m + nim ↑m_1).grundyValue = ↑(m ^^^ m_1)
m : ℕ
hm : ∀ m_1 < m, (nim ↑n + nim ↑m_1).grundyValue = ↑(n ^^^ m_1)
u : ℕ
hu : u < n ^^^ m
h : u ^^^ n < m
⊢ n ^^^ (u ^^^ n) = u
state_after: no goals