Theorem: Stream'.Seq1.join_join
File: Mathlib/Data/Seq/Seq.lean

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

case r
α : Type u
β : Type v
γ : Type w
SS : Seq (Seq1 (Seq1 α))
⊢ ∃ s SS_1, SS.join.join = s.append SS_1.join.join ∧ (Seq.map join SS).join = s.append (Seq.map join SS_1).join

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

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

case h2
α : Type u
β : Type v
γ : Type w
SS✝ : Seq (Seq1 (Seq1 α))
s1 s2 : Seq α
h : ∃ s SS, s1 = s.append SS.join.join ∧ s2 = s.append (Seq.map join SS).join
s : Seq α
SS : Seq (Seq1 (Seq1 α))
⊢ α →
    ∀ (s : Seq α),
      ∃ s_1 SS_1,
        s.append SS.join.join = s_1.append SS_1.join.join ∧
          s.append (Seq.map join SS).join = s_1.append (Seq.map join SS_1).join

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

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

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

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

tactic: simp only [Seq.join_cons, join_append, destruct_cons]
state_before: case h1.h2.mk.mk
α : Type u
β : Type v
γ : Type w
SS✝¹ : Seq (Seq1 (Seq1 α))
s1 s2 : Seq α
h : ∃ s SS, s1 = s.append SS.join.join ∧ s2 = s.append (Seq.map join SS).join
s✝ : Seq α
SS✝ SS : Seq (Seq1 (Seq1 α))
S : Seq (Seq1 α)
x : α
s : Seq α
⊢ match (Seq.cons ((x, s), S) SS).join.join.destruct, (Seq.cons (join ((x, s), S)) (Seq.map join SS)).join.destruct with
  | none, none => True
  | some (a, s), some (a', s') =>
    a = a' ∧ ∃ s_1 SS, s = s_1.append SS.join.join ∧ s' = s_1.append (Seq.map join SS).join
  | x, x_1 => False
state_after: case h1.h2.mk.mk
α : Type u
β : Type v
γ : Type w
SS✝¹ : Seq (Seq1 (Seq1 α))
s1 s2 : Seq α
h : ∃ s SS, s1 = s.append SS.join.join ∧ s2 = s.append (Seq.map join SS).join
s✝ : Seq α
SS✝ SS : Seq (Seq1 (Seq1 α))
S : Seq (Seq1 α)
x : α
s : Seq α
⊢ match some (x, s.append (S.join.append SS.join.join)),
    (Seq.cons (join ((x, s), S)) (Seq.map join SS)).join.destruct with
  | none, none => True
  | some (a, s), some (a', s') =>
    a = a' ∧ ∃ s_1 SS, s = s_1.append SS.join.join ∧ s' = s_1.append (Seq.map join SS).join
  | x, x_1 => False

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

case h1.h2.mk.mk.h2
α : Type u
β : Type v
γ : Type w
SS✝¹ : Seq (Seq1 (Seq1 α))
s1 s2 : Seq α
h : ∃ s SS, s1 = s.append SS.join.join ∧ s2 = s.append (Seq.map join SS).join
s✝ : Seq α
SS✝ SS : Seq (Seq1 (Seq1 α))
S : Seq (Seq1 α)
x : α
s : Seq α
⊢ ∀ (x : α) (s : Seq α),
    ∃ s_1 SS_1,
      Seq.cons x (s.append (S.join.append SS.join.join)) = s_1.append SS_1.join.join ∧
        Seq.cons x (s.append (S.join.append (Seq.map join SS).join)) = s_1.append (Seq.map join SS_1).join

tactic: exact ⟨_, _, rfl, rfl⟩
state_before: case h1.h2.mk.mk.h1
α : Type u
β : Type v
γ : Type w
SS✝¹ : Seq (Seq1 (Seq1 α))
s1 s2 : Seq α
h : ∃ s SS, s1 = s.append SS.join.join ∧ s2 = s.append (Seq.map join SS).join
s✝ : Seq α
SS✝ SS : Seq (Seq1 (Seq1 α))
S : Seq (Seq1 α)
x : α
s : Seq α
⊢ ∃ s SS_1,
    S.join.append SS.join.join = s.append SS_1.join.join ∧
      S.join.append (Seq.map join SS).join = s.append (Seq.map join SS_1).join
