l3lab/ntp-mathlib huggingface dataset:
/-- The convergent of `GeneralizedContinuedFraction.of v` at step `n - 1` is exactly `v` if the
`IntFractPair.stream` of the corresponding continued fraction terminated at step `n`. -/
theorem of_correctness_of_nth_stream_eq_none (nth_stream_eq_none : IntFractPair.stream v n = none) :
    v = (of v).convergents (n - 1) := by
  induction n with
  | zero => contradiction
  -- IntFractPair.stream v 0 ≠ none
  | succ n IH =>
    let g := of v
    change v = g.convergents n
    have :
      IntFractPair.stream v n = none ∨ ∃ ifp, IntFractPair.stream v n = some ifp ∧ ifp.fr = 0 :=
      IntFractPair.succ_nth_stream_eq_none_iff.1 nth_stream_eq_none
    rcases this with (⟨nth_stream_eq_none⟩ | ⟨ifp_n, nth_stream_eq, nth_stream_fr_eq_zero⟩)
    · cases' n with n'
      · contradiction
      -- IntFractPair.stream v 0 ≠ none
      · have : g.TerminatedAt n' :=
          of_terminatedAt_n_iff_succ_nth_intFractPair_stream_eq_none.2
            nth_stream_eq_none
        have : g.convergents (n' + 1) = g.convergents n' :=
          convergents_stable_of_terminated n'.le_succ this
        rw [this]
        

Proof state:
case succ.inl.succ
K : Type u_1
inst✝¹ : LinearOrderedField K
v : K
n : ℕ
inst✝ : FloorRing K
g : GeneralizedContinuedFraction K := of v
n' : ℕ
IH : IntFractPair.stream v (Nat.succ n') = none → v = convergents (of v) (Nat.succ n' - 1)
nth_stream_eq_none✝ : IntFractPair.stream v (Nat.succ (Nat.succ n')) = none
nth_stream_eq_none : IntFractPair.stream v (Nat.succ n') = none
this✝ : TerminatedAt g n'
this : convergents g (n' + 1) = convergents g n'
⊢ v = convergents g n'

Next tactic:
exact IH nth_stream_eq_none
/-- The convergent of `GeneralizedContinuedFraction.of v` at step `n - 1` is exactly `v` if the
`IntFractPair.stream` of the corresponding continued fraction terminated at step `n`. -/
theorem of_correctness_of_nth_stream_eq_none (nth_stream_eq_none : IntFractPair.stream v n = none) :
    v = (of v).convergents (n - 1) := by
  induction n with
  | zero => contradiction
  -- IntFractPair.stream v 0 ≠ none
  | succ n IH =>
    let g := of v
    change v = g.convergents n
    have :
      IntFractPair.stream v n = none ∨ ∃ ifp, IntFractPair.stream v n = some ifp ∧ ifp.fr = 0 :=
      IntFractPair.succ_nth_stream_eq_none_iff.1 nth_stream_eq_none
    rcases this with (⟨nth_stream_eq_none⟩ | ⟨ifp_n, nth_stream_eq, nth_stream_fr_eq_zero⟩)
    · cases' n with n'
      · contradiction
      -- IntFractPair.stream v 0 ≠ none
      · have : g.TerminatedAt n' :=
          of_terminatedAt_n_iff_succ_nth_intFractPair_stream_eq_none.2
            nth_stream_eq_none
        have : g.convergents (n' + 1) = g.convergents n' :=
          convergents_stable_of_terminated n'.le_succ this
        rw [this]
        exact IH nth_stream_eq_none
    · 

Proof state:
case succ.inr.intro.intro
K : Type u_1
inst✝¹ : LinearOrderedField K
v : K
n✝ : ℕ
inst✝ : FloorRing K
n : ℕ
IH : IntFractPair.stream v n = none → v = convergents (of v) (n - 1)
nth_stream_eq_none : IntFractPair.stream v (Nat.succ n) = none
g : GeneralizedContinuedFraction K := of v
ifp_n : IntFractPair K
nth_stream_eq : IntFractPair.stream v n = some ifp_n
nth_stream_fr_eq_zero : ifp_n.fr = 0
⊢ v = convergents g n

Next tactic:
simpa [nth_stream_fr_eq_zero, compExactValue] using
        compExactValue_correctness_of_stream_eq_some nth_stream_eq
/-- If `GeneralizedContinuedFraction.of v` terminates, then its convergents will eventually always
be `v`.
-/
theorem of_correctness_atTop_of_terminates (terminates : (of v).Terminates) :
    ∀ᶠ n in atTop, v = (of v).convergents n := by
  

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
v : K
n : ℕ
inst✝ : FloorRing K
terminates : Terminates (of v)
⊢ ∀ᶠ (n : ℕ) in atTop, v = convergents (of v) n

Next tactic:
rw [eventually_atTop]
/-- If `GeneralizedContinuedFraction.of v` terminates, then its convergents will eventually always
be `v`.
-/
theorem of_correctness_atTop_of_terminates (terminates : (of v).Terminates) :
    ∀ᶠ n in atTop, v = (of v).convergents n := by
  rw [eventually_atTop]
  

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
v : K
n : ℕ
inst✝ : FloorRing K
terminates : Terminates (of v)
⊢ ∃ a, ∀ b ≥ a, v = convergents (of v) b

Next tactic:
obtain ⟨n, terminated_at_n⟩ : ∃ n, (of v).TerminatedAt n
/-- If `GeneralizedContinuedFraction.of v` terminates, then its convergents will eventually always
be `v`.
-/
theorem of_correctness_atTop_of_terminates (terminates : (of v).Terminates) :
    ∀ᶠ n in atTop, v = (of v).convergents n := by
  rw [eventually_atTop]
  obtain ⟨n, terminated_at_n⟩ : ∃ n, (of v).TerminatedAt n
  

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
v : K
n : ℕ
inst✝ : FloorRing K
terminates : Terminates (of v)
⊢ ∃ n, TerminatedAt (of v) n
case intro
K : Type u_1
inst✝¹ : LinearOrderedField K
v : K
n✝ : ℕ
inst✝ : FloorRing K
terminates : Terminates (of v)
n : ℕ
terminated_at_n : TerminatedAt (of v) n
⊢ ∃ a, ∀ b ≥ a, v = convergents (of v) b

Next tactic:
exact terminates
/-- If `GeneralizedContinuedFraction.of v` terminates, then its convergents will eventually always
be `v`.
-/
theorem of_correctness_atTop_of_terminates (terminates : (of v).Terminates) :
    ∀ᶠ n in atTop, v = (of v).convergents n := by
  rw [eventually_atTop]
  obtain ⟨n, terminated_at_n⟩ : ∃ n, (of v).TerminatedAt n
  exact terminates
  

Proof state:
case intro
K : Type u_1
inst✝¹ : LinearOrderedField K
v : K
n✝ : ℕ
inst✝ : FloorRing K
terminates : Terminates (of v)
n : ℕ
terminated_at_n : TerminatedAt (of v) n
⊢ ∃ a, ∀ b ≥ a, v = convergents (of v) b

Next tactic:
use n
/-- If `GeneralizedContinuedFraction.of v` terminates, then its convergents will eventually always
be `v`.
-/
theorem of_correctness_atTop_of_terminates (terminates : (of v).Terminates) :
    ∀ᶠ n in atTop, v = (of v).convergents n := by
  rw [eventually_atTop]
  obtain ⟨n, terminated_at_n⟩ : ∃ n, (of v).TerminatedAt n
  exact terminates
  use n
  

Proof state:
case h
K : Type u_1
inst✝¹ : LinearOrderedField K
v : K
n✝ : ℕ
inst✝ : FloorRing K
terminates : Terminates (of v)
n : ℕ
terminated_at_n : TerminatedAt (of v) n
⊢ ∀ b ≥ n, v = convergents (of v) b

Next tactic:
intro m m_geq_n
/-- If `GeneralizedContinuedFraction.of v` terminates, then its convergents will eventually always
be `v`.
-/
theorem of_correctness_atTop_of_terminates (terminates : (of v).Terminates) :
    ∀ᶠ n in atTop, v = (of v).convergents n := by
  rw [eventually_atTop]
  obtain ⟨n, terminated_at_n⟩ : ∃ n, (of v).TerminatedAt n
  exact terminates
  use n
  intro m m_geq_n
  

Proof state:
case h
K : Type u_1
inst✝¹ : LinearOrderedField K
v : K
n✝ : ℕ
inst✝ : FloorRing K
terminates : Terminates (of v)
n : ℕ
terminated_at_n : TerminatedAt (of v) n
m : ℕ
m_geq_n : m ≥ n
⊢ v = convergents (of v) m

Next tactic:
rw [convergents_stable_of_terminated m_geq_n terminated_at_n]
/-- If `GeneralizedContinuedFraction.of v` terminates, then its convergents will eventually always
be `v`.
-/
theorem of_correctness_atTop_of_terminates (terminates : (of v).Terminates) :
    ∀ᶠ n in atTop, v = (of v).convergents n := by
  rw [eventually_atTop]
  obtain ⟨n, terminated_at_n⟩ : ∃ n, (of v).TerminatedAt n
  exact terminates
  use n
  intro m m_geq_n
  rw [convergents_stable_of_terminated m_geq_n terminated_at_n]
  

Proof state:
case h
K : Type u_1
inst✝¹ : LinearOrderedField K
v : K
n✝ : ℕ
inst✝ : FloorRing K
terminates : Terminates (of v)
n : ℕ
terminated_at_n : TerminatedAt (of v) n
m : ℕ
m_geq_n : m ≥ n
⊢ v = convergents (of v) n

Next tactic:
exact of_correctness_of_terminatedAt terminated_at_n
@[functor_norm]
theorem seq_map_assoc (x : F (α → β)) (f : γ → α) (y : F γ) :
    x <*> f <$> y = (· ∘ f) <$> x <*> y := by
  

Proof state:
α β γ : Type u
F : Type u → Type v
inst✝¹ : Applicative F
inst✝ : LawfulApplicative F
x : F (α → β)
f : γ → α
y : F γ
⊢ (Seq.seq x fun x => f <$> y) = Seq.seq ((fun x => x ∘ f) <$> x) fun x => y

Next tactic:
simp only [← pure_seq]
@[functor_norm]
theorem seq_map_assoc (x : F (α → β)) (f : γ → α) (y : F γ) :
    x <*> f <$> y = (· ∘ f) <$> x <*> y := by
  simp only [← pure_seq]
  

Proof state:
α β γ : Type u
F : Type u → Type v
inst✝¹ : Applicative F
inst✝ : LawfulApplicative F
x : F (α → β)
f : γ → α
y : F γ
⊢ (Seq.seq x fun x => Seq.seq (pure f) fun x => y) = Seq.seq (Seq.seq (pure fun x => x ∘ f) fun x_1 => x) fun x => y

Next tactic:
simp only [seq_assoc, Function.comp, seq_pure, ← comp_map]
@[functor_norm]
theorem seq_map_assoc (x : F (α → β)) (f : γ → α) (y : F γ) :
    x <*> f <$> y = (· ∘ f) <$> x <*> y := by
  simp only [← pure_seq]
  simp only [seq_assoc, Function.comp, seq_pure, ← comp_map]
  

Proof state:
α β γ : Type u
F : Type u → Type v
inst✝¹ : Applicative F
inst✝ : LawfulApplicative F
x : F (α → β)
f : γ → α
y : F γ
⊢ (Seq.seq ((fun x x_1 => x (f x_1)) <$> x) fun x => y) =
    Seq.seq (Seq.seq (pure fun x x_1 => x (f x_1)) fun x_1 => x) fun x => y

Next tactic:
simp [pure_seq]
@[functor_norm]
theorem map_seq (f : β → γ) (x : F (α → β)) (y : F α) :
    f <$> (x <*> y) = (f ∘ ·) <$> x <*> y := by
  

Proof state:
α β γ : Type u
F : Type u → Type v
inst✝¹ : Applicative F
inst✝ : LawfulApplicative F
f : β → γ
x : F (α → β)
y : F α
⊢ (f <$> Seq.seq x fun x => y) = Seq.seq ((fun x => f ∘ x) <$> x) fun x => y

Next tactic:
simp only [← pure_seq]
@[functor_norm]
theorem map_seq (f : β → γ) (x : F (α → β)) (y : F α) :
    f <$> (x <*> y) = (f ∘ ·) <$> x <*> y := by
  simp only [← pure_seq]; 

Proof state:
α β γ : Type u
F : Type u → Type v
inst✝¹ : Applicative F
inst✝ : LawfulApplicative F
f : β → γ
x : F (α → β)
y : F α
⊢ (Seq.seq (pure f) fun x_1 => Seq.seq x fun x => y) = Seq.seq (Seq.seq (pure fun x => f ∘ x) fun x_1 => x) fun x => y

Next tactic:
simp [seq_assoc]
theorem map_bind (x : m α) {g : α → m β} {f : β → γ} :
    f <$> (x >>= g) = x >>= fun a => f <$> g a := by
  

Proof state:
α β γ : Type u
m : Type u → Type v
inst✝¹ : Monad m
inst✝ : LawfulMonad m
x : m α
g : α → m β
f : β → γ
⊢ f <$> (x >>= g) = do
    let a ← x
    f <$> g a

Next tactic:
rw [← bind_pure_comp, bind_assoc]
theorem map_bind (x : m α) {g : α → m β} {f : β → γ} :
    f <$> (x >>= g) = x >>= fun a => f <$> g a := by
  rw [← bind_pure_comp, bind_assoc]; 

Proof state:
α β γ : Type u
m : Type u → Type v
inst✝¹ : Monad m
inst✝ : LawfulMonad m
x : m α
g : α → m β
f : β → γ
⊢ (do
      let x ← x
      let a ← g x
      pure (f a)) =
    do
    let a ← x
    f <$> g a

Next tactic:
simp [bind_pure_comp]
theorem seq_bind_eq (x : m α) {g : β → m γ} {f : α → β} :
    f <$> x >>= g = x >>= g ∘ f :=
  show bind (f <$> x) g = bind x (g ∘ f) by
    

Proof state:
α β γ : Type u
m : Type u → Type v
inst✝¹ : Monad m
inst✝ : LawfulMonad m
x : m α
g : β → m γ
f : α → β
⊢ f <$> x >>= g = x >>= g ∘ f

Next tactic:
rw [← bind_pure_comp, bind_assoc]
theorem seq_bind_eq (x : m α) {g : β → m γ} {f : α → β} :
    f <$> x >>= g = x >>= g ∘ f :=
  show bind (f <$> x) g = bind x (g ∘ f) by
    rw [← bind_pure_comp, bind_assoc]
    

Proof state:
α β γ : Type u
m : Type u → Type v
inst✝¹ : Monad m
inst✝ : LawfulMonad m
x : m α
g : β → m γ
f : α → β
⊢ (x >>= fun x => pure (f x) >>= g) = x >>= g ∘ f

Next tactic:
simp [pure_bind, Function.comp_def]
@[functor_norm]
theorem fish_pure {α β} (f : α → m β) : f >=> pure = f := by
  

Proof state:
α✝ β✝ γ : Type u
m : Type u → Type v
inst✝¹ : Monad m
inst✝ : LawfulMonad m
α : Type u_1
β : Type u
f : α → m β
⊢ f >=> pure = f

Next tactic:
simp (config := { unfoldPartialApp := true }) only [(· >=> ·), functor_norm]
@[functor_norm]
theorem fish_pipe {α β} (f : α → m β) : pure >=> f = f := by
  

Proof state:
α✝ β✝ γ : Type u
m : Type u → Type v
inst✝¹ : Monad m
inst✝ : LawfulMonad m
α β : Type u
f : α → m β
⊢ pure >=> f = f

Next tactic:
simp (config := { unfoldPartialApp := true }) only [(· >=> ·), functor_norm]
@[functor_norm]
theorem fish_assoc {α β γ φ} (f : α → m β) (g : β → m γ) (h : γ → m φ) :
    (f >=> g) >=> h = f >=> g >=> h := by
  

Proof state:
α✝ β✝ γ✝ : Type u
m : Type u → Type v
inst✝¹ : Monad m
inst✝ : LawfulMonad m
α : Type u_1
β γ φ : Type u
f : α → m β
g : β → m γ
h : γ → m φ
⊢ (f >=> g) >=> h = f >=> g >=> h

Next tactic:
simp (config := { unfoldPartialApp := true }) only [(· >=> ·), functor_norm]
theorem joinM_map_map {α β : Type u} (f : α → β) (a : m (m α)) :
    joinM (Functor.map f <$> a) = f <$> joinM a := by
  

Proof state:
α✝ β✝ γ : Type u
m : Type u → Type u
inst✝¹ : Monad m
inst✝ : LawfulMonad m
α β : Type u
f : α → β
a : m (m α)
⊢ joinM (Functor.map f <$> a) = f <$> joinM a

Next tactic:
simp only [joinM, (· ∘ ·), id.def, ← bind_pure_comp, bind_assoc, map_bind, pure_bind]
theorem joinM_map_joinM {α : Type u} (a : m (m (m α))) : joinM (joinM <$> a) = joinM (joinM a) := by
  

Proof state:
α✝ β γ : Type u
m : Type u → Type u
inst✝¹ : Monad m
inst✝ : LawfulMonad m
α : Type u
a : m (m (m α))
⊢ joinM (joinM <$> a) = joinM (joinM a)

Next tactic:
simp only [joinM, (· ∘ ·), id.def, map_bind, ← bind_pure_comp, bind_assoc, pure_bind]
@[simp]
theorem joinM_map_pure {α : Type u} (a : m α) : joinM (pure <$> a) = a := by
  

Proof state:
α✝ β γ : Type u
m : Type u → Type u
inst✝¹ : Monad m
inst✝ : LawfulMonad m
α : Type u
a : m α
⊢ joinM (pure <$> a) = a

Next tactic:
simp only [joinM, (· ∘ ·), id.def, map_bind, ← bind_pure_comp, bind_assoc, pure_bind, bind_pure]
@[simp]
theorem guard_true {h : Decidable True} : @guard F _ True h = pure () := by 

Proof state:
α β γ : Type u
F : Type → Type v
inst✝ : Alternative F
h : Decidable True
⊢ guard True = pure ()

Next tactic:
simp [guard, if_pos]
@[simp]
theorem guard_false {h : Decidable False} : @guard F _ False h = failure :=
  by 

Proof state:
α β γ : Type u
F : Type → Type v
inst✝ : Alternative F
h : Decidable False
⊢ guard False = failure

Next tactic:
simp [guard, if_neg not_false]
instance : LawfulFunctor (Sum.{v, u} e) := by
  

Proof state:
α β γ : Type u
e : Type v
⊢ LawfulFunctor (Sum e)

Next tactic:
refine' { .. }
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> 

Proof state:
case refine'_1
α β γ : Type u
e : Type v
⊢ ∀ {α β : Type u}, Functor.mapConst = Functor.map ∘ Function.const β

Next tactic:
intros
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> 

Proof state:
case refine'_2
α β γ : Type u
e : Type v
⊢ ∀ {α : Type u} (x : e ⊕ α), id <$> x = x

Next tactic:
intros
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> 

Proof state:
case refine'_3
α β γ : Type u
e : Type v
⊢ ∀ {α β γ : Type u} (g : α → β) (h : β → γ) (x : e ⊕ α), (h ∘ g) <$> x = h <$> g <$> x

Next tactic:
intros
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> intros <;> (

Proof state:
case refine'_1
α β γ : Type u
e : Type v
α✝ β✝ : Type u
⊢ Functor.mapConst = Functor.map ∘ Function.const β✝

Next tactic:
try casesm Sum _ _
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> intros <;> (try 

Proof state:
case refine'_1
α β γ : Type u
e : Type v
α✝ β✝ : Type u
⊢ Functor.mapConst = Functor.map ∘ Function.const β✝

Next tactic:
casesm Sum _ _
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> intros <;> (

Proof state:
case refine'_2
α β γ : Type u
e : Type v
α✝ : Type u
x✝ : e ⊕ α✝
⊢ id <$> x✝ = x✝

Next tactic:
try casesm Sum _ _
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> intros <;> (try 

Proof state:
case refine'_2
α β γ : Type u
e : Type v
α✝ : Type u
x✝ : e ⊕ α✝
⊢ id <$> x✝ = x✝

Next tactic:
casesm Sum _ _
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> intros <;> (

Proof state:
case refine'_3
α β γ : Type u
e : Type v
α✝ β✝ γ✝ : Type u
g✝ : α✝ → β✝
h✝ : β✝ → γ✝
x✝ : e ⊕ α✝
⊢ (h✝ ∘ g✝) <$> x✝ = h✝ <$> g✝ <$> x✝

Next tactic:
try casesm Sum _ _
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> intros <;> (try 

Proof state:
case refine'_3
α β γ : Type u
e : Type v
α✝ β✝ γ✝ : Type u
g✝ : α✝ → β✝
h✝ : β✝ → γ✝
x✝ : e ⊕ α✝
⊢ (h✝ ∘ g✝) <$> x✝ = h✝ <$> g✝ <$> x✝

Next tactic:
casesm Sum _ _
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> intros <;> (try casesm Sum _ _) <;> 

Proof state:
case refine'_1
α β γ : Type u
e : Type v
α✝ β✝ : Type u
⊢ Functor.mapConst = Functor.map ∘ Function.const β✝

Next tactic:
rfl
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> intros <;> (try casesm Sum _ _) <;> 

Proof state:
case refine'_2.inl
α β γ : Type u
e : Type v
α✝ : Type u
val✝ : e
⊢ id <$> inl val✝ = inl val✝

Next tactic:
rfl
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> intros <;> (try casesm Sum _ _) <;> 

Proof state:
case refine'_2.inr
α β γ : Type u
e : Type v
α✝ : Type u
val✝ : α✝
⊢ id <$> inr val✝ = inr val✝

Next tactic:
rfl
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> intros <;> (try casesm Sum _ _) <;> 

Proof state:
case refine'_3.inl
α β γ : Type u
e : Type v
α✝ β✝ γ✝ : Type u
g✝ : α✝ → β✝
h✝ : β✝ → γ✝
val✝ : e
⊢ (h✝ ∘ g✝) <$> inl val✝ = h✝ <$> g✝ <$> inl val✝

Next tactic:
rfl
instance : LawfulFunctor (Sum.{v, u} e) := by
  refine' { .. } <;> intros <;> (try casesm Sum _ _) <;> 

Proof state:
case refine'_3.inr
α β γ : Type u
e : Type v
α✝ β✝ γ✝ : Type u
g✝ : α✝ → β✝
h✝ : β✝ → γ✝
val✝ : α✝
⊢ (h✝ ∘ g✝) <$> inr val✝ = h✝ <$> g✝ <$> inr val✝

Next tactic:
rfl
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> rfl
  seqLeft_eq := by
    

Proof state:
α β γ : Type u
e : Type v
⊢ ∀ {α β : Type u} (x : e ⊕ α) (y : e ⊕ β), (SeqLeft.seqLeft x fun x => y) = Seq.seq (Function.const β <$> x) fun x => y

Next tactic:
intros
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> rfl
  seqLeft_eq := by
    intros
    

Proof state:
α β γ : Type u
e : Type v
α✝ β✝ : Type u
x✝ : e ⊕ α✝
y✝ : e ⊕ β✝
⊢ (SeqLeft.seqLeft x✝ fun x => y✝) = Seq.seq (Function.const β✝ <$> x✝) fun x => y✝

Next tactic:
casesm Sum _ _
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> rfl
  seqLeft_eq := by
    intros
    casesm Sum _ _ <;> 

Proof state:
case inl
α β γ : Type u
e : Type v
α✝ β✝ : Type u
y✝ : e ⊕ β✝
val✝ : e
⊢ (SeqLeft.seqLeft (inl val✝) fun x => y✝) = Seq.seq (Function.const β✝ <$> inl val✝) fun x => y✝

Next tactic:
rfl
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> rfl
  seqLeft_eq := by
    intros
    casesm Sum _ _ <;> 

Proof state:
case inr
α β γ : Type u
e : Type v
α✝ β✝ : Type u
y✝ : e ⊕ β✝
val✝ : α✝
⊢ (SeqLeft.seqLeft (inr val✝) fun x => y✝) = Seq.seq (Function.const β✝ <$> inr val✝) fun x => y✝

Next tactic:
rfl
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    

Proof state:
α β γ : Type u
e : Type v
⊢ ∀ {α β : Type u} (x : e ⊕ α) (y : e ⊕ β),
    (SeqRight.seqRight x fun x => y) = Seq.seq (Function.const α id <$> x) fun x => y

Next tactic:
intros
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    

Proof state:
α β γ : Type u
e : Type v
α✝ β✝ : Type u
x✝ : e ⊕ α✝
y✝ : e ⊕ β✝
⊢ (SeqRight.seqRight x✝ fun x => y✝) = Seq.seq (Function.const α✝ id <$> x✝) fun x => y✝

Next tactic:
casesm Sum _ _
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> 

Proof state:
case inl
α β γ : Type u
e : Type v
α✝ β✝ : Type u
y✝ : e ⊕ β✝
val✝ : e
⊢ (SeqRight.seqRight (inl val✝) fun x => y✝) = Seq.seq (Function.const α✝ id <$> inl val✝) fun x => y✝

Next tactic:
casesm Sum _ _
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> 

Proof state:
case inr
α β γ : Type u
e : Type v
α✝ β✝ : Type u
y✝ : e ⊕ β✝
val✝ : α✝
⊢ (SeqRight.seqRight (inr val✝) fun x => y✝) = Seq.seq (Function.const α✝ id <$> inr val✝) fun x => y✝

Next tactic:
casesm Sum _ _
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> 

Proof state:
case inl.inl
α β γ : Type u
e : Type v
α✝ β✝ : Type u
val✝¹ val✝ : e
⊢ (SeqRight.seqRight (inl val✝¹) fun x => inl val✝) = Seq.seq (Function.const α✝ id <$> inl val✝¹) fun x => inl val✝

Next tactic:
rfl
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> 

Proof state:
case inl.inr
α β γ : Type u
e : Type v
α✝ β✝ : Type u
val✝¹ : e
val✝ : β✝
⊢ (SeqRight.seqRight (inl val✝¹) fun x => inr val✝) = Seq.seq (Function.const α✝ id <$> inl val✝¹) fun x => inr val✝

Next tactic:
rfl
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> 

Proof state:
case inr.inl
α β γ : Type u
e : Type v
α✝ β✝ : Type u
val✝¹ : α✝
val✝ : e
⊢ (SeqRight.seqRight (inr val✝¹) fun x => inl val✝) = Seq.seq (Function.const α✝ id <$> inr val✝¹) fun x => inl val✝

Next tactic:
rfl
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> 

Proof state:
case inr.inr
α β γ : Type u
e : Type v
α✝ β✝ : Type u
val✝¹ : α✝
val✝ : β✝
⊢ (SeqRight.seqRight (inr val✝¹) fun x => inr val✝) = Seq.seq (Function.const α✝ id <$> inr val✝¹) fun x => inr val✝

Next tactic:
rfl
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> rfl
  seqLeft_eq := by
    intros
    casesm Sum _ _ <;> rfl
  pure_seq := by
    

Proof state:
α β γ : Type u
e : Type v
⊢ ∀ {α β : Type u} (g : α → β) (x : e ⊕ α), (Seq.seq (pure g) fun x_1 => x) = g <$> x

Next tactic:
intros
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> rfl
  seqLeft_eq := by
    intros
    casesm Sum _ _ <;> rfl
  pure_seq := by
    intros
    

Proof state:
α β γ : Type u
e : Type v
α✝ β✝ : Type u
g✝ : α✝ → β✝
x✝ : e ⊕ α✝
⊢ (Seq.seq (pure g✝) fun x => x✝) = g✝ <$> x✝

Next tactic:
rfl
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> rfl
  seqLeft_eq := by
    intros
    casesm Sum _ _ <;> rfl
  pure_seq := by
    intros
    rfl
  bind_assoc := by
    intros
    casesm Sum _ _ <;> rfl
  pure_bind := by
    intros
    rfl
  bind_pure_comp := by
    

Proof state:
α β γ : Type u
e : Type v
⊢ ∀ {α β : Type u} (f : α → β) (x : e ⊕ α),
    (do
        let a ← x
        pure (f a)) =
      f <$> x

Next tactic:
intros
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> rfl
  seqLeft_eq := by
    intros
    casesm Sum _ _ <;> rfl
  pure_seq := by
    intros
    rfl
  bind_assoc := by
    intros
    casesm Sum _ _ <;> rfl
  pure_bind := by
    intros
    rfl
  bind_pure_comp := by
    intros
    

Proof state:
α β γ : Type u
e : Type v
α✝ β✝ : Type u
f✝ : α✝ → β✝
x✝ : e ⊕ α✝
⊢ (do
      let a ← x✝
      pure (f✝ a)) =
    f✝ <$> x✝

Next tactic:
casesm Sum _ _
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> rfl
  seqLeft_eq := by
    intros
    casesm Sum _ _ <;> rfl
  pure_seq := by
    intros
    rfl
  bind_assoc := by
    intros
    casesm Sum _ _ <;> rfl
  pure_bind := by
    intros
    rfl
  bind_pure_comp := by
    intros
    casesm Sum _ _ <;> 

Proof state:
case inl
α β γ : Type u
e : Type v
α✝ β✝ : Type u
f✝ : α✝ → β✝
val✝ : e
⊢ (do
      let a ← inl val✝
      pure (f✝ a)) =
    f✝ <$> inl val✝

Next tactic:
rfl
instance : LawfulMonad (Sum.{v, u} e) where
  seqRight_eq := by
    intros
    casesm Sum _ _ <;> casesm Sum _ _ <;> rfl
  seqLeft_eq := by
    intros
    casesm Sum _ _ <;> rfl
  pure_seq := by
    intros
    rfl
  bind_assoc := by
    intros
    casesm Sum _ _ <;> rfl
  pure_bind := by
    intros
    rfl
  bind_pure_comp := by
    intros
    casesm Sum _ _ <;> 

Proof state:
case inr
α β γ : Type u
e : Type v
α✝ β✝ : Type u
f✝ : α✝ → β✝
val✝ : α✝
⊢ (do
      let a ← inr val✝
      pure (f✝ a)) =
    f✝ <$> inr val✝

Next tactic:
rfl