l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem cons_append (a : α) (s t) : append (cons a s) t = cons a (append s t) :=
  destruct_eq_cons <| by
    dsimp [append]; rw [corec_eq]
    dsimp [append]; 

Proof state:
α : Type u
β : Type v
γ : Type w
a : α
s t : Seq α
⊢ (match
      match destruct (cons a s) with
      | none =>
        match destruct t with
        | none => none
        | some (a, b) => some (a, nil, b)
      | some (a, s₁') => some (a, s₁', t) with
    | none => none
    | some (a, b) =>
      some
        (a,
          corec
            (fun x =>
              match destruct x.1 with
              | none =>
                match destruct x.2 with
                | none => none
                | some (a, b) => some (a, nil, b)
              | some (a, s₁') => some (a, s₁', x.2))
            b)) =
    some
      (a,
        corec
          (fun x =>
            match destruct x.1 with
            | none =>
              match destruct x.2 with
              | none => none
              | some (a, b) => some (a, nil, b)
            | some (a, s₁') => some (a, s₁', x.2))
          (s, t))

Next tactic:
rw [destruct_cons]
@[simp]
theorem append_nil (s : Seq α) : append s nil = s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
s : Seq α
⊢ append s nil = s

Next tactic:
apply coinduction2 s
@[simp]
theorem append_nil (s : Seq α) : append s nil = s := by
  apply coinduction2 s; 

Proof state:
case H
α : Type u
β : Type v
γ : Type w
s : Seq α
⊢ ∀ (s : Seq α), BisimO (fun s1 s2 => ∃ s, s1 = append s nil ∧ s2 = s) (destruct (append s nil)) (destruct s)

Next tactic:
intro s
@[simp]
theorem append_nil (s : Seq α) : append s nil = s := by
  apply coinduction2 s; intro s
  

Proof state:
case H
α : Type u
β : Type v
γ : Type w
s✝ s : Seq α
⊢ BisimO (fun s1 s2 => ∃ s, s1 = append s nil ∧ s2 = s) (destruct (append s nil)) (destruct s)

Next tactic:
apply recOn s _ _
@[simp]
theorem append_nil (s : Seq α) : append s nil = s := by
  apply coinduction2 s; intro s
  apply recOn s _ _
  · 

Proof state:
α : Type u
β : Type v
γ : Type w
s✝ s : Seq α
⊢ BisimO (fun s1 s2 => ∃ s, s1 = append s nil ∧ s2 = s) (destruct (append nil nil)) (destruct nil)

Next tactic:
trivial
@[simp]
theorem append_nil (s : Seq α) : append s nil = s := by
  apply coinduction2 s; intro s
  apply recOn s _ _
  · trivial
  · 

Proof state:
α : Type u
β : Type v
γ : Type w
s✝ s : Seq α
⊢ ∀ (x : α) (s : Seq α),
    BisimO (fun s1 s2 => ∃ s, s1 = append s nil ∧ s2 = s) (destruct (append (cons x s) nil)) (destruct (cons x s))

Next tactic:
intro x s
@[simp]
theorem append_nil (s : Seq α) : append s nil = s := by
  apply coinduction2 s; intro s
  apply recOn s _ _
  · trivial
  · intro x s
    

Proof state:
α : Type u
β : Type v
γ : Type w
s✝¹ s✝ : Seq α
x : α
s : Seq α
⊢ BisimO (fun s1 s2 => ∃ s, s1 = append s nil ∧ s2 = s) (destruct (append (cons x s) nil)) (destruct (cons x s))

Next tactic:
rw [cons_append, destruct_cons, destruct_cons]
@[simp]
theorem append_nil (s : Seq α) : append s nil = s := by
  apply coinduction2 s; intro s
  apply recOn s _ _
  · trivial
  · intro x s
    rw [cons_append, destruct_cons, destruct_cons]
    

Proof state:
α : Type u
β : Type v
γ : Type w
s✝¹ s✝ : Seq α
x : α
s : Seq α
⊢ BisimO (fun s1 s2 => ∃ s, s1 = append s nil ∧ s2 = s) (some (x, append s nil)) (some (x, s))

