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; 

Proof state:
case R
S : Type u
inst✝ : State S
s : S
m : ℕ
hn : turnBound s ≤ 0
hm : turnBound s ≤ m + 1
⊢ RightMoves (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim) ≃
    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
m : ℕ
hn : turnBound s ≤ 0
hm : turnBound s ≤ m + 1
⊢ (i : LeftMoves (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim)) →
    moveLeft (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim) 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 => (_ : False).elim) fun t => (_ : False).elim)))
          i)
case a
S : Type u
inst✝ : State S
s : S
m : ℕ
hn : turnBound s ≤ 0
hm : turnBound s ≤ m + 1
⊢ (j : RightMoves (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim)) →
    moveRight (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim) 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
    · 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
m : ℕ
hn : turnBound s ≤ 0
hm : turnBound s ≤ m + 1
⊢ (i : LeftMoves (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim)) →
    moveLeft (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim) 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 => (_ : False).elim) fun t => (_ : False).elim)))
          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; 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
m : ℕ
hn : turnBound s ≤ 0
hm : turnBound s ≤ m + 1
i : LeftMoves (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim)
⊢ moveLeft (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim) 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 => (_ : False).elim) fun t => (_ : False).elim)))
        i)

Next tactic:
dsimp at 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; 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
m : ℕ
hn : turnBound s ≤ 0
hm : turnBound s ≤ m + 1
i : { t // t ∈ l s }
⊢ moveLeft (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim) 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 => (_ : False).elim) fun t => (_ : False).elim)))
        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
      

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

Next tactic:
exact turnBound_ne_zero_of_left_move i.2 (nonpos_iff_eq_zero.mp hn)
/-- 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)
    · 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
m : ℕ
hn : turnBound s ≤ 0
hm : turnBound s ≤ m + 1
⊢ (j : RightMoves (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim)) →
    moveRight (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim) 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 => (_ : False).elim) fun t => (_ : False).elim)))
          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; 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
m : ℕ
hn : turnBound s ≤ 0
hm : turnBound s ≤ m + 1
j : RightMoves (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim)
⊢ moveRight (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim) 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 => (_ : False).elim) fun t => (_ : False).elim)))
        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; 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
m : ℕ
hn : turnBound s ≤ 0
hm : turnBound s ≤ m + 1
j : { t // t ∈ r s }
⊢ moveRight (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim) 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 => (_ : False).elim) fun t => (_ : False).elim)))
        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
      

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

Next tactic:
exact turnBound_ne_zero_of_right_move j.2 (nonpos_iff_eq_zero.mp hn)
/-- 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
    

Proof state:
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
⊢ ofStateAux (n + 1) s hn ≡r ofStateAux 0 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]
    

Proof state:
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
⊢ (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 => (_ : False).elim) fun t => (_ : False).elim

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; 

Proof state:
case L
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
⊢ 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)) ≃
    LeftMoves (mk { t // t ∈ l s } { t // t ∈ r s } (fun t => (_ : False).elim) fun t => (_ : False).elim)
case R
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
⊢ 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 => (_ : False).elim) fun t => (_ : False).elim)
case a
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
⊢ (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 => (_ : False).elim) fun t => (_ : False).elim) (?L i)
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) (?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; 

Proof state:
case R
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
⊢ 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 => (_ : False).elim) fun t => (_ : False).elim)
case a
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
⊢ (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 => (_ : 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)
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) (?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
    · 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
⊢ (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 => (_ : 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:
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; 

Proof state:
case a
S : Type u
inst✝ : State S
s : S
n : ℕ
hn : turnBound s ≤ n + 1
hm : turnBound s ≤ 0
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 => (_ : 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:
dsimp at i