l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem join_append (S T : Seq (Seq1 α)) : join (append S T) = append (join S) (join T) := by
  apply
    eq_of_bisim fun s1 s2 =>
      ∃ s S T, s1 = append s (join (append S T)) ∧ s2 = append s (append (join S) (join T))
  · intro s1 s2 h
    

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Next tactic:
cases' s with a s
@[simp]
theorem join_append (S T : Seq (Seq1 α)) : join (append S T) = append (join S) (join T) := by
  apply
    eq_of_bisim fun s1 s2 =>
      ∃ s S T, s1 = append s (join (append S T)) ∧ s2 = append s (append (join S) (join T))
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, S, T, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn S <;> simp
          · apply recOn T
            · simp
            · intro s T
              cases' s with a s; 

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

Next tactic:
simp
@[simp]
theorem join_append (S T : Seq (Seq1 α)) : join (append S T) = append (join S) (join T) := by
  apply
    eq_of_bisim fun s1 s2 =>
      ∃ s S T, s1 = append s (join (append S T)) ∧ s2 = append s (append (join S) (join T))
  · intro s1 s2 h
    exact
      match s1, s2, h with
      | _, _, ⟨s, S, T, rfl, rfl⟩ => by
        apply recOn s <;> simp
        · apply recOn S <;> simp
          · apply recOn T
            · simp
            · intro s T
              cases' s with a s; simp
              

Proof state:
case h1.h1.h2.mk
α : Type u
β : Type v
γ : Type w
S✝ T✝¹ : Seq (Seq1 α)
s1 s2 : Seq α
h : ∃ s S T, s1 = append s (join (append S T)) ∧ s2 = append s (append (join S) (join T))
s✝ : Seq α
S T✝ T : Seq (Seq1 α)
a : α
s : Seq α
⊢ ∃ s_1 S T_1,
    append s (join T) = append s_1 (join (append S T_1)) ∧ append s (join T) = append s_1 (append (join S) (join T_1))

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

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

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

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

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

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

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

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

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

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

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

Proof state:
case h1.h2.mk
α : Type u
β : Type v
γ : Type w
S✝¹ T✝ : Seq (Seq1 α)
s1 s2 : Seq α
h : ∃ s S T, s1 = append s (join (append S T)) ∧ s2 = append s (append (join S) (join T))
s✝ : Seq α
S✝ T S : Seq (Seq1 α)
a : α
s : Seq α
⊢ ∃ s_1 S_1 T_1,
    append s (join (append S T)) = append s_1 (join (append S_1 T_1)) ∧
      append s (append (join S) (join T)) = append s_1 (append (join S_1) (join T_1))

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

Proof state:
case h2
α : Type u
β : Type v
γ : Type w
S✝ T✝ : Seq (Seq1 α)
s1 s2 : Seq α
h : ∃ s S T, s1 = append s (join (append S T)) ∧ s2 = append s (append (join S) (join T))
s : Seq α
S T : Seq (Seq1 α)
⊢ α →
    ∀ (s : Seq α),
      ∃ s_1 S_1 T_1,
        append s (join (append S T)) = append s_1 (join (append S_1 T_1)) ∧
          append s (append (join S) (join T)) = append s_1 (append (join S_1) (join T_1))

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

Proof state:
case h2
α : Type u
β : Type v
γ : Type w
S✝ T✝ : Seq (Seq1 α)
s1 s2 : Seq α
h : ∃ s S T, s1 = append s (join (append S T)) ∧ s2 = append s (append (join S) (join T))
s✝ : Seq α
S T : Seq (Seq1 α)
x✝ : α
s : Seq α
⊢ ∃ s_1 S_1 T_1,
    append s (join (append S T)) = append s_1 (join (append S_1 T_1)) ∧
      append s (append (join S) (join T)) = append s_1 (append (join S_1) (join T_1))

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

Proof state:
case r
α : Type u
β : Type v
γ : Type w
S T : Seq (Seq1 α)
⊢ ∃ s S_1 T_1,
    join (append S T) = append s (join (append S_1 T_1)) ∧
      append (join S) (join T) = append s (append (join S_1) (join T_1))

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

Proof state:
case r.refine'_1
α : Type u
β : Type v
γ : Type w
S T : Seq (Seq1 α)
⊢ join (append S T) = append nil (join (append S T))

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

Proof state:
case r.refine'_2
α : Type u
β : Type v
γ : Type w
S T : Seq (Seq1 α)
⊢ append (join S) (join T) = append nil (append (join S) (join T))

Next tactic:
simp
@[simp]
theorem ofStream_cons (a : α) (s) : ofStream (a::s) = cons a (ofStream s) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
a : α
s : Stream' α
⊢ ↑(a :: s) = cons a ↑s

Next tactic:
apply Subtype.eq
@[simp]
theorem ofStream_cons (a : α) (s) : ofStream (a::s) = cons a (ofStream s) := by
  apply Subtype.eq; 

Proof state:
case a
α : Type u
β : Type v
γ : Type w
a : α
s : Stream' α
⊢ ↑↑(a :: s) = ↑(cons a ↑s)

Next tactic:
simp [ofStream, cons]
@[simp]
theorem ofStream_cons (a : α) (s) : ofStream (a::s) = cons a (ofStream s) := by
  apply Subtype.eq; simp [ofStream, cons]; 

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

Next tactic:
rw [Stream'.map_cons]
@[simp]
theorem ofList_append (l l' : List α) : ofList (l ++ l') = append (ofList l) (ofList l') := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
l l' : List α
⊢ ↑(l ++ l') = append ↑l ↑l'

Next tactic:
induction l
@[simp]
theorem ofList_append (l l' : List α) : ofList (l ++ l') = append (ofList l) (ofList l') := by
  induction l <;> 

Proof state:
case nil
α : Type u
β : Type v
γ : Type w
l' : List α
⊢ ↑([] ++ l') = append ↑[] ↑l'

Next tactic:
simp [*]