l3lab/ntp-mathlib huggingface dataset:
/-- Auxiliary lemma for `toModuleMonoidAlgebra`. -/
theorem to_Module_monoidAlgebra_map_aux {k G : Type*} [CommRing k] [Monoid G] (V W : Type*)
    [AddCommGroup V] [AddCommGroup W] [Module k V] [Module k W] (ρ : G →* V →ₗ[k] V)
    (σ : G →* W →ₗ[k] W) (f : V →ₗ[k] W) (w : ∀ g : G, f.comp (ρ g) = (σ g).comp f)
    (r : MonoidAlgebra k G) (x : V) :
    f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) r) x) =
      (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) r) (f x) := by
  apply MonoidAlgebra.induction_on r
  · intro g
    simp only [one_smul, MonoidAlgebra.lift_single, MonoidAlgebra.of_apply]
    exact LinearMap.congr_fun (w g) x
  · intro g h gw hw; simp only [map_add, add_left_inj, LinearMap.add_apply, hw, gw]
  · intro r g w
    

Proof state:
case hsmul
k✝ G✝ : Type u
inst✝⁷ : CommRing k✝
inst✝⁶ : Monoid G✝
k : Type u_1
G : Type u_2
inst✝⁵ : CommRing k
inst✝⁴ : Monoid G
V : Type u_3
W : Type u_4
inst✝³ : AddCommGroup V
inst✝² : AddCommGroup W
inst✝¹ : Module k V
inst✝ : Module k W
ρ : G →* V →ₗ[k] V
σ : G →* W →ₗ[k] W
f : V →ₗ[k] W
w✝ : ∀ (g : G), f ∘ₗ ρ g = σ g ∘ₗ f
r✝ : MonoidAlgebra k G
x : V
r : k
g : MonoidAlgebra k G
w : f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) g) x) = (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) g) (f x)
⊢ f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) (r • g)) x) = (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) (r • g)) (f x)

