l3lab/ntp-mathlib huggingface dataset:
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
i : { t // t ∈ l s }
⊢ moveLeft
      (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
        ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
      i ≡r
    moveLeft (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim)
      ((Equiv.refl
          (LeftMoves
            (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
              ofStateAux n ↑t (_ : turnBound ↑t ≤ n))))
        i)

Next tactic:
exfalso
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      

Proof state:
case a.h
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
i : { t // t ∈ l s }
⊢ False

Next tactic:
exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hm)
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hm)
    · 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
⊢ (j :
      RightMoves
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
          ofStateAux n ↑t (_ : turnBound ↑t ≤ n))) →
    moveRight
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
          ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
        j ≡r
      moveRight (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim)
        ((Equiv.refl
            (RightMoves
              (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
                ofStateAux n ↑t (_ : turnBound ↑t ≤ n))))
          j)

Next tactic:
intro j
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hm)
    · intro j; 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
j :
  RightMoves
    (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
      ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
⊢ moveRight
      (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
        ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
      j ≡r
    moveRight (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim)
      ((Equiv.refl
          (RightMoves
            (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
              ofStateAux n ↑t (_ : turnBound ↑t ≤ n))))
        j)

Next tactic:
dsimp at j
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hm)
    · intro j; dsimp at j; 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
j : { t // t ∈ r s }
⊢ moveRight
      (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
        ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
      j ≡r
    moveRight (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim)
      ((Equiv.refl
          (RightMoves
            (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
              ofStateAux n ↑t (_ : turnBound ↑t ≤ n))))
        j)

Next tactic:
exfalso
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hm)
    · intro j; dsimp at j; exfalso
      

Proof state:
case a.h
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
j : { t // t ∈ r s }
⊢ False

Next tactic:
exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hm)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, n + 1, m + 1, hn, hm => by
    

Proof state:
S : Type u
inst✝ : State S
s : S
n m : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ m + 1
⊢ ofStateAux (n + 1) s hn ≡r ofStateAux (m + 1) s hm

Next tactic:
dsimp [PGame.ofStateAux]
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hm)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, n + 1, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    

Proof state:
S : Type u
inst✝ : State S
s : S
n m : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ m + 1
⊢ (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
      ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) ≡r
    mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux m ↑t (_ : turnBound ↑t ≤ m)) fun t =>
      ofStateAux m ↑t (_ : turnBound ↑t ≤ m)

Next tactic:
fconstructor
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hm)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, n + 1, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; 

Proof state:
case R
S : Type u
inst✝ : State S
s : S
n m : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ m + 1
⊢ RightMoves
      (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
        ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) ≃
    RightMoves
      (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux m ↑t (_ : turnBound ↑t ≤ m)) fun t =>
        ofStateAux m ↑t (_ : turnBound ↑t ≤ m))
case a
S : Type u
inst✝ : State S
s : S
n m : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ m + 1
⊢ (i :
      LeftMoves
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
          ofStateAux n ↑t (_ : turnBound ↑t ≤ n))) →
    moveLeft
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
          ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
        i ≡r
      moveLeft
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux m ↑t (_ : turnBound ↑t ≤ m)) fun t =>
          ofStateAux m ↑t (_ : turnBound ↑t ≤ m))
        ((Equiv.refl
            (LeftMoves
              (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
                ofStateAux n ↑t (_ : turnBound ↑t ≤ n))))
          i)
case a
S : Type u
inst✝ : State S
s : S
n m : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ m + 1
⊢ (j :
      RightMoves
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
          ofStateAux n ↑t (_ : turnBound ↑t ≤ n))) →
    moveRight
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
          ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
        j ≡r
      moveRight
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux m ↑t (_ : turnBound ↑t ≤ m)) fun t =>
          ofStateAux m ↑t (_ : turnBound ↑t ≤ m))
        (?R j)

Next tactic:
rfl
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hm)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, n + 1, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
n m : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ m + 1
⊢ (i :
      LeftMoves
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
          ofStateAux n ↑t (_ : turnBound ↑t ≤ n))) →
    moveLeft
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
          ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
        i ≡r
      moveLeft
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux m ↑t (_ : turnBound ↑t ≤ m)) fun t =>
          ofStateAux m ↑t (_ : turnBound ↑t ≤ m))
        ((Equiv.refl
            (LeftMoves
              (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
                ofStateAux n ↑t (_ : turnBound ↑t ≤ n))))
          i)

Next tactic:
intro i
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hm)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, n + 1, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i
      

Proof state:
case a
S : Type u
inst✝ : State S
s : S
n m : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ m + 1
i :
  LeftMoves
    (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
      ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
⊢ moveLeft
      (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
        ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
      i ≡r
    moveLeft
      (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux m ↑t (_ : turnBound ↑t ≤ m)) fun t =>
        ofStateAux m ↑t (_ : turnBound ↑t ≤ m))
      ((Equiv.refl
          (LeftMoves
            (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
              ofStateAux n ↑t (_ : turnBound ↑t ≤ n))))
        i)

Next tactic:
apply ofStateAuxRelabelling
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hm)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, n + 1, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i
      apply ofStateAuxRelabelling
    · 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
n m : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ m + 1
⊢ (j :
      RightMoves
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
          ofStateAux n ↑t (_ : turnBound ↑t ≤ n))) →
    moveRight
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
          ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
        j ≡r
      moveRight
        (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux m ↑t (_ : turnBound ↑t ≤ m)) fun t =>
          ofStateAux m ↑t (_ : turnBound ↑t ≤ m))
        ((Equiv.refl
            (RightMoves
              (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
                ofStateAux n ↑t (_ : turnBound ↑t ≤ n))))
          j)

Next tactic:
intro j
/-- Two different (valid) turn bounds give equivalent games. -/
def ofStateAuxRelabelling :
    ∀ (s : S) (n m : ℕ) (hn : turnBound s ≤ n) (hm : turnBound s ≤ m),
      Relabelling (ofStateAux n s hn) (ofStateAux m s hm)
  | s, 0, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, 0, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
  | s, n + 1, 0, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i; dsimp at i; exfalso
      exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hm)
    · intro j; dsimp at j; exfalso
      exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hm)
  | s, n + 1, m + 1, hn, hm => by
    dsimp [PGame.ofStateAux]
    fconstructor; rfl; rfl
    · intro i
      apply ofStateAuxRelabelling
    · intro j
      

Proof state:
case a
S : Type u
inst✝ : State S
s : S
n m : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ m + 1
j :
  RightMoves
    (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
      ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
⊢ moveRight
      (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
        ofStateAux n ↑t (_ : turnBound ↑t ≤ n))
      j ≡r
    moveRight
      (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux m ↑t (_ : turnBound ↑t ≤ m)) fun t =>
        ofStateAux m ↑t (_ : turnBound ↑t ≤ m))
      ((Equiv.refl
          (RightMoves
            (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => ofStateAux n ↑t (_ : turnBound ↑t ≤ n)) fun t =>
              ofStateAux n ↑t (_ : turnBound ↑t ≤ n))))
        j)

Next tactic:
apply ofStateAuxRelabelling