l3lab/ntp-mathlib huggingface dataset:
/-- Final functors preserve filteredness.

This can be seen as a generalization of `IsFiltered.of_right_adjoint` (which states that right
adjoints preserve filteredness), as right adjoints are always final, see `final_of_adjunction`.
-/
theorem IsFilteredOrEmpty.of_final (F : C ⥤ D) [Final F] [IsFilteredOrEmpty C] :
    IsFilteredOrEmpty D where
  cocone_objs X Y := ⟨F.obj (IsFiltered.max (Final.lift F X) (Final.lift F Y)),
    Final.homToLift F X ≫ F.map (IsFiltered.leftToMax _ _),
    ⟨Final.homToLift F Y ≫ F.map (IsFiltered.rightToMax _ _), trivial⟩⟩
  cocone_maps {X Y} f g := by
    let P : StructuredArrow X F → Prop := fun h => ∃ (Z : C) (q₁ : h.right ⟶ Z)
      (q₂ : Final.lift F Y ⟶ Z), h.hom ≫ F.map q₁ = f ≫ Final.homToLift F Y ≫ F.map q₂
    rsuffices ⟨Z, q₁, q₂, h⟩ : Nonempty (P (StructuredArrow.mk (g ≫ Final.homToLift F Y)))
    · refine' ⟨F.obj (IsFiltered.coeq q₁ q₂),
        Final.homToLift F Y ≫ F.map (q₁ ≫ IsFiltered.coeqHom q₁ q₂), _⟩
      conv_lhs => rw [IsFiltered.coeq_condition]
      simp only [F.map_comp, ← reassoc_of% h, StructuredArrow.mk_hom_eq_self, Category.assoc]
    have h₀ : P (StructuredArrow.mk (f ≫ Final.homToLift F Y)) := ⟨_, 𝟙 _, 𝟙 _, by simp⟩
    refine' isPreconnected_induction P _ _ h₀ _
    · rintro U V h ⟨Z, q₁, q₂, hq⟩
      obtain ⟨W, q₃, q₄, hq'⟩ := IsFiltered.span q₁ h.right
      refine' ⟨W, q₄, q₂ ≫ q₃, _⟩
      rw [F.map_comp, ← reassoc_of% hq, ← F.map_comp, hq', F.map_comp, StructuredArrow.w_assoc]
    · rintro U V h ⟨Z, q₁, q₂, hq⟩
      exact ⟨Z, h.right ≫ q₁, q₂, by 

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
D : Type u₂
inst✝² : Category.{v₂, u₂} D
F : C ⥤ D
inst✝¹ : Final F
inst✝ : IsFilteredOrEmpty C
X Y : D
f g : X ⟶ Y
P : StructuredArrow X F → Prop := fun h => ∃ Z q₁ q₂, h.hom ≫ F.map q₁ = f ≫ Final.homToLift F Y ≫ F.map q₂
h₀ : P (StructuredArrow.mk (f ≫ Final.homToLift F Y))
U V : StructuredArrow X F
h : U ⟶ V
Z : C
q₁ : V.right ⟶ Z
q₂ : Final.lift F Y ⟶ Z
hq : V.hom ≫ F.map q₁ = f ≫ Final.homToLift F Y ≫ F.map q₂
⊢ U.hom ≫ F.map (h.right ≫ q₁) = f ≫ Final.homToLift F Y ≫ F.map q₂

Next tactic:
simp only [F.map_comp, StructuredArrow.w_assoc, hq]
instance subsingleton_short (x : PGame) : Subsingleton (Short x) := by
  

Proof state:
x : PGame
⊢ Subsingleton (Short x)

Next tactic:
induction x with
  | mk xl xr xL xR =>
    constructor
    intro a b
    cases a; cases b
    congr!
instance subsingleton_short (x : PGame) : Subsingleton (Short x) := by
  induction x with
  

Proof state:
case mk
xl xr : Type ?u.934
xL : xl → PGame
xR : xr → PGame
a_ih✝¹ : ∀ (a : xl), Subsingleton (Short (xL a))
a_ih✝ : ∀ (a : xr), Subsingleton (Short (xR a))
⊢ Subsingleton (Short (mk xl xr xL xR))

Next tactic:
| mk xl xr xL xR =>
    constructor
    intro a b
    cases a; cases b
    congr!
instance subsingleton_short (x : PGame) : Subsingleton (Short x) := by
  induction x with
  | mk xl xr xL xR =>
    

Proof state:
case mk
xl xr : Type ?u.934
xL : xl → PGame
xR : xr → PGame
a_ih✝¹ : ∀ (a : xl), Subsingleton (Short (xL a))
a_ih✝ : ∀ (a : xr), Subsingleton (Short (xR a))
⊢ Subsingleton (Short (mk xl xr xL xR))

Next tactic:
constructor
instance subsingleton_short (x : PGame) : Subsingleton (Short x) := by
  induction x with
  | mk xl xr xL xR =>
    constructor
    

Proof state:
case mk.allEq
xl xr : Type ?u.934
xL : xl → PGame
xR : xr → PGame
a_ih✝¹ : ∀ (a : xl), Subsingleton (Short (xL a))
a_ih✝ : ∀ (a : xr), Subsingleton (Short (xR a))
⊢ ∀ (a b : Short (mk xl xr xL xR)), a = b

Next tactic:
intro a b
instance subsingleton_short (x : PGame) : Subsingleton (Short x) := by
  induction x with
  | mk xl xr xL xR =>
    constructor
    intro a b
    

Proof state:
case mk.allEq
xl xr : Type ?u.934
xL : xl → PGame
xR : xr → PGame
a_ih✝¹ : ∀ (a : xl), Subsingleton (Short (xL a))
a_ih✝ : ∀ (a : xr), Subsingleton (Short (xR a))
a b : Short (mk xl xr xL xR)
⊢ a = b

Next tactic:
cases a
instance subsingleton_short (x : PGame) : Subsingleton (Short x) := by
  induction x with
  | mk xl xr xL xR =>
    constructor
    intro a b
    cases a; 

Proof state:
case mk.allEq.mk
xl xr : Type ?u.988
xL : xl → PGame
xR : xr → PGame
a_ih✝¹ : ∀ (a : xl), Subsingleton (Short (xL a))
a_ih✝ : ∀ (a : xr), Subsingleton (Short (xR a))
b : Short (mk xl xr xL xR)
inst✝¹ : Fintype xl
inst✝ : Fintype xr
x✝¹ : (i : xl) → Short (xL i)
x✝ : (j : xr) → Short (xR j)
⊢ Short.mk x✝¹ x✝ = b

Next tactic:
cases b
instance subsingleton_short (x : PGame) : Subsingleton (Short x) := by
  induction x with
  | mk xl xr xL xR =>
    constructor
    intro a b
    cases a; cases b
    

Proof state:
case mk.allEq.mk.mk
xl xr : Type ?u.1173
xL : xl → PGame
xR : xr → PGame
a_ih✝¹ : ∀ (a : xl), Subsingleton (Short (xL a))
a_ih✝ : ∀ (a : xr), Subsingleton (Short (xR a))
inst✝³ : Fintype xl
inst✝² : Fintype xr
x✝³ : (i : xl) → Short (xL i)
x✝² : (j : xr) → Short (xR j)
inst✝¹ : Fintype xl
inst✝ : Fintype xr
x✝¹ : (i : xl) → Short (xL i)
x✝ : (j : xr) → Short (xR j)
⊢ Short.mk x✝³ x✝² = Short.mk x✝¹ x✝

Next tactic:
congr!
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      

Proof state:
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
a b : Short (mk xl xr xL xR)
⊢ a = b

Next tactic:
cases a
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; 

Proof state:
case mk
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
b : Short (mk xl xr xL xR)
inst✝¹ : Fintype xl
inst✝ : Fintype xr
x✝¹ : (i : xl) → Short (xL i)
x✝ : (j : xr) → Short (xR j)
⊢ Short.mk x✝¹ x✝ = b

Next tactic:
cases b
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      

Proof state:
case mk.mk
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
inst✝³ : Fintype xl
inst✝² : Fintype xr
x✝³ : (i : xl) → Short (xL i)
x✝² : (j : xr) → Short (xR j)
inst✝¹ : Fintype xl
inst✝ : Fintype xr
x✝¹ : (i : xl) → Short (xL i)
x✝ : (j : xr) → Short (xR j)
⊢ Short.mk x✝³ x✝² = Short.mk x✝¹ x✝

Next tactic:
congr!
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · 

Proof state:
case mk.mk.h.e'_5
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
inst✝³ : Fintype xl
inst✝² : Fintype xr
x✝³ : (i : xl) → Short (xL i)
x✝² : (j : xr) → Short (xR j)
inst✝¹ : Fintype xl
inst✝ : Fintype xr
x✝¹ : (i : xl) → Short (xL i)
x✝ : (j : xr) → Short (xR j)
⊢ x✝³ = x✝¹

Next tactic:
funext x
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · funext x
        

Proof state:
case mk.mk.h.e'_5.h
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
inst✝³ : Fintype xl
inst✝² : Fintype xr
x✝³ : (i : xl) → Short (xL i)
x✝² : (j : xr) → Short (xR j)
inst✝¹ : Fintype xl
inst✝ : Fintype xr
x✝¹ : (i : xl) → Short (xL i)
x✝ : (j : xr) → Short (xR j)
x : xl
⊢ x✝³ x = x✝¹ x

Next tactic:
apply @Subsingleton.elim _ (subsingleton_short_example (xL x))
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xL x))
        -- Decreasing goal in Lean 4 is `Subsequent (xL x) (mk α β L R)`
        -- where `α`, `β`, `L`, and `R` are fresh hypotheses only propositionally
        -- equal to `xl`, `xr`, `xL`, and `xR`.
        -- (In Lean 3 it was `(mk xl xr xL xR)` instead.)
      · 

