l3lab/ntp-mathlib huggingface dataset:
instance : CommApplicative Id := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_7
α✝ β✝ : Type ?u.5436
g✝ : α✝ → β✝
x✝ : α✝
⊢ g✝ <$> pure x✝ = pure (g✝ x✝)

Next tactic:
rfl
instance : CommApplicative Id := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_8
α✝ β✝ : Type ?u.5436
g✝ : Id (α✝ → β✝)
x✝ : α✝
⊢ (Seq.seq g✝ fun x => pure x✝) = (fun h => h x✝) <$> g✝

Next tactic:
rfl
instance : CommApplicative Id := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_9
α✝ β✝ γ✝ : Type ?u.5436
x✝ : Id α✝
g✝ : Id (α✝ → β✝)
h✝ : Id (β✝ → γ✝)
⊢ (Seq.seq h✝ fun x => Seq.seq g✝ fun x => x✝) = Seq.seq (Seq.seq (Function.comp <$> h✝) fun x => g✝) fun x => x✝

Next tactic:
rfl
instance : CommApplicative Id := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_10
α✝ β✝ : Type ?u.5436
a✝ : Id α✝
b✝ : Id β✝
⊢ (Seq.seq (Prod.mk <$> a✝) fun x => b✝) = Seq.seq ((fun b a => (a, b)) <$> b✝) fun x => a✝

Next tactic:
rfl
theorem map_pure (f : α → β) (x : α) : (f <$> pure x : Comp F G β) = pure (f x) :=
  Comp.ext <| by 

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type v
f : α → β
x : α
⊢ run (f <$> pure x) = run (pure (f x))

Next tactic:
simp
theorem seq_pure (f : Comp F G (α → β)) (x : α) : f <*> pure x = (fun g : α → β => g x) <$> f :=
  Comp.ext <| by 

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type v
f : Comp F G (α → β)
x : α
⊢ run (Seq.seq f fun x_1 => pure x) = run ((fun g => g x) <$> f)

Next tactic:
simp [(· ∘ ·), functor_norm]
theorem seq_assoc (x : Comp F G α) (f : Comp F G (α → β)) (g : Comp F G (β → γ)) :
    g <*> (f <*> x) = @Function.comp α β γ <$> g <*> f <*> x :=
  Comp.ext <| by 

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type v
x : Comp F G α
f : Comp F G (α → β)
g : Comp F G (β → γ)
⊢ run (Seq.seq g fun x_1 => Seq.seq f fun x_2 => x) =
    run (Seq.seq (Seq.seq (Function.comp <$> g) fun x => f) fun x_1 => x)

Next tactic:
simp [(· ∘ ·), functor_norm]
theorem pure_seq_eq_map (f : α → β) (x : Comp F G α) : pure f <*> x = f <$> x :=
  Comp.ext <| by 

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

