l3lab/ntp-mathlib huggingface dataset:
/-- The product of two Chebyshev polynomials is the sum of two other Chebyshev polynomials. -/
theorem mul_T : ∀ m k, 2 * T R m * T R (m + k) = T R (2 * m + k) + T R k
  | 0 => by simp [two_mul, add_mul]
  | 1 => by simp [add_comm]
  | m + 2 => by
    intro k
    -- clean up the `T` nat indices in the goal
    suffices 2 * T R (m + 2) * T R (m + k + 2) = T R (2 * m + k + 4) + T R k by
      have h_nat₁ : 2 * (m + 2) + k = 2 * m + k + 4 := by ring
      have h_nat₂ : m + 2 + k = m + k + 2 := by ring
      simpa [h_nat₁, h_nat₂] using this
    -- clean up the `T` nat indices in the inductive hypothesis applied to `m + 1` and `k + 1`
    have H₁ : 2 * T R (m + 1) * T R (m + k + 2) = T R (2 * m + k + 3) + T R (k + 1) := by
      have h_nat₁ : m + 1 + (k + 1) = m + k + 2 := by ring
      have h_nat₂ : 2 * (m + 1) + (k + 1) = 2 * m + k + 3 := by ring
      simpa [h_nat₁, h_nat₂] using mul_T (m + 1) (k + 1)
    -- clean up the `T` nat indices in the inductive hypothesis applied to `m` and `k + 2`
    have H₂ : 2 * T R m * T R (m + k + 2) = T R (2 * m + k + 2) + T R (k + 2) := by
      have h_nat₁ : 2 * m + (k + 2) = 2 * m + k + 2 := by simp [add_assoc]
      have h_nat₂ : m + (k + 2) = m + k + 2 := by simp [add_assoc]
      simpa [h_nat₁, h_nat₂] using mul_T m (k + 2)
    -- state the `T` recurrence relation for a few useful indices
    have h₁ := T_add_two R m
    have h₂ : T R (2 * m + k + 4) = 2 * X * T R (2 * m + k + 3) - T R (2 * m + k + 2) :=
      T_add_two R (2 * m + k + 2)
    have h₃ := T_add_two R k
    -- the desired identity is an appropriate linear combination of H₁, H₂, h₁, h₂, h₃
    

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
m k : ℕ
H₁ : 2 * T R (m + 1) * T R (m + k + 2) = T R (2 * m + k + 3) + T R (k + 1)
H₂ : 2 * T R m * T R (m + k + 2) = T R (2 * m + k + 2) + T R (k + 2)
h₁ : T R (m + 2) = 2 * X * T R (m + 1) - T R m
h₂ : T R (2 * m + k + 4) = 2 * X * T R (2 * m + k + 3) - T R (2 * m + k + 2)
h₃ : T R (k + 2) = 2 * X * T R (k + 1) - T R k
⊢ 2 * T R (m + 2) * T R (m + k + 2) = T R (2 * m + k + 4) + T R k

Next tactic:
linear_combination 2 * T R (m + k + 2) * h₁ + 2 * (X : R[X]) * H₁ - H₂ - h₂ - h₃
/-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/
theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n)
  | 0 => by 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
⊢ ∀ (n : ℕ), T R (0 * n) = comp (T R 0) (T R n)

Next tactic:
simp
/-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/
theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n)
  | 0 => by simp
  | 1 => by 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
⊢ ∀ (n : ℕ), T R (1 * n) = comp (T R 1) (T R n)

Next tactic:
simp
/-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/
theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n)
  | 0 => by simp
  | 1 => by simp
  | m + 2 => by
    

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
m : ℕ
⊢ ∀ (n : ℕ), T R ((m + 2) * n) = comp (T R (m + 2)) (T R n)

Next tactic:
intro n
/-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/
theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n)
  | 0 => by simp
  | 1 => by simp
  | m + 2 => by
    intro n
    

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
m n : ℕ
⊢ T R ((m + 2) * n) = comp (T R (m + 2)) (T R n)

Next tactic:
have : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n) := by
      convert mul_T R n (m * n) using 1 <;> ring_nf
/-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/
theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n)
  | 0 => by simp
  | 1 => by simp
  | m + 2 => by
    intro n
    have : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n) := by
      

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
m n : ℕ
⊢ 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n)

Next tactic:
convert mul_T R n (m * n) using 1
/-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/
theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n)
  | 0 => by simp
  | 1 => by simp
  | m + 2 => by
    intro n
    have : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n) := by
      convert mul_T R n (m * n) using 1 <;> 

