l3lab/ntp-mathlib huggingface dataset:
theorem reindexLinearEquiv_trans (e₁ : m ≃ m') (e₂ : n ≃ n') (e₁' : m' ≃ m'') (e₂' : n' ≃ n'') :
    (reindexLinearEquiv R A e₁ e₂).trans (reindexLinearEquiv R A e₁' e₂') =
      (reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂') : _ ≃ₗ[R] _) := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
l' : Type u_5
m' : Type u_6
n' : Type u_7
o' : Type u_8
m'' : Type u_9
n'' : Type u_10
R : Type u_11
A : Type u_12
inst✝² : Semiring R
inst✝¹ : AddCommMonoid A
inst✝ : Module R A
e₁ : m ≃ m'
e₂ : n ≃ n'
e₁' : m' ≃ m''
e₂' : n' ≃ n''
⊢ reindexLinearEquiv R A e₁ e₂ ≪≫ₗ reindexLinearEquiv R A e₁' e₂' = reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂')

Next tactic:
ext
theorem reindexLinearEquiv_trans (e₁ : m ≃ m') (e₂ : n ≃ n') (e₁' : m' ≃ m'') (e₂' : n' ≃ n'') :
    (reindexLinearEquiv R A e₁ e₂).trans (reindexLinearEquiv R A e₁' e₂') =
      (reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂') : _ ≃ₗ[R] _) := by
  ext
  

Proof state:
case h.a.h
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
l' : Type u_5
m' : Type u_6
n' : Type u_7
o' : Type u_8
m'' : Type u_9
n'' : Type u_10
R : Type u_11
A : Type u_12
inst✝² : Semiring R
inst✝¹ : AddCommMonoid A
inst✝ : Module R A
e₁ : m ≃ m'
e₂ : n ≃ n'
e₁' : m' ≃ m''
e₂' : n' ≃ n''
x✝¹ : Matrix m n A
i✝ : m''
x✝ : n''
⊢ (reindexLinearEquiv R A e₁ e₂ ≪≫ₗ reindexLinearEquiv R A e₁' e₂') x✝¹ i✝ x✝ =
    (reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂')) x✝¹ i✝ x✝

Next tactic:
rfl
theorem reindexLinearEquiv_comp (e₁ : m ≃ m') (e₂ : n ≃ n') (e₁' : m' ≃ m'') (e₂' : n' ≃ n'') :
    reindexLinearEquiv R A e₁' e₂' ∘ reindexLinearEquiv R A e₁ e₂ =
      reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂') := by
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
l' : Type u_5
m' : Type u_6
n' : Type u_7
o' : Type u_8
m'' : Type u_9
n'' : Type u_10
R : Type u_11
A : Type u_12
inst✝² : Semiring R
inst✝¹ : AddCommMonoid A
inst✝ : Module R A
e₁ : m ≃ m'
e₂ : n ≃ n'
e₁' : m' ≃ m''
e₂' : n' ≃ n''
⊢ ⇑(reindexLinearEquiv R A e₁' e₂') ∘ ⇑(reindexLinearEquiv R A e₁ e₂) =
    ⇑(reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂'))

Next tactic:
rw [← reindexLinearEquiv_trans]
theorem reindexLinearEquiv_comp (e₁ : m ≃ m') (e₂ : n ≃ n') (e₁' : m' ≃ m'') (e₂' : n' ≃ n'') :
    reindexLinearEquiv R A e₁' e₂' ∘ reindexLinearEquiv R A e₁ e₂ =
      reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂') := by
  rw [← reindexLinearEquiv_trans]
  

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
l' : Type u_5
m' : Type u_6
n' : Type u_7
o' : Type u_8
m'' : Type u_9
n'' : Type u_10
R : Type u_11
A : Type u_12
inst✝² : Semiring R
inst✝¹ : AddCommMonoid A
inst✝ : Module R A
e₁ : m ≃ m'
e₂ : n ≃ n'
e₁' : m' ≃ m''
e₂' : n' ≃ n''
⊢ ⇑(reindexLinearEquiv R A e₁' e₂') ∘ ⇑(reindexLinearEquiv R A e₁ e₂) =
    ⇑(reindexLinearEquiv R A e₁ e₂ ≪≫ₗ reindexLinearEquiv R A e₁' e₂')

Next tactic:
rfl
/-- For square matrices with coefficients in commutative semirings, the natural map that reindexes
a matrix's rows and columns with equivalent types, `Matrix.reindex`, is an equivalence of algebras.
-/
def reindexAlgEquiv (e : m ≃ n) : Matrix m m R ≃ₐ[R] Matrix n n R :=
  { reindexLinearEquiv R R e e with
    toFun := reindex e e
    map_mul' := fun a b => (reindexLinearEquiv_mul R R e e e a b).symm
    -- Porting note: `submatrix_smul` needed help
    commutes' := fun r => by 

Proof state:
l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
l' : Type u_5
m' : Type u_6
n' : Type u_7
o' : Type u_8
m'' : Type u_9
n'' : Type u_10
R : Type u_11
A : Type u_12
inst✝⁴ : CommSemiring R
inst✝³ : Fintype n
inst✝² : Fintype m
inst✝¹ : DecidableEq m
inst✝ : DecidableEq n
e : m ≃ n
src✝ : Matrix m m R ≃ₗ[R] Matrix n n R := reindexLinearEquiv R R e e
r : R
⊢ Equiv.toFun
      { toFun := ⇑(reindex e e), invFun := src✝.invFun, left_inv := (_ : Function.LeftInverse src✝.invFun src✝.toFun),
        right_inv := (_ : Function.RightInverse src✝.invFun src✝.toFun) }
      ((algebraMap R (Matrix m m R)) r) =
    (algebraMap R (Matrix n n R)) r

Next tactic:
simp [algebraMap, Algebra.toRingHom, submatrix_smul _ 1]
/-- A lawful `Control.Monad` gives a category theory `Monad` on the category of types.
-/
@[simps!]
def ofTypeMonad : Monad (Type u) where
  toFunctor := ofTypeFunctor m
  η' := ⟨@pure m _, fun α β f => funext fun x => (LawfulApplicative.map_pure f x).symm⟩
  μ' := ⟨@joinM m _, fun α β (f : α → β) => funext fun a => by 

Proof state:
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
α β : Type u
f : α → β
a : (ofTypeFunctor m ⋙ ofTypeFunctor m).obj α
⊢ ((ofTypeFunctor m ⋙ ofTypeFunctor m).map f ≫ joinM) a = (joinM ≫ (ofTypeFunctor m).map f) a

Next tactic:
apply joinM_map_map
/-- A lawful `Control.Monad` gives a category theory `Monad` on the category of types.
-/
@[simps!]
def ofTypeMonad : Monad (Type u) where
  toFunctor := ofTypeFunctor m
  η' := ⟨@pure m _, fun α β f => funext fun x => (LawfulApplicative.map_pure f x).symm⟩
  μ' := ⟨@joinM m _, fun α β (f : α → β) => funext fun a => by apply joinM_map_map⟩
  assoc' α := funext fun a => by 

Proof state:
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
α : Type u
a : (ofTypeFunctor m).obj ((ofTypeFunctor m ⋙ ofTypeFunctor m).obj α)
⊢ ((ofTypeFunctor m).map ((NatTrans.mk (@joinM m inst✝¹)).app α) ≫ (NatTrans.mk (@joinM m inst✝¹)).app α) a =
    ((NatTrans.mk (@joinM m inst✝¹)).app ((ofTypeFunctor m).obj α) ≫ (NatTrans.mk (@joinM m inst✝¹)).app α) a

Next tactic:
apply joinM_map_joinM
/-- A lawful `Control.Monad` gives a category theory `Monad` on the category of types.
-/
@[simps!]
def ofTypeMonad : Monad (Type u) where
  toFunctor := ofTypeFunctor m
  η' := ⟨@pure m _, fun α β f => funext fun x => (LawfulApplicative.map_pure f x).symm⟩
  μ' := ⟨@joinM m _, fun α β (f : α → β) => funext fun a => by apply joinM_map_map⟩
  assoc' α := funext fun a => by apply joinM_map_joinM
  left_unit' α := funext fun a => by 

Proof state:
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
α : Type u
a : (𝟭 (Type u)).obj ((ofTypeFunctor m).obj α)
⊢ ((NatTrans.mk (@pure m Applicative.toPure)).app ((ofTypeFunctor m).obj α) ≫ (NatTrans.mk (@joinM m inst✝¹)).app α) a =
    𝟙 ((𝟭 (Type u)).obj ((ofTypeFunctor m).obj α)) a

Next tactic:
apply joinM_pure
/-- A lawful `Control.Monad` gives a category theory `Monad` on the category of types.
-/
@[simps!]
def ofTypeMonad : Monad (Type u) where
  toFunctor := ofTypeFunctor m
  η' := ⟨@pure m _, fun α β f => funext fun x => (LawfulApplicative.map_pure f x).symm⟩
  μ' := ⟨@joinM m _, fun α β (f : α → β) => funext fun a => by apply joinM_map_map⟩
  assoc' α := funext fun a => by apply joinM_map_joinM
  left_unit' α := funext fun a => by apply joinM_pure
  right_unit' α := funext fun a => by 

Proof state:
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
α : Type u
a : (ofTypeFunctor m).obj ((𝟭 (Type u)).obj α)
⊢ ((ofTypeFunctor m).map ((NatTrans.mk (@pure m Applicative.toPure)).app α) ≫ (NatTrans.mk (@joinM m inst✝¹)).app α) a =
    𝟙 ((ofTypeFunctor m).obj ((𝟭 (Type u)).obj α)) a

Next tactic:
apply joinM_map_pure
/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m) where
  functor :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        

Proof state:
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
X✝ Y✝ Z✝ : KleisliCat m
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
⊢ { obj := fun X => X, map := fun {X Y} f => f }.map (f ≫ g) =
    { obj := fun X => X, map := fun {X Y} f => f }.map f ≫ { obj := fun X => X, map := fun {X Y} f => f }.map g

Next tactic:
funext t
/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m) where
  functor :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        funext t
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        

Proof state:
case h
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
X✝ Y✝ Z✝ : KleisliCat m
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
t : { obj := fun X => X, map := fun {X Y} f => f }.obj X✝
⊢ { obj := fun X => X, map := fun {X Y} f => f }.map (f ≫ g) t =
    ({ obj := fun X => X, map := fun {X Y} f => f }.map f ≫ { obj := fun X => X, map := fun {X Y} f => f }.map g) t

Next tactic:
change _ = joinM (g <$> (f t))
/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m) where
  functor :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        funext t
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change _ = joinM (g <$> (f t))
        

Proof state:
case h
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
X✝ Y✝ Z✝ : KleisliCat m
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
t : { obj := fun X => X, map := fun {X Y} f => f }.obj X✝
⊢ { obj := fun X => X, map := fun {X Y} f => f }.map (f ≫ g) t = joinM (g <$> f t)

Next tactic:
simp only [joinM, seq_bind_eq, Function.comp.left_id]
/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m) where
  functor :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        funext t
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change _ = joinM (g <$> (f t))
        simp only [joinM, seq_bind_eq, Function.comp.left_id]
        

Proof state:
case h
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
X✝ Y✝ Z✝ : KleisliCat m
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
t : { obj := fun X => X, map := fun {X Y} f => f }.obj X✝
⊢ (f ≫ g) t = f t >>= g

Next tactic:
rfl
/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m) where
  functor :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        funext t
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change _ = joinM (g <$> (f t))
        simp only [joinM, seq_bind_eq, Function.comp.left_id]
        rfl }
  inverse :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        --Porting note: Need these instances for some lemmas below.
        --Should they be added as actual instances elsewhere?
        