Proof state:
case mk.mk.h.e'_6
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
inst✝³ : Fintype xl
inst✝² : Fintype xr
x✝³ : (i : xl) → Short (xL i)
x✝² : (j : xr) → Short (xR j)
inst✝¹ : Fintype xl
inst✝ : Fintype xr
x✝¹ : (i : xl) → Short (xL i)
x✝ : (j : xr) → Short (xR j)
⊢ x✝² = x✝

Next tactic:
funext x
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xL x))
        -- Decreasing goal in Lean 4 is `Subsequent (xL x) (mk α β L R)`
        -- where `α`, `β`, `L`, and `R` are fresh hypotheses only propositionally
        -- equal to `xl`, `xr`, `xL`, and `xR`.
        -- (In Lean 3 it was `(mk xl xr xL xR)` instead.)
      · funext x
        

Proof state:
case mk.mk.h.e'_6.h
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
inst✝³ : Fintype xl
inst✝² : Fintype xr
x✝³ : (i : xl) → Short (xL i)
x✝² : (j : xr) → Short (xR j)
inst✝¹ : Fintype xl
inst✝ : Fintype xr
x✝¹ : (i : xl) → Short (xL i)
x✝ : (j : xr) → Short (xR j)
x : xr
⊢ x✝² x = x✝ x

