l3lab/ntp-mathlib huggingface dataset:
theorem lt_birthday_iff {x : PGame} {o : Ordinal} :
    o < x.birthday ↔
      (∃ i : x.LeftMoves, o ≤ (x.moveLeft i).birthday) ∨
        ∃ i : x.RightMoves, o ≤ (x.moveRight i).birthday := by
  constructor
  · 

Proof state:
case mp
x : PGame
o : Ordinal.{u_1}
⊢ o < birthday x → (∃ i, o ≤ birthday (moveLeft x i)) ∨ ∃ i, o ≤ birthday (moveRight x i)

Next tactic:
rw [birthday_def]
theorem lt_birthday_iff {x : PGame} {o : Ordinal} :
    o < x.birthday ↔
      (∃ i : x.LeftMoves, o ≤ (x.moveLeft i).birthday) ∨
        ∃ i : x.RightMoves, o ≤ (x.moveRight i).birthday := by
  constructor
  · rw [birthday_def]
    

Proof state:
case mp
x : PGame
o : Ordinal.{u_1}
⊢ o < max (lsub fun i => birthday (moveLeft x i)) (lsub fun i => birthday (moveRight x i)) →
    (∃ i, o ≤ birthday (moveLeft x i)) ∨ ∃ i, o ≤ birthday (moveRight x i)

Next tactic:
intro h
theorem lt_birthday_iff {x : PGame} {o : Ordinal} :
    o < x.birthday ↔
      (∃ i : x.LeftMoves, o ≤ (x.moveLeft i).birthday) ∨
        ∃ i : x.RightMoves, o ≤ (x.moveRight i).birthday := by
  constructor
  · rw [birthday_def]
    intro h
    

Proof state:
case mp
x : PGame
o : Ordinal.{u_1}
h : o < max (lsub fun i => birthday (moveLeft x i)) (lsub fun i => birthday (moveRight x i))
⊢ (∃ i, o ≤ birthday (moveLeft x i)) ∨ ∃ i, o ≤ birthday (moveRight x i)

Next tactic:
cases' lt_max_iff.1 h with h' h'
theorem lt_birthday_iff {x : PGame} {o : Ordinal} :
    o < x.birthday ↔
      (∃ i : x.LeftMoves, o ≤ (x.moveLeft i).birthday) ∨
        ∃ i : x.RightMoves, o ≤ (x.moveRight i).birthday := by
  constructor
  · rw [birthday_def]
    intro h
    cases' lt_max_iff.1 h with h' h'
    · 

Proof state:
case mp.inl
x : PGame
o : Ordinal.{u_1}
h : o < max (lsub fun i => birthday (moveLeft x i)) (lsub fun i => birthday (moveRight x i))
h' : o < lsub fun i => birthday (moveLeft x i)
⊢ (∃ i, o ≤ birthday (moveLeft x i)) ∨ ∃ i, o ≤ birthday (moveRight x i)

Next tactic:
left
theorem lt_birthday_iff {x : PGame} {o : Ordinal} :
    o < x.birthday ↔
      (∃ i : x.LeftMoves, o ≤ (x.moveLeft i).birthday) ∨
        ∃ i : x.RightMoves, o ≤ (x.moveRight i).birthday := by
  constructor
  · rw [birthday_def]
    intro h
    cases' lt_max_iff.1 h with h' h'
    · left
      

Proof state:
case mp.inl.h
x : PGame
o : Ordinal.{u_1}
h : o < max (lsub fun i => birthday (moveLeft x i)) (lsub fun i => birthday (moveRight x i))
h' : o < lsub fun i => birthday (moveLeft x i)
⊢ ∃ i, o ≤ birthday (moveLeft x i)

Next tactic:
rwa [lt_lsub_iff] at h'
theorem lt_birthday_iff {x : PGame} {o : Ordinal} :
    o < x.birthday ↔
      (∃ i : x.LeftMoves, o ≤ (x.moveLeft i).birthday) ∨
        ∃ i : x.RightMoves, o ≤ (x.moveRight i).birthday := by
  constructor
  · rw [birthday_def]
    intro h
    cases' lt_max_iff.1 h with h' h'
    · left
      rwa [lt_lsub_iff] at h'
    · 

