l3lab/ntp-mathlib huggingface dataset:
/-- Given a `k`-linear `G`-representation `A`, there is a `k`-linear isomorphism between
representation morphisms `Hom(k[G], A)` and `A`. -/
@[simps]
noncomputable def leftRegularHomEquiv (A : Rep k G) : (Rep.ofMulAction k G G ⟶ A) ≃ₗ[k] A where
  toFun f := f.hom (Finsupp.single 1 1)
  map_add' x y := rfl
  map_smul' r x := rfl
  invFun x := leftRegularHom A x
  left_inv f := by
    refine' Action.Hom.ext _ _ (Finsupp.lhom_ext' fun x : G => LinearMap.ext_ring _)
    have :
      f.hom ((ofMulAction k G G).ρ x (Finsupp.single (1 : G) (1 : k))) =
        A.ρ x (f.hom (Finsupp.single (1 : G) (1 : k))) :=
      LinearMap.ext_iff.1 (f.comm x) (Finsupp.single 1 1)
/- Porting note: rest of broken proof was
    simp only [LinearMap.comp_apply, Finsupp.lsingle_apply, left_regular_hom_hom,
      Finsupp.lift_apply, Finsupp.sum_single_index, one_smul, ← this, zero_smul, of_ρ_apply,
      Representation.ofMulAction_single x (1 : G) (1 : k), smul_eq_mul, mul_one] -/
    simp only [LinearMap.comp_apply, Finsupp.lsingle_apply, leftRegularHom_hom]
    erw [Finsupp.lift_apply]
    rw [Finsupp.sum_single_index, ← this, of_ρ_apply]
    erw [Representation.ofMulAction_single x (1 : G) (1 : k)]
    

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
X Y : Action (Type u) (MonCat.of G)
f✝ : X ⟶ Y
A : Rep k G
f : ofMulAction k G G ⟶ A
x : G
this : f.hom (((ρ (ofMulAction k G G)) x) fun₀ | 1 => 1) = ((ρ A) x) (f.hom fun₀ | 1 => 1)
⊢ (1 • f.hom fun₀ | x • 1 => 1) = f.hom fun₀ | x => 1
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
X Y : Action (Type u) (MonCat.of G)
f✝ : X ⟶ Y
A : Rep k G
f : ofMulAction k G G ⟶ A
x : G
this : f.hom (((ρ (ofMulAction k G G)) x) fun₀ | 1 => 1) = ((ρ A) x) (f.hom fun₀ | 1 => 1)
⊢ 0 • ((ρ A) x) (f.hom fun₀ | 1 => 1) = 0

Next tactic:
simp only [one_smul, smul_eq_mul, mul_one]
/-- Given a `k`-linear `G`-representation `A`, there is a `k`-linear isomorphism between
representation morphisms `Hom(k[G], A)` and `A`. -/
@[simps]
noncomputable def leftRegularHomEquiv (A : Rep k G) : (Rep.ofMulAction k G G ⟶ A) ≃ₗ[k] A where
  toFun f := f.hom (Finsupp.single 1 1)
  map_add' x y := rfl
  map_smul' r x := rfl
  invFun x := leftRegularHom A x
  left_inv f := by
    refine' Action.Hom.ext _ _ (Finsupp.lhom_ext' fun x : G => LinearMap.ext_ring _)
    have :
      f.hom ((ofMulAction k G G).ρ x (Finsupp.single (1 : G) (1 : k))) =
        A.ρ x (f.hom (Finsupp.single (1 : G) (1 : k))) :=
      LinearMap.ext_iff.1 (f.comm x) (Finsupp.single 1 1)
