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

Proof steps:
state_before: α : Type u
β : Type v
γ : Type w
a : α
s t : Seq α
⊢ ((cons a s).append t).destruct = some (a, s.append t)
state_after: α : Type u
β : Type v
γ : Type w
a : α
s t : Seq α
⊢ (corec
        (fun x =>
          match x.1.destruct with
          | none =>
            match x.2.destruct with
            | none => none
            | some (a, b) => some (a, nil, b)
          | some (a, s₁') => some (a, s₁', x.2))
        (cons a s, t)).destruct =
    some
      (a,
        corec
          (fun x =>
            match x.1.destruct with
            | none =>
              match x.2.destruct with
              | none => none
              | some (a, b) => some (a, nil, b)
            | some (a, s₁') => some (a, s₁', x.2))
          (s, t))
tactic: dsimp [append]
state_before: α : Type u
β : Type v
γ : Type w
a : α
s t : Seq α
⊢ (corec
        (fun x =>
          match x.1.destruct with
          | none =>
            match x.2.destruct with
            | none => none
            | some (a, b) => some (a, nil, b)
          | some (a, s₁') => some (a, s₁', x.2))
        (cons a s, t)).destruct =
    some
      (a,
        corec
          (fun x =>
            match x.1.destruct with
            | none =>
              match x.2.destruct with
              | none => none
              | some (a, b) => some (a, nil, b)
            | some (a, s₁') => some (a, s₁', x.2))
          (s, t))
state_after: α : Type u
β : Type v
γ : Type w
a : α
s t : Seq α
⊢ omap
      (corec fun x =>
        match x.1.destruct with
        | none =>
          match x.2.destruct with
          | none => none
          | some (a, b) => some (a, nil, b)
        | some (a, s₁') => some (a, s₁', x.2))
      (match (cons a s, t).1.destruct with
      | none =>
        match (cons a s, t).2.destruct with
        | none => none
        | some (a, b) => some (a, nil, b)
      | some (a_1, s₁') => some (a_1, s₁', (cons a s, t).2)) =
    some
      (a,
        corec
          (fun x =>
            match x.1.destruct with
            | none =>
              match x.2.destruct with
              | none => none
              | some (a, b) => some (a, nil, b)
            | some (a, s₁') => some (a, s₁', x.2))
          (s, t))
tactic: rw [corec_eq]
state_before: α : Type u
β : Type v
γ : Type w
a : α
s t : Seq α
⊢ omap
      (corec fun x =>
        match x.1.destruct with
        | none =>
          match x.2.destruct with
          | none => none
          | some (a, b) => some (a, nil, b)
        | some (a, s₁') => some (a, s₁', x.2))
      (match (cons a s, t).1.destruct with
      | none =>
        match (cons a s, t).2.destruct with
        | none => none
        | some (a, b) => some (a, nil, b)
      | some (a_1, s₁') => some (a_1, s₁', (cons a s, t).2)) =
    some
      (a,
        corec
          (fun x =>
            match x.1.destruct with
            | none =>
              match x.2.destruct with
              | none => none
              | some (a, b) => some (a, nil, b)
            | some (a, s₁') => some (a, s₁', x.2))
          (s, t))
state_after: α : Type u
β : Type v
γ : Type w
a : α
s t : Seq α
⊢ (match
      match (cons a s).destruct with
      | none =>
        match t.destruct 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 x.1.destruct with
              | none =>
                match x.2.destruct 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 x.1.destruct with
            | none =>
              match x.2.destruct with
              | none => none
              | some (a, b) => some (a, nil, b)
            | some (a, s₁') => some (a, s₁', x.2))
          (s, t))
tactic: dsimp [append]
state_before: α : Type u
β : Type v
γ : Type w
a : α
s t : Seq α
⊢ (match
      match (cons a s).destruct with
      | none =>
        match t.destruct 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 x.1.destruct with
              | none =>
                match x.2.destruct 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 x.1.destruct with
            | none =>
              match x.2.destruct with
              | none => none
              | some (a, b) => some (a, nil, b)
            | some (a, s₁') => some (a, s₁', x.2))
          (s, t))
state_after: no goals
tactic: rw [destruct_cons]