Proof state:
case mp.inr
x : PGame
o : Ordinal.{u_1}
h : o < max (lsub fun i => birthday (moveLeft x i)) (lsub fun i => birthday (moveRight x i))
h' : o < lsub fun i => birthday (moveRight x i)
⊢ (∃ i, o ≤ birthday (moveLeft x i)) ∨ ∃ i, o ≤ birthday (moveRight x i)

Next tactic:
right
theorem lt_birthday_iff {x : PGame} {o : Ordinal} :
    o < x.birthday ↔
      (∃ i : x.LeftMoves, o ≤ (x.moveLeft i).birthday) ∨
        ∃ i : x.RightMoves, o ≤ (x.moveRight i).birthday := by
  constructor
  · rw [birthday_def]
    intro h
    cases' lt_max_iff.1 h with h' h'
    · left
      rwa [lt_lsub_iff] at h'
    · right
      

Proof state:
case mp.inr.h
x : PGame
o : Ordinal.{u_1}
h : o < max (lsub fun i => birthday (moveLeft x i)) (lsub fun i => birthday (moveRight x i))
h' : o < lsub fun i => birthday (moveRight x i)
⊢ ∃ i, o ≤ birthday (moveRight x i)

Next tactic:
rwa [lt_lsub_iff] at h'
theorem lt_birthday_iff {x : PGame} {o : Ordinal} :
    o < x.birthday ↔
      (∃ i : x.LeftMoves, o ≤ (x.moveLeft i).birthday) ∨
        ∃ i : x.RightMoves, o ≤ (x.moveRight i).birthday := by
  constructor
  · rw [birthday_def]
    intro h
    cases' lt_max_iff.1 h with h' h'
    · left
      rwa [lt_lsub_iff] at h'
    · right
      rwa [lt_lsub_iff] at h'
  · 

Proof state:
case mpr
x : PGame
o : Ordinal.{u_1}
⊢ ((∃ i, o ≤ birthday (moveLeft x i)) ∨ ∃ i, o ≤ birthday (moveRight x i)) → o < birthday x

Next tactic:
rintro (⟨i, hi⟩ | ⟨i, hi⟩)
theorem lt_birthday_iff {x : PGame} {o : Ordinal} :
    o < x.birthday ↔
      (∃ i : x.LeftMoves, o ≤ (x.moveLeft i).birthday) ∨
        ∃ i : x.RightMoves, o ≤ (x.moveRight i).birthday := by
  constructor
  · rw [birthday_def]
    intro h
    cases' lt_max_iff.1 h with h' h'
    · left
      rwa [lt_lsub_iff] at h'
    · right
      rwa [lt_lsub_iff] at h'
  · rintro (⟨i, hi⟩ | ⟨i, hi⟩)
    · 

Proof state:
case mpr.inl.intro
x : PGame
o : Ordinal.{u_1}
i : LeftMoves x
hi : o ≤ birthday (moveLeft x i)
⊢ o < birthday x

Next tactic:
exact hi.trans_lt (birthday_moveLeft_lt i)
theorem lt_birthday_iff {x : PGame} {o : Ordinal} :
    o < x.birthday ↔
      (∃ i : x.LeftMoves, o ≤ (x.moveLeft i).birthday) ∨
        ∃ i : x.RightMoves, o ≤ (x.moveRight i).birthday := by
  constructor
  · rw [birthday_def]
    intro h
    cases' lt_max_iff.1 h with h' h'
    · left
      rwa [lt_lsub_iff] at h'
    · right
      rwa [lt_lsub_iff] at h'
  · rintro (⟨i, hi⟩ | ⟨i, hi⟩)
    · exact hi.trans_lt (birthday_moveLeft_lt i)
    · 

Proof state:
case mpr.inr.intro
x : PGame
o : Ordinal.{u_1}
i : RightMoves x
hi : o ≤ birthday (moveRight x i)
⊢ o < birthday x

Next tactic:
exact hi.trans_lt (birthday_moveRight_lt i)
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    

Proof state:
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
⊢ birthday (PGame.mk xl xr xL xR) = birthday (PGame.mk yl yr yL yR)

Next tactic:
unfold birthday
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    