/- Porting note: rest of broken proof was
    simp only [LinearMap.comp_apply, Finsupp.lsingle_apply, left_regular_hom_hom,
      Finsupp.lift_apply, Finsupp.sum_single_index, one_smul, ← this, zero_smul, of_ρ_apply,
      Representation.ofMulAction_single x (1 : G) (1 : k), smul_eq_mul, mul_one] -/
    simp only [LinearMap.comp_apply, Finsupp.lsingle_apply, leftRegularHom_hom]
    erw [Finsupp.lift_apply]
    rw [Finsupp.sum_single_index, ← this, of_ρ_apply]
    erw [Representation.ofMulAction_single x (1 : G) (1 : k)]
    simp only [one_smul, smul_eq_mul, mul_one]
    · -- This goal didn't exist before leanprover/lean4#2644
      

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
X Y : Action (Type u) (MonCat.of G)
f✝ : X ⟶ Y
A : Rep k G
f : ofMulAction k G G ⟶ A
x : G
this : f.hom (((ρ (ofMulAction k G G)) x) fun₀ | 1 => 1) = ((ρ A) x) (f.hom fun₀ | 1 => 1)
⊢ (f.hom fun₀ | x => 1) = f.hom fun₀ | x => 1

Next tactic:
rfl
/-- Given a `k`-linear `G`-representation `A`, there is a `k`-linear isomorphism between
representation morphisms `Hom(k[G], A)` and `A`. -/
@[simps]
noncomputable def leftRegularHomEquiv (A : Rep k G) : (Rep.ofMulAction k G G ⟶ A) ≃ₗ[k] A where
  toFun f := f.hom (Finsupp.single 1 1)
  map_add' x y := rfl
  map_smul' r x := rfl
  invFun x := leftRegularHom A x
  left_inv f := by
    refine' Action.Hom.ext _ _ (Finsupp.lhom_ext' fun x : G => LinearMap.ext_ring _)
    have :
      f.hom ((ofMulAction k G G).ρ x (Finsupp.single (1 : G) (1 : k))) =
        A.ρ x (f.hom (Finsupp.single (1 : G) (1 : k))) :=
      LinearMap.ext_iff.1 (f.comm x) (Finsupp.single 1 1)
/- Porting note: rest of broken proof was
    simp only [LinearMap.comp_apply, Finsupp.lsingle_apply, left_regular_hom_hom,
      Finsupp.lift_apply, Finsupp.sum_single_index, one_smul, ← this, zero_smul, of_ρ_apply,
      Representation.ofMulAction_single x (1 : G) (1 : k), smul_eq_mul, mul_one] -/
    simp only [LinearMap.comp_apply, Finsupp.lsingle_apply, leftRegularHom_hom]
    erw [Finsupp.lift_apply]
    rw [Finsupp.sum_single_index, ← this, of_ρ_apply]
    erw [Representation.ofMulAction_single x (1 : G) (1 : k)]
    simp only [one_smul, smul_eq_mul, mul_one]
    · -- This goal didn't exist before leanprover/lean4#2644
      rfl
    · 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
X Y : Action (Type u) (MonCat.of G)
f✝ : X ⟶ Y
A : Rep k G
f : ofMulAction k G G ⟶ A
x : G
this : f.hom (((ρ (ofMulAction k G G)) x) fun₀ | 1 => 1) = ((ρ A) x) (f.hom fun₀ | 1 => 1)
⊢ 0 • ((ρ A) x) (f.hom fun₀ | 1 => 1) = 0

Next tactic:
rw [zero_smul]
theorem leftRegularHomEquiv_symm_single {A : Rep k G} (x : A) (g : G) :
    ((leftRegularHomEquiv A).symm x).hom (Finsupp.single g 1) = A.ρ g x := by
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
X Y : Action (Type u) (MonCat.of G)
f : X ⟶ Y
A : Rep k G
x : CoeSort.coe A
g : G
⊢ (((LinearEquiv.symm (leftRegularHomEquiv A)) x).hom fun₀ | g => 1) = ((ρ A) g) x

Next tactic:
erw [leftRegularHomEquiv_symm_apply, leftRegularHom_hom, Finsupp.lift_apply,
    Finsupp.sum_single_index, one_smul]