Next tactic:
dsimp
@[simp]
theorem append_nil (s : Seq α) : append s nil = s := by
  apply coinduction2 s; intro s
  apply recOn s _ _
  · trivial
  · intro x s
    rw [cons_append, destruct_cons, destruct_cons]
    dsimp
    

Proof state:
α : Type u
β : Type v
γ : Type w
s✝¹ s✝ : Seq α
x : α
s : Seq α
⊢ x = x ∧ ∃ s_1, append s nil = append s_1 nil ∧ s = s_1

Next tactic:
exact ⟨rfl, s, rfl, rfl⟩
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
s t u : Seq α
⊢ append (append s t) u = append s (append t u)

Next tactic:
apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · 

Proof state:
case bisim
α : Type u
β : Type v
γ : Type w
s t u : Seq α
⊢ IsBisimulation fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)

Next tactic:
intro s1 s2 h
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    

Proof state:
case bisim
α : Type u
β : Type v
γ : Type w
s t u s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
⊢ BisimO (fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)) (destruct s1) (destruct s2)

Next tactic:
exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> simp
            · intro _ u
              refine' ⟨nil, nil, u, _, _⟩ <;> simp
          · intro _ t
            refine' ⟨nil, t, u, _, _⟩ <;> simp
        · intro _ s
          exact ⟨s, t, u, rfl, rfl⟩
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        

Proof state:
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t u : Seq α
⊢ BisimO (fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u))
    (destruct (append (append s t) u)) (destruct (append s (append t u)))

Next tactic:
apply recOn s
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> 

Proof state:
case h1
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t u : Seq α
⊢ BisimO (fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u))
    (destruct (append (append nil t) u)) (destruct (append nil (append t u)))

Next tactic:
simp
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> 

Proof state:
case h2
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t u : Seq α
⊢ ∀ (x : α) (s : Seq α),
    BisimO (fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u))
      (destruct (append (append (cons x s) t) u)) (destruct (append (cons x s) (append t u)))

Next tactic:
simp
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · 

Proof state:
case h1
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t u : Seq α
⊢ match destruct (append t u), destruct (append t u) with
  | none, none => True
  | some (a, s), some (a', s') => a = a' ∧ ∃ s_1 t u, s = append (append s_1 t) u ∧ s' = append s_1 (append t u)
  | x, x_1 => False

Next tactic:
apply recOn t
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> 

Proof state:
case h1.h1
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t u : Seq α
⊢ match destruct (append nil u), destruct (append nil u) with
  | none, none => True
  | some (a, s), some (a', s') => a = a' ∧ ∃ s_1 t u, s = append (append s_1 t) u ∧ s' = append s_1 (append t u)
  | x, x_1 => False

Next tactic:
simp
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> 

Proof state:
case h1.h2
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t u : Seq α
⊢ ∀ (x : α) (s : Seq α),
    match destruct (append (cons x s) u), destruct (append (cons x s) u) with
    | none, none => True
    | some (a, s), some (a', s') => a = a' ∧ ∃ s_1 t u, s = append (append s_1 t) u ∧ s' = append s_1 (append t u)
    | x, x_1 => False

Next tactic:
simp
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · 

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

Next tactic:
apply recOn u
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> 

Proof state:
case h1.h1.h1
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t u : Seq α
⊢ match destruct nil, destruct nil with
  | none, none => True
  | some (a, s), some (a', s') => a = a' ∧ ∃ s_1 t u, s = append (append s_1 t) u ∧ s' = append s_1 (append t u)
  | x, x_1 => False

Next tactic:
simp
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> 

Proof state:
case h1.h1.h2
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t u : Seq α
⊢ ∀ (x : α) (s : Seq α),
    match destruct (cons x s), destruct (cons x s) with
    | none, none => True
    | some (a, s), some (a', s') => a = a' ∧ ∃ s_1 t u, s = append (append s_1 t) u ∧ s' = append s_1 (append t u)
    | x, x_1 => False

Next tactic:
simp
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> simp
            · 

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

Next tactic:
intro _ u
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> simp
            · intro _ u
              

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

Next tactic:
refine' ⟨nil, nil, u, _, _⟩
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> simp
            · intro _ u
              refine' ⟨nil, nil, u, _, _⟩ <;> 