Next tactic:
apply @Subsingleton.elim _ (subsingleton_short_example (xR x))
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xL x))
        -- Decreasing goal in Lean 4 is `Subsequent (xL x) (mk α β L R)`
        -- where `α`, `β`, `L`, and `R` are fresh hypotheses only propositionally
        -- equal to `xl`, `xr`, `xL`, and `xR`.
        -- (In Lean 3 it was `(mk xl xr xL xR)` instead.)
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xR x))⟩
termination_by subsingleton_short_example x => x
-- We need to unify a bunch of hypotheses before `pgame_wf_tac` can work.
decreasing_by 

Proof state:
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
x✝⁵ : ∀ (y : PGame), (invImage (fun a => a) instWellFoundedRelationPGame).1 y (mk xl xr xL xR) → Subsingleton (Short y)
a b : Short (mk xl xr xL xR)
α β : Type u_1
L : α → PGame
R : β → PGame
x✝⁴ : ∀ (y : PGame), (invImage (fun a => a) instWellFoundedRelationPGame).1 y (mk α β L R) → Subsingleton (Short y)
h✝³ : mk xl xr xL xR = mk α β L R
α_eq✝¹ : xl = α
L✝² : xl → PGame
inst✝³ : Fintype xl
β_eq✝¹ : xr = β
R✝² : xr → PGame
inst✝² : Fintype xr
a_eq✝³ : HEq xL L✝²
x✝³ : (i : xl) → Short (xL i)
a_eq✝² : HEq xR R✝²
x✝² : (j : xr) → Short (xR j)
h✝² : HEq a (Short.mk x✝³ x✝²)
α✝ β✝ : Type u_1
L✝¹ : α✝ → PGame
R✝¹ : β✝ → PGame
h✝¹ : mk xl xr xL xR = mk α✝ β✝ L✝¹ R✝¹
α_eq✝ : xl = α✝
L✝ : xl → PGame
inst✝¹ : Fintype xl
β_eq✝ : xr = β✝
R✝ : xr → PGame
inst✝ : Fintype xr
a_eq✝¹ : HEq xL L✝
x✝¹ : (i : xl) → Short (xL i)
a_eq✝ : HEq xR R✝
x✝ : (j : xr) → Short (xR j)
h✝ : HEq b (Short.mk x✝¹ x✝)
x : xl
⊢ (invImage (fun a => a) instWellFoundedRelationPGame).1 (xL x) (mk α β L R)