theorem leftRegularHomEquiv_symm_single {A : Rep k G} (x : A) (g : G) :
    ((leftRegularHomEquiv A).symm x).hom (Finsupp.single g 1) = A.ρ g x := by
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  erw [leftRegularHomEquiv_symm_apply, leftRegularHom_hom, Finsupp.lift_apply,
    Finsupp.sum_single_index, one_smul]
  · 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
X Y : Action (Type u) (MonCat.of G)
f : X ⟶ Y
A : Rep k G
x : CoeSort.coe A
g : G
⊢ 0 • ((ρ A) g) x = 0

Next tactic:
rw [zero_smul]
/-- Given a `k`-linear `G`-representation `(A, ρ₁)`, this is the 'internal Hom' functor sending
`(B, ρ₂)` to the representation `Homₖ(A, B)` that maps `g : G` and `f : A →ₗ[k] B` to
`(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
@[simps]
protected def ihom (A : Rep k G) : Rep k G ⥤ Rep k G where
  obj B := Rep.of (Representation.linHom A.ρ B.ρ)
  map := fun {X} {Y} f =>
    { hom := ModuleCat.ofHom (LinearMap.llcomp k _ _ _ f.hom)
      comm := fun g => LinearMap.ext fun x => LinearMap.ext fun y => by
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B C A X Y : Rep k G
f : X ⟶ Y
g : ↑(MonCat.of G)
x : ↑((fun B => of (Representation.linHom (ρ A) (ρ B))) X).V
y : CoeSort.coe A
⊢ ((((fun B => of (Representation.linHom (ρ A) (ρ B))) X).ρ g ≫
          ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom))
        x)
      y =
    ((ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom) ≫
          ((fun B => of (Representation.linHom (ρ A) (ρ B))) Y).ρ g)
        x)
      y

Next tactic:
show f.hom (X.ρ g _) = _
/-- Given a `k`-linear `G`-representation `(A, ρ₁)`, this is the 'internal Hom' functor sending
`(B, ρ₂)` to the representation `Homₖ(A, B)` that maps `g : G` and `f : A →ₗ[k] B` to
`(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
@[simps]
protected def ihom (A : Rep k G) : Rep k G ⥤ Rep k G where
  obj B := Rep.of (Representation.linHom A.ρ B.ρ)
  map := fun {X} {Y} f =>
    { hom := ModuleCat.ofHom (LinearMap.llcomp k _ _ _ f.hom)
      comm := fun g => LinearMap.ext fun x => LinearMap.ext fun y => by
        show f.hom (X.ρ g _) = _
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B C A X Y : Rep k G
f : X ⟶ Y
g : ↑(MonCat.of G)
x : ↑((fun B => of (Representation.linHom (ρ A) (ρ B))) X).V
y : CoeSort.coe A
⊢ f.hom (((ρ X) g) ((LinearMap.comp x ((ρ A) g⁻¹)) y)) =
    ((ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom) ≫
          ((fun B => of (Representation.linHom (ρ A) (ρ B))) Y).ρ g)
        x)
      y

Next tactic:
simp only [hom_comm_apply]
/-- Given a `k`-linear `G`-representation `(A, ρ₁)`, this is the 'internal Hom' functor sending
`(B, ρ₂)` to the representation `Homₖ(A, B)` that maps `g : G` and `f : A →ₗ[k] B` to
`(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
@[simps]
protected def ihom (A : Rep k G) : Rep k G ⥤ Rep k G where
  obj B := Rep.of (Representation.linHom A.ρ B.ρ)
  map := fun {X} {Y} f =>
    { hom := ModuleCat.ofHom (LinearMap.llcomp k _ _ _ f.hom)
      comm := fun g => LinearMap.ext fun x => LinearMap.ext fun y => by
        show f.hom (X.ρ g _) = _
        simp only [hom_comm_apply]; 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B C A X Y : Rep k G
f : X ⟶ Y
g : ↑(MonCat.of G)
x : ↑((fun B => of (Representation.linHom (ρ A) (ρ B))) X).V
y : CoeSort.coe A
⊢ ((ρ Y) g) (f.hom ((LinearMap.comp x ((ρ A) g⁻¹)) y)) =
    ((ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom) ≫
          (of (Representation.linHom (ρ A) (ρ Y))).ρ g)
        x)
      y

Next tactic:
rfl
/-- Given a `k`-linear `G`-representation `(A, ρ₁)`, this is the 'internal Hom' functor sending
`(B, ρ₂)` to the representation `Homₖ(A, B)` that maps `g : G` and `f : A →ₗ[k] B` to
`(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
@[simps]
protected def ihom (A : Rep k G) : Rep k G ⥤ Rep k G where
  obj B := Rep.of (Representation.linHom A.ρ B.ρ)
  map := fun {X} {Y} f =>
    { hom := ModuleCat.ofHom (LinearMap.llcomp k _ _ _ f.hom)
      comm := fun g => LinearMap.ext fun x => LinearMap.ext fun y => by
        show f.hom (X.ρ g _) = _
        simp only [hom_comm_apply]; rfl }
  map_id := fun _ => by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B C A x✝ : Rep k G
⊢ { obj := fun B => of (Representation.linHom (ρ A) (ρ B)),
          map := fun {X Y} f =>
            Hom.mk (ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)) }.map
      (𝟙 x✝) =
    𝟙
      ({ obj := fun B => of (Representation.linHom (ρ A) (ρ B)),
            map := fun {X Y} f =>
              Hom.mk
                (ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)) }.obj
        x✝)