Proof state:
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
⊢ max (lsub fun i => birthday (xL i)) (lsub fun i => birthday (xR i)) =
    max (lsub fun i => birthday (yL i)) (lsub fun i => birthday (yR i))

Next tactic:
congr 1
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    

Proof state:
case e_a
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
⊢ (lsub fun i => birthday (xL i)) = lsub fun i => birthday (yL i)
case e_a
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
⊢ (lsub fun i => birthday (xR i)) = lsub fun i => birthday (yR i)

Next tactic:
all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      ext i; constructor
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      

Proof state:
case e_a
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
⊢ (lsub fun i => birthday (xL i)) = lsub fun i => birthday (yL i)

Next tactic:
apply lsub_eq_of_range_eq.{u, u, u}
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      

Proof state:
case e_a
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
⊢ (Set.range fun i => birthday (xL i)) = Set.range fun i => birthday (yL i)

Next tactic:
ext i
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      ext i; 

Proof state:
case e_a.h
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
i : Ordinal.{u}
⊢ (i ∈ Set.range fun i => birthday (xL i)) ↔ i ∈ Set.range fun i => birthday (yL i)

Next tactic:
constructor
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      

Proof state:
case e_a
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
⊢ (lsub fun i => birthday (xR i)) = lsub fun i => birthday (yR i)

Next tactic:
apply lsub_eq_of_range_eq.{u, u, u}
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      

Proof state:
case e_a
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
⊢ (Set.range fun i => birthday (xR i)) = Set.range fun i => birthday (yR i)

Next tactic:
ext i
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      ext i; 

Proof state:
case e_a.h
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
i : Ordinal.{u}
⊢ (i ∈ Set.range fun i => birthday (xR i)) ↔ i ∈ Set.range fun i => birthday (yR i)

Next tactic:
constructor
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      ext i; constructor
    

Proof state:
case e_a.h.mp
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
i : Ordinal.{u}
⊢ (i ∈ Set.range fun i => birthday (xL i)) → i ∈ Set.range fun i => birthday (yL i)
case e_a.h.mpr
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
i : Ordinal.{u}
⊢ (i ∈ Set.range fun i => birthday (yL i)) → i ∈ Set.range fun i => birthday (xL i)
case e_a.h.mp
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
i : Ordinal.{u}
⊢ (i ∈ Set.range fun i => birthday (xR i)) → i ∈ Set.range fun i => birthday (yR i)
case e_a.h.mpr
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
i : Ordinal.{u}
⊢ (i ∈ Set.range fun i => birthday (yR i)) → i ∈ Set.range fun i => birthday (xR i)

Next tactic:
all_goals rintro ⟨j, rfl⟩
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      ext i; constructor
    all_goals 

Proof state:
case e_a.h.mp
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
i : Ordinal.{u}
⊢ (i ∈ Set.range fun i => birthday (xL i)) → i ∈ Set.range fun i => birthday (yL i)

Next tactic:
rintro ⟨j, rfl⟩
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      ext i; constructor
    all_goals 

Proof state:
case e_a.h.mpr
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
i : Ordinal.{u}
⊢ (i ∈ Set.range fun i => birthday (yL i)) → i ∈ Set.range fun i => birthday (xL i)

Next tactic:
rintro ⟨j, rfl⟩
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      ext i; constructor
    all_goals 

Proof state:
case e_a.h.mp
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
i : Ordinal.{u}
⊢ (i ∈ Set.range fun i => birthday (xR i)) → i ∈ Set.range fun i => birthday (yR i)

Next tactic:
rintro ⟨j, rfl⟩
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      ext i; constructor
    all_goals 

Proof state:
case e_a.h.mpr
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
i : Ordinal.{u}
⊢ (i ∈ Set.range fun i => birthday (yR i)) → i ∈ Set.range fun i => birthday (xR i)

Next tactic:
rintro ⟨j, rfl⟩
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      ext i; constructor
    all_goals rintro ⟨j, rfl⟩
    · 

Proof state:
case e_a.h.mp.intro
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
j : xl
⊢ (fun i => birthday (xL i)) j ∈ Set.range fun i => birthday (yL i)

