Theorem: SatisfiesM.seq
File: .lake/packages/batteries/Batteries/Classes/SatisfiesM.lean

Proof steps:
state_before: m : Type u_1 → Type u_2
α α✝ : Type u_1
p₁ : (α → α✝) → Prop
f : m (α → α✝)
p₂ : α → Prop
q : α✝ → Prop
inst✝¹ : Applicative m
inst✝ : LawfulApplicative m
x : m α
hf : SatisfiesM p₁ f
hx : SatisfiesM p₂ x
H : ∀ {f : α → α✝} {a : α}, p₁ f → p₂ a → q (f a)
⊢ SatisfiesM q (Seq.seq f fun x_1 => x)
state_after: m : Type u_1 → Type u_2
α α✝ : Type u_1
p₁ : (α → α✝) → Prop
f✝ : m (α → α✝)
p₂ : α → Prop
q : α✝ → Prop
inst✝¹ : Applicative m
inst✝ : LawfulApplicative m
x✝ : m α
hf : SatisfiesM p₁ f✝
hx : SatisfiesM p₂ x✝
H : ∀ {f : α → α✝} {a : α}, p₁ f → p₂ a → q (f a)
f : m { a // p₁ a }
x : m { a // p₂ a }
⊢ SatisfiesM q (Seq.seq (Subtype.val <$> f) fun x_1 => Subtype.val <$> x)
tactic: match f, x, hf, hx with | _, _, ⟨f, rfl⟩, ⟨x, rfl⟩ => ?_
state_before: m : Type u_1 → Type u_2
α α✝ : Type u_1
p₁ : (α → α✝) → Prop
f✝ : m (α → α✝)
p₂ : α → Prop
q : α✝ → Prop
inst✝¹ : Applicative m
inst✝ : LawfulApplicative m
x✝ : m α
hf : SatisfiesM p₁ f✝
hx : SatisfiesM p₂ x✝
H : ∀ {f : α → α✝} {a : α}, p₁ f → p₂ a → q (f a)
f : m { a // p₁ a }
x : m { a // p₂ a }
⊢ SatisfiesM q (Seq.seq (Subtype.val <$> f) fun x_1 => Subtype.val <$> x)
state_after: m : Type u_1 → Type u_2
α α✝ : Type u_1
p₁ : (α → α✝) → Prop
f✝ : m (α → α✝)
p₂ : α → Prop
q : α✝ → Prop
inst✝¹ : Applicative m
inst✝ : LawfulApplicative m
x✝ : m α
hf : SatisfiesM p₁ f✝
hx : SatisfiesM p₂ x✝
H : ∀ {f : α → α✝} {a : α}, p₁ f → p₂ a → q (f a)
f : m { a // p₁ a }
x : m { a // p₂ a }
⊢ (Subtype.val <$>
      Seq.seq
        ((fun x x_1 =>
            match x with
            | ⟨a, h₁⟩ =>
              match x_1 with
              | ⟨b, h₂⟩ => ⟨a b, ⋯⟩) <$>
          f)
        fun x_1 => x) =
    Seq.seq (Subtype.val <$> f) fun x_1 => Subtype.val <$> x
tactic: refine ⟨(fun ⟨a, h₁⟩ ⟨b, h₂⟩ => ⟨a b, H h₁ h₂⟩) <$> f <*> x, ?_⟩
state_before: m : Type u_1 → Type u_2
α α✝ : Type u_1
p₁ : (α → α✝) → Prop
f✝ : m (α → α✝)
p₂ : α → Prop
q : α✝ → Prop
inst✝¹ : Applicative m
inst✝ : LawfulApplicative m
x✝ : m α
hf : SatisfiesM p₁ f✝
hx : SatisfiesM p₂ x✝
H : ∀ {f : α → α✝} {a : α}, p₁ f → p₂ a → q (f a)
f : m { a // p₁ a }
x : m { a // p₂ a }
⊢ (Subtype.val <$>
      Seq.seq
        ((fun x x_1 =>
            match x with
            | ⟨a, h₁⟩ =>
              match x_1 with
              | ⟨b, h₂⟩ => ⟨a b, ⋯⟩) <$>
          f)
        fun x_1 => x) =
    Seq.seq (Subtype.val <$> f) fun x_1 => Subtype.val <$> x
state_after: m : Type u_1 → Type u_2
α α✝ : Type u_1
p₁ : (α → α✝) → Prop
f✝ : m (α → α✝)
p₂ : α → Prop
q : α✝ → Prop
inst✝¹ : Applicative m
inst✝ : LawfulApplicative m
x✝ : m α
hf : SatisfiesM p₁ f✝
hx : SatisfiesM p₂ x✝
H : ∀ {f : α → α✝} {a : α}, p₁ f → p₂ a → q (f a)
f : m { a // p₁ a }
x : m { a // p₂ a }
⊢ (Seq.seq (pure Subtype.val) fun x_1 =>
      Seq.seq (Seq.seq (pure fun x x_2 => ⟨x.val x_2.val, ⋯⟩) fun x => f) fun x_2 => x) =
    Seq.seq (Seq.seq (pure Subtype.val) fun x => f) fun x_1 => Seq.seq (pure Subtype.val) fun x_2 => x
tactic: simp only [← pure_seq]
state_before: m : Type u_1 → Type u_2
α α✝ : Type u_1
p₁ : (α → α✝) → Prop
f✝ : m (α → α✝)
p₂ : α → Prop
q : α✝ → Prop
inst✝¹ : Applicative m
inst✝ : LawfulApplicative m
x✝ : m α
hf : SatisfiesM p₁ f✝
hx : SatisfiesM p₂ x✝
H : ∀ {f : α → α✝} {a : α}, p₁ f → p₂ a → q (f a)
f : m { a // p₁ a }
x : m { a // p₂ a }
⊢ (Seq.seq (pure Subtype.val) fun x_1 =>
      Seq.seq (Seq.seq (pure fun x x_2 => ⟨x.val x_2.val, ⋯⟩) fun x => f) fun x_2 => x) =
    Seq.seq (Seq.seq (pure Subtype.val) fun x => f) fun x_1 => Seq.seq (pure Subtype.val) fun x_2 => x
state_after: m : Type u_1 → Type u_2
α α✝ : Type u_1
p₁ : (α → α✝) → Prop
f✝ : m (α → α✝)
p₂ : α → Prop
q : α✝ → Prop
inst✝¹ : Applicative m
inst✝ : LawfulApplicative m
x✝ : m α
hf : SatisfiesM p₁ f✝
hx : SatisfiesM p₂ x✝
H : ∀ {f : α → α✝} {a : α}, p₁ f → p₂ a → q (f a)
f : m { a // p₁ a }
x : m { a // p₂ a }
⊢ (Seq.seq (Seq.seq (pure (Function.comp Subtype.val ∘ fun x x_1 => ⟨x.val x_1.val, ⋯⟩)) fun x => f) fun x_1 => x) =
    Seq.seq ((fun h => h Subtype.val) <$> Function.comp <$> Seq.seq (pure Subtype.val) fun x => f) fun x_1 => x
tactic: simp [SatisfiesM, seq_assoc]
state_before: m : Type u_1 → Type u_2
α α✝ : Type u_1
p₁ : (α → α✝) → Prop
f✝ : m (α → α✝)
p₂ : α → Prop
q : α✝ → Prop
inst✝¹ : Applicative m
inst✝ : LawfulApplicative m
x✝ : m α
hf : SatisfiesM p₁ f✝
hx : SatisfiesM p₂ x✝
H : ∀ {f : α → α✝} {a : α}, p₁ f → p₂ a → q (f a)
f : m { a // p₁ a }
x : m { a // p₂ a }
⊢ (Seq.seq (Seq.seq (pure (Function.comp Subtype.val ∘ fun x x_1 => ⟨x.val x_1.val, ⋯⟩)) fun x => f) fun x_1 => x) =
    Seq.seq ((fun h => h Subtype.val) <$> Function.comp <$> Seq.seq (pure Subtype.val) fun x => f) fun x_1 => x
state_after: m : Type u_1 → Type u_2
α α✝ : Type u_1
p₁ : (α → α✝) → Prop
f✝ : m (α → α✝)
p₂ : α → Prop
q : α✝ → Prop
inst✝¹ : Applicative m
inst✝ : LawfulApplicative m
x✝ : m α
hf : SatisfiesM p₁ f✝
hx : SatisfiesM p₂ x✝
H : ∀ {f : α → α✝} {a : α}, p₁ f → p₂ a → q (f a)
f : m { a // p₁ a }
x : m { a // p₂ a }
⊢ (Seq.seq (Seq.seq (pure (Function.comp Subtype.val ∘ fun x x_1 => ⟨x.val x_1.val, ⋯⟩)) fun x => f) fun x_1 => x) =
    Seq.seq
      (Seq.seq (pure fun h => h Subtype.val) fun x =>
        Seq.seq (pure Function.comp) fun x => Seq.seq (pure Subtype.val) fun x => f)
      fun x_1 => x
tactic: simp only [← pure_seq]
state_before: m : Type u_1 → Type u_2
α α✝ : Type u_1
p₁ : (α → α✝) → Prop
f✝ : m (α → α✝)
p₂ : α → Prop
q : α✝ → Prop
inst✝¹ : Applicative m
inst✝ : LawfulApplicative m
x✝ : m α
hf : SatisfiesM p₁ f✝
hx : SatisfiesM p₂ x✝
H : ∀ {f : α → α✝} {a : α}, p₁ f → p₂ a → q (f a)
f : m { a // p₁ a }
x : m { a // p₂ a }
⊢ (Seq.seq (Seq.seq (pure (Function.comp Subtype.val ∘ fun x x_1 => ⟨x.val x_1.val, ⋯⟩)) fun x => f) fun x_1 => x) =
    Seq.seq
      (Seq.seq (pure fun h => h Subtype.val) fun x =>
        Seq.seq (pure Function.comp) fun x => Seq.seq (pure Subtype.val) fun x => f)
      fun x_1 => x
state_after: no goals
tactic: simp [seq_assoc, Function.comp_def]