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

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

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

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

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

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

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

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

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

tactic: simpa [map] using ⟨_, _, rfl, rfl⟩
state_before: case h1.h2.mk
α : Type u
β : Type v
γ : Type w
f : α → β
S✝¹ : Seq (Seq1 α)
s1 s2 : Seq β
h : ∃ s S, s1 = s.append (Seq.map f S.join) ∧ s2 = s.append (Seq.map (map f) S).join
s✝ : Seq β
S✝ S : Seq (Seq1 α)
a : α
s : Seq α
⊢ match (Seq.map f (Seq.cons (a, s) S).join).destruct, (Seq.cons (map f (a, s)) (Seq.map (map f) S)).join.destruct with
  | none, none => True
  | some (a, s), some (a', s') =>
    a = a' ∧ ∃ s_1 S, s = s_1.append (Seq.map f S.join) ∧ s' = s_1.append (Seq.map (map f) S).join
  | x, x_1 => False
state_after: no goals

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

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

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