Proof state:
case h.e'_2
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
m n : ℕ
⊢ 2 * T R n * T R ((m + 1) * n) = 2 * T R n * T R (n + m * n)

Next tactic:
ring_nf
/-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/
theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n)
  | 0 => by simp
  | 1 => by simp
  | m + 2 => by
    intro n
    have : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n) := by
      convert mul_T R n (m * n) using 1 <;> 

Proof state:
case h.e'_3
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
m n : ℕ
⊢ T R ((m + 2) * n) + T R (m * n) = T R (2 * n + m * n) + T R (m * n)

Next tactic:
ring_nf
/-- The `(m * n)`-th Chebyshev polynomial is the composition of the `m`-th and `n`-th -/
theorem T_mul : ∀ m n, T R (m * n) = (T R m).comp (T R n)
  | 0 => by simp
  | 1 => by simp
  | m + 2 => by
    intro n
    have : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n) := by
      convert mul_T R n (m * n) using 1 <;> ring_nf
    

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
m n : ℕ
this : 2 * T R n * T R ((m + 1) * n) = T R ((m + 2) * n) + T R (m * n)
⊢ T R ((m + 2) * n) = comp (T R (m + 2)) (T R n)

Next tactic:
simp [this, T_mul m, ← T_mul (m + 1)]
instance : Linear k (FdRep k G) := by 

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
⊢ Linear k (FdRep k G)

Next tactic:
infer_instance
instance (V : FdRep k G) : AddCommGroup V := by
  

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
V : FdRep k G
⊢ AddCommGroup (CoeSort.coe V)

Next tactic:
change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj
instance (V : FdRep k G) : AddCommGroup V := by
  change AddCommGroup ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; 

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
V : FdRep k G
⊢ AddCommGroup ↑((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj

Next tactic:
infer_instance
instance (V : FdRep k G) : Module k V := by
  

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
V : FdRep k G
⊢ Module k (CoeSort.coe V)

Next tactic:
change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj
instance (V : FdRep k G) : Module k V := by
  change Module k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj; 

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
V : FdRep k G
⊢ Module k ↑((forget₂ (FdRep k G) (FGModuleCat k)).obj V).obj

Next tactic:
infer_instance
instance (V : FdRep k G) : FiniteDimensional k V := by
  

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
V : FdRep k G
⊢ FiniteDimensional k (CoeSort.coe V)

Next tactic:
change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V)
instance (V : FdRep k G) : FiniteDimensional k V := by
  change FiniteDimensional k ((forget₂ (FdRep k G) (FGModuleCat k)).obj V); 

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
V : FdRep k G
⊢ FiniteDimensional k ↑((forget₂ (FdRep k G) (FGModuleCat k)).obj V)

Next tactic:
infer_instance
theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) :
    W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by
  -- Porting note: Changed `rw` to `erw`
  

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
V W : FdRep k G
i : V ≅ W
g : G
⊢ (ρ W) g = (LinearEquiv.conj (isoToLinearEquiv i)) ((ρ V) g)

Next tactic:
erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply]
theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) :
    W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by
  -- Porting note: Changed `rw` to `erw`
  erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply]
  

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
V W : FdRep k G
i : V ≅ W
g : G
⊢ (ρ W) g =
    ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i).inv ≫
      (ρ V) g ≫ ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i).hom

Next tactic:
rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)]
theorem Iso.conj_ρ {V W : FdRep k G} (i : V ≅ W) (g : G) :
    W.ρ g = (FdRep.isoToLinearEquiv i).conj (V.ρ g) := by
  -- Porting note: Changed `rw` to `erw`
  erw [FdRep.isoToLinearEquiv, ← FGModuleCat.Iso.conj_eq_conj, Iso.conj_apply]
  rw [Iso.eq_inv_comp ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i)]
  

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
V W : FdRep k G
i : V ≅ W
g : G
⊢ ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i).hom ≫ (ρ W) g =
    (ρ V) g ≫ ((Action.forget (FGModuleCat k) (MonCat.of G)).mapIso i).hom

Next tactic:
exact (i.hom.comm g).symm
theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by
  

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
V : FdRep k G
⊢ Rep.ρ ((forget₂ (FdRep k G) (Rep k G)).obj V) = ρ V

Next tactic:
ext g v
theorem forget₂_ρ (V : FdRep k G) : ((forget₂ (FdRep k G) (Rep k G)).obj V).ρ = V.ρ := by
  ext g v; 

Proof state:
case h.h
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
V : FdRep k G
g : G
v : CoeSort.coe ((forget₂ (FdRep k G) (Rep k G)).obj V)
⊢ ((Rep.ρ ((forget₂ (FdRep k G) (Rep k G)).obj V)) g) v = ((ρ V) g) v