Proof state:
case h1.h1.h2.refine'_1
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝¹ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t u✝ : Seq α
x✝ : α
u : Seq α
⊢ u = append (append nil nil) u

Next tactic:
simp
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> simp
            · intro _ u
              refine' ⟨nil, nil, u, _, _⟩ <;> 

Proof state:
case h1.h1.h2.refine'_2
α : Type u
β : Type v
γ : Type w
s✝ t✝ u✝¹ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t u✝ : Seq α
x✝ : α
u : Seq α
⊢ u = append nil (append nil u)

Next tactic:
simp
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> simp
            · intro _ u
              refine' ⟨nil, nil, u, _, _⟩ <;> simp
          · 

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

Next tactic:
intro _ t
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> simp
            · intro _ u
              refine' ⟨nil, nil, u, _, _⟩ <;> simp
          · intro _ t
            

Proof state:
case h1.h2
α : Type u
β : Type v
γ : Type w
s✝ t✝¹ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t✝ u : Seq α
x✝ : α
t : Seq α
⊢ ∃ s t_1 u_1, append t u = append (append s t_1) u_1 ∧ append t u = append s (append t_1 u_1)

Next tactic:
refine' ⟨nil, t, u, _, _⟩
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> simp
            · intro _ u
              refine' ⟨nil, nil, u, _, _⟩ <;> simp
          · intro _ t
            refine' ⟨nil, t, u, _, _⟩ <;> 

Proof state:
case h1.h2.refine'_1
α : Type u
β : Type v
γ : Type w
s✝ t✝¹ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t✝ u : Seq α
x✝ : α
t : Seq α
⊢ append t u = append (append nil t) u

Next tactic:
simp
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> simp
            · intro _ u
              refine' ⟨nil, nil, u, _, _⟩ <;> simp
          · intro _ t
            refine' ⟨nil, t, u, _, _⟩ <;> 

Proof state:
case h1.h2.refine'_2
α : Type u
β : Type v
γ : Type w
s✝ t✝¹ u✝ s1 s2 : Seq α
h : ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
s t✝ u : Seq α
x✝ : α
t : Seq α
⊢ append t u = append nil (append t u)

Next tactic:
simp
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> simp
            · intro _ u
              refine' ⟨nil, nil, u, _, _⟩ <;> simp
          · intro _ t
            refine' ⟨nil, t, u, _, _⟩ <;> simp
        · 

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

Next tactic:
intro _ s
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> simp
            · intro _ u
              refine' ⟨nil, nil, u, _, _⟩ <;> simp
          · intro _ t
            refine' ⟨nil, t, u, _, _⟩ <;> simp
        · intro _ s
          

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

Next tactic:
exact ⟨s, t, u, rfl, rfl⟩
@[simp]
theorem append_assoc (s t u : Seq α) : append (append s t) u = append s (append t u) := by
  apply eq_of_bisim fun s1 s2 => ∃ s t u, s1 = append (append s t) u ∧ s2 = append s (append t u)
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, t, u, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn t <;> simp
          · apply recOn u <;> simp
            · intro _ u
              refine' ⟨nil, nil, u, _, _⟩ <;> simp
          · intro _ t
            refine' ⟨nil, t, u, _, _⟩ <;> simp
        · intro _ s
          exact ⟨s, t, u, rfl, rfl⟩
  · 

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

Next tactic:
exact ⟨s, t, u, rfl, rfl⟩
@[simp]
theorem map_cons (f : α → β) (a) : ∀ s, map f (cons a s) = cons (f a) (map f s)
  | ⟨s, al⟩ => by 

Proof state:
α : Type u
β : Type v
γ : Type w
f : α → β
a : α
s : Stream' (Option α)
al : IsSeq s
⊢ map f (cons a { val := s, property := al }) = cons (f a) (map f { val := s, property := al })

Next tactic:
apply Subtype.eq
@[simp]
theorem map_cons (f : α → β) (a) : ∀ s, map f (cons a s) = cons (f a) (map f s)
  | ⟨s, al⟩ => by apply Subtype.eq; 

Proof state:
case a
α : Type u
β : Type v
γ : Type w
f : α → β
a : α
s : Stream' (Option α)
al : IsSeq s
⊢ ↑(map f (cons a { val := s, property := al })) = ↑(cons (f a) (map f { val := s, property := al }))

