Theorem: PFunctor.M.bisim
File: Mathlib/Data/PFunctor/Univariate/M.lean

Proof steps:
state_before: F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
P : PFunctor.{u}
α : Type u_2
R : P.M → P.M → Prop
h : ∀ (x y : P.M), R x y → ∃ a f f', x.dest = ⟨a, f⟩ ∧ y.dest = ⟨a, f'⟩ ∧ ∀ (i : P.B a), R (f i) (f' i)
⊢ ∀ (x y : P.M), R x y → x = y
state_after: F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
P : PFunctor.{u}
α : Type u_2
R : P.M → P.M → Prop
h : ∀ (x y : P.M), R x y → ∃ a f f', x.dest = ⟨a, f⟩ ∧ y.dest = ⟨a, f'⟩ ∧ ∀ (i : P.B a), R (f i) (f' i)
x y : P.M
h' : R x y
⊢ x = y
tactic: introv h'
state_before: F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
P : PFunctor.{u}
α : Type u_2
R : P.M → P.M → Prop
h : ∀ (x y : P.M), R x y → ∃ a f f', x.dest = ⟨a, f⟩ ∧ y.dest = ⟨a, f'⟩ ∧ ∀ (i : P.B a), R (f i) (f' i)
x y : P.M
h' : R x y
⊢ x = y
state_after: F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
P : PFunctor.{u}
α : Type u_2
R : P.M → P.M → Prop
h : ∀ (x y : P.M), R x y → ∃ a f f', x.dest = ⟨a, f⟩ ∧ y.dest = ⟨a, f'⟩ ∧ ∀ (i : P.B a), R (f i) (f' i)
x y : P.M
h' : R x y
this : Inhabited P.A
⊢ x = y
tactic: haveI := Inhabited.mk x.head
state_before: F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
P : PFunctor.{u}
α : Type u_2
R : P.M → P.M → Prop
h : ∀ (x y : P.M), R x y → ∃ a f f', x.dest = ⟨a, f⟩ ∧ y.dest = ⟨a, f'⟩ ∧ ∀ (i : P.B a), R (f i) (f' i)
x y : P.M
h' : R x y
this : Inhabited P.A
⊢ x = y
state_after: F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
P : PFunctor.{u}
α : Type u_2
R : P.M → P.M → Prop
h : ∀ (x y : P.M), R x y → ∃ a f f', x.dest = ⟨a, f⟩ ∧ y.dest = ⟨a, f'⟩ ∧ ∀ (i : P.B a), R (f i) (f' i)
x y : P.M
h' : R x y
this : Inhabited P.A
⊢ IsBisimulation R
tactic: apply eq_of_bisim R _ _ _ h'
state_before: F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
P : PFunctor.{u}
α : Type u_2
R : P.M → P.M → Prop
h : ∀ (x y : P.M), R x y → ∃ a f f', x.dest = ⟨a, f⟩ ∧ y.dest = ⟨a, f'⟩ ∧ ∀ (i : P.B a), R (f i) (f' i)
x y : P.M
h' : R x y
this : Inhabited P.A
⊢ IsBisimulation R
state_after: F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
P : PFunctor.{u}
α : Type u_2
R : P.M → P.M → Prop
h : ∀ (x y : P.M), R x y → ∃ a f f', x.dest = ⟨a, f⟩ ∧ y.dest = ⟨a, f'⟩ ∧ ∀ (i : P.B a), R (f i) (f' i)
this : Inhabited P.A
⊢ IsBisimulation R
tactic: clear h' x y
state_before: F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
P : PFunctor.{u}
α : Type u_2
R : P.M → P.M → Prop
h : ∀ (x y : P.M), R x y → ∃ a f f', x.dest = ⟨a, f⟩ ∧ y.dest = ⟨a, f'⟩ ∧ ∀ (i : P.B a), R (f i) (f' i)
this : Inhabited P.A
⊢ IsBisimulation R
state_after: case head.intro.intro.intro.intro.intro
F : PFunctor.{u}
X : Type u_1
f✝ : X → ↑F X
P : PFunctor.{u}
α : Type u_2
R : P.M → P.M → Prop
this : Inhabited P.A
a a' : P.A
f : P.B a → P.M
f' : P.B a' → P.M
ih : R (M.mk ⟨a, f⟩) (M.mk ⟨a', f'⟩)
a'' : P.A
g g' : P.B a'' → P.M
h₀ : (M.mk ⟨a, f⟩).dest = ⟨a'', g⟩
h₁ : (M.mk ⟨a', f'⟩).dest = ⟨a'', g'⟩
h₂ : ∀ (i : P.B a''), R (g i) (g' i)
⊢ a = a'

case tail.intro.intro.intro.intro.intro
F : PFunctor.{u}
X : Type u_1
f✝ : X → ↑F X
P : PFunctor.{u}
α : Type u_2
R : P.M → P.M → Prop
this : Inhabited P.A
a : P.A
f f' : P.B a → P.M
ih : R (M.mk ⟨a, f⟩) (M.mk ⟨a, f'⟩)
i : P.B a
a'' : P.A
g g' : P.B a'' → P.M
h₀ : (M.mk ⟨a, f⟩).dest = ⟨a'', g⟩
h₁ : (M.mk ⟨a, f'⟩).dest = ⟨a'', g'⟩
h₂ : ∀ (i : P.B a''), R (g i) (g' i)
⊢ R (f i) (f' i)
tactic: constructor <;> introv ih <;> rcases h _ _ ih with ⟨a'', g, g', h₀, h₁, h₂⟩ <;> clear h