Next tactic:
exact ⟨_, (r.moveLeft j).birthday_congr.symm⟩
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      ext i; constructor
    all_goals rintro ⟨j, rfl⟩
    · exact ⟨_, (r.moveLeft j).birthday_congr.symm⟩
    · 

Proof state:
case e_a.h.mpr.intro
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
j : yl
⊢ (fun i => birthday (yL i)) j ∈ Set.range fun i => birthday (xL i)

Next tactic:
exact ⟨_, (r.moveLeftSymm j).birthday_congr⟩
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      ext i; constructor
    all_goals rintro ⟨j, rfl⟩
    · exact ⟨_, (r.moveLeft j).birthday_congr.symm⟩
    · exact ⟨_, (r.moveLeftSymm j).birthday_congr⟩
    · 

Proof state:
case e_a.h.mp.intro
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
j : xr
⊢ (fun i => birthday (xR i)) j ∈ Set.range fun i => birthday (yR i)

Next tactic:
exact ⟨_, (r.moveRight j).birthday_congr.symm⟩
theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩, r => by
    unfold birthday
    congr 1
    all_goals
      apply lsub_eq_of_range_eq.{u, u, u}
      ext i; constructor
    all_goals rintro ⟨j, rfl⟩
    · exact ⟨_, (r.moveLeft j).birthday_congr.symm⟩
    · exact ⟨_, (r.moveLeftSymm j).birthday_congr⟩
    · exact ⟨_, (r.moveRight j).birthday_congr.symm⟩
    · 

Proof state:
case e_a.h.mpr.intro
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
r : PGame.mk xl xr xL xR ≡r PGame.mk yl yr yL yR
j : yr
⊢ (fun i => birthday (yR i)) j ∈ Set.range fun i => birthday (xR i)

Next tactic:
exact ⟨_, (r.moveRightSymm j).birthday_congr⟩
@[simp]
theorem birthday_eq_zero {x : PGame} :
    birthday x = 0 ↔ IsEmpty x.LeftMoves ∧ IsEmpty x.RightMoves := by
  

Proof state:
x : PGame
⊢ birthday x = 0 ↔ IsEmpty (LeftMoves x) ∧ IsEmpty (RightMoves x)

Next tactic:
rw [birthday_def, max_eq_zero, lsub_eq_zero_iff, lsub_eq_zero_iff]
@[simp]
theorem birthday_zero : birthday 0 = 0 := by 

Proof state:
⊢ birthday 0 = 0

Next tactic:
simp [inferInstanceAs (IsEmpty PEmpty)]
@[simp]
theorem birthday_one : birthday 1 = 1 := by 

Proof state:
⊢ birthday 1 = 1

Next tactic:
rw [birthday_def]
@[simp]
theorem birthday_one : birthday 1 = 1 := by rw [birthday_def]; 

Proof state:
⊢ max (lsub fun i => birthday (moveLeft 1 i)) (lsub fun i => birthday (moveRight 1 i)) = 1

Next tactic:
simp
@[simp]
theorem birthday_star : birthday star = 1 := by 

Proof state:
⊢ birthday star = 1

Next tactic:
rw [birthday_def]
@[simp]
theorem birthday_star : birthday star = 1 := by rw [birthday_def]; 

Proof state:
⊢ max (lsub fun i => birthday (moveLeft star i)) (lsub fun i => birthday (moveRight star i)) = 1

Next tactic:
simp
@[simp]
theorem neg_birthday : ∀ x : PGame, (-x).birthday = x.birthday
  | ⟨xl, xr, xL, xR⟩ => by
    

Proof state:
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
⊢ birthday (-mk xl xr xL xR) = birthday (mk xl xr xL xR)

Next tactic:
rw [birthday_def, birthday_def, max_comm]
@[simp]
theorem neg_birthday : ∀ x : PGame, (-x).birthday = x.birthday
  | ⟨xl, xr, xL, xR⟩ => by
    rw [birthday_def, birthday_def, max_comm]
    

Proof state:
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
⊢ max (lsub fun i => birthday (moveRight (-mk xl xr xL xR) i)) (lsub fun i => birthday (moveLeft (-mk xl xr xL xR) i)) =
    max (lsub fun i => birthday (moveLeft (mk xl xr xL xR) i)) (lsub fun i => birthday (moveRight (mk xl xr xL xR) i))