Next tactic:
dsimp [cons, map]
@[simp]
theorem map_cons (f : α → β) (a) : ∀ s, map f (cons a s) = cons (f a) (map f s)
  | ⟨s, al⟩ => by apply Subtype.eq; dsimp [cons, map]; 

Proof state:
case a
α : Type u
β : Type v
γ : Type w
f : α → β
a : α
s : Stream' (Option α)
al : IsSeq s
⊢ Stream'.map (Option.map f) (some a :: s) = some (f a) :: Stream'.map (Option.map f) s

Next tactic:
rw [Stream'.map_cons]
@[simp]
theorem map_cons (f : α → β) (a) : ∀ s, map f (cons a s) = cons (f a) (map f s)
  | ⟨s, al⟩ => by apply Subtype.eq; dsimp [cons, map]; rw [Stream'.map_cons]; 

Proof state:
case a
α : Type u
β : Type v
γ : Type w
f : α → β
a : α
s : Stream' (Option α)
al : IsSeq s
⊢ Option.map f (some a) :: Stream'.map (Option.map f) s = some (f a) :: Stream'.map (Option.map f) s

Next tactic:
rfl
@[simp]
theorem map_id : ∀ s : Seq α, map id s = s
  | ⟨s, al⟩ => by
    

Proof state:
α : Type u
β : Type v
γ : Type w
s : Stream' (Option α)
al : IsSeq s
⊢ map id { val := s, property := al } = { val := s, property := al }

Next tactic:
apply Subtype.eq
@[simp]
theorem map_id : ∀ s : Seq α, map id s = s
  | ⟨s, al⟩ => by
    apply Subtype.eq; 

Proof state:
case a
α : Type u
β : Type v
γ : Type w
s : Stream' (Option α)
al : IsSeq s
⊢ ↑(map id { val := s, property := al }) = ↑{ val := s, property := al }

Next tactic:
dsimp [map]
@[simp]
theorem map_id : ∀ s : Seq α, map id s = s
  | ⟨s, al⟩ => by
    apply Subtype.eq; dsimp [map]
    

Proof state:
case a
α : Type u
β : Type v
γ : Type w
s : Stream' (Option α)
al : IsSeq s
⊢ Stream'.map (Option.map id) s = s

Next tactic:
rw [Option.map_id, Stream'.map_id]
@[simp]
theorem map_tail (f : α → β) : ∀ s, map f (tail s) = tail (map f s)
  | ⟨s, al⟩ => by 

Proof state:
α : Type u
β : Type v
γ : Type w
f : α → β
s : Stream' (Option α)
al : IsSeq s
⊢ map f (tail { val := s, property := al }) = tail (map f { val := s, property := al })

Next tactic:
apply Subtype.eq
@[simp]
theorem map_tail (f : α → β) : ∀ s, map f (tail s) = tail (map f s)
  | ⟨s, al⟩ => by apply Subtype.eq; 

Proof state:
case a
α : Type u
β : Type v
γ : Type w
f : α → β
s : Stream' (Option α)
al : IsSeq s
⊢ ↑(map f (tail { val := s, property := al })) = ↑(tail (map f { val := s, property := al }))

Next tactic:
dsimp [tail, map]
theorem map_comp (f : α → β) (g : β → γ) : ∀ s : Seq α, map (g ∘ f) s = map g (map f s)
  | ⟨s, al⟩ => by
    

Proof state:
α : Type u
β : Type v
γ : Type w
f : α → β
g : β → γ
s : Stream' (Option α)
al : IsSeq s
⊢ map (g ∘ f) { val := s, property := al } = map g (map f { val := s, property := al })

Next tactic:
apply Subtype.eq
theorem map_comp (f : α → β) (g : β → γ) : ∀ s : Seq α, map (g ∘ f) s = map g (map f s)
  | ⟨s, al⟩ => by
    apply Subtype.eq; 

Proof state:
case a
α : Type u
β : Type v
γ : Type w
f : α → β
g : β → γ
s : Stream' (Option α)
al : IsSeq s
⊢ ↑(map (g ∘ f) { val := s, property := al }) = ↑(map g (map f { val := s, property := al }))

Next tactic:
dsimp [map]