l3lab/ntp-mathlib huggingface dataset:
theorem openEmbedding_of_continuous_injective_open {f : α → β} (h₁ : Continuous f)
    (h₂ : Injective f) (h₃ : IsOpenMap f) : OpenEmbedding f := by
  simp only [openEmbedding_iff_embedding_open, embedding_iff, inducing_iff_nhds, *, and_true_iff]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
f : α → β
h₁ : Continuous f
h₂ : Injective f
h₃ : IsOpenMap f
⊢ ∀ (a : α), 𝓝 a = comap f (𝓝 (f a))

Next tactic:
exact fun a =>
    le_antisymm (h₁.tendsto _).le_comap (@comap_map _ _ (𝓝 a) _ h₂ ▸ comap_mono (h₃.nhds_le _))
theorem OpenEmbedding.isOpenMap_iff {g : β → γ} {f : α → β} (hg : OpenEmbedding g) :
    IsOpenMap f ↔ IsOpenMap (g ∘ f) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
g : β → γ
f : α → β
hg : OpenEmbedding g
⊢ IsOpenMap f ↔ IsOpenMap (g ∘ f)

Next tactic:
simp_rw [isOpenMap_iff_nhds_le, ← map_map, comp, ← hg.map_nhds_eq, Filter.map_le_map_iff hg.inj]
theorem OpenEmbedding.of_comp_iff (f : α → β) {g : β → γ} (hg : OpenEmbedding g) :
    OpenEmbedding (g ∘ f) ↔ OpenEmbedding f := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
f : α → β
g : β → γ
hg : OpenEmbedding g
⊢ OpenEmbedding (g ∘ f) ↔ OpenEmbedding f

Next tactic:
simp only [openEmbedding_iff_continuous_injective_open, ← hg.isOpenMap_iff, ←
    hg.1.continuous_iff, hg.inj.of_comp_iff]
theorem ClosedEmbedding.closed_iff_image_closed (hf : ClosedEmbedding f) {s : Set α} :
    IsClosed s ↔ IsClosed (f '' s) :=
  ⟨hf.isClosedMap s, fun h => by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
f : α → β
hf : ClosedEmbedding f
s : Set α
h : IsClosed (f '' s)
⊢ IsClosed s