state_after: no goals

tactic: intro x s
state_before: case h1.h2.mk.mk.h2
α : Type u
β : Type v
γ : Type w
SS✝¹ : Seq (Seq1 (Seq1 α))
s1 s2 : Seq α
h : ∃ s SS, s1 = s.append SS.join.join ∧ s2 = s.append (Seq.map join SS).join
s✝ : Seq α
SS✝ SS : Seq (Seq1 (Seq1 α))
S : Seq (Seq1 α)
x : α
s : Seq α
⊢ ∀ (x : α) (s : Seq α),
    ∃ s_1 SS_1,
      Seq.cons x (s.append (S.join.append SS.join.join)) = s_1.append SS_1.join.join ∧
        Seq.cons x (s.append (S.join.append (Seq.map join SS).join)) = s_1.append (Seq.map join SS_1).join
state_after: case h1.h2.mk.mk.h2
α : Type u
β : Type v
γ : Type w
SS✝¹ : Seq (Seq1 (Seq1 α))
s1 s2 : Seq α
h : ∃ s SS, s1 = s.append SS.join.join ∧ s2 = s.append (Seq.map join SS).join
s✝¹ : Seq α
SS✝ SS : Seq (Seq1 (Seq1 α))
S : Seq (Seq1 α)
x✝ : α
s✝ : Seq α
x : α
s : Seq α
⊢ ∃ s_1 SS_1,
    Seq.cons x (s.append (S.join.append SS.join.join)) = s_1.append SS_1.join.join ∧
      Seq.cons x (s.append (S.join.append (Seq.map join SS).join)) = s_1.append (Seq.map join SS_1).join

tactic: refine ⟨Seq.cons x (append s (Seq.join S)), SS, ?_, ?_⟩ <;> simp
state_before: case h1.h2.mk.mk.h2
α : Type u
β : Type v
γ : Type w
SS✝¹ : Seq (Seq1 (Seq1 α))
s1 s2 : Seq α
h : ∃ s SS, s1 = s.append SS.join.join ∧ s2 = s.append (Seq.map join SS).join
s✝¹ : Seq α
SS✝ SS : Seq (Seq1 (Seq1 α))
S : Seq (Seq1 α)
x✝ : α
s✝ : Seq α
x : α
s : Seq α
⊢ ∃ s_1 SS_1,
    Seq.cons x (s.append (S.join.append SS.join.join)) = s_1.append SS_1.join.join ∧
      Seq.cons x (s.append (S.join.append (Seq.map join SS).join)) = s_1.append (Seq.map join SS_1).join
state_after: no goals

tactic: intro _ s
state_before: case h2
α : Type u
β : Type v
γ : Type w
SS✝ : Seq (Seq1 (Seq1 α))
s1 s2 : Seq α
h : ∃ s SS, s1 = s.append SS.join.join ∧ s2 = s.append (Seq.map join SS).join
s : Seq α
SS : Seq (Seq1 (Seq1 α))
⊢ α →
    ∀ (s : Seq α),
      ∃ s_1 SS_1,
        s.append SS.join.join = s_1.append SS_1.join.join ∧
          s.append (Seq.map join SS).join = s_1.append (Seq.map join SS_1).join
state_after: case h2
α : Type u
β : Type v
γ : Type w
SS✝ : Seq (Seq1 (Seq1 α))
s1 s2 : Seq α
h : ∃ s SS, s1 = s.append SS.join.join ∧ s2 = s.append (Seq.map join SS).join
s✝ : Seq α
SS : Seq (Seq1 (Seq1 α))
x✝ : α
s : Seq α
⊢ ∃ s_1 SS_1,
    s.append SS.join.join = s_1.append SS_1.join.join ∧
      s.append (Seq.map join SS).join = s_1.append (Seq.map join SS_1).join

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

tactic: refine ⟨nil, SS, ?_, ?_⟩ <;> simp
state_before: case r
α : Type u
β : Type v
γ : Type w
SS : Seq (Seq1 (Seq1 α))
⊢ ∃ s SS_1, SS.join.join = s.append SS_1.join.join ∧ (Seq.map join SS).join = s.append (Seq.map join SS_1).join
state_after: no goals