Next tactic:
{
  subst_vars
  simp only [mk.injEq, heq_eq_eq, true_and] at *
  casesm* _ ∧ _
  subst_vars
  pgame_wf_tac
}
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xL x))
        -- Decreasing goal in Lean 4 is `Subsequent (xL x) (mk α β L R)`
        -- where `α`, `β`, `L`, and `R` are fresh hypotheses only propositionally
        -- equal to `xl`, `xr`, `xL`, and `xR`.
        -- (In Lean 3 it was `(mk xl xr xL xR)` instead.)
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xR x))⟩
termination_by subsingleton_short_example x => x
-- We need to unify a bunch of hypotheses before `pgame_wf_tac` can work.
decreasing_by {
  

Proof state:
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
x✝⁵ : ∀ (y : PGame), (invImage (fun a => a) instWellFoundedRelationPGame).1 y (mk xl xr xL xR) → Subsingleton (Short y)
a b : Short (mk xl xr xL xR)
α β : Type u_1
L : α → PGame
R : β → PGame
x✝⁴ : ∀ (y : PGame), (invImage (fun a => a) instWellFoundedRelationPGame).1 y (mk α β L R) → Subsingleton (Short y)
h✝³ : mk xl xr xL xR = mk α β L R
α_eq✝¹ : xl = α
L✝² : xl → PGame
inst✝³ : Fintype xl
β_eq✝¹ : xr = β
R✝² : xr → PGame
inst✝² : Fintype xr
a_eq✝³ : HEq xL L✝²
x✝³ : (i : xl) → Short (xL i)
a_eq✝² : HEq xR R✝²
x✝² : (j : xr) → Short (xR j)
h✝² : HEq a (Short.mk x✝³ x✝²)
α✝ β✝ : Type u_1
L✝¹ : α✝ → PGame
R✝¹ : β✝ → PGame
h✝¹ : mk xl xr xL xR = mk α✝ β✝ L✝¹ R✝¹
α_eq✝ : xl = α✝
L✝ : xl → PGame
inst✝¹ : Fintype xl
β_eq✝ : xr = β✝
R✝ : xr → PGame
inst✝ : Fintype xr
a_eq✝¹ : HEq xL L✝
x✝¹ : (i : xl) → Short (xL i)
a_eq✝ : HEq xR R✝
x✝ : (j : xr) → Short (xR j)
h✝ : HEq b (Short.mk x✝¹ x✝)
x : xl
⊢ (invImage (fun a => a) instWellFoundedRelationPGame).1 (xL x) (mk α β L R)

Next tactic:
subst_vars
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xL x))
        -- Decreasing goal in Lean 4 is `Subsequent (xL x) (mk α β L R)`
        -- where `α`, `β`, `L`, and `R` are fresh hypotheses only propositionally
        -- equal to `xl`, `xr`, `xL`, and `xR`.
        -- (In Lean 3 it was `(mk xl xr xL xR)` instead.)
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xR x))⟩
termination_by subsingleton_short_example x => x
-- We need to unify a bunch of hypotheses before `pgame_wf_tac` can work.
decreasing_by {
  subst_vars
  

Proof state:
α✝ β✝ : Type u_1
L✝ : α✝ → PGame
R✝ : β✝ → PGame
L xL : α✝ → PGame
inst✝³ : Fintype α✝
x✝⁵ : (i : α✝) → Short (xL i)
inst✝² : Fintype α✝
x✝⁴ : (i : α✝) → Short (xL i)
x : α✝
R xR : β✝ → PGame
inst✝¹ : Fintype β✝
x✝³ : (j : β✝) → Short (xR j)
inst✝ : Fintype β✝
x✝² : (j : β✝) → Short (xR j)
x✝¹ : ∀ (y : PGame), (invImage (fun a => a) instWellFoundedRelationPGame).1 y (mk α✝ β✝ L R) → Subsingleton (Short y)
x✝ : ∀ (y : PGame), (invImage (fun a => a) instWellFoundedRelationPGame).1 y (mk α✝ β✝ xL xR) → Subsingleton (Short y)
h✝¹ : mk α✝ β✝ xL xR = mk α✝ β✝ L R
h✝ : mk α✝ β✝ xL xR = mk α✝ β✝ L✝ R✝
⊢ (invImage (fun a => a) instWellFoundedRelationPGame).1 (xL x) (mk α✝ β✝ L R)

Next tactic:
simp only [mk.injEq, heq_eq_eq, true_and] at *
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xL x))
        -- Decreasing goal in Lean 4 is `Subsequent (xL x) (mk α β L R)`
        -- where `α`, `β`, `L`, and `R` are fresh hypotheses only propositionally
        -- equal to `xl`, `xr`, `xL`, and `xR`.
        -- (In Lean 3 it was `(mk xl xr xL xR)` instead.)
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xR x))⟩
termination_by subsingleton_short_example x => x
-- We need to unify a bunch of hypotheses before `pgame_wf_tac` can work.
decreasing_by {
  subst_vars
  simp only [mk.injEq, heq_eq_eq, true_and] at *
  

Proof state:
α✝ β✝ : Type u_1
L✝ : α✝ → PGame
R✝ : β✝ → PGame
L xL : α✝ → PGame
inst✝³ : Fintype α✝
x✝⁵ : (i : α✝) → Short (xL i)
inst✝² : Fintype α✝
x✝⁴ : (i : α✝) → Short (xL i)
x : α✝
R xR : β✝ → PGame
inst✝¹ : Fintype β✝
x✝³ : (j : β✝) → Short (xR j)
inst✝ : Fintype β✝
x✝² : (j : β✝) → Short (xR j)
x✝¹ : ∀ (y : PGame), InvImage WellFoundedRelation.rel (fun a => a) y (mk α✝ β✝ L R) → Subsingleton (Short y)
x✝ : ∀ (y : PGame), InvImage WellFoundedRelation.rel (fun a => a) y (mk α✝ β✝ xL xR) → Subsingleton (Short y)
h✝¹ : xL = L ∧ xR = R
h✝ : xL = L✝ ∧ xR = R✝
⊢ InvImage WellFoundedRelation.rel (fun a => a) (xL x) (mk α✝ β✝ L R)

Next tactic:
casesm* _ ∧ _
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xL x))
        -- Decreasing goal in Lean 4 is `Subsequent (xL x) (mk α β L R)`
        -- where `α`, `β`, `L`, and `R` are fresh hypotheses only propositionally
        -- equal to `xl`, `xr`, `xL`, and `xR`.
        -- (In Lean 3 it was `(mk xl xr xL xR)` instead.)
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xR x))⟩
termination_by subsingleton_short_example x => x
-- We need to unify a bunch of hypotheses before `pgame_wf_tac` can work.
decreasing_by {
  subst_vars
  simp only [mk.injEq, heq_eq_eq, true_and] at *
  casesm* _ ∧ _
  

Proof state:
case intro.intro
α✝ β✝ : Type u_1
L✝ : α✝ → PGame
R✝ : β✝ → PGame
L xL : α✝ → PGame
inst✝³ : Fintype α✝
x✝⁵ : (i : α✝) → Short (xL i)
inst✝² : Fintype α✝
x✝⁴ : (i : α✝) → Short (xL i)
x : α✝
R xR : β✝ → PGame
inst✝¹ : Fintype β✝
x✝³ : (j : β✝) → Short (xR j)
inst✝ : Fintype β✝
x✝² : (j : β✝) → Short (xR j)
x✝¹ : ∀ (y : PGame), InvImage WellFoundedRelation.rel (fun a => a) y (mk α✝ β✝ L R) → Subsingleton (Short y)
x✝ : ∀ (y : PGame), InvImage WellFoundedRelation.rel (fun a => a) y (mk α✝ β✝ xL xR) → Subsingleton (Short y)
left✝¹ : xL = L
right✝¹ : xR = R
left✝ : xL = L✝
right✝ : xR = R✝
⊢ InvImage WellFoundedRelation.rel (fun a => a) (xL x) (mk α✝ β✝ L R)

Next tactic:
subst_vars
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xL x))
        -- Decreasing goal in Lean 4 is `Subsequent (xL x) (mk α β L R)`
        -- where `α`, `β`, `L`, and `R` are fresh hypotheses only propositionally
        -- equal to `xl`, `xr`, `xL`, and `xR`.
        -- (In Lean 3 it was `(mk xl xr xL xR)` instead.)
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xR x))⟩
termination_by subsingleton_short_example x => x
-- We need to unify a bunch of hypotheses before `pgame_wf_tac` can work.
decreasing_by {
  subst_vars
  simp only [mk.injEq, heq_eq_eq, true_and] at *
  casesm* _ ∧ _
  subst_vars
  

Proof state:
case intro.intro
α✝ β✝ : Type u_1
xL : α✝ → PGame
inst✝³ : Fintype α✝
x✝⁵ : (i : α✝) → Short (xL i)
inst✝² : Fintype α✝
x✝⁴ : (i : α✝) → Short (xL i)
x : α✝
xR : β✝ → PGame
inst✝¹ : Fintype β✝
x✝³ : (j : β✝) → Short (xR j)
inst✝ : Fintype β✝
x✝² : (j : β✝) → Short (xR j)
x✝¹ x✝ : ∀ (y : PGame), InvImage WellFoundedRelation.rel (fun a => a) y (mk α✝ β✝ xL xR) → Subsingleton (Short y)
⊢ InvImage WellFoundedRelation.rel (fun a => a) (xL x) (mk α✝ β✝ xL xR)

Next tactic:
pgame_wf_tac
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xL x))
        -- Decreasing goal in Lean 4 is `Subsequent (xL x) (mk α β L R)`
        -- where `α`, `β`, `L`, and `R` are fresh hypotheses only propositionally
        -- equal to `xl`, `xr`, `xL`, and `xR`.
        -- (In Lean 3 it was `(mk xl xr xL xR)` instead.)
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xR x))⟩
termination_by subsingleton_short_example x => x
-- We need to unify a bunch of hypotheses before `pgame_wf_tac` can work.
decreasing_by 