Next tactic:
rw [← preimage_image_eq s hf.inj]
theorem ClosedEmbedding.closed_iff_image_closed (hf : ClosedEmbedding f) {s : Set α} :
    IsClosed s ↔ IsClosed (f '' s) :=
  ⟨hf.isClosedMap s, fun h => by
    rw [← preimage_image_eq s hf.inj]
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
f : α → β
hf : ClosedEmbedding f
s : Set α
h : IsClosed (f '' s)
⊢ IsClosed (f ⁻¹' (f '' s))

Next tactic:
exact h.preimage hf.continuous
theorem ClosedEmbedding.closed_iff_preimage_closed (hf : ClosedEmbedding f) {s : Set β}
    (hs : s ⊆ range f) : IsClosed s ↔ IsClosed (f ⁻¹' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
f : α → β
hf : ClosedEmbedding f
s : Set β
hs : s ⊆ range f
⊢ IsClosed s ↔ IsClosed (f ⁻¹' s)

Next tactic:
rw [hf.closed_iff_image_closed, image_preimage_eq_of_subset hs]
theorem closedEmbedding_of_continuous_injective_closed (h₁ : Continuous f) (h₂ : Injective f)
    (h₃ : IsClosedMap f) : ClosedEmbedding f := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
f : α → β
h₁ : Continuous f
h₂ : Injective f
h₃ : IsClosedMap f
⊢ ClosedEmbedding f

Next tactic:
refine closedEmbedding_of_embedding_closed ⟨⟨?_⟩, h₂⟩ h₃
theorem closedEmbedding_of_continuous_injective_closed (h₁ : Continuous f) (h₂ : Injective f)
    (h₃ : IsClosedMap f) : ClosedEmbedding f := by
  refine closedEmbedding_of_embedding_closed ⟨⟨?_⟩, h₂⟩ h₃
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
f : α → β
h₁ : Continuous f
h₂ : Injective f
h₃ : IsClosedMap f
⊢ inst✝² = induced f inst✝¹

Next tactic:
refine h₁.le_induced.antisymm fun s hs => ?_
theorem closedEmbedding_of_continuous_injective_closed (h₁ : Continuous f) (h₂ : Injective f)
    (h₃ : IsClosedMap f) : ClosedEmbedding f := by
  refine closedEmbedding_of_embedding_closed ⟨⟨?_⟩, h₂⟩ h₃
  refine h₁.le_induced.antisymm fun s hs => ?_
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
f : α → β
h₁ : Continuous f
h₂ : Injective f
h₃ : IsClosedMap f
s : Set α
hs : IsOpen s
⊢ IsOpen s

Next tactic:
refine ⟨(f '' sᶜ)ᶜ, (h₃ _ hs.isClosed_compl).isOpen_compl, ?_⟩
theorem closedEmbedding_of_continuous_injective_closed (h₁ : Continuous f) (h₂ : Injective f)
    (h₃ : IsClosedMap f) : ClosedEmbedding f := by
  refine closedEmbedding_of_embedding_closed ⟨⟨?_⟩, h₂⟩ h₃
  refine h₁.le_induced.antisymm fun s hs => ?_
  refine ⟨(f '' sᶜ)ᶜ, (h₃ _ hs.isClosed_compl).isOpen_compl, ?_⟩
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : TopologicalSpace γ
f : α → β
h₁ : Continuous f
h₂ : Injective f
h₃ : IsClosedMap f
s : Set α
hs : IsOpen s
⊢ f ⁻¹' (f '' sᶜ)ᶜ = s

Next tactic:
rw [preimage_compl, preimage_image_eq _ h₂, compl_compl]
theorem turnBound_ne_zero_of_left_move {s t : S} (m : t ∈ l s) : turnBound s ≠ 0 := by
  

Proof state:
S : Type u
inst✝ : State S
s t : S
m : t ∈ l s
⊢ turnBound s ≠ 0

Next tactic:
intro h
theorem turnBound_ne_zero_of_left_move {s t : S} (m : t ∈ l s) : turnBound s ≠ 0 := by
  intro h
  

Proof state:
S : Type u
inst✝ : State S
s t : S
m : t ∈ l s
h : turnBound s = 0
⊢ False

Next tactic:
have t := left_bound m
theorem turnBound_ne_zero_of_left_move {s t : S} (m : t ∈ l s) : turnBound s ≠ 0 := by
  intro h
  have t := left_bound m
  

Proof state:
S : Type u
inst✝ : State S
s t✝ : S
m : t✝ ∈ l s
h : turnBound s = 0
t : turnBound t✝ < turnBound s
⊢ False

Next tactic:
rw [h] at t
theorem turnBound_ne_zero_of_left_move {s t : S} (m : t ∈ l s) : turnBound s ≠ 0 := by
  intro h
  have t := left_bound m
  rw [h] at t
  

Proof state:
S : Type u
inst✝ : State S
s t✝ : S
m : t✝ ∈ l s
h : turnBound s = 0
t : turnBound t✝ < 0
⊢ False

Next tactic:
exact Nat.not_succ_le_zero _ t
theorem turnBound_ne_zero_of_right_move {s t : S} (m : t ∈ r s) : turnBound s ≠ 0 := by
  

Proof state:
S : Type u
inst✝ : State S
s t : S
m : t ∈ r s
⊢ turnBound s ≠ 0

Next tactic:
intro h
theorem turnBound_ne_zero_of_right_move {s t : S} (m : t ∈ r s) : turnBound s ≠ 0 := by
  intro h
  

Proof state:
S : Type u
inst✝ : State S
s t : S
m : t ∈ r s
h : turnBound s = 0
⊢ False

Next tactic:
have t := right_bound m
theorem turnBound_ne_zero_of_right_move {s t : S} (m : t ∈ r s) : turnBound s ≠ 0 := by
  intro h
  have t := right_bound m
  

Proof state:
S : Type u
inst✝ : State S
s t✝ : S
m : t✝ ∈ r s
h : turnBound s = 0
t : turnBound t✝ < turnBound s
⊢ False

Next tactic:
rw [h] at t
theorem turnBound_ne_zero_of_right_move {s t : S} (m : t ∈ r s) : turnBound s ≠ 0 := by
  intro h
  have t := right_bound m
  rw [h] at t
  

Proof state:
S : Type u
inst✝ : State S
s t✝ : S
m : t✝ ∈ r s
h : turnBound s = 0
t : turnBound t✝ < 0
⊢ False

Next tactic:
exact Nat.not_succ_le_zero _ t
/-- Construct a `PGame` from a state and a (not necessarily optimal) bound on the number of
turns remaining.
-/
def ofStateAux : ∀ (n : ℕ) (s : S), turnBound s ≤ n → PGame
  | 0, s, h =>
    PGame.mk { t // t ∈ l s } { t // t ∈ r s }
      (fun t => by 

Proof state:
S : Type u
inst✝ : State S
s : S
h : turnBound s ≤ 0
t : { t // t ∈ l s }
⊢ PGame

Next tactic:
exfalso
/-- Construct a `PGame` from a state and a (not necessarily optimal) bound on the number of
turns remaining.
-/
def ofStateAux : ∀ (n : ℕ) (s : S), turnBound s ≤ n → PGame
  | 0, s, h =>
    PGame.mk { t // t ∈ l s } { t // t ∈ r s }
      (fun t => by exfalso; 

Proof state:
case h
S : Type u
inst✝ : State S
s : S
h : turnBound s ≤ 0
t : { t // t ∈ l s }
⊢ False

Next tactic:
exact turnBound_ne_zero_of_left_move t.2 (nonpos_iff_eq_zero.mp h)
/-- Construct a `PGame` from a state and a (not necessarily optimal) bound on the number of
turns remaining.
-/
def ofStateAux : ∀ (n : ℕ) (s : S), turnBound s ≤ n → PGame
  | 0, s, h =>
    PGame.mk { t // t ∈ l s } { t // t ∈ r s }
      (fun t => by exfalso; exact turnBound_ne_zero_of_left_move t.2 (nonpos_iff_eq_zero.mp h))
      fun t => by 

Proof state:
S : Type u
inst✝ : State S
s : S
h : turnBound s ≤ 0
t : { t // t ∈ r s }
⊢ PGame

Next tactic:
exfalso
/-- Construct a `PGame` from a state and a (not necessarily optimal) bound on the number of
turns remaining.
-/
def ofStateAux : ∀ (n : ℕ) (s : S), turnBound s ≤ n → PGame
  | 0, s, h =>
    PGame.mk { t // t ∈ l s } { t // t ∈ r s }
      (fun t => by exfalso; exact turnBound_ne_zero_of_left_move t.2 (nonpos_iff_eq_zero.mp h))
      fun t => by exfalso; 

Proof state:
case h
S : Type u
inst✝ : State S
s : S
h : turnBound s ≤ 0
t : { t // t ∈ r s }
⊢ False

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

Proof state:
S : Type u
inst✝ : State S
s : S
hn hm : turnBound s ≤ 0
⊢ ofStateAux 0 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]
    

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

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

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

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

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

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

Proof state:
case a.h
S : Type u
inst✝ : State S
s : S
hn 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 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)
    · 

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

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

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

Proof state:
case a.h
S : Type u
inst✝ : State S
s : S
hn 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
    

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

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

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