Proof state:
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
X✝ Y✝ Z✝ : Kleisli (ofTypeMonad m)
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
⊢ { obj := fun X => X, map := fun {X Y} f => f }.map (f ≫ g) =
    { obj := fun X => X, map := fun {X Y} f => f }.map f ≫ { obj := fun X => X, map := fun {X Y} f => f }.map g

Next tactic:
letI : _root_.Monad (ofTypeMonad m).obj :=
          show _root_.Monad m from inferInstance
/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m) where
  functor :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        funext t
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change _ = joinM (g <$> (f t))
        simp only [joinM, seq_bind_eq, Function.comp.left_id]
        rfl }
  inverse :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        --Porting note: Need these instances for some lemmas below.
        --Should they be added as actual instances elsewhere?
        letI : _root_.Monad (ofTypeMonad m).obj :=
          show _root_.Monad m from inferInstance
        

Proof state:
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
X✝ Y✝ Z✝ : Kleisli (ofTypeMonad m)
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
this : _root_.Monad (ofTypeMonad m).toFunctor.toPrefunctor.obj :=
  let_fun this := inferInstance;
  this
⊢ { obj := fun X => X, map := fun {X Y} f => f }.map (f ≫ g) =
    { obj := fun X => X, map := fun {X Y} f => f }.map f ≫ { obj := fun X => X, map := fun {X Y} f => f }.map g