Proof state:
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
x✝⁵ : ∀ (y : PGame), (invImage (fun a => a) instWellFoundedRelationPGame).1 y (mk xl xr xL xR) → Subsingleton (Short y)
a b : Short (mk xl xr xL xR)
α β : Type u_1
L : α → PGame
R : β → PGame
x✝⁴ : ∀ (y : PGame), (invImage (fun a => a) instWellFoundedRelationPGame).1 y (mk α β L R) → Subsingleton (Short y)
h✝³ : mk xl xr xL xR = mk α β L R
α_eq✝¹ : xl = α
L✝² : xl → PGame
inst✝³ : Fintype xl
β_eq✝¹ : xr = β
R✝² : xr → PGame
inst✝² : Fintype xr
a_eq✝³ : HEq xL L✝²
x✝³ : (i : xl) → Short (xL i)
a_eq✝² : HEq xR R✝²
x✝² : (j : xr) → Short (xR j)
h✝² : HEq a (Short.mk x✝³ x✝²)
α✝ β✝ : Type u_1
L✝¹ : α✝ → PGame
R✝¹ : β✝ → PGame
h✝¹ : mk xl xr xL xR = mk α✝ β✝ L✝¹ R✝¹
α_eq✝ : xl = α✝
L✝ : xl → PGame
inst✝¹ : Fintype xl
β_eq✝ : xr = β✝
R✝ : xr → PGame
inst✝ : Fintype xr
a_eq✝¹ : HEq xL L✝
x✝¹ : (i : xl) → Short (xL i)
a_eq✝ : HEq xR R✝
x✝ : (j : xr) → Short (xR j)
h✝ : HEq b (Short.mk x✝¹ x✝)
x : xr
⊢ (invImage (fun a => a) instWellFoundedRelationPGame).1 (xR x) (mk α β L R)