Next tactic:
rfl
example : MonoidalCategory (FdRep k G) := by 

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
⊢ MonoidalCategory (FdRep k G)

Next tactic:
infer_instance
example : MonoidalPreadditive (FdRep k G) := by 

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
⊢ MonoidalPreadditive (FdRep k G)

Next tactic:
infer_instance
example : MonoidalLinear k (FdRep k G) := by 

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
⊢ MonoidalLinear k (FdRep k G)

Next tactic:
infer_instance
instance : HasKernels (FdRep k G) := by 

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
⊢ HasKernels (FdRep k G)

Next tactic:
infer_instance
/-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/
def forget₂HomLinearEquiv (X Y : FdRep k G) :
    ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y
    where
  toFun f := ⟨f.hom, f.comm⟩
  map_add' _ _ := rfl
  map_smul' _ _ := rfl
  invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩
  left_inv _ := by 

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
X Y : FdRep k G
x✝ : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y
⊢ (fun f => Action.Hom.mk ((forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom))
      (AddHom.toFun
        {
            toAddHom :=
              { toFun := fun f => Action.Hom.mk f.hom,
                map_add' :=
                  (_ :
                    ∀ (x x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                      (fun f => Action.Hom.mk f.hom) (x + x_1) = (fun f => Action.Hom.mk f.hom) (x + x_1)) },
            map_smul' :=
              (_ :
                ∀ (x : k) (x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                  AddHom.toFun
                      { toFun := fun f => Action.Hom.mk f.hom,
                        map_add' :=
                          (_ :
                            ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                              (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) }
                      (x • x_1) =
                    AddHom.toFun
                      { toFun := fun f => Action.Hom.mk f.hom,
                        map_add' :=
                          (_ :
                            ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                              (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) }
                      (x • x_1)) }.toAddHom
        x✝) =
    x✝

Next tactic:
ext
/-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/
def forget₂HomLinearEquiv (X Y : FdRep k G) :
    ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y
    where
  toFun f := ⟨f.hom, f.comm⟩
  map_add' _ _ := rfl
  map_smul' _ _ := rfl
  invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩
  left_inv _ := by ext; 

Proof state:
case h.h
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
X Y : FdRep k G
x✝¹ : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y
x✝ : ↑((forget₂ (FdRep k G) (Rep k G)).obj X).V
⊢ ((fun f => Action.Hom.mk ((forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom))
          (AddHom.toFun
            {
                toAddHom :=
                  { toFun := fun f => Action.Hom.mk f.hom,
                    map_add' :=
                      (_ :
                        ∀ (x x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                          (fun f => Action.Hom.mk f.hom) (x + x_1) = (fun f => Action.Hom.mk f.hom) (x + x_1)) },
                map_smul' :=
                  (_ :
                    ∀ (x : k) (x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                      AddHom.toFun
                          { toFun := fun f => Action.Hom.mk f.hom,
                            map_add' :=
                              (_ :
                                ∀
                                  (x x_2 :
                                    (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                                  (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) }
                          (x • x_1) =
                        AddHom.toFun
                          { toFun := fun f => Action.Hom.mk f.hom,
                            map_add' :=
                              (_ :
                                ∀
                                  (x x_2 :
                                    (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                                  (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) }
                          (x • x_1)) }.toAddHom
            x✝¹)).hom
      x✝ =
    x✝¹.hom x✝

Next tactic:
rfl
/-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/
def forget₂HomLinearEquiv (X Y : FdRep k G) :
    ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y
    where
  toFun f := ⟨f.hom, f.comm⟩
  map_add' _ _ := rfl
  map_smul' _ _ := rfl
  invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩
  left_inv _ := by ext; rfl
  right_inv _ := by 

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
X Y : FdRep k G
x✝ : X ⟶ Y
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := fun f => Action.Hom.mk f.hom,
              map_add' :=
                (_ :
                  ∀ (x x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                    (fun f => Action.Hom.mk f.hom) (x + x_1) = (fun f => Action.Hom.mk f.hom) (x + x_1)) },
          map_smul' :=
            (_ :
              ∀ (x : k) (x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                AddHom.toFun
                    { toFun := fun f => Action.Hom.mk f.hom,
                      map_add' :=
                        (_ :
                          ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                            (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) }
                    (x • x_1) =
                  AddHom.toFun
                    { toFun := fun f => Action.Hom.mk f.hom,
                      map_add' :=
                        (_ :
                          ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                            (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) }
                    (x • x_1)) }.toAddHom
      ((fun f => Action.Hom.mk ((forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom)) x✝) =
    x✝

Next tactic:
ext
/-- The forgetful functor to `Rep k G` preserves hom-sets and their vector space structure. -/
def forget₂HomLinearEquiv (X Y : FdRep k G) :
    ((forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y) ≃ₗ[k] X ⟶ Y
    where
  toFun f := ⟨f.hom, f.comm⟩
  map_add' _ _ := rfl
  map_smul' _ _ := rfl
  invFun f := ⟨(forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom, f.comm⟩
  left_inv _ := by ext; rfl
  right_inv _ := by ext; 

Proof state:
case h.w
k G : Type u
inst✝¹ : Field k
inst✝ : Monoid G
X Y : FdRep k G
x✝¹ : X ⟶ Y
x✝ : (forget (FGModuleCat k)).obj X.V
⊢ (AddHom.toFun
          {
              toAddHom :=
                { toFun := fun f => Action.Hom.mk f.hom,
                  map_add' :=
                    (_ :
                      ∀ (x x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                        (fun f => Action.Hom.mk f.hom) (x + x_1) = (fun f => Action.Hom.mk f.hom) (x + x_1)) },
              map_smul' :=
                (_ :
                  ∀ (x : k) (x_1 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                    AddHom.toFun
                        { toFun := fun f => Action.Hom.mk f.hom,
                          map_add' :=
                            (_ :
                              ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                                (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) }
                        (x • x_1) =
                      AddHom.toFun
                        { toFun := fun f => Action.Hom.mk f.hom,
                          map_add' :=
                            (_ :
                              ∀ (x x_2 : (forget₂ (FdRep k G) (Rep k G)).obj X ⟶ (forget₂ (FdRep k G) (Rep k G)).obj Y),
                                (fun f => Action.Hom.mk f.hom) (x + x_2) = (fun f => Action.Hom.mk f.hom) (x + x_2)) }
                        (x • x_1)) }.toAddHom
          ((fun f => Action.Hom.mk ((forget₂ (FGModuleCat k) (ModuleCat k)).map f.hom)) x✝¹)).hom
      x✝ =
    x✝¹.hom x✝

Next tactic:
rfl
noncomputable instance : RightRigidCategory (FdRep k G) := by
  

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Group G
⊢ RightRigidCategory (FdRep k G)

Next tactic:
change RightRigidCategory (Action (FGModuleCat k) (GroupCat.of G))
noncomputable instance : RightRigidCategory (FdRep k G) := by
  change RightRigidCategory (Action (FGModuleCat k) (GroupCat.of G)); 

Proof state:
k G : Type u
inst✝¹ : Field k
inst✝ : Group G
⊢ RightRigidCategory (Action (FGModuleCat k) ((forget₂ GroupCat MonCat).obj (GroupCat.of G)))

Next tactic:
infer_instance
/-- When `V` and `W` are finite dimensional representations of a group `G`, the isomorphism
`dualTensorHomEquiv k V W` of vector spaces induces an isomorphism of representations. -/
noncomputable def dualTensorIsoLinHom : FdRep.of ρV.dual ⊗ W ≅ FdRep.of (linHom ρV W.ρ) := by
  

Proof state:
k G V : Type u
inst✝⁴ : Field k
inst✝³ : Group G
inst✝² : AddCommGroup V
inst✝¹ : Module k V
inst✝ : FiniteDimensional k V
ρV : Representation k G V
W : FdRep k G
⊢ of (dual ρV) ⊗ W ≅ of (linHom ρV (ρ W))

Next tactic:
refine Action.mkIso (dualTensorIsoLinHomAux ρV W) ?_
/-- When `V` and `W` are finite dimensional representations of a group `G`, the isomorphism
`dualTensorHomEquiv k V W` of vector spaces induces an isomorphism of representations. -/
noncomputable def dualTensorIsoLinHom : FdRep.of ρV.dual ⊗ W ≅ FdRep.of (linHom ρV W.ρ) := by
  refine Action.mkIso (dualTensorIsoLinHomAux ρV W) ?_
  

Proof state:
k G V : Type u
inst✝⁴ : Field k
inst✝³ : Group G
inst✝² : AddCommGroup V
inst✝¹ : Module k V
inst✝ : FiniteDimensional k V
ρV : Representation k G V
W : FdRep k G
⊢ ∀ (g : ↑(MonCat.of G)),
    (of (dual ρV) ⊗ W).ρ g ≫ (dualTensorIsoLinHomAux ρV W).hom =
      (dualTensorIsoLinHomAux ρV W).hom ≫ (of (linHom ρV (ρ W))).ρ g

Next tactic:
convert dualTensorHom_comm ρV W.ρ
theorem subset_sSup_of_within [Inhabited s] {t : Set s}
    (h' : t.Nonempty) (h'' : BddAbove t)  (h : sSup ((↑) '' t : Set α) ∈ s) :
    sSup ((↑) '' t : Set α) = (@sSup s _ t : α) := by 

Proof state:
α : Type u_1
s : Set α
inst✝² : Preorder α
inst✝¹ : SupSet α
inst✝ : Inhabited ↑s
t : Set ↑s
h' : Set.Nonempty t
h'' : BddAbove t
h : sSup (Subtype.val '' t) ∈ s
⊢ sSup (Subtype.val '' t) = ↑(sSup t)

Next tactic:
simp [dif_pos, h, h', h'']
theorem subset_sSup_emptyset [Inhabited s] :
    sSup (∅ : Set s) = default := by
  

Proof state:
α : Type u_1
s : Set α
inst✝² : Preorder α
inst✝¹ : SupSet α
inst✝ : Inhabited ↑s
⊢ sSup ∅ = default

Next tactic:
simp [sSup]
theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) :
    sSup t = default := by
  

Proof state:
α : Type u_1
s : Set α
inst✝² : Preorder α
inst✝¹ : SupSet α
inst✝ : Inhabited ↑s
t : Set ↑s
ht : ¬BddAbove t
⊢ sSup t = default

Next tactic:
simp [sSup, ht]
theorem subset_sInf_of_within [Inhabited s] {t : Set s}
    (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) :
    sInf ((↑) '' t : Set α) = (@sInf s _ t : α) := by 

Proof state:
α : Type u_1
s : Set α
inst✝² : Preorder α
inst✝¹ : InfSet α
inst✝ : Inhabited ↑s
t : Set ↑s
h' : Set.Nonempty t
h'' : BddBelow t
h : sInf (Subtype.val '' t) ∈ s
⊢ sInf (Subtype.val '' t) = ↑(sInf t)

Next tactic:
simp [dif_pos, h, h', h'']
theorem subset_sInf_emptyset [Inhabited s] :
    sInf (∅ : Set s) = default := by
  

Proof state:
α : Type u_1
s : Set α
inst✝² : Preorder α
inst✝¹ : InfSet α
inst✝ : Inhabited ↑s
⊢ sInf ∅ = default

Next tactic:
simp [sInf]
theorem subset_sInf_of_not_bddBelow [Inhabited s] {t : Set s} (ht : ¬BddBelow t) :
    sInf t = default := by
  

Proof state:
α : Type u_1
s : Set α
inst✝² : Preorder α
inst✝¹ : InfSet α
inst✝ : Inhabited ↑s
t : Set ↑s
ht : ¬BddBelow t
⊢ sInf t = default

Next tactic:
simp [sInf, ht]
/-- For a nonempty subset of a conditionally complete linear order to be a conditionally complete
linear order, it suffices that it contain the `sSup` of all its nonempty bounded-above subsets, and
the `sInf` of all its nonempty bounded-below subsets.
See note [reducible non-instances]. -/
@[reducible]
noncomputable def subsetConditionallyCompleteLinearOrder [Inhabited s]
    (h_Sup : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddAbove t), sSup ((↑) '' t : Set α) ∈ s)
    (h_Inf : ∀ {t : Set s} (_ : t.Nonempty) (_h_bdd : BddBelow t), sInf ((↑) '' t : Set α) ∈ s) :
    ConditionallyCompleteLinearOrder s :=
  { subsetSupSet s, subsetInfSet s, DistribLattice.toLattice, (inferInstance : LinearOrder s) with
    le_csSup := by
      

Proof state:
α : Type u_1
s : Set α
inst✝¹ : ConditionallyCompleteLinearOrder α
inst✝ : Inhabited ↑s
h_Sup : ∀ {t : Set ↑s}, Set.Nonempty t → BddAbove t → sSup (Subtype.val '' t) ∈ s
h_Inf : ∀ {t : Set ↑s}, Set.Nonempty t → BddBelow t → sInf (Subtype.val '' t) ∈ s
src✝³ : SupSet ↑s := subsetSupSet s
src✝² : InfSet ↑s := subsetInfSet s
src✝¹ : Lattice ↑s := DistribLattice.toLattice
src✝ : LinearOrder ↑s := inferInstance
⊢ ∀ (s_1 : Set ↑s) (a : ↑s), BddAbove s_1 → a ∈ s_1 → a ≤ sSup s_1

Next tactic:
rintro t c h_bdd hct