Next tactic:
simp [Applicative.pure_seq_eq_map', functor_norm]
instance instLawfulApplicativeComp : LawfulApplicative (Comp F G) where
  seqLeft_eq := by 

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type v
⊢ ∀ {α β : Type v} (x : Comp F G α) (y : Comp F G β),
    (SeqLeft.seqLeft x fun x => y) = Seq.seq (const β <$> x) fun x => y

Next tactic:
intros
instance instLawfulApplicativeComp : LawfulApplicative (Comp F G) where
  seqLeft_eq := by intros; 

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ α✝ β✝ : Type v
x✝ : Comp F G α✝
y✝ : Comp F G β✝
⊢ (SeqLeft.seqLeft x✝ fun x => y✝) = Seq.seq (const β✝ <$> x✝) fun x => y✝

Next tactic:
rfl
instance instLawfulApplicativeComp : LawfulApplicative (Comp F G) where
  seqLeft_eq := by intros; rfl
  seqRight_eq := by 

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type v
⊢ ∀ {α β : Type v} (x : Comp F G α) (y : Comp F G β),
    (SeqRight.seqRight x fun x => y) = Seq.seq (const α id <$> x) fun x => y

Next tactic:
intros
instance instLawfulApplicativeComp : LawfulApplicative (Comp F G) where
  seqLeft_eq := by intros; rfl
  seqRight_eq := by intros; 

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ α✝ β✝ : Type v
x✝ : Comp F G α✝
y✝ : Comp F G β✝
⊢ (SeqRight.seqRight x✝ fun x => y✝) = Seq.seq (const α✝ id <$> x✝) fun x => y✝

Next tactic:
rfl
theorem applicative_comp_id {F} [AF : Applicative F] [LawfulApplicative F] :
    @Comp.instApplicativeComp F Id _ _ = AF :=
  @Applicative.ext F _ _ (@Comp.instLawfulApplicativeComp F Id _ _ _ _) _
    (fun _ => rfl) (fun f x => show id <$> f <*> x = f <*> x by 

Proof state:
F✝ : Type u → Type w
G : Type v → Type u
inst✝⁴ : Applicative F✝
inst✝³ : Applicative G
inst✝² : LawfulApplicative F✝
inst✝¹ : LawfulApplicative G
α β γ : Type v
F : Type u_1 → Type u_2
AF : Applicative F
inst✝ : LawfulApplicative F
α✝ β✝ : Type u_1
f : F (α✝ → β✝)
x : F α✝
⊢ (Seq.seq (id <$> f) fun x_1 => x) = Seq.seq f fun x_1 => x

Next tactic:
rw [id_map]
instance {f : Type u → Type w} {g : Type v → Type u} [Applicative f] [Applicative g]
    [CommApplicative f] [CommApplicative g] : CommApplicative (Comp f g) := by
  

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝⁷ : Applicative F
inst✝⁶ : Applicative G
inst✝⁵ : LawfulApplicative F
inst✝⁴ : LawfulApplicative G
α β γ : Type v
f : Type u → Type w
g : Type v → Type u
inst✝³ : Applicative f
inst✝² : Applicative g
inst✝¹ : CommApplicative f
inst✝ : CommApplicative g
⊢ CommApplicative (Comp f g)

Next tactic:
refine' { @instLawfulApplicativeComp f g _ _ _ _ with .. }
instance {f : Type u → Type w} {g : Type v → Type u} [Applicative f] [Applicative g]
    [CommApplicative f] [CommApplicative g] : CommApplicative (Comp f g) := by
  refine' { @instLawfulApplicativeComp f g _ _ _ _ with .. }
  

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝⁷ : Applicative F
inst✝⁶ : Applicative G
inst✝⁵ : LawfulApplicative F
inst✝⁴ : LawfulApplicative G
α β γ : Type v
f : Type u → Type w
g : Type v → Type u
inst✝³ : Applicative f
inst✝² : Applicative g
inst✝¹ : CommApplicative f
inst✝ : CommApplicative g
src✝ : LawfulApplicative (Comp f g) := instLawfulApplicativeComp
⊢ ∀ {α β : Type v} (a : Comp f g α) (b : Comp f g β),
    (Seq.seq (Prod.mk <$> a) fun x => b) = Seq.seq ((fun b a => (a, b)) <$> b) fun x => a

Next tactic:
intros
instance {f : Type u → Type w} {g : Type v → Type u} [Applicative f] [Applicative g]
    [CommApplicative f] [CommApplicative g] : CommApplicative (Comp f g) := by
  refine' { @instLawfulApplicativeComp f g _ _ _ _ with .. }
  intros
  

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝⁷ : Applicative F
inst✝⁶ : Applicative G
inst✝⁵ : LawfulApplicative F
inst✝⁴ : LawfulApplicative G
α β γ : Type v
f : Type u → Type w
g : Type v → Type u
inst✝³ : Applicative f
inst✝² : Applicative g
inst✝¹ : CommApplicative f
inst✝ : CommApplicative g
src✝ : LawfulApplicative (Comp f g) := instLawfulApplicativeComp
α✝ β✝ : Type v
a✝ : Comp f g α✝
b✝ : Comp f g β✝
⊢ (Seq.seq (Prod.mk <$> a✝) fun x => b✝) = Seq.seq ((fun b a => (a, b)) <$> b✝) fun x => a✝

Next tactic:
simp! [map, Seq.seq, functor_norm]
instance {f : Type u → Type w} {g : Type v → Type u} [Applicative f] [Applicative g]
    [CommApplicative f] [CommApplicative g] : CommApplicative (Comp f g) := by
  refine' { @instLawfulApplicativeComp f g _ _ _ _ with .. }
  intros
  simp! [map, Seq.seq, functor_norm]
  

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝⁷ : Applicative F
inst✝⁶ : Applicative G
inst✝⁵ : LawfulApplicative F
inst✝⁴ : LawfulApplicative G
α β γ : Type v
f : Type u → Type w
g : Type v → Type u
inst✝³ : Applicative f
inst✝² : Applicative g
inst✝¹ : CommApplicative f
inst✝ : CommApplicative g
src✝ : LawfulApplicative (Comp f g) := instLawfulApplicativeComp
α✝ β✝ : Type v
a✝ : Comp f g α✝
b✝ : Comp f g β✝
⊢ mk (Seq.seq ((fun x x_1 => Seq.seq x fun x => x_1) <$> mk ((fun x => Prod.mk <$> x) <$> a✝)) fun x => b✝) =
    mk
      (Seq.seq ((fun x x_1 => Seq.seq x fun x => x_1) <$> mk ((fun x => (fun b a => (a, b)) <$> x) <$> b✝)) fun x => a✝)

Next tactic:
rw [commutative_map]
instance {f : Type u → Type w} {g : Type v → Type u} [Applicative f] [Applicative g]
    [CommApplicative f] [CommApplicative g] : CommApplicative (Comp f g) := by
  refine' { @instLawfulApplicativeComp f g _ _ _ _ with .. }
  intros
  simp! [map, Seq.seq, functor_norm]
  rw [commutative_map]
  

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝⁷ : Applicative F
inst✝⁶ : Applicative G
inst✝⁵ : LawfulApplicative F
inst✝⁴ : LawfulApplicative G
α β γ : Type v
f : Type u → Type w
g : Type v → Type u
inst✝³ : Applicative f
inst✝² : Applicative g
inst✝¹ : CommApplicative f
inst✝ : CommApplicative g
src✝ : LawfulApplicative (Comp f g) := instLawfulApplicativeComp
α✝ β✝ : Type v
a✝ : Comp f g α✝
b✝ : Comp f g β✝
⊢ mk (Seq.seq ((flip fun x x_1 => Seq.seq x fun x => x_1) <$> b✝) fun x => mk ((fun x => Prod.mk <$> x) <$> a✝)) =
    mk
      (Seq.seq ((fun x x_1 => Seq.seq x fun x => x_1) <$> mk ((fun x => (fun b a => (a, b)) <$> x) <$> b✝)) fun x => a✝)

Next tactic:
simp only [mk, flip, seq_map_assoc, Function.comp, map_map]
instance {f : Type u → Type w} {g : Type v → Type u} [Applicative f] [Applicative g]
    [CommApplicative f] [CommApplicative g] : CommApplicative (Comp f g) := by
  refine' { @instLawfulApplicativeComp f g _ _ _ _ with .. }
  intros
  simp! [map, Seq.seq, functor_norm]
  rw [commutative_map]
  simp only [mk, flip, seq_map_assoc, Function.comp, map_map]
  

Proof state:
F : Type u → Type w
G : Type v → Type u
inst✝⁷ : Applicative F
inst✝⁶ : Applicative G
inst✝⁵ : LawfulApplicative F
inst✝⁴ : LawfulApplicative G
α β γ : Type v
f : Type u → Type w
g : Type v → Type u
inst✝³ : Applicative f
inst✝² : Applicative g
inst✝¹ : CommApplicative f
inst✝ : CommApplicative g
src✝ : LawfulApplicative (Comp f g) := instLawfulApplicativeComp
α✝ β✝ : Type v
a✝ : Comp f g α✝
b✝ : Comp f g β✝
⊢ (Seq.seq ((fun x x_1 => Seq.seq (Prod.mk <$> x_1) fun x_2 => x) <$> b✝) fun x => a✝) =
    Seq.seq ((fun x x_1 => Seq.seq ((fun b a => (a, b)) <$> x) fun x => x_1) <$> b✝) fun x => a✝

Next tactic:
congr
instance {f : Type u → Type w} {g : Type v → Type u} [Applicative f] [Applicative g]
    [CommApplicative f] [CommApplicative g] : CommApplicative (Comp f g) := by
  refine' { @instLawfulApplicativeComp f g _ _ _ _ with .. }
  intros
  simp! [map, Seq.seq, functor_norm]
  rw [commutative_map]
  simp only [mk, flip, seq_map_assoc, Function.comp, map_map]
  congr
  

Proof state:
case e_a.e_a
F : Type u → Type w
G : Type v → Type u
inst✝⁷ : Applicative F
inst✝⁶ : Applicative G
inst✝⁵ : LawfulApplicative F
inst✝⁴ : LawfulApplicative G
α β γ : Type v
f : Type u → Type w
g : Type v → Type u
inst✝³ : Applicative f
inst✝² : Applicative g
inst✝¹ : CommApplicative f
inst✝ : CommApplicative g
src✝ : LawfulApplicative (Comp f g) := instLawfulApplicativeComp
α✝ β✝ : Type v
a✝ : Comp f g α✝
b✝ : Comp f g β✝
⊢ (fun x x_1 => Seq.seq (Prod.mk <$> x_1) fun x_2 => x) = fun x x_1 => Seq.seq ((fun b a => (a, b)) <$> x) fun x => x_1

Next tactic:
funext x y
instance {f : Type u → Type w} {g : Type v → Type u} [Applicative f] [Applicative g]
    [CommApplicative f] [CommApplicative g] : CommApplicative (Comp f g) := by
  refine' { @instLawfulApplicativeComp f g _ _ _ _ with .. }
  intros
  simp! [map, Seq.seq, functor_norm]
  rw [commutative_map]
  simp only [mk, flip, seq_map_assoc, Function.comp, map_map]
  congr
  funext x y
  

Proof state:
case e_a.e_a.h.h
F : Type u → Type w
G : Type v → Type u
inst✝⁷ : Applicative F
inst✝⁶ : Applicative G
inst✝⁵ : LawfulApplicative F
inst✝⁴ : LawfulApplicative G
α β γ : Type v
f : Type u → Type w
g : Type v → Type u
inst✝³ : Applicative f
inst✝² : Applicative g
inst✝¹ : CommApplicative f
inst✝ : CommApplicative g
src✝ : LawfulApplicative (Comp f g) := instLawfulApplicativeComp
α✝ β✝ : Type v
a✝ : Comp f g α✝
b✝ : Comp f g β✝
x : g β✝
y : g α✝
⊢ (Seq.seq (Prod.mk <$> y) fun x_1 => x) = Seq.seq ((fun b a => (a, b)) <$> x) fun x => y

Next tactic:
rw [commutative_map]
instance {f : Type u → Type w} {g : Type v → Type u} [Applicative f] [Applicative g]
    [CommApplicative f] [CommApplicative g] : CommApplicative (Comp f g) := by
  refine' { @instLawfulApplicativeComp f g _ _ _ _ with .. }
  intros
  simp! [map, Seq.seq, functor_norm]
  rw [commutative_map]
  simp only [mk, flip, seq_map_assoc, Function.comp, map_map]
  congr
  funext x y
  rw [commutative_map]
  

Proof state:
case e_a.e_a.h.h
F : Type u → Type w
G : Type v → Type u
inst✝⁷ : Applicative F
inst✝⁶ : Applicative G
inst✝⁵ : LawfulApplicative F
inst✝⁴ : LawfulApplicative G
α β γ : Type v
f : Type u → Type w
g : Type v → Type u
inst✝³ : Applicative f
inst✝² : Applicative g
inst✝¹ : CommApplicative f
inst✝ : CommApplicative g
src✝ : LawfulApplicative (Comp f g) := instLawfulApplicativeComp
α✝ β✝ : Type v
a✝ : Comp f g α✝
b✝ : Comp f g β✝
x : g β✝
y : g α✝
⊢ (Seq.seq (flip Prod.mk <$> x) fun x => y) = Seq.seq ((fun b a => (a, b)) <$> x) fun x => y

Next tactic:
congr
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  

Proof state:
α : Type ?u.36182
inst✝ : Monoid α
⊢ LawfulApplicative (Const α)

Next tactic:
refine' { .. }
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> 

Proof state:
case refine'_1
α : Type ?u.36182
inst✝ : Monoid α
⊢ ∀ {α_1 β : Type ?u.36188}, mapConst = map ∘ Function.const β

Next tactic:
intros
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> 

Proof state:
case refine'_2
α : Type ?u.36182
inst✝ : Monoid α
⊢ ∀ {α_1 : Type ?u.36188} (x : Const α α_1), id <$> x = x

Next tactic:
intros
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> 

Proof state:
case refine'_3
α : Type ?u.36182
inst✝ : Monoid α
⊢ ∀ {α_1 β γ : Type ?u.36188} (g : α_1 → β) (h : β → γ) (x : Const α α_1), (h ∘ g) <$> x = h <$> g <$> x

Next tactic:
intros
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> 

Proof state:
case refine'_4
α : Type ?u.36182
inst✝ : Monoid α
⊢ ∀ {α_1 β : Type ?u.36188} (x : Const α α_1) (y : Const α β),
    (SeqLeft.seqLeft x fun x => y) = Seq.seq (Function.const β <$> x) fun x => y

Next tactic:
intros
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> 

Proof state:
case refine'_5
α : Type ?u.36182
inst✝ : Monoid α
⊢ ∀ {α_1 β : Type ?u.36188} (x : Const α α_1) (y : Const α β),
    (SeqRight.seqRight x fun x => y) = Seq.seq (Function.const α_1 id <$> x) fun x => y

Next tactic:
intros
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> 

Proof state:
case refine'_6
α : Type ?u.36182
inst✝ : Monoid α
⊢ ∀ {α_1 β : Type ?u.36188} (g : α_1 → β) (x : Const α α_1), (Seq.seq (pure g) fun x_1 => x) = g <$> x

Next tactic:
intros
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> 

Proof state:
case refine'_7
α : Type ?u.36182
inst✝ : Monoid α
⊢ ∀ {α_1 β : Type ?u.36188} (g : α_1 → β) (x : α_1), g <$> pure x = pure (g x)

Next tactic:
intros
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> 

Proof state:
case refine'_8
α : Type ?u.36182
inst✝ : Monoid α
⊢ ∀ {α_1 β : Type ?u.36188} (g : Const α (α_1 → β)) (x : α_1), (Seq.seq g fun x_1 => pure x) = (fun h => h x) <$> g

Next tactic:
intros
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> 

Proof state:
case refine'_9
α : Type ?u.36182
inst✝ : Monoid α
⊢ ∀ {α_1 β γ : Type ?u.36188} (x : Const α α_1) (g : Const α (α_1 → β)) (h : Const α (β → γ)),
    (Seq.seq h fun x_1 => Seq.seq g fun x_2 => x) = Seq.seq (Seq.seq (Function.comp <$> h) fun x => g) fun x_1 => x

Next tactic:
intros
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> 

Proof state:
case refine'_1
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ : Type ?u.36188
⊢ mapConst = map ∘ Function.const β✝

Next tactic:
simp [mul_assoc, (· <$> ·), Seq.seq, pure]
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> 

Proof state:
case refine'_2
α : Type ?u.36182
inst✝ : Monoid α
α✝ : Type ?u.36188
x✝ : Const α α✝
⊢ id <$> x✝ = x✝

Next tactic:
simp [mul_assoc, (· <$> ·), Seq.seq, pure]
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> 

Proof state:
case refine'_3
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ γ✝ : Type ?u.36188
g✝ : α✝ → β✝
h✝ : β✝ → γ✝
x✝ : Const α α✝
⊢ (h✝ ∘ g✝) <$> x✝ = h✝ <$> g✝ <$> x✝

Next tactic:
simp [mul_assoc, (· <$> ·), Seq.seq, pure]
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> 

Proof state:
case refine'_4
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ : Type ?u.36188
x✝ : Const α α✝
y✝ : Const α β✝
⊢ (SeqLeft.seqLeft x✝ fun x => y✝) = Seq.seq (Function.const β✝ <$> x✝) fun x => y✝

Next tactic:
simp [mul_assoc, (· <$> ·), Seq.seq, pure]
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> 

Proof state:
case refine'_5
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ : Type ?u.36188
x✝ : Const α α✝
y✝ : Const α β✝
⊢ (SeqRight.seqRight x✝ fun x => y✝) = Seq.seq (Function.const α✝ id <$> x✝) fun x => y✝

Next tactic:
simp [mul_assoc, (· <$> ·), Seq.seq, pure]
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> 

Proof state:
case refine'_6
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ : Type ?u.36188
g✝ : α✝ → β✝
x✝ : Const α α✝
⊢ (Seq.seq (pure g✝) fun x => x✝) = g✝ <$> x✝

Next tactic:
simp [mul_assoc, (· <$> ·), Seq.seq, pure]
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> 

Proof state:
case refine'_7
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ : Type ?u.36188
g✝ : α✝ → β✝
x✝ : α✝
⊢ g✝ <$> pure x✝ = pure (g✝ x✝)

Next tactic:
simp [mul_assoc, (· <$> ·), Seq.seq, pure]
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> 

Proof state:
case refine'_8
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ : Type ?u.36188
g✝ : Const α (α✝ → β✝)
x✝ : α✝
⊢ (Seq.seq g✝ fun x => pure x✝) = (fun h => h x✝) <$> g✝

Next tactic:
simp [mul_assoc, (· <$> ·), Seq.seq, pure]
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> 

Proof state:
case refine'_9
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ γ✝ : Type ?u.36188
x✝ : Const α α✝
g✝ : Const α (α✝ → β✝)
h✝ : Const α (β✝ → γ✝)
⊢ (Seq.seq h✝ fun x => Seq.seq g✝ fun x => x✝) = Seq.seq (Seq.seq (Function.comp <$> h✝) fun x => g✝) fun x => x✝

Next tactic:
simp [mul_assoc, (· <$> ·), Seq.seq, pure]
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> simp [mul_assoc, (· <$> ·), Seq.seq, pure] <;> 

Proof state:
case refine'_1
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ : Type ?u.36188
⊢ mapConst = Const.map ∘ Function.const β✝

Next tactic:
rfl
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> simp [mul_assoc, (· <$> ·), Seq.seq, pure] <;> 

Proof state:
case refine'_2
α : Type ?u.36182
inst✝ : Monoid α
α✝ : Type ?u.36188
x✝ : Const α α✝
⊢ Const.map id x✝ = x✝

Next tactic:
rfl
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> simp [mul_assoc, (· <$> ·), Seq.seq, pure] <;> 

Proof state:
case refine'_3
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ γ✝ : Type ?u.36188
g✝ : α✝ → β✝
h✝ : β✝ → γ✝
x✝ : Const α α✝
⊢ Const.map (h✝ ∘ g✝) x✝ = Const.map h✝ (Const.map g✝ x✝)

Next tactic:
rfl
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> simp [mul_assoc, (· <$> ·), Seq.seq, pure] <;> 

Proof state:
case refine'_4
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ : Type ?u.36188
x✝ : Const α α✝
y✝ : Const α β✝
⊢ (SeqLeft.seqLeft x✝ fun x => y✝) = Const.map (Function.const β✝) x✝ * y✝

Next tactic:
rfl
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> simp [mul_assoc, (· <$> ·), Seq.seq, pure] <;> 

Proof state:
case refine'_5
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ : Type ?u.36188
x✝ : Const α α✝
y✝ : Const α β✝
⊢ (SeqRight.seqRight x✝ fun x => y✝) = Const.map (Function.const α✝ id) x✝ * y✝

Next tactic:
rfl
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> simp [mul_assoc, (· <$> ·), Seq.seq, pure] <;> 

Proof state:
case refine'_6
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ : Type ?u.36188
g✝ : α✝ → β✝
x✝ : Const α α✝
⊢ x✝ = Const.map g✝ x✝

Next tactic:
rfl
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> simp [mul_assoc, (· <$> ·), Seq.seq, pure] <;> 

Proof state:
case refine'_7
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ : Type ?u.36188
g✝ : α✝ → β✝
x✝ : α✝
⊢ Const.map g✝ 1 = 1

Next tactic:
rfl
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> simp [mul_assoc, (· <$> ·), Seq.seq, pure] <;> 

Proof state:
case refine'_8
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ : Type ?u.36188
g✝ : Const α (α✝ → β✝)
x✝ : α✝
⊢ g✝ = Const.map (fun h => h x✝) g✝

Next tactic:
rfl
instance {α} [Monoid α] : LawfulApplicative (Const α) := by
  refine' { .. } <;> intros <;> simp [mul_assoc, (· <$> ·), Seq.seq, pure] <;> 

Proof state:
case refine'_9
α : Type ?u.36182
inst✝ : Monoid α
α✝ β✝ γ✝ : Type ?u.36188
x✝ : Const α α✝
g✝ : Const α (α✝ → β✝)
h✝ : Const α (β✝ → γ✝)
⊢ h✝ * (g✝ * x✝) = Const.map Function.comp h✝ * (g✝ * x✝)

Next tactic:
rfl
instance {α} [AddMonoid α] : LawfulApplicative (AddConst α) := by
  

Proof state:
α : Type ?u.38625
inst✝ : AddMonoid α
⊢ LawfulApplicative (AddConst α)

Next tactic:
refine' { .. }
instance {α} [AddMonoid α] : LawfulApplicative (AddConst α) := by
  refine' { .. } <;> 

Proof state:
case refine'_1
α : Type ?u.38625
inst✝ : AddMonoid α
⊢ ∀ {α_1 β : Type ?u.38630}, mapConst = map ∘ Function.const β

Next tactic:
intros
instance {α} [AddMonoid α] : LawfulApplicative (AddConst α) := by
  refine' { .. } <;> 

Proof state:
case refine'_2
α : Type ?u.38625
inst✝ : AddMonoid α
⊢ ∀ {α_1 : Type ?u.38630} (x : AddConst α α_1), id <$> x = x

Next tactic:
intros
instance {α} [AddMonoid α] : LawfulApplicative (AddConst α) := by
  refine' { .. } <;> 

Proof state:
case refine'_3
α : Type ?u.38625
inst✝ : AddMonoid α
⊢ ∀ {α_1 β γ : Type ?u.38630} (g : α_1 → β) (h : β → γ) (x : AddConst α α_1), (h ∘ g) <$> x = h <$> g <$> x

Next tactic:
intros
instance {α} [AddMonoid α] : LawfulApplicative (AddConst α) := by
  refine' { .. } <;> 

Proof state:
case refine'_4
α : Type ?u.38625
inst✝ : AddMonoid α
⊢ ∀ {α_1 β : Type ?u.38630} (x : AddConst α α_1) (y : AddConst α β),
    (SeqLeft.seqLeft x fun x => y) = Seq.seq (Function.const β <$> x) fun x => y

Next tactic:
intros
instance {α} [AddMonoid α] : LawfulApplicative (AddConst α) := by
  refine' { .. } <;> 

Proof state:
case refine'_5
α : Type ?u.38625
inst✝ : AddMonoid α
⊢ ∀ {α_1 β : Type ?u.38630} (x : AddConst α α_1) (y : AddConst α β),
    (SeqRight.seqRight x fun x => y) = Seq.seq (Function.const α_1 id <$> x) fun x => y

Next tactic:
intros
instance {α} [AddMonoid α] : LawfulApplicative (AddConst α) := by
  refine' { .. } <;> 

Proof state:
case refine'_6
α : Type ?u.38625
inst✝ : AddMonoid α
⊢ ∀ {α_1 β : Type ?u.38630} (g : α_1 → β) (x : AddConst α α_1), (Seq.seq (pure g) fun x_1 => x) = g <$> x

Next tactic:
intros
instance {α} [AddMonoid α] : LawfulApplicative (AddConst α) := by
  refine' { .. } <;> 

Proof state:
case refine'_7
α : Type ?u.38625
inst✝ : AddMonoid α
⊢ ∀ {α_1 β : Type ?u.38630} (g : α_1 → β) (x : α_1), g <$> pure x = pure (g x)

Next tactic:
intros
instance {α} [AddMonoid α] : LawfulApplicative (AddConst α) := by
  refine' { .. } <;> 

Proof state:
case refine'_8
α : Type ?u.38625
inst✝ : AddMonoid α
⊢ ∀ {α_1 β : Type ?u.38630} (g : AddConst α (α_1 → β)) (x : α_1), (Seq.seq g fun x_1 => pure x) = (fun h => h x) <$> g

Next tactic:
intros
instance {α} [AddMonoid α] : LawfulApplicative (AddConst α) := by
  refine' { .. } <;> 

Proof state:
case refine'_9
α : Type ?u.38625
inst✝ : AddMonoid α
⊢ ∀ {α_1 β γ : Type ?u.38630} (x : AddConst α α_1) (g : AddConst α (α_1 → β)) (h : AddConst α (β → γ)),
    (Seq.seq h fun x_1 => Seq.seq g fun x_2 => x) = Seq.seq (Seq.seq (Function.comp <$> h) fun x => g) fun x_1 => x

Next tactic:
intros