Next tactic:
{
  subst_vars
  simp only [mk.injEq, heq_eq_eq, true_and] at *
  casesm* _ ∧ _
  subst_vars
  pgame_wf_tac
}
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xL x))
        -- Decreasing goal in Lean 4 is `Subsequent (xL x) (mk α β L R)`
        -- where `α`, `β`, `L`, and `R` are fresh hypotheses only propositionally
        -- equal to `xl`, `xr`, `xL`, and `xR`.
        -- (In Lean 3 it was `(mk xl xr xL xR)` instead.)
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xR x))⟩
termination_by subsingleton_short_example x => x
-- We need to unify a bunch of hypotheses before `pgame_wf_tac` can work.
decreasing_by {
  

Proof state:
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
x✝⁵ : ∀ (y : PGame), (invImage (fun a => a) instWellFoundedRelationPGame).1 y (mk xl xr xL xR) → Subsingleton (Short y)
a b : Short (mk xl xr xL xR)
α β : Type u_1
L : α → PGame
R : β → PGame
x✝⁴ : ∀ (y : PGame), (invImage (fun a => a) instWellFoundedRelationPGame).1 y (mk α β L R) → Subsingleton (Short y)
h✝³ : mk xl xr xL xR = mk α β L R
α_eq✝¹ : xl = α
L✝² : xl → PGame
inst✝³ : Fintype xl
β_eq✝¹ : xr = β
R✝² : xr → PGame
inst✝² : Fintype xr
a_eq✝³ : HEq xL L✝²
x✝³ : (i : xl) → Short (xL i)
a_eq✝² : HEq xR R✝²
x✝² : (j : xr) → Short (xR j)
h✝² : HEq a (Short.mk x✝³ x✝²)
α✝ β✝ : Type u_1
L✝¹ : α✝ → PGame
R✝¹ : β✝ → PGame
h✝¹ : mk xl xr xL xR = mk α✝ β✝ L✝¹ R✝¹
α_eq✝ : xl = α✝
L✝ : xl → PGame
inst✝¹ : Fintype xl
β_eq✝ : xr = β✝
R✝ : xr → PGame
inst✝ : Fintype xr
a_eq✝¹ : HEq xL L✝
x✝¹ : (i : xl) → Short (xL i)
a_eq✝ : HEq xR R✝
x✝ : (j : xr) → Short (xR j)
h✝ : HEq b (Short.mk x✝¹ x✝)
x : xr
⊢ (invImage (fun a => a) instWellFoundedRelationPGame).1 (xR x) (mk α β L R)

Next tactic:
subst_vars
attribute [-instance] subsingleton_short in
theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)
  | mk xl xr xL xR =>
    ⟨fun a b => by
      cases a; cases b
      congr!
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xL x))
        -- Decreasing goal in Lean 4 is `Subsequent (xL x) (mk α β L R)`
        -- where `α`, `β`, `L`, and `R` are fresh hypotheses only propositionally
        -- equal to `xl`, `xr`, `xL`, and `xR`.
        -- (In Lean 3 it was `(mk xl xr xL xR)` instead.)
      · funext x
        apply @Subsingleton.elim _ (subsingleton_short_example (xR x))⟩