Next tactic:
ext
/-- Given a `k`-linear `G`-representation `(A, ρ₁)`, this is the 'internal Hom' functor sending
`(B, ρ₂)` to the representation `Homₖ(A, B)` that maps `g : G` and `f : A →ₗ[k] B` to
`(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
@[simps]
protected def ihom (A : Rep k G) : Rep k G ⥤ Rep k G where
  obj B := Rep.of (Representation.linHom A.ρ B.ρ)
  map := fun {X} {Y} f =>
    { hom := ModuleCat.ofHom (LinearMap.llcomp k _ _ _ f.hom)
      comm := fun g => LinearMap.ext fun x => LinearMap.ext fun y => by
        show f.hom (X.ρ g _) = _
        simp only [hom_comm_apply]; rfl }
  map_id := fun _ => by ext; 

Proof state:
case h.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B C A x✝¹ : Rep k G
x✝ :
  ↑({ obj := fun B => of (Representation.linHom (ρ A) (ρ B)),
            map := fun {X Y} f =>
              Hom.mk
                (ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)) }.obj
        x✝¹).V
⊢ ({ obj := fun B => of (Representation.linHom (ρ A) (ρ B)),
              map := fun {X Y} f =>
                Hom.mk
                  (ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)) }.map
          (𝟙 x✝¹)).hom
      x✝ =
    (𝟙
          ({ obj := fun B => of (Representation.linHom (ρ A) (ρ B)),
                map := fun {X Y} f =>
                  Hom.mk
                    (ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)) }.obj
            x✝¹)).hom
      x✝

Next tactic:
rfl
/-- Given a `k`-linear `G`-representation `(A, ρ₁)`, this is the 'internal Hom' functor sending
`(B, ρ₂)` to the representation `Homₖ(A, B)` that maps `g : G` and `f : A →ₗ[k] B` to
`(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
@[simps]
protected def ihom (A : Rep k G) : Rep k G ⥤ Rep k G where
  obj B := Rep.of (Representation.linHom A.ρ B.ρ)
  map := fun {X} {Y} f =>
    { hom := ModuleCat.ofHom (LinearMap.llcomp k _ _ _ f.hom)
      comm := fun g => LinearMap.ext fun x => LinearMap.ext fun y => by
        show f.hom (X.ρ g _) = _
        simp only [hom_comm_apply]; rfl }
  map_id := fun _ => by ext; rfl
  map_comp := fun _ _ => by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B C A X✝ Y✝ Z✝ : Rep k G
x✝¹ : X✝ ⟶ Y✝
x✝ : Y✝ ⟶ Z✝
⊢ { obj := fun B => of (Representation.linHom (ρ A) (ρ B)),
          map := fun {X Y} f =>
            Hom.mk (ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)) }.map
      (x✝¹ ≫ x✝) =
    { obj := fun B => of (Representation.linHom (ρ A) (ρ B)),
            map := fun {X Y} f =>
              Hom.mk
                (ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)) }.map
        x✝¹ ≫
      { obj := fun B => of (Representation.linHom (ρ A) (ρ B)),
            map := fun {X Y} f =>
              Hom.mk
                (ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)) }.map
        x✝