Next tactic:
simp only [AlgHom.map_smul, w, RingHom.id_apply, LinearMap.smul_apply, LinearMap.map_smulₛₗ]
/-- Functorially convert a module over `MonoidAlgebra k G` into a representation of `G`. -/
def ofModuleMonoidAlgebra : ModuleCat.{u} (MonoidAlgebra k G) ⥤ Rep k G where
  obj M := Rep.of (Representation.ofModule M)
  map f :=
    { hom := { f with map_smul' := fun r x => f.map_smul (algebraMap k _ r) x }
      comm := fun g => by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
X✝ Y✝ : ModuleCat (MonoidAlgebra k G)
f : X✝ ⟶ Y✝
g : ↑(MonCat.of G)
⊢ ((fun M => of (Representation.ofModule ↑M)) X✝).ρ g ≫
      { toAddHom := f.toAddHom,
        map_smul' :=
          (_ :
            ∀ (r : k) (x : ↑((fun M => of (Representation.ofModule ↑M)) X✝).V),
              f ((algebraMap k (MonoidAlgebra k G)) r • x) = (algebraMap k (MonoidAlgebra k G)) r • f x) } =
    { toAddHom := f.toAddHom,
        map_smul' :=
          (_ :
            ∀ (r : k) (x : ↑((fun M => of (Representation.ofModule ↑M)) X✝).V),
              f ((algebraMap k (MonoidAlgebra k G)) r • x) = (algebraMap k (MonoidAlgebra k G)) r • f x) } ≫
      ((fun M => of (Representation.ofModule ↑M)) Y✝).ρ g

Next tactic:
ext
/-- Functorially convert a module over `MonoidAlgebra k G` into a representation of `G`. -/
def ofModuleMonoidAlgebra : ModuleCat.{u} (MonoidAlgebra k G) ⥤ Rep k G where
  obj M := Rep.of (Representation.ofModule M)
  map f :=
    { hom := { f with map_smul' := fun r x => f.map_smul (algebraMap k _ r) x }
      comm := fun g => by ext; 

Proof state:
case h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
X✝ Y✝ : ModuleCat (MonoidAlgebra k G)
f : X✝ ⟶ Y✝
g : ↑(MonCat.of G)
x✝ : ↑((fun M => of (Representation.ofModule ↑M)) X✝).V
⊢ (((fun M => of (Representation.ofModule ↑M)) X✝).ρ g ≫
        { toAddHom := f.toAddHom,
          map_smul' :=
            (_ :
              ∀ (r : k) (x : ↑((fun M => of (Representation.ofModule ↑M)) X✝).V),
                f ((algebraMap k (MonoidAlgebra k G)) r • x) = (algebraMap k (MonoidAlgebra k G)) r • f x) })
      x✝ =
    ({ toAddHom := f.toAddHom,
          map_smul' :=
            (_ :
              ∀ (r : k) (x : ↑((fun M => of (Representation.ofModule ↑M)) X✝).V),
                f ((algebraMap k (MonoidAlgebra k G)) r • x) = (algebraMap k (MonoidAlgebra k G)) r • f x) } ≫
        ((fun M => of (Representation.ofModule ↑M)) Y✝).ρ g)
      x✝

Next tactic:
apply f.map_smul
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def counitIsoAddEquiv {M : ModuleCat.{u} (MonoidAlgebra k G)} :
    (ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M ≃+ M := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
M : ModuleCat (MonoidAlgebra k G)
⊢ ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M) ≃+ ↑M

Next tactic:
dsimp [ofModuleMonoidAlgebra, toModuleMonoidAlgebra]
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def counitIsoAddEquiv {M : ModuleCat.{u} (MonoidAlgebra k G)} :
    (ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M ≃+ M := by
  dsimp [ofModuleMonoidAlgebra, toModuleMonoidAlgebra]
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
M : ModuleCat (MonoidAlgebra k G)
⊢ ↑(ModuleCat.of (MonoidAlgebra k G) (Representation.asModule (Representation.ofModule ↑M))) ≃+ ↑M

Next tactic:
refine' (Representation.ofModule M).asModuleEquiv.trans
    (RestrictScalars.addEquiv k (MonoidAlgebra k G) _)
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def unitIsoAddEquiv {V : Rep k G} : V ≃+ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
V : Rep k G
⊢ CoeSort.coe V ≃+ CoeSort.coe ((toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V)

Next tactic:
dsimp [ofModuleMonoidAlgebra, toModuleMonoidAlgebra]
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def unitIsoAddEquiv {V : Rep k G} : V ≃+ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V := by
  dsimp [ofModuleMonoidAlgebra, toModuleMonoidAlgebra]
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
V : Rep k G
⊢ CoeSort.coe V ≃+
    RestrictScalars k (MonoidAlgebra k G) ↑(ModuleCat.of (MonoidAlgebra k G) (Representation.asModule (ρ V)))

Next tactic:
refine' V.ρ.asModuleEquiv.symm.trans _
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def unitIsoAddEquiv {V : Rep k G} : V ≃+ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V := by
  dsimp [ofModuleMonoidAlgebra, toModuleMonoidAlgebra]
  refine' V.ρ.asModuleEquiv.symm.trans _
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
V : Rep k G
⊢ Representation.asModule (ρ V) ≃+
    RestrictScalars k (MonoidAlgebra k G) ↑(ModuleCat.of (MonoidAlgebra k G) (Representation.asModule (ρ V)))

Next tactic:
exact (RestrictScalars.addEquiv _ _ _).symm
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def counitIso (M : ModuleCat.{u} (MonoidAlgebra k G)) :
    (ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M ≅ M :=
  LinearEquiv.toModuleIso'
    { counitIsoAddEquiv with
      map_smul' := fun r x => by
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
M : ModuleCat (MonoidAlgebra k G)
src✝ : ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M) ≃+ ↑M := counitIsoAddEquiv
r : MonoidAlgebra k G
x : ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M)
⊢ AddHom.toFun
      { toFun := src✝.toFun,
        map_add' :=
          (_ :
            ∀ (x y : ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M)),
              Equiv.toFun src✝.toEquiv (x + y) = Equiv.toFun src✝.toEquiv x + Equiv.toFun src✝.toEquiv y) }
      (r • x) =
    (RingHom.id (MonoidAlgebra k G)) r •
      AddHom.toFun
        { toFun := src✝.toFun,
          map_add' :=
            (_ :
              ∀ (x y : ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M)),
                Equiv.toFun src✝.toEquiv (x + y) = Equiv.toFun src✝.toEquiv x + Equiv.toFun src✝.toEquiv y) }
        x

Next tactic:
dsimp [counitIsoAddEquiv]
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def counitIso (M : ModuleCat.{u} (MonoidAlgebra k G)) :
    (ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M ≅ M :=
  LinearEquiv.toModuleIso'
    { counitIsoAddEquiv with
      map_smul' := fun r x => by
        dsimp [counitIsoAddEquiv]
/- Porting note: rest of broken proof was `simp`. -/
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
M : ModuleCat (MonoidAlgebra k G)
src✝ : ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M) ≃+ ↑M := counitIsoAddEquiv
r : MonoidAlgebra k G
x : ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M)
⊢ (AddEquiv.trans (Representation.asModuleEquiv (Representation.ofModule ↑M))
        (RestrictScalars.addEquiv k (MonoidAlgebra k G) ↑M))
      (r • x) =
    r •
      (AddEquiv.trans (Representation.asModuleEquiv (Representation.ofModule ↑M))
          (RestrictScalars.addEquiv k (MonoidAlgebra k G) ↑M))
        x

Next tactic:
rw [AddEquiv.trans_apply]
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def counitIso (M : ModuleCat.{u} (MonoidAlgebra k G)) :
    (ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M ≅ M :=
  LinearEquiv.toModuleIso'
    { counitIsoAddEquiv with
      map_smul' := fun r x => by
        dsimp [counitIsoAddEquiv]
/- Porting note: rest of broken proof was `simp`. -/
        rw [AddEquiv.trans_apply]
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
M : ModuleCat (MonoidAlgebra k G)
src✝ : ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M) ≃+ ↑M := counitIsoAddEquiv
r : MonoidAlgebra k G
x : ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M)
⊢ (RestrictScalars.addEquiv k (MonoidAlgebra k G) ↑M)
      ((Representation.asModuleEquiv (Representation.ofModule ↑M)) (r • x)) =
    r •
      (AddEquiv.trans (Representation.asModuleEquiv (Representation.ofModule ↑M))
          (RestrictScalars.addEquiv k (MonoidAlgebra k G) ↑M))
        x

Next tactic:
rw [AddEquiv.trans_apply]
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def counitIso (M : ModuleCat.{u} (MonoidAlgebra k G)) :
    (ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M ≅ M :=
  LinearEquiv.toModuleIso'
    { counitIsoAddEquiv with
      map_smul' := fun r x => by
        dsimp [counitIsoAddEquiv]
/- Porting note: rest of broken proof was `simp`. -/
        rw [AddEquiv.trans_apply]
        rw [AddEquiv.trans_apply]
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
M : ModuleCat (MonoidAlgebra k G)
src✝ : ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M) ≃+ ↑M := counitIsoAddEquiv
r : MonoidAlgebra k G
x : ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M)
⊢ (RestrictScalars.addEquiv k (MonoidAlgebra k G) ↑M)
      ((Representation.asModuleEquiv (Representation.ofModule ↑M)) (r • x)) =
    r •
      (RestrictScalars.addEquiv k (MonoidAlgebra k G) ↑M)
        ((Representation.asModuleEquiv (Representation.ofModule ↑M)) x)

Next tactic:
erw [@Representation.ofModule_asAlgebraHom_apply_apply k G _ _ _ _ (_)]
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def counitIso (M : ModuleCat.{u} (MonoidAlgebra k G)) :
    (ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M ≅ M :=
  LinearEquiv.toModuleIso'
    { counitIsoAddEquiv with
      map_smul' := fun r x => by
        dsimp [counitIsoAddEquiv]
/- Porting note: rest of broken proof was `simp`. -/
        rw [AddEquiv.trans_apply]
        rw [AddEquiv.trans_apply]
        erw [@Representation.ofModule_asAlgebraHom_apply_apply k G _ _ _ _ (_)]
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
M : ModuleCat (MonoidAlgebra k G)
src✝ : ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M) ≃+ ↑M := counitIsoAddEquiv
r : MonoidAlgebra k G
x : ↑((ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M)
⊢ (AddEquiv.symm (RestrictScalars.addEquiv k (MonoidAlgebra k G) (CoeSort.coe (ofModuleMonoidAlgebra.obj M))))
      (r • (RestrictScalars.addEquiv k (MonoidAlgebra k G) (CoeSort.coe (ofModuleMonoidAlgebra.obj M))) x) =
    r •
      (RestrictScalars.addEquiv k (MonoidAlgebra k G) ↑M)
        ((Representation.asModuleEquiv (Representation.ofModule ↑M)) x)

Next tactic:
exact AddEquiv.symm_apply_apply _ _
theorem unit_iso_comm (V : Rep k G) (g : G) (x : V) :
    unitIsoAddEquiv ((V.ρ g).toFun x) = ((ofModuleMonoidAlgebra.obj
      (toModuleMonoidAlgebra.obj V)).ρ g).toFun (unitIsoAddEquiv x) := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
V : Rep k G
g : G
x : CoeSort.coe V
⊢ unitIsoAddEquiv (AddHom.toFun ((ρ V) g).toAddHom x) =
    AddHom.toFun ((ρ (ofModuleMonoidAlgebra.obj (toModuleMonoidAlgebra.obj V))) g).toAddHom (unitIsoAddEquiv x)

Next tactic:
dsimp [unitIsoAddEquiv, ofModuleMonoidAlgebra, toModuleMonoidAlgebra]
theorem unit_iso_comm (V : Rep k G) (g : G) (x : V) :
    unitIsoAddEquiv ((V.ρ g).toFun x) = ((ofModuleMonoidAlgebra.obj
      (toModuleMonoidAlgebra.obj V)).ρ g).toFun (unitIsoAddEquiv x) := by
  dsimp [unitIsoAddEquiv, ofModuleMonoidAlgebra, toModuleMonoidAlgebra]
/- Porting note: rest of broken proof was
  simp only [AddEquiv.apply_eq_iff_eq, AddEquiv.apply_symm_apply,
    Representation.asModuleEquiv_symm_map_rho, Representation.ofModule_asModule_act] -/
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
V : Rep k G
g : G
x : CoeSort.coe V
⊢ (AddEquiv.trans (AddEquiv.symm (Representation.asModuleEquiv (ρ V)))
        (AddEquiv.symm (RestrictScalars.addEquiv k (MonoidAlgebra k G) (Representation.asModule (ρ V)))))
      (((ρ V) g) x) =
    AddHom.toFun
      ((Representation.ofModule ↑(ModuleCat.of (MonoidAlgebra k G) (Representation.asModule (ρ V)))) g).toAddHom
      ((AddEquiv.trans (AddEquiv.symm (Representation.asModuleEquiv (ρ V)))
          (AddEquiv.symm (RestrictScalars.addEquiv k (MonoidAlgebra k G) (Representation.asModule (ρ V)))))
        x)

Next tactic:
erw [Representation.asModuleEquiv_symm_map_rho]
theorem unit_iso_comm (V : Rep k G) (g : G) (x : V) :
    unitIsoAddEquiv ((V.ρ g).toFun x) = ((ofModuleMonoidAlgebra.obj
      (toModuleMonoidAlgebra.obj V)).ρ g).toFun (unitIsoAddEquiv x) := by
  dsimp [unitIsoAddEquiv, ofModuleMonoidAlgebra, toModuleMonoidAlgebra]
/- Porting note: rest of broken proof was
  simp only [AddEquiv.apply_eq_iff_eq, AddEquiv.apply_symm_apply,
    Representation.asModuleEquiv_symm_map_rho, Representation.ofModule_asModule_act] -/
  erw [Representation.asModuleEquiv_symm_map_rho]
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
V : Rep k G
g : G
x : CoeSort.coe V
⊢ (MonoidAlgebra.of k G) g • (AddEquiv.symm (Representation.asModuleEquiv (ρ V))) x =
    AddHom.toFun
      ((Representation.ofModule ↑(ModuleCat.of (MonoidAlgebra k G) (Representation.asModule (ρ V)))) g).toAddHom
      ((AddEquiv.trans (AddEquiv.symm (Representation.asModuleEquiv (ρ V)))
          (AddEquiv.symm (RestrictScalars.addEquiv k (MonoidAlgebra k G) (Representation.asModule (ρ V)))))
        x)

Next tactic:
rfl
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def unitIso (V : Rep k G) : V ≅ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V :=
  Action.mkIso
    (LinearEquiv.toModuleIso'
      { unitIsoAddEquiv with
        map_smul' := fun r x => by
          

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
V : Rep k G
src✝ : CoeSort.coe V ≃+ CoeSort.coe ((toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V) := unitIsoAddEquiv
r : k
x : ↑V.V
⊢ AddHom.toFun
      { toFun := src✝.toFun,
        map_add' :=
          (_ :
            ∀ (x y : CoeSort.coe V),
              Equiv.toFun src✝.toEquiv (x + y) = Equiv.toFun src✝.toEquiv x + Equiv.toFun src✝.toEquiv y) }
      (r • x) =
    (RingHom.id k) r •
      AddHom.toFun
        { toFun := src✝.toFun,
          map_add' :=
            (_ :
              ∀ (x y : CoeSort.coe V),
                Equiv.toFun src✝.toEquiv (x + y) = Equiv.toFun src✝.toEquiv x + Equiv.toFun src✝.toEquiv y) }
        x

Next tactic:
dsimp [unitIsoAddEquiv]
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def unitIso (V : Rep k G) : V ≅ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V :=
  Action.mkIso
    (LinearEquiv.toModuleIso'
      { unitIsoAddEquiv with
        map_smul' := fun r x => by
          dsimp [unitIsoAddEquiv]
/- Porting note: rest of broken proof was
          simp only [Representation.asModuleEquiv_symm_map_smul,
            RestrictScalars.addEquiv_symm_map_algebraMap_smul] -/
          -- 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
V : Rep k G
src✝ : CoeSort.coe V ≃+ CoeSort.coe ((toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V) := unitIsoAddEquiv
r : k
x : ↑V.V
⊢ (AddEquiv.trans (AddEquiv.symm (Representation.asModuleEquiv (ρ V)))
        (AddEquiv.symm (RestrictScalars.addEquiv k (MonoidAlgebra k G) (Representation.asModule (ρ V)))))
      (r • x) =
    r •
      (AddEquiv.trans (AddEquiv.symm (Representation.asModuleEquiv (ρ V)))
          (AddEquiv.symm (RestrictScalars.addEquiv k (MonoidAlgebra k G) (Representation.asModule (ρ V)))))
        x

Next tactic:
erw [AddEquiv.trans_apply,
            Representation.asModuleEquiv_symm_map_smul]
/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
def unitIso (V : Rep k G) : V ≅ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V :=
  Action.mkIso
    (LinearEquiv.toModuleIso'
      { unitIsoAddEquiv with
        map_smul' := fun r x => by
          dsimp [unitIsoAddEquiv]
/- Porting note: rest of broken proof was
          simp only [Representation.asModuleEquiv_symm_map_smul,
            RestrictScalars.addEquiv_symm_map_algebraMap_smul] -/
          -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
          erw [AddEquiv.trans_apply,
            Representation.asModuleEquiv_symm_map_smul]
          

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
V : Rep k G
src✝ : CoeSort.coe V ≃+ CoeSort.coe ((toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V) := unitIsoAddEquiv
r : k
x : ↑V.V
⊢ (algebraMap k (MonoidAlgebra k G)) r • (AddEquiv.symm (Representation.asModuleEquiv (ρ V))) x =
    r •
      (AddEquiv.trans (AddEquiv.symm (Representation.asModuleEquiv (ρ V)))
          (AddEquiv.symm (RestrictScalars.addEquiv k (MonoidAlgebra k G) (Representation.asModule (ρ V)))))
        x

Next tactic:
rfl
/-- The categorical equivalence `Rep k G ≌ ModuleCat (MonoidAlgebra k G)`. -/
def equivalenceModuleMonoidAlgebra : Rep k G ≌ ModuleCat.{u} (MonoidAlgebra k G) where
  functor := toModuleMonoidAlgebra
  inverse := ofModuleMonoidAlgebra
  unitIso := NatIso.ofComponents (fun V => unitIso V) (by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
⊢ ∀ {X Y : Rep k G} (f : X ⟶ Y),
    (𝟭 (Rep k G)).map f ≫ ((fun V => unitIso V) Y).hom =
      ((fun V => unitIso V) X).hom ≫ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).map f

Next tactic:
aesop_cat
/-- The categorical equivalence `Rep k G ≌ ModuleCat (MonoidAlgebra k G)`. -/
def equivalenceModuleMonoidAlgebra : Rep k G ≌ ModuleCat.{u} (MonoidAlgebra k G) where
  functor := toModuleMonoidAlgebra
  inverse := ofModuleMonoidAlgebra
  unitIso := NatIso.ofComponents (fun V => unitIso V) (by aesop_cat)
  counitIso := NatIso.ofComponents (fun M => counitIso M) (by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
⊢ ∀ {X Y : ModuleCat (MonoidAlgebra k G)} (f : X ⟶ Y),
    (ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).map f ≫ ((fun M => counitIso M) Y).hom =
      ((fun M => counitIso M) X).hom ≫ (𝟭 (ModuleCat (MonoidAlgebra k G))).map f

Next tactic:
aesop_cat
/-- Let `r > 1` and `1/r + 1/s = 1`. Then `B_r` and `B'_s` are disjoint (i.e. no collision exists).
-/
private theorem no_collision : Disjoint {beattySeq r k | k} {beattySeq' s k | k} := by
  

Proof state:
r s : ℝ
hrs : Real.IsConjugateExponent r s
j k : ℤ
⊢ Disjoint {x | ∃ k, beattySeq r k = x} {x | ∃ k, beattySeq' s k = x}

Next tactic:
rw [Set.disjoint_left]
/-- Let `r > 1` and `1/r + 1/s = 1`. Then `B_r` and `B'_s` are disjoint (i.e. no collision exists).
-/
private theorem no_collision : Disjoint {beattySeq r k | k} {beattySeq' s k | k} := by
  rw [Set.disjoint_left]
  

Proof state:
r s : ℝ
hrs : Real.IsConjugateExponent r s
j k : ℤ
⊢ ∀ ⦃a : ℤ⦄, a ∈ {x | ∃ k, beattySeq r k = x} → a ∉ {x | ∃ k, beattySeq' s k = x}

Next tactic:
intro j ⟨k, h₁⟩ ⟨m, h₂⟩
/-- Let `r > 1` and `1/r + 1/s = 1`. Then `B_r` and `B'_s` are disjoint (i.e. no collision exists).
-/
private theorem no_collision : Disjoint {beattySeq r k | k} {beattySeq' s k | k} := by
  rw [Set.disjoint_left]
  intro j ⟨k, h₁⟩ ⟨m, h₂⟩
  

Proof state:
r s : ℝ
hrs : Real.IsConjugateExponent r s
j✝ k✝ j k : ℤ
h₁ : beattySeq r k = j
m : ℤ
h₂ : beattySeq' s m = j
⊢ False

Next tactic:
rw [beattySeq, Int.floor_eq_iff, ← div_le_iff hrs.pos, ← lt_div_iff hrs.pos] at h₁
/-- Let `r > 1` and `1/r + 1/s = 1`. Then `B_r` and `B'_s` are disjoint (i.e. no collision exists).
-/
private theorem no_collision : Disjoint {beattySeq r k | k} {beattySeq' s k | k} := by
  rw [Set.disjoint_left]
  intro j ⟨k, h₁⟩ ⟨m, h₂⟩
  rw [beattySeq, Int.floor_eq_iff, ← div_le_iff hrs.pos, ← lt_div_iff hrs.pos] at h₁
  

Proof state:
r s : ℝ
hrs : Real.IsConjugateExponent r s
j✝ k✝ j k : ℤ
h₁ : ↑j / r ≤ ↑k ∧ ↑k < (↑j + 1) / r
m : ℤ
h₂ : beattySeq' s m = j
⊢ False

Next tactic:
rw [beattySeq', sub_eq_iff_eq_add, Int.ceil_eq_iff, Int.cast_add, Int.cast_one,
    add_sub_cancel, ← div_lt_iff hrs.symm.pos, ← le_div_iff hrs.symm.pos] at h₂
/-- Let `r > 1` and `1/r + 1/s = 1`. Then `B_r` and `B'_s` are disjoint (i.e. no collision exists).
-/
private theorem no_collision : Disjoint {beattySeq r k | k} {beattySeq' s k | k} := by
  rw [Set.disjoint_left]
  intro j ⟨k, h₁⟩ ⟨m, h₂⟩
  rw [beattySeq, Int.floor_eq_iff, ← div_le_iff hrs.pos, ← lt_div_iff hrs.pos] at h₁
  rw [beattySeq', sub_eq_iff_eq_add, Int.ceil_eq_iff, Int.cast_add, Int.cast_one,
    add_sub_cancel, ← div_lt_iff hrs.symm.pos, ← le_div_iff hrs.symm.pos] at h₂
  

Proof state:
r s : ℝ
hrs : Real.IsConjugateExponent r s
j✝ k✝ j k : ℤ
h₁ : ↑j / r ≤ ↑k ∧ ↑k < (↑j + 1) / r
m : ℤ
h₂ : ↑j / s < ↑m ∧ ↑m ≤ (↑j + 1) / s
⊢ False

Next tactic:
have h₃ := add_lt_add_of_le_of_lt h₁.1 h₂.1
/-- Let `r > 1` and `1/r + 1/s = 1`. Then `B_r` and `B'_s` are disjoint (i.e. no collision exists).
-/
private theorem no_collision : Disjoint {beattySeq r k | k} {beattySeq' s k | k} := by
  rw [Set.disjoint_left]
  intro j ⟨k, h₁⟩ ⟨m, h₂⟩
  rw [beattySeq, Int.floor_eq_iff, ← div_le_iff hrs.pos, ← lt_div_iff hrs.pos] at h₁
  rw [beattySeq', sub_eq_iff_eq_add, Int.ceil_eq_iff, Int.cast_add, Int.cast_one,
    add_sub_cancel, ← div_lt_iff hrs.symm.pos, ← le_div_iff hrs.symm.pos] at h₂
  have h₃ := add_lt_add_of_le_of_lt h₁.1 h₂.1
  

Proof state:
r s : ℝ
hrs : Real.IsConjugateExponent r s
j✝ k✝ j k : ℤ
h₁ : ↑j / r ≤ ↑k ∧ ↑k < (↑j + 1) / r
m : ℤ
h₂ : ↑j / s < ↑m ∧ ↑m ≤ (↑j + 1) / s
h₃ : ↑j / r + ↑j / s < ↑k + ↑m
⊢ False

Next tactic:
have h₄ := add_lt_add_of_lt_of_le h₁.2 h₂.2
/-- Let `r > 1` and `1/r + 1/s = 1`. Then `B_r` and `B'_s` are disjoint (i.e. no collision exists).
-/
private theorem no_collision : Disjoint {beattySeq r k | k} {beattySeq' s k | k} := by
  rw [Set.disjoint_left]
  intro j ⟨k, h₁⟩ ⟨m, h₂⟩
  rw [beattySeq, Int.floor_eq_iff, ← div_le_iff hrs.pos, ← lt_div_iff hrs.pos] at h₁
  rw [beattySeq', sub_eq_iff_eq_add, Int.ceil_eq_iff, Int.cast_add, Int.cast_one,
    add_sub_cancel, ← div_lt_iff hrs.symm.pos, ← le_div_iff hrs.symm.pos] at h₂
  have h₃ := add_lt_add_of_le_of_lt h₁.1 h₂.1
  have h₄ := add_lt_add_of_lt_of_le h₁.2 h₂.2
  

Proof state:
r s : ℝ
hrs : Real.IsConjugateExponent r s
j✝ k✝ j k : ℤ
h₁ : ↑j / r ≤ ↑k ∧ ↑k < (↑j + 1) / r
m : ℤ
h₂ : ↑j / s < ↑m ∧ ↑m ≤ (↑j + 1) / s
h₃ : ↑j / r + ↑j / s < ↑k + ↑m
h₄ : ↑k + ↑m < (↑j + 1) / r + (↑j + 1) / s
⊢ False

Next tactic:
simp_rw [div_eq_inv_mul, ← right_distrib, inv_eq_one_div, hrs.inv_add_inv_conj, one_mul] at h₃ h₄
/-- Let `r > 1` and `1/r + 1/s = 1`. Then `B_r` and `B'_s` are disjoint (i.e. no collision exists).
-/
private theorem no_collision : Disjoint {beattySeq r k | k} {beattySeq' s k | k} := by
  rw [Set.disjoint_left]
  intro j ⟨k, h₁⟩ ⟨m, h₂⟩
  rw [beattySeq, Int.floor_eq_iff, ← div_le_iff hrs.pos, ← lt_div_iff hrs.pos] at h₁
  rw [beattySeq', sub_eq_iff_eq_add, Int.ceil_eq_iff, Int.cast_add, Int.cast_one,
    add_sub_cancel, ← div_lt_iff hrs.symm.pos, ← le_div_iff hrs.symm.pos] at h₂
  have h₃ := add_lt_add_of_le_of_lt h₁.1 h₂.1
  have h₄ := add_lt_add_of_lt_of_le h₁.2 h₂.2
  simp_rw [div_eq_inv_mul, ← right_distrib, inv_eq_one_div, hrs.inv_add_inv_conj, one_mul] at h₃ h₄
  

Proof state:
r s : ℝ
hrs : Real.IsConjugateExponent r s
j✝ k✝ j k : ℤ
h₁ : ↑j / r ≤ ↑k ∧ ↑k < (↑j + 1) / r
m : ℤ
h₂ : ↑j / s < ↑m ∧ ↑m ≤ (↑j + 1) / s
h₃ : ↑j < ↑k + ↑m
h₄ : ↑k + ↑m < ↑j + 1
⊢ False

Next tactic:
rw [← Int.cast_one] at h₄