termination_by subsingleton_short_example x => x
-- We need to unify a bunch of hypotheses before `pgame_wf_tac` can work.
decreasing_by {
  subst_vars
  

Proof state:
α✝ β✝ : Type u_1
L✝ : α✝ → PGame
R✝ : β✝ → PGame
L xL : α✝ → PGame
inst✝³ : Fintype α✝
x✝⁵ : (i : α✝) → Short (xL i)
inst✝² : Fintype α✝
x✝⁴ : (i : α✝) → Short (xL i)
R xR : β✝ → PGame
inst✝¹ : Fintype β✝
x✝³ : (j : β✝) → Short (xR j)
inst✝ : Fintype β✝
x✝² : (j : β✝) → Short (xR j)
x : β✝
x✝¹ : ∀ (y : PGame), (invImage (fun a => a) instWellFoundedRelationPGame).1 y (mk α✝ β✝ L R) → Subsingleton (Short y)
x✝ : ∀ (y : PGame), (invImage (fun a => a) instWellFoundedRelationPGame).1 y (mk α✝ β✝ xL xR) → Subsingleton (Short y)
h✝¹ : mk α✝ β✝ xL xR = mk α✝ β✝ L R
h✝ : mk α✝ β✝ xL xR = mk α✝ β✝ L✝ R✝
⊢ (invImage (fun a => a) instWellFoundedRelationPGame).1 (xR x) (mk α✝ β✝ L R)

Next tactic:
simp only [mk.injEq, heq_eq_eq, true_and] at *