Next tactic:
ext
/-- Given a `k`-linear `G`-representation `(A, ρ₁)`, this is the 'internal Hom' functor sending
`(B, ρ₂)` to the representation `Homₖ(A, B)` that maps `g : G` and `f : A →ₗ[k] B` to
`(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
@[simps]
protected def ihom (A : Rep k G) : Rep k G ⥤ Rep k G where
  obj B := Rep.of (Representation.linHom A.ρ B.ρ)
  map := fun {X} {Y} f =>
    { hom := ModuleCat.ofHom (LinearMap.llcomp k _ _ _ f.hom)
      comm := fun g => LinearMap.ext fun x => LinearMap.ext fun y => by
        show f.hom (X.ρ g _) = _
        simp only [hom_comm_apply]; rfl }
  map_id := fun _ => by ext; rfl
  map_comp := fun _ _ => by ext; 

Proof state:
case h.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B C A X✝ Y✝ Z✝ : Rep k G
x✝² : X✝ ⟶ Y✝
x✝¹ : Y✝ ⟶ Z✝
x✝ :
  ↑({ obj := fun B => of (Representation.linHom (ρ A) (ρ B)),
            map := fun {X Y} f =>
              Hom.mk
                (ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)) }.obj
        X✝).V
⊢ ({ obj := fun B => of (Representation.linHom (ρ A) (ρ B)),
              map := fun {X Y} f =>
                Hom.mk
                  (ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)) }.map
          (x✝² ≫ x✝¹)).hom
      x✝ =
    ({ obj := fun B => of (Representation.linHom (ρ A) (ρ B)),
                map := fun {X Y} f =>
                  Hom.mk
                    (ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)) }.map
            x✝² ≫
          { obj := fun B => of (Representation.linHom (ρ A) (ρ B)),
                map := fun {X Y} f =>
                  Hom.mk
                    (ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)) }.map
            x✝¹).hom
      x✝

Next tactic:
rfl
/-- Given a `k`-linear `G`-representation `A`, this is the Hom-set bijection in the adjunction
`A ⊗ - ⊣ ihom(A, -)`. It sends `f : A ⊗ B ⟶ C` to a `Rep k G` morphism defined by currying the
`k`-linear map underlying `f`, giving a map `A →ₗ[k] B →ₗ[k] C`, then flipping the arguments. -/
def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom A).obj C) where
  toFun f :=
    { hom := (TensorProduct.curry f.hom).flip
      comm := fun g => by
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : A ⊗ B ⟶ C
g : ↑(MonCat.of G)
⊢ B.ρ g ≫ LinearMap.flip (TensorProduct.curry f.hom) =
    LinearMap.flip (TensorProduct.curry f.hom) ≫ ((Rep.ihom A).obj C).ρ g

Next tactic:
refine' LinearMap.ext fun x => LinearMap.ext fun y => _
/-- Given a `k`-linear `G`-representation `A`, this is the Hom-set bijection in the adjunction
`A ⊗ - ⊣ ihom(A, -)`. It sends `f : A ⊗ B ⟶ C` to a `Rep k G` morphism defined by currying the
`k`-linear map underlying `f`, giving a map `A →ₗ[k] B →ₗ[k] C`, then flipping the arguments. -/
def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom A).obj C) where
  toFun f :=
    { hom := (TensorProduct.curry f.hom).flip
      comm := fun g => by
        refine' LinearMap.ext fun x => LinearMap.ext fun y => _
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : A ⊗ B ⟶ C
g : ↑(MonCat.of G)
x : ↑B.V
y : CoeSort.coe A
⊢ ((B.ρ g ≫ LinearMap.flip (TensorProduct.curry f.hom)) x) y =
    ((LinearMap.flip (TensorProduct.curry f.hom) ≫ ((Rep.ihom A).obj C).ρ g) x) y

Next tactic:
change f.hom (_ ⊗ₜ[k] _) = C.ρ g (f.hom (_ ⊗ₜ[k] _))
/-- Given a `k`-linear `G`-representation `A`, this is the Hom-set bijection in the adjunction
`A ⊗ - ⊣ ihom(A, -)`. It sends `f : A ⊗ B ⟶ C` to a `Rep k G` morphism defined by currying the
`k`-linear map underlying `f`, giving a map `A →ₗ[k] B →ₗ[k] C`, then flipping the arguments. -/
def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom A).obj C) where
  toFun f :=
    { hom := (TensorProduct.curry f.hom).flip
      comm := fun g => by
        refine' LinearMap.ext fun x => LinearMap.ext fun y => _
        change f.hom (_ ⊗ₜ[k] _) = C.ρ g (f.hom (_ ⊗ₜ[k] _))
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : A ⊗ B ⟶ C
g : ↑(MonCat.of G)
x : ↑B.V
y : CoeSort.coe A
⊢ f.hom (y ⊗ₜ[k] (B.ρ g) x) = ((ρ C) g) (f.hom (((ρ A) g⁻¹) y ⊗ₜ[k] x))

Next tactic:
rw [← hom_comm_apply]
/-- Given a `k`-linear `G`-representation `A`, this is the Hom-set bijection in the adjunction
`A ⊗ - ⊣ ihom(A, -)`. It sends `f : A ⊗ B ⟶ C` to a `Rep k G` morphism defined by currying the
`k`-linear map underlying `f`, giving a map `A →ₗ[k] B →ₗ[k] C`, then flipping the arguments. -/
def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom A).obj C) where
  toFun f :=
    { hom := (TensorProduct.curry f.hom).flip
      comm := fun g => by
        refine' LinearMap.ext fun x => LinearMap.ext fun y => _
        change f.hom (_ ⊗ₜ[k] _) = C.ρ g (f.hom (_ ⊗ₜ[k] _))
        rw [← hom_comm_apply]
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : A ⊗ B ⟶ C
g : ↑(MonCat.of G)
x : ↑B.V
y : CoeSort.coe A
⊢ f.hom (y ⊗ₜ[k] (B.ρ g) x) = f.hom (((ρ (A ⊗ B)) g) (((ρ A) g⁻¹) y ⊗ₜ[k] x))

Next tactic:
change _ = f.hom ((A.ρ g * A.ρ g⁻¹) y ⊗ₜ[k] _)
/-- Given a `k`-linear `G`-representation `A`, this is the Hom-set bijection in the adjunction
`A ⊗ - ⊣ ihom(A, -)`. It sends `f : A ⊗ B ⟶ C` to a `Rep k G` morphism defined by currying the
`k`-linear map underlying `f`, giving a map `A →ₗ[k] B →ₗ[k] C`, then flipping the arguments. -/
def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom A).obj C) where
  toFun f :=
    { hom := (TensorProduct.curry f.hom).flip
      comm := fun g => by
        refine' LinearMap.ext fun x => LinearMap.ext fun y => _
        change f.hom (_ ⊗ₜ[k] _) = C.ρ g (f.hom (_ ⊗ₜ[k] _))
        rw [← hom_comm_apply]
        change _ = f.hom ((A.ρ g * A.ρ g⁻¹) y ⊗ₜ[k] _)
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : A ⊗ B ⟶ C
g : ↑(MonCat.of G)
x : ↑B.V
y : CoeSort.coe A
⊢ f.hom (y ⊗ₜ[k] (B.ρ g) x) =
    f.hom
      (((ρ A) g * (ρ A) g⁻¹) y ⊗ₜ[k]
        (((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj B).map g) (((ρ A) g⁻¹) y, x).2)

Next tactic:
simp only [← map_mul, mul_inv_self, map_one]
/-- Given a `k`-linear `G`-representation `A`, this is the Hom-set bijection in the adjunction
`A ⊗ - ⊣ ihom(A, -)`. It sends `f : A ⊗ B ⟶ C` to a `Rep k G` morphism defined by currying the
`k`-linear map underlying `f`, giving a map `A →ₗ[k] B →ₗ[k] C`, then flipping the arguments. -/
def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom A).obj C) where
  toFun f :=
    { hom := (TensorProduct.curry f.hom).flip
      comm := fun g => by
        refine' LinearMap.ext fun x => LinearMap.ext fun y => _
        change f.hom (_ ⊗ₜ[k] _) = C.ρ g (f.hom (_ ⊗ₜ[k] _))
        rw [← hom_comm_apply]
        change _ = f.hom ((A.ρ g * A.ρ g⁻¹) y ⊗ₜ[k] _)
        simp only [← map_mul, mul_inv_self, map_one]
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : A ⊗ B ⟶ C
g : ↑(MonCat.of G)
x : ↑B.V
y : CoeSort.coe A
⊢ f.hom (y ⊗ₜ[k] (B.ρ g) x) =
    f.hom (1 y ⊗ₜ[k] (((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj B).map g) x)

Next tactic:
rfl
/-- Given a `k`-linear `G`-representation `A`, this is the Hom-set bijection in the adjunction
`A ⊗ - ⊣ ihom(A, -)`. It sends `f : A ⊗ B ⟶ C` to a `Rep k G` morphism defined by currying the
`k`-linear map underlying `f`, giving a map `A →ₗ[k] B →ₗ[k] C`, then flipping the arguments. -/
def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom A).obj C) where
  toFun f :=
    { hom := (TensorProduct.curry f.hom).flip
      comm := fun g => by
        refine' LinearMap.ext fun x => LinearMap.ext fun y => _
        change f.hom (_ ⊗ₜ[k] _) = C.ρ g (f.hom (_ ⊗ₜ[k] _))
        rw [← hom_comm_apply]
        change _ = f.hom ((A.ρ g * A.ρ g⁻¹) y ⊗ₜ[k] _)
        simp only [← map_mul, mul_inv_self, map_one]
        rfl }
  invFun f :=
    { hom := TensorProduct.uncurry k _ _ _ f.hom.flip
      comm := fun g => TensorProduct.ext' fun x y => by
/- Porting note: rest of broken proof was
        dsimp only [MonoidalCategory.tensorLeft_obj, ModuleCat.comp_def, LinearMap.comp_apply,
          tensor_rho, ModuleCat.MonoidalCategory.hom_apply, TensorProduct.map_tmul]
        simp only [TensorProduct.uncurry_apply f.hom.flip, LinearMap.flip_apply, Action_ρ_eq_ρ,
          hom_comm_apply f g y, Rep.ihom_obj_ρ_apply, LinearMap.comp_apply, ρ_inv_self_apply] -/
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : B ⟶ (Rep.ihom A).obj C
g : ↑(MonCat.of G)
x : ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj A).obj PUnit.unit)
y : ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj B).obj PUnit.unit)
⊢ ((A ⊗ B).ρ g ≫
        (TensorProduct.uncurry k
            ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj A).obj PUnit.unit)
            ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj B).obj PUnit.unit) ↑C.V)
          (LinearMap.flip f.hom))
      (x ⊗ₜ[k] y) =
    ((TensorProduct.uncurry k
            ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj A).obj PUnit.unit)
            ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj B).obj PUnit.unit) ↑C.V)
          (LinearMap.flip f.hom) ≫
        C.ρ g)
      (x ⊗ₜ[k] y)

Next tactic:
change TensorProduct.uncurry k _ _ _ f.hom.flip (A.ρ g x ⊗ₜ[k] B.ρ g y) =
          C.ρ g (TensorProduct.uncurry k _ _ _ f.hom.flip (x ⊗ₜ[k] y))