Theorem: Stream'.Seq.append_assoc
File: Mathlib/Data/Seq/Seq.lean

tactic: apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
state_before: α : Type u
β : Type v
γ : Type w
s t u : Seq α
⊢ (s.append t).append u = s.append (t.append u)
state_after: case bisim
α : Type u
β : Type v
γ : Type w
s t u : Seq α
⊢ IsBisimulation fun s1 s2 => ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)

case r
α : Type u
β : Type v
γ : Type w
s t u : Seq α
⊢ ∃ s_1 t_1 u_1,
    (s.append t).append u = (s_1.append t_1).append u_1 ∧ s.append (t.append u) = s_1.append (t_1.append u_1)

tactic: intro s1 s2 h
state_before: case bisim
α : Type u
β : Type v
γ : Type w
s t u : Seq α
⊢ IsBisimulation fun s1 s2 => ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
state_after: case bisim
α : Type u
β : Type v
γ : Type w
s t u s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
⊢ BisimO (fun s1 s2 => ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)) s1.destruct s2.destruct

tactic: apply recOn s <;> simp
state_before: α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u : Seq α
⊢ BisimO (fun s1 s2 => ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u))
    ((s.append t).append u).destruct (s.append (t.append u)).destruct
state_after: case h1
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u : Seq α
⊢ match (t.append u).destruct, (t.append u).destruct with
  | none, none => True
  | some (a, s), some (a', s') => a = a' ∧ ∃ s_1 t u, s = (s_1.append t).append u ∧ s' = s_1.append (t.append u)
  | x, x_1 => False

case h2
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u : Seq α
⊢ α →
    ∀ (s : Seq α),
      ∃ s_1 t_1 u_1,
        (s.append t).append u = (s_1.append t_1).append u_1 ∧ s.append (t.append u) = s_1.append (t_1.append u_1)

tactic: apply recOn t <;> simp
state_before: case h1
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u : Seq α
⊢ match (t.append u).destruct, (t.append u).destruct with
  | none, none => True
  | some (a, s), some (a', s') => a = a' ∧ ∃ s_1 t u, s = (s_1.append t).append u ∧ s' = s_1.append (t.append u)
  | x, x_1 => False
state_after: case h1.h1
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u : Seq α
⊢ match u.destruct, u.destruct with
  | none, none => True
  | some (a, s), some (a', s') => a = a' ∧ ∃ s_1 t u, s = (s_1.append t).append u ∧ s' = s_1.append (t.append u)
  | x, x_1 => False

case h1.h2
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u : Seq α
⊢ α → ∀ (s : Seq α), ∃ s_1 t u_1, s.append u = (s_1.append t).append u_1 ∧ s.append u = s_1.append (t.append u_1)

tactic: apply recOn u <;> simp
state_before: case h1.h1
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u : Seq α
⊢ match u.destruct, u.destruct with
  | none, none => True
  | some (a, s), some (a', s') => a = a' ∧ ∃ s_1 t u, s = (s_1.append t).append u ∧ s' = s_1.append (t.append u)
  | x, x_1 => False
state_after: case h1.h1.h2
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u : Seq α
⊢ α → ∀ (s : Seq α), ∃ s_1 t u, s = (s_1.append t).append u ∧ s = s_1.append (t.append u)

tactic: intro _ u
state_before: case h1.h1.h2
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u : Seq α
⊢ α → ∀ (s : Seq α), ∃ s_1 t u, s = (s_1.append t).append u ∧ s = s_1.append (t.append u)
state_after: case h1.h1.h2
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝¹ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u✝ : Seq α
x✝ : α
u : Seq α
⊢ ∃ s t u_1, u = (s.append t).append u_1 ∧ u = s.append (t.append u_1)

tactic: refine ⟨nil, nil, u, ?_, ?_⟩ <;> simp
state_before: case h1.h1.h2
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝¹ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u✝ : Seq α
x✝ : α
u : Seq α
⊢ ∃ s t u_1, u = (s.append t).append u_1 ∧ u = s.append (t.append u_1)
state_after: no goals

tactic: intro _ t
state_before: case h1.h2
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u : Seq α
⊢ α → ∀ (s : Seq α), ∃ s_1 t u_1, s.append u = (s_1.append t).append u_1 ∧ s.append u = s_1.append (t.append u_1)
state_after: case h1.h2
α : Type u
β : Type v
γ : Type w
s✝ t✝¹ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t✝ u : Seq α
x✝ : α
t : Seq α
⊢ ∃ s t_1 u_1, t.append u = (s.append t_1).append u_1 ∧ t.append u = s.append (t_1.append u_1)

tactic: refine ⟨nil, t, u, ?_, ?_⟩ <;> simp
state_before: case h1.h2
α : Type u
β : Type v
γ : Type w
s✝ t✝¹ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t✝ u : Seq α
x✝ : α
t : Seq α
⊢ ∃ s t_1 u_1, t.append u = (s.append t_1).append u_1 ∧ t.append u = s.append (t_1.append u_1)
state_after: no goals

tactic: intro _ s
state_before: case h2
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s t u : Seq α
⊢ α →
    ∀ (s : Seq α),
      ∃ s_1 t_1 u_1,
        (s.append t).append u = (s_1.append t_1).append u_1 ∧ s.append (t.append u) = s_1.append (t_1.append u_1)
state_after: case h2
α : Type u
β : Type v
γ : Type w
s✝¹ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s✝ t u : Seq α
x✝ : α
s : Seq α
⊢ ∃ s_1 t_1 u_1,
    (s.append t).append u = (s_1.append t_1).append u_1 ∧ s.append (t.append u) = s_1.append (t_1.append u_1)

tactic: exact ⟨s, t, u, rfl, rfl⟩
state_before: case h2
α : Type u
β : Type v
γ : Type w
s✝¹ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = (s.append t).append u ∧ s2 = s.append (t.append u)
s✝ t u : Seq α
x✝ : α
s : Seq α
⊢ ∃ s_1 t_1 u_1,
    (s.append t).append u = (s_1.append t_1).append u_1 ∧ s.append (t.append u) = s_1.append (t_1.append u_1)
state_after: no goals

tactic: exact ⟨s, t, u, rfl, rfl⟩
state_before: case r
α : Type u
β : Type v
γ : Type w
s t u : Seq α
⊢ ∃ s_1 t_1 u_1,
    (s.append t).append u = (s_1.append t_1).append u_1 ∧ s.append (t.append u) = s_1.append (t_1.append u_1)
state_after: no goals