Theorem: SetTheory.PGame.birthday_add
File: Mathlib/SetTheory/Game/Birthday.lean

Proof steps:
state_before: a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ (mk xl xr xL xR + mk yl yr yL yR).birthday = (mk xl xr xL xR).birthday ♯ (mk yl yr yL yR).birthday
state_after: 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 => ((mk xl xr xL xR + mk yl yr yL yR).moveLeft i).birthday)
      (lsub fun i => ((mk xl xr xL xR + mk yl yr yL yR).moveRight i).birthday) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
tactic: rw [birthday_def, nadd_def]
state_before: 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 => ((mk xl xr xL xR + mk yl yr yL yR).moveLeft i).birthday)
      (lsub fun i => ((mk xl xr xL xR + mk yl yr yL yR).moveRight i).birthday) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
state_after: 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
      (max (lsub fun a => ((mk xl xr xL xR + mk yl yr yL yR).moveLeft (Sum.inl a)).birthday)
        (lsub fun b => ((mk xl xr xL xR + mk yl yr yL yR).moveLeft (Sum.inr b)).birthday))
      (max (lsub fun a => ((mk xl xr xL xR + mk yl yr yL yR).moveRight (Sum.inl a)).birthday)
        (lsub fun b => ((mk xl xr xL xR + mk yl yr yL yR).moveRight (Sum.inr b)).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
tactic: erw [lsub_sum, lsub_sum]
state_before: 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
      (max (lsub fun a => ((mk xl xr xL xR + mk yl yr yL yR).moveLeft (Sum.inl a)).birthday)
        (lsub fun b => ((mk xl xr xL xR + mk yl yr yL yR).moveLeft (Sum.inr b)).birthday))
      (max (lsub fun a => ((mk xl xr xL xR + mk yl yr yL yR).moveRight (Sum.inl a)).birthday)
        (lsub fun b => ((mk xl xr xL xR + mk yl yr yL yR).moveRight (Sum.inr b)).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
state_after: 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 (max (lsub fun a => (xL a + mk yl yr yL yR).birthday) (lsub fun b => (mk xl xr xL xR + yL b).birthday))
      (max (lsub fun a => (xR a + mk yl yr yL yR).birthday) (lsub fun b => (mk xl xr xL xR + yR b).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
tactic: simp only [lsub_sum, mk_add_moveLeft_inl, moveLeft_mk, mk_add_moveLeft_inr,
      mk_add_moveRight_inl, moveRight_mk, mk_add_moveRight_inr]
state_before: 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 (max (lsub fun a => (xL a + mk yl yr yL yR).birthday) (lsub fun b => (mk xl xr xL xR + yL b).birthday))
      (max (lsub fun a => (xR a + mk yl yr yL yR).birthday) (lsub fun b => (mk xl xr xL xR + yR b).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
state_after: 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 (max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday) (lsub fun b => (mk xl xr xL xR + yL b).birthday))
      (max (lsub fun a => (xR a + mk yl yr yL yR).birthday) (lsub fun b => (mk xl xr xL xR + yR b).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
tactic: conv_lhs => left; left; right; intro a; rw [birthday_add (xL a) ⟨yl, yr, yL, yR⟩]
state_before: 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 (max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday) (lsub fun b => (mk xl xr xL xR + yL b).birthday))
      (max (lsub fun a => (xR a + mk yl yr yL yR).birthday) (lsub fun b => (mk xl xr xL xR + yR b).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
state_after: 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
      (max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
        (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday))
      (max (lsub fun a => (xR a + mk yl yr yL yR).birthday) (lsub fun b => (mk xl xr xL xR + yR b).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
tactic: conv_lhs => left; right; right; intro b; rw [birthday_add ⟨xl, xr, xL, xR⟩ (yL b)]
state_before: 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
      (max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
        (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday))
      (max (lsub fun a => (xR a + mk yl yr yL yR).birthday) (lsub fun b => (mk xl xr xL xR + yR b).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
state_after: 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
      (max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
        (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday))
      (max (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday)
        (lsub fun b => (mk xl xr xL xR + yR b).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
tactic: conv_lhs => right; left; right; intro a; rw [birthday_add (xR a) ⟨yl, yr, yL, yR⟩]
state_before: 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
      (max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
        (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday))
      (max (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday)
        (lsub fun b => (mk xl xr xL xR + yR b).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
state_after: 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
      (max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
        (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday))
      (max (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday)
        (lsub fun b => (mk xl xr xL xR).birthday ♯ (yR b).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
tactic: conv_lhs => right; right; right; intro b; rw [birthday_add ⟨xl, xr, xL, xR⟩ (yR b)]
state_before: 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
      (max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
        (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday))
      (max (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday)
        (lsub fun b => (mk xl xr xL xR).birthday ♯ (yR b).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
state_after: 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
      (max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
        (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday))
      (max (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday)
        (lsub fun b => (mk xl xr xL xR).birthday ♯ (yR b).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
tactic: rw [max_max_max_comm]
state_before: 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
      (max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
        (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday))
      (max (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday)
        (lsub fun b => (mk xl xr xL xR).birthday ♯ (yR b).birthday)) =
    max ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday)
      ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b')
state_after: case e_a.a
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 a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
      (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday) ≤
    (mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday

case e_a.a
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday) ≤
    max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
      (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday)

case e_a.a
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 b => (mk xl xr xL xR).birthday ♯ (yL b).birthday)
      (lsub fun b => (mk xl xr xL xR).birthday ♯ (yR b).birthday) ≤
    (mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b'

case e_a.a
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b') ≤
    max (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday)
      (lsub fun b => (mk xl xr xL xR).birthday ♯ (yR b).birthday)
tactic: congr <;> apply le_antisymm
state_before: case e_a.a
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 a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
      (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday) ≤
    (mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday

case e_a.a
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday) ≤
    max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
      (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday)

case e_a.a
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 b => (mk xl xr xL xR).birthday ♯ (yL b).birthday)
      (lsub fun b => (mk xl xr xL xR).birthday ♯ (yR b).birthday) ≤
    (mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b'

case e_a.a
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b') ≤
    max (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday)
      (lsub fun b => (mk xl xr xL xR).birthday ♯ (yR b).birthday)
state_after: case e_a.a
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday) ≤
    max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
      (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday)

case e_a.a
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b') ≤
    max (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday)
      (lsub fun b => (mk xl xr xL xR).birthday ♯ (yR b).birthday)
tactic: any_goals
      exact
        max_le_iff.2
          ⟨lsub_le_iff.2 fun i => lt_blsub _ _ (birthday_moveLeft_lt _),
            lsub_le_iff.2 fun i => lt_blsub _ _ (birthday_moveRight_lt _)⟩
state_before: case e_a.a
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ ((mk xl xr xL xR).birthday.blsub fun a' x => a' ♯ (mk yl yr yL yR).birthday) ≤
    max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
      (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday)

case e_a.a
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
⊢ ((mk yl yr yL yR).birthday.blsub fun b' x => (mk xl xr xL xR).birthday ♯ b') ≤
    max (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday)
      (lsub fun b => (mk xl xr xL xR).birthday ♯ (yR b).birthday)
state_after: case e_a.a.inl.intro
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
i : Ordinal.{u}
hi : i < (mk xl xr xL xR).birthday
j : (mk xl xr xL xR).LeftMoves
hj : i ≤ ((mk xl xr xL xR).moveLeft j).birthday
⊢ i ♯ (mk yl yr yL yR).birthday <
    max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
      (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday)

case e_a.a.inr.intro
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
i : Ordinal.{u}
hi : i < (mk xl xr xL xR).birthday
j : (mk xl xr xL xR).RightMoves
hj : i ≤ ((mk xl xr xL xR).moveRight j).birthday
⊢ i ♯ (mk yl yr yL yR).birthday <
    max (lsub fun a => (xL a).birthday ♯ (mk yl yr yL yR).birthday)
      (lsub fun a => (xR a).birthday ♯ (mk yl yr yL yR).birthday)

case e_a.a.inl.intro
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
i : Ordinal.{u}
hi : i < (mk yl yr yL yR).birthday
j : (mk yl yr yL yR).LeftMoves
hj : i ≤ ((mk yl yr yL yR).moveLeft j).birthday
⊢ (mk xl xr xL xR).birthday ♯ i <
    max (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday)
      (lsub fun b => (mk xl xr xL xR).birthday ♯ (yR b).birthday)

case e_a.a.inr.intro
a b x : PGame
xl xr : Type u
xL : xl → PGame
xR : xr → PGame
yl yr : Type u
yL : yl → PGame
yR : yr → PGame
i : Ordinal.{u}
hi : i < (mk yl yr yL yR).birthday
j : (mk yl yr yL yR).RightMoves
hj : i ≤ ((mk yl yr yL yR).moveRight j).birthday
⊢ (mk xl xr xL xR).birthday ♯ i <
    max (lsub fun b => (mk xl xr xL xR).birthday ♯ (yL b).birthday)
      (lsub fun b => (mk xl xr xL xR).birthday ♯ (yR b).birthday)
tactic: all_goals
      refine blsub_le_iff.2 fun i hi => ?_
      rcases lt_birthday_iff.1 hi with (⟨j, hj⟩ | ⟨j, hj⟩)