Next tactic:
congr
@[simp]
theorem neg_birthday : ∀ x : PGame, (-x).birthday = x.birthday
  | ⟨xl, xr, xL, xR⟩ => by
    rw [birthday_def, birthday_def, max_comm]
    congr <;> 

Proof state:
case e_a.e_f
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
⊢ (fun i => birthday (moveRight (-mk xl xr xL xR) i)) = fun i => birthday (moveLeft (mk xl xr xL xR) i)

Next tactic:
funext
@[simp]
theorem neg_birthday : ∀ x : PGame, (-x).birthday = x.birthday
  | ⟨xl, xr, xL, xR⟩ => by
    rw [birthday_def, birthday_def, max_comm]
    congr <;> 

Proof state:
case e_a.e_f
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
⊢ (fun i => birthday (moveLeft (-mk xl xr xL xR) i)) = fun i => birthday (moveRight (mk xl xr xL xR) i)

Next tactic:
funext
@[simp]
theorem neg_birthday : ∀ x : PGame, (-x).birthday = x.birthday
  | ⟨xl, xr, xL, xR⟩ => by
    rw [birthday_def, birthday_def, max_comm]
    congr <;> funext <;> 

Proof state:
case e_a.e_f.h
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
x✝ : RightMoves (-mk xl xr xL xR)
⊢ birthday (moveRight (-mk xl xr xL xR) x✝) = birthday (moveLeft (mk xl xr xL xR) x✝)

Next tactic:
apply neg_birthday
@[simp]
theorem neg_birthday : ∀ x : PGame, (-x).birthday = x.birthday
  | ⟨xl, xr, xL, xR⟩ => by
    rw [birthday_def, birthday_def, max_comm]
    congr <;> funext <;> 

Proof state:
case e_a.e_f.h
xl xr : Type u_1
xL : xl → PGame
xR : xr → PGame
x✝ : LeftMoves (-mk xl xr xL xR)
⊢ birthday (moveLeft (-mk xl xr xL xR) x✝) = birthday (moveRight (mk xl xr xL xR) x✝)

Next tactic:
apply neg_birthday
@[simp]
theorem toPGame_birthday (o : Ordinal) : o.toPGame.birthday = o := by
  

Proof state:
o : Ordinal.{u_1}
⊢ birthday (toPGame o) = o

Next tactic:
induction' o using Ordinal.induction with o IH
@[simp]
theorem toPGame_birthday (o : Ordinal) : o.toPGame.birthday = o := by
  induction' o using Ordinal.induction with o IH
  

Proof state:
case h
o : Ordinal.{u_1}
IH : ∀ k < o, birthday (toPGame k) = k
⊢ birthday (toPGame o) = o

Next tactic:
rw [toPGame_def, PGame.birthday]
@[simp]
theorem toPGame_birthday (o : Ordinal) : o.toPGame.birthday = o := by
  induction' o using Ordinal.induction with o IH
  rw [toPGame_def, PGame.birthday]
  

Proof state:
case h
o : Ordinal.{u_1}
IH : ∀ k < o, birthday (toPGame k) = k
⊢ max (lsub fun i => birthday (toPGame (typein (fun x x_1 => x < x_1) i))) (lsub fun i => birthday (PEmpty.elim i)) = o

Next tactic:
simp only [lsub_empty, max_zero_right]
@[simp]
theorem toPGame_birthday (o : Ordinal) : o.toPGame.birthday = o := by
  induction' o using Ordinal.induction with o IH
  rw [toPGame_def, PGame.birthday]
  simp only [lsub_empty, max_zero_right]
  -- Porting note: was `nth_rw 1 [← lsub_typein o]`
  

Proof state:
case h
o : Ordinal.{u_1}
IH : ∀ k < o, birthday (toPGame k) = k
⊢ (lsub fun i => birthday (toPGame (typein (fun x x_1 => x < x_1) i))) = o

Next tactic:
conv_rhs => rw [← lsub_typein o]
@[simp]
theorem toPGame_birthday (o : Ordinal) : o.toPGame.birthday = o := by
  induction' o using Ordinal.induction with o IH
  rw [toPGame_def, PGame.birthday]
  simp only [lsub_empty, max_zero_right]
  -- Porting note: was `nth_rw 1 [← lsub_typein o]`
  conv_rhs => 

