Theorem: Relation.cutExpand_fibration
File: Mathlib/Logic/Hydra.lean

tactic: rintro ⟨s₁, s₂⟩ s ⟨t, a, hr, he⟩
state_before: α : Type u_1
r✝ r : α → α → Prop
⊢ Fibration (GameAdd (CutExpand r) (CutExpand r)) (CutExpand r) fun s => s.fst + s.snd

tactic: dsimp at he ⊢
state_before: case mk.intro.intro.intro
α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = (fun s => s.fst + s.snd) (s₁, s₂) + t
⊢ ∃ a', GameAdd (CutExpand r) (CutExpand r) a' (s₁, s₂) ∧ (fun s => s.fst + s.snd) a' = s

tactic: obtain ⟨ha, hb⟩ := add_singleton_eq_iff.1 he
state_before: case mk.intro.intro.intro
α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = s₁ + s₂ + t
⊢ ∃ a', GameAdd (CutExpand r) (CutExpand r) a' (s₁, s₂) ∧ a'.fst + a'.snd = s

tactic: rw [hb]
state_before: case mk.intro.intro.intro.intro
α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = s₁ + s₂ + t
ha : a ∈ s₁ + s₂ + t
hb : s = erase (s₁ + s₂ + t) a
⊢ ∃ a', GameAdd (CutExpand r) (CutExpand r) a' (s₁, s₂) ∧ a'.fst + a'.snd = s

tactic: rw [add_assoc, mem_add] at ha
state_before: case mk.intro.intro.intro.intro
α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = s₁ + s₂ + t
ha : a ∈ s₁ + s₂ + t
hb : s = erase (s₁ + s₂ + t) a
⊢ ∃ a', GameAdd (CutExpand r) (CutExpand r) a' (s₁, s₂) ∧ a'.fst + a'.snd = erase (s₁ + s₂ + t) a

α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = s₁ + s₂ + t
⊢ DecidableEq α

tactic: obtain h | h := ha
state_before: case mk.intro.intro.intro.intro
α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = s₁ + s₂ + t
ha : a ∈ s₁ ∨ a ∈ s₂ + t
hb : s = erase (s₁ + s₂ + t) a
⊢ ∃ a', GameAdd (CutExpand r) (CutExpand r) a' (s₁, s₂) ∧ a'.fst + a'.snd = erase (s₁ + s₂ + t) a

α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = s₁ + s₂ + t
⊢ DecidableEq α

tactic: refine' ⟨(s₁.erase a + t, s₂), GameAdd.fst ⟨t, a, hr, _⟩, _⟩
state_before: case mk.intro.intro.intro.intro.inl
α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = s₁ + s₂ + t
hb : s = erase (s₁ + s₂ + t) a
h : a ∈ s₁
⊢ ∃ a', GameAdd (CutExpand r) (CutExpand r) a' (s₁, s₂) ∧ a'.fst + a'.snd = erase (s₁ + s₂ + t) a

tactic: rw [add_comm, ← add_assoc, singleton_add, cons_erase h]
state_before: case mk.intro.intro.intro.intro.inl.refine'_1
α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = s₁ + s₂ + t
hb : s = erase (s₁ + s₂ + t) a
h : a ∈ s₁
⊢ erase s₁ a + t + {a} = s₁ + t

tactic: rw [add_assoc s₁, erase_add_left_pos _ h, add_right_comm, add_assoc]
state_before: case mk.intro.intro.intro.intro.inl.refine'_2
α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = s₁ + s₂ + t
hb : s = erase (s₁ + s₂ + t) a
h : a ∈ s₁
⊢ (erase s₁ a + t, s₂).fst + (erase s₁ a + t, s₂).snd = erase (s₁ + s₂ + t) a

tactic: refine' ⟨(s₁, (s₂ + t).erase a), GameAdd.snd ⟨t, a, hr, _⟩, _⟩
state_before: case mk.intro.intro.intro.intro.inr
α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = s₁ + s₂ + t
hb : s = erase (s₁ + s₂ + t) a
h : a ∈ s₂ + t
⊢ ∃ a', GameAdd (CutExpand r) (CutExpand r) a' (s₁, s₂) ∧ a'.fst + a'.snd = erase (s₁ + s₂ + t) a

tactic: rw [add_comm, singleton_add, cons_erase h]
state_before: case mk.intro.intro.intro.intro.inr.refine'_1
α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = s₁ + s₂ + t
hb : s = erase (s₁ + s₂ + t) a
h : a ∈ s₂ + t
⊢ erase (s₂ + t) a + {a} = s₂ + t

tactic: rw [add_assoc, erase_add_right_pos _ h]
state_before: case mk.intro.intro.intro.intro.inr.refine'_2
α : Type u_1
r✝ r : α → α → Prop
s₁ s₂ s t : Multiset α
a : α
hr : ∀ (a' : α), a' ∈ t → r a' a
he : s + {a} = s₁ + s₂ + t
hb : s = erase (s₁ + s₂ + t) a
h : a ∈ s₂ + t
⊢ (s₁, erase (s₂ + t) a).fst + (s₁, erase (s₂ + t) a).snd = erase (s₁ + s₂ + t) a