Next tactic:
letI : LawfulMonad (ofTypeMonad m).obj :=
          show LawfulMonad m from inferInstance
/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m) where
  functor :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        funext t
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change _ = joinM (g <$> (f t))
        simp only [joinM, seq_bind_eq, Function.comp.left_id]
        rfl }
  inverse :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        --Porting note: Need these instances for some lemmas below.
        --Should they be added as actual instances elsewhere?
        letI : _root_.Monad (ofTypeMonad m).obj :=
          show _root_.Monad m from inferInstance
        letI : LawfulMonad (ofTypeMonad m).obj :=
          show LawfulMonad m from inferInstance
        

Proof state:
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
X✝ Y✝ Z✝ : Kleisli (ofTypeMonad m)
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
this✝ : _root_.Monad (ofTypeMonad m).toFunctor.toPrefunctor.obj :=
  let_fun this := inferInstance;
  this
this : LawfulMonad (ofTypeMonad m).toFunctor.toPrefunctor.obj :=
  let_fun this := inferInstance;
  this
⊢ { obj := fun X => X, map := fun {X Y} f => f }.map (f ≫ g) =
    { obj := fun X => X, map := fun {X Y} f => f }.map f ≫ { obj := fun X => X, map := fun {X Y} f => f }.map g

Next tactic:
funext t
/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m) where
  functor :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        funext t
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change _ = joinM (g <$> (f t))
        simp only [joinM, seq_bind_eq, Function.comp.left_id]
        rfl }
  inverse :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        --Porting note: Need these instances for some lemmas below.
        --Should they be added as actual instances elsewhere?
        letI : _root_.Monad (ofTypeMonad m).obj :=
          show _root_.Monad m from inferInstance
        letI : LawfulMonad (ofTypeMonad m).obj :=
          show LawfulMonad m from inferInstance
        funext t
        