Proof state:
o : Ordinal.{u_1}
IH : ∀ k < o, birthday (toPGame k) = k
| o

Next tactic:
rw [← lsub_typein o]
@[simp]
theorem toPGame_birthday (o : Ordinal) : o.toPGame.birthday = o := by
  induction' o using Ordinal.induction with o IH
  rw [toPGame_def, PGame.birthday]
  simp only [lsub_empty, max_zero_right]
  -- Porting note: was `nth_rw 1 [← lsub_typein o]`
  conv_rhs => rw [← lsub_typein o]
  

Proof state:
case h
o : Ordinal.{u_1}
IH : ∀ k < o, birthday (toPGame k) = k
⊢ (lsub fun i => birthday (toPGame (typein (fun x x_1 => x < x_1) i))) = lsub (typein fun x x_1 => x < x_1)

Next tactic:
congr with x
@[simp]
theorem toPGame_birthday (o : Ordinal) : o.toPGame.birthday = o := by
  induction' o using Ordinal.induction with o IH
  rw [toPGame_def, PGame.birthday]
  simp only [lsub_empty, max_zero_right]
  -- Porting note: was `nth_rw 1 [← lsub_typein o]`
  conv_rhs => rw [← lsub_typein o]
  congr with x
  

Proof state:
case h.e_f.h
o : Ordinal.{u_1}
IH : ∀ k < o, birthday (toPGame k) = k
x : (Quotient.out o).α
⊢ birthday (toPGame (typein (fun x x_1 => x < x_1) x)) = typein (fun x x_1 => x < x_1) x

Next tactic:
exact IH _ (typein_lt_self x)
theorem le_birthday : ∀ x : PGame, x ≤ x.birthday.toPGame
  | ⟨xl, _, xL, _⟩ =>
    le_def.2
      ⟨fun i =>
        Or.inl ⟨toLeftMovesToPGame ⟨_, birthday_moveLeft_lt i⟩, by 

Proof state:
xl β✝ : Type u_1
xL : xl → PGame
a✝ : β✝ → PGame
i : LeftMoves (mk xl β✝ xL a✝)
⊢ moveLeft (mk xl β✝ xL a✝) i ≤
    moveLeft (toPGame (birthday (mk xl β✝ xL a✝)))
      (toLeftMovesToPGame
        { val := birthday (moveLeft (mk xl β✝ xL a✝) i),
          property := (_ : birthday (moveLeft (mk xl β✝ xL a✝) i) < birthday (mk xl β✝ xL a✝)) })

Next tactic:
simp [le_birthday (xL i)]
theorem neg_birthday_le : -x.birthday.toPGame ≤ x := by
  

Proof state:
a b x : PGame
⊢ -toPGame (birthday x) ≤ x

Next tactic:
simpa only [neg_birthday, ← neg_le_iff] using le_birthday (-x)
@[simp]
theorem birthday_add : ∀ x y : PGame.{u}, (x + y).birthday = x.birthday ♯ y.birthday
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩ => by
    

Proof state:
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ birthday (mk xl xr xL xR + mk yl yr yL yR) = birthday (mk xl xr xL xR) ♯ birthday (mk yl yr yL yR)

Next tactic:
rw [birthday_def, nadd_def]
@[simp]
theorem birthday_add : ∀ x y : PGame.{u}, (x + y).birthday = x.birthday ♯ y.birthday
  | ⟨xl, xr, xL, xR⟩, ⟨yl, yr, yL, yR⟩ => by
    rw [birthday_def, nadd_def]
    -- Porting note: `simp` doesn't apply
    

Proof state:
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ max (lsub fun i => birthday (moveLeft (mk xl xr xL xR + mk yl yr yL yR) i))
      (lsub fun i => birthday (moveRight (mk xl xr xL xR + mk yl yr yL yR) i)) =
    max (blsub (birthday (mk xl xr xL xR)) fun a' x => a' ♯ birthday (mk yl yr yL yR))
      (blsub (birthday (mk yl yr yL yR)) fun b' x => birthday (mk xl xr xL xR) ♯ b')

Next tactic:
erw [lsub_sum, lsub_sum]