Proof state:
case h
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
X✝ Y✝ Z✝ : Kleisli (ofTypeMonad m)
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
this✝ : _root_.Monad (ofTypeMonad m).toFunctor.toPrefunctor.obj :=
  let_fun this := inferInstance;
  this
this : LawfulMonad (ofTypeMonad m).toFunctor.toPrefunctor.obj :=
  let_fun this := inferInstance;
  this
t : { obj := fun X => X, map := fun {X Y} f => f }.obj X✝
⊢ { obj := fun X => X, map := fun {X Y} f => f }.map (f ≫ g) t =
    ({ obj := fun X => X, map := fun {X Y} f => f }.map f ≫ { obj := fun X => X, map := fun {X Y} f => f }.map g) t

Next tactic:
dsimp
/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m) where
  functor :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        funext t
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change _ = joinM (g <$> (f t))
        simp only [joinM, seq_bind_eq, Function.comp.left_id]
        rfl }
  inverse :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        --Porting note: Need these instances for some lemmas below.
        --Should they be added as actual instances elsewhere?
        letI : _root_.Monad (ofTypeMonad m).obj :=
          show _root_.Monad m from inferInstance
        letI : LawfulMonad (ofTypeMonad m).obj :=
          show LawfulMonad m from inferInstance
        funext t
        dsimp
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        

Proof state:
case h
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
X✝ Y✝ Z✝ : Kleisli (ofTypeMonad m)
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
this✝ : _root_.Monad (ofTypeMonad m).toFunctor.toPrefunctor.obj :=
  let_fun this := inferInstance;
  this
this : LawfulMonad (ofTypeMonad m).toFunctor.toPrefunctor.obj :=
  let_fun this := inferInstance;
  this
t : { obj := fun X => X, map := fun {X Y} f => f }.obj X✝
⊢ (f ≫ g) t = (f ≫ g) t

Next tactic:
change joinM (g <$> (f t)) = _
/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m) where
  functor :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        funext t
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change _ = joinM (g <$> (f t))
        simp only [joinM, seq_bind_eq, Function.comp.left_id]
        rfl }
  inverse :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        --Porting note: Need these instances for some lemmas below.
        --Should they be added as actual instances elsewhere?
        letI : _root_.Monad (ofTypeMonad m).obj :=
          show _root_.Monad m from inferInstance
        letI : LawfulMonad (ofTypeMonad m).obj :=
          show LawfulMonad m from inferInstance
        funext t
        dsimp
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change joinM (g <$> (f t)) = _
        

Proof state:
case h
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
X✝ Y✝ Z✝ : Kleisli (ofTypeMonad m)
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
this✝ : _root_.Monad (ofTypeMonad m).toFunctor.toPrefunctor.obj :=
  let_fun this := inferInstance;
  this
this : LawfulMonad (ofTypeMonad m).toFunctor.toPrefunctor.obj :=
  let_fun this := inferInstance;
  this
t : { obj := fun X => X, map := fun {X Y} f => f }.obj X✝
⊢ joinM (g <$> f t) = (f ≫ g) t

Next tactic:
simp only [joinM, seq_bind_eq, Function.comp.left_id]
/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m) where
  functor :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        funext t
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change _ = joinM (g <$> (f t))
        simp only [joinM, seq_bind_eq, Function.comp.left_id]
        rfl }
  inverse :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        --Porting note: Need these instances for some lemmas below.
        --Should they be added as actual instances elsewhere?
        letI : _root_.Monad (ofTypeMonad m).obj :=
          show _root_.Monad m from inferInstance
        letI : LawfulMonad (ofTypeMonad m).obj :=
          show LawfulMonad m from inferInstance
        funext t
        dsimp
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change joinM (g <$> (f t)) = _
        simp only [joinM, seq_bind_eq, Function.comp.left_id]
        

Proof state:
case h
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
X✝ Y✝ Z✝ : Kleisli (ofTypeMonad m)
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
this✝ : _root_.Monad (ofTypeMonad m).toFunctor.toPrefunctor.obj :=
  let_fun this := inferInstance;
  this
this : LawfulMonad (ofTypeMonad m).toFunctor.toPrefunctor.obj :=
  let_fun this := inferInstance;
  this
t : { obj := fun X => X, map := fun {X Y} f => f }.obj X✝
⊢ f t >>= g = (f ≫ g) t

Next tactic:
rfl
/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m) where
  functor :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        funext t
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change _ = joinM (g <$> (f t))
        simp only [joinM, seq_bind_eq, Function.comp.left_id]
        rfl }
  inverse :=
    { obj := fun X => X
      map := fun f => f
      map_id := fun X => rfl
      map_comp := fun f g => by
        --unfold_projs
        --Porting note: Need these instances for some lemmas below.
        --Should they be added as actual instances elsewhere?
        letI : _root_.Monad (ofTypeMonad m).obj :=
          show _root_.Monad m from inferInstance
        letI : LawfulMonad (ofTypeMonad m).obj :=
          show LawfulMonad m from inferInstance
        funext t
        dsimp
        -- Porting note: missing tactic `unfold_projs`, using `change` instead.
        change joinM (g <$> (f t)) = _
        simp only [joinM, seq_bind_eq, Function.comp.left_id]
        rfl }
  unitIso := by
    

Proof state:
m : Type u → Type u
inst✝¹ : _root_.Monad m
inst✝ : LawfulMonad m
⊢ 𝟭 (KleisliCat m) ≅
    Functor.mk { obj := fun X => X, map := fun {X Y} f => f } ⋙
      Functor.mk { obj := fun X => X, map := fun {X Y} f => f }

Next tactic:
refine' NatIso.ofComponents (fun X => Iso.refl X) fun f => _