l3lab/ntp-mathlib huggingface dataset:
/-- The **Minkowski Convex Body Theorem for compact domain**. If `s` is a convex compact symmetric
domain of `E` whose volume is large enough compared to the covolume of a lattice `L` of `E`, then it
contains a non-zero lattice point of `L`. Compared to
`exists_ne_zero_mem_lattice_of_measure_mul_two_pow_lt_measure`, this version requires in addition
that `s` is compact and `L` is discrete but provides a weaker inequality rather than a strict
inequality. -/
theorem exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure [NormedAddCommGroup E]
    [NormedSpace ℝ E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] [IsAddHaarMeasure μ]
    {L : AddSubgroup E} [Countable L] [DiscreteTopology L] (fund : IsAddFundamentalDomain L F μ)
    (h_symm : ∀ x ∈ s, -x ∈ s) (h_conv : Convex ℝ s) (h_cpt : IsCompact s)
    (h : μ F * 2 ^ finrank ℝ E ≤ μ s) :
    ∃ x ≠ 0, ((x : L) : E) ∈ s := by
  have h_mes : μ s ≠ 0 := by
    intro hμ
    suffices μ F = 0 from fund.measure_ne_zero (NeZero.ne μ) this
    rw [hμ, le_zero_iff, mul_eq_zero] at h
    exact h.resolve_right <| (pow_ne_zero_iff finrank_pos).mpr two_ne_zero
  have h_nemp : s.Nonempty := nonempty_of_measure_ne_zero h_mes
  let u : ℕ → ℝ≥0 := (exists_seq_strictAnti_tendsto 0).choose
  let K : ConvexBody E := ⟨s, h_conv, h_cpt, h_nemp⟩
  let S : ℕ → ConvexBody E := fun n => (1 + u n) • K
  let Z : ℕ → Set E := fun n => (S n) ∩ (L \ {0})
  -- The convex bodies `S n` have volume strictly larger than `μ s` and thus we can apply
  -- `exists_ne_zero_mem_lattice_of_measure_mul_two_pow_lt_measure` to them and obtain that
  -- `S n` contains a nonzero point of `L`. Since the intersection of the `S n` is equal to `s`,
  -- it follows that `s` contains a nonzero point of `L`.
  have h_zero : 0 ∈ K := K.zero_mem_of_symmetric h_symm
  suffices Set.Nonempty (⋂ n, Z n) by
    erw [← Set.iInter_inter, K.iInter_smul_eq_self h_zero] at this
    · obtain ⟨x, hx⟩ := this
      exact ⟨⟨x, by aesop⟩, by aesop⟩
    · exact (exists_seq_strictAnti_tendsto (0:ℝ≥0)).choose_spec.2.2
  have h_clos : IsClosed ((L : Set E) \ {0}) := by
    rsuffices ⟨U, hU⟩ : ∃ U : Set E, IsOpen U ∧  U ∩ L = {0}
    · rw [sdiff_eq_sdiff_iff_inf_eq_inf (z := U).mpr (by 

Proof state:
E : Type u_1
L✝ : Type u_2
inst✝⁸ : MeasurableSpace E
μ : Measure E
F s : Set E
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : BorelSpace E
inst✝⁴ : FiniteDimensional ℝ E
inst✝³ : Nontrivial E
inst✝² : IsAddHaarMeasure μ
L : AddSubgroup E
inst✝¹ : Countable ↥L
inst✝ : DiscreteTopology ↥L
fund : IsAddFundamentalDomain (↥L) F
h_symm : ∀ x ∈ s, -x ∈ s
h_conv : Convex ℝ s
h_cpt : IsCompact s
h : ↑↑μ F * 2 ^ finrank ℝ E ≤ ↑↑μ s
h_mes : ↑↑μ s ≠ 0
h_nemp : Set.Nonempty s
u : ℕ → ℝ≥0 := Exists.choose (_ : ∃ u, StrictAnti u ∧ (∀ (n : ℕ), 0 < u n) ∧ Tendsto u atTop (nhds 0))
K : ConvexBody E := { carrier := s, convex' := h_conv, isCompact' := h_cpt, nonempty' := h_nemp }
S : ℕ → ConvexBody E := fun n => (1 + u n) • K
Z : ℕ → Set E := fun n => ↑(S n) ∩ (↑L \ {0})
h_zero : 0 ∈ K
U : Set E
hU : IsOpen U ∧ U ∩ ↑L = {0}
⊢ ↑L ⊓ {0} = ↑L ⊓ U

Next tactic:
simp [Set.inter_comm .. ▸ hU.2, zero_mem]
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_assoc := fun x y z => by
      have := LinearMap.congr_fun A.mul_assoc (x ⊗ₜ y ⊗ₜ z)
      convert this
    left_distrib := fun x y z => by
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x y z : ↑A.X
⊢ x * (y + z) = x * y + x * z

Next tactic:
have := A.mul.map_add (x ⊗ₜ y) (x ⊗ₜ z)
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_assoc := fun x y z => by
      have := LinearMap.congr_fun A.mul_assoc (x ⊗ₜ y ⊗ₜ z)
      convert this
    left_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ y) (x ⊗ₜ z)
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x y z : ↑A.X
this : A.mul (x ⊗ₜ[R] y + x ⊗ₜ[R] z) = A.mul (x ⊗ₜ[R] y) + A.mul (x ⊗ₜ[R] z)
⊢ x * (y + z) = x * y + x * z

Next tactic:
convert this
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_assoc := fun x y z => by
      have := LinearMap.congr_fun A.mul_assoc (x ⊗ₜ y ⊗ₜ z)
      convert this
    left_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ y) (x ⊗ₜ z)
      convert this
      

Proof state:
case h.e'_2
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x y z : ↑A.X
this : A.mul (x ⊗ₜ[R] y + x ⊗ₜ[R] z) = A.mul (x ⊗ₜ[R] y) + A.mul (x ⊗ₜ[R] z)
⊢ x * (y + z) = A.mul (x ⊗ₜ[R] y + x ⊗ₜ[R] z)

Next tactic:
rw [← TensorProduct.tmul_add]
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_assoc := fun x y z => by
      have := LinearMap.congr_fun A.mul_assoc (x ⊗ₜ y ⊗ₜ z)
      convert this
    left_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ y) (x ⊗ₜ z)
      convert this
      rw [← TensorProduct.tmul_add]
      

Proof state:
case h.e'_2
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x y z : ↑A.X
this : A.mul (x ⊗ₜ[R] y + x ⊗ₜ[R] z) = A.mul (x ⊗ₜ[R] y) + A.mul (x ⊗ₜ[R] z)
⊢ x * (y + z) = A.mul (x ⊗ₜ[R] (y + z))

Next tactic:
rfl
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_assoc := fun x y z => by
      have := LinearMap.congr_fun A.mul_assoc (x ⊗ₜ y ⊗ₜ z)
      convert this
    left_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ y) (x ⊗ₜ z)
      convert this
      rw [← TensorProduct.tmul_add]
      rfl
    right_distrib := fun x y z => by
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x y z : ↑A.X
⊢ (x + y) * z = x * z + y * z

Next tactic:
have := A.mul.map_add (x ⊗ₜ z) (y ⊗ₜ z)
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_assoc := fun x y z => by
      have := LinearMap.congr_fun A.mul_assoc (x ⊗ₜ y ⊗ₜ z)
      convert this
    left_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ y) (x ⊗ₜ z)
      convert this
      rw [← TensorProduct.tmul_add]
      rfl
    right_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ z) (y ⊗ₜ z)
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x y z : ↑A.X
this : A.mul (x ⊗ₜ[R] z + y ⊗ₜ[R] z) = A.mul (x ⊗ₜ[R] z) + A.mul (y ⊗ₜ[R] z)
⊢ (x + y) * z = x * z + y * z

Next tactic:
convert this
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_assoc := fun x y z => by
      have := LinearMap.congr_fun A.mul_assoc (x ⊗ₜ y ⊗ₜ z)
      convert this
    left_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ y) (x ⊗ₜ z)
      convert this
      rw [← TensorProduct.tmul_add]
      rfl
    right_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ z) (y ⊗ₜ z)
      convert this
      

Proof state:
case h.e'_2
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x y z : ↑A.X
this : A.mul (x ⊗ₜ[R] z + y ⊗ₜ[R] z) = A.mul (x ⊗ₜ[R] z) + A.mul (y ⊗ₜ[R] z)
⊢ (x + y) * z = A.mul (x ⊗ₜ[R] z + y ⊗ₜ[R] z)

Next tactic:
rw [← TensorProduct.add_tmul]
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_assoc := fun x y z => by
      have := LinearMap.congr_fun A.mul_assoc (x ⊗ₜ y ⊗ₜ z)
      convert this
    left_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ y) (x ⊗ₜ z)
      convert this
      rw [← TensorProduct.tmul_add]
      rfl
    right_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ z) (y ⊗ₜ z)
      convert this
      rw [← TensorProduct.add_tmul]
      

Proof state:
case h.e'_2
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x y z : ↑A.X
this : A.mul (x ⊗ₜ[R] z + y ⊗ₜ[R] z) = A.mul (x ⊗ₜ[R] z) + A.mul (y ⊗ₜ[R] z)
⊢ (x + y) * z = A.mul ((x + y) ⊗ₜ[R] z)

Next tactic:
rfl
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_assoc := fun x y z => by
      have := LinearMap.congr_fun A.mul_assoc (x ⊗ₜ y ⊗ₜ z)
      convert this
    left_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ y) (x ⊗ₜ z)
      convert this
      rw [← TensorProduct.tmul_add]
      rfl
    right_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ z) (y ⊗ₜ z)
      convert this
      rw [← TensorProduct.add_tmul]
      rfl
    zero_mul := fun x => show A.mul _ = 0 by
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x : ↑A.X
⊢ A.mul (0 ⊗ₜ[R] x) = 0

Next tactic:
rw [TensorProduct.zero_tmul, map_zero]
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_assoc := fun x y z => by
      have := LinearMap.congr_fun A.mul_assoc (x ⊗ₜ y ⊗ₜ z)
      convert this
    left_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ y) (x ⊗ₜ z)
      convert this
      rw [← TensorProduct.tmul_add]
      rfl
    right_distrib := fun x y z => by
      have := A.mul.map_add (x ⊗ₜ z) (y ⊗ₜ z)
      convert this
      rw [← TensorProduct.add_tmul]
      rfl
    zero_mul := fun x => show A.mul _ = 0 by
      rw [TensorProduct.zero_tmul, map_zero]
    mul_zero := fun x => show A.mul _ = 0 by
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x : ↑A.X
⊢ A.mul (x ⊗ₜ[R] 0) = 0

Next tactic:
rw [TensorProduct.tmul_zero, map_zero]
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_assoc := fun x y z => by
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x y z : ↑A.X
⊢ x * y * z = x * (y * z)

Next tactic:
have := LinearMap.congr_fun A.mul_assoc (x ⊗ₜ y ⊗ₜ z)
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_assoc := fun x y z => by
      have := LinearMap.congr_fun A.mul_assoc (x ⊗ₜ y ⊗ₜ z)
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x y z : ↑A.X
this :
  (CategoryTheory.MonoidalCategory.tensorHom A.mul (𝟙 A.X) ≫ A.mul) ((x ⊗ₜ[R] y) ⊗ₜ[R] z) =
    ((CategoryTheory.MonoidalCategory.associator A.X A.X A.X).hom ≫
        CategoryTheory.MonoidalCategory.tensorHom (𝟙 A.X) A.mul ≫ A.mul)
      ((x ⊗ₜ[R] y) ⊗ₜ[R] z)
⊢ x * y * z = x * (y * z)

Next tactic:
convert this
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x : ↑A.X
⊢ 1 * x = x

Next tactic:
have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x : ↑A.X
this :
  (CategoryTheory.MonoidalCategory.tensorHom A.one (𝟙 A.X) ≫ A.mul) (1 ⊗ₜ[R] x) =
    (CategoryTheory.MonoidalCategory.leftUnitor A.X).hom (1 ⊗ₜ[R] x)
⊢ 1 * x = x

Next tactic:
convert this
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      

Proof state:
case h.e'_3
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x : ↑A.X
this :
  (CategoryTheory.MonoidalCategory.tensorHom A.one (𝟙 A.X) ≫ A.mul) (1 ⊗ₜ[R] x) =
    (CategoryTheory.MonoidalCategory.leftUnitor A.X).hom (1 ⊗ₜ[R] x)
⊢ x = (CategoryTheory.MonoidalCategory.leftUnitor A.X).hom (1 ⊗ₜ[R] x)

Next tactic:
rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x : ↑A.X
⊢ x * 1 = x

Next tactic:
have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x : ↑A.X
this :
  (CategoryTheory.MonoidalCategory.tensorHom (𝟙 A.X) A.one ≫ A.mul) (x ⊗ₜ[R] 1) =
    (CategoryTheory.MonoidalCategory.rightUnitor A.X).hom (x ⊗ₜ[R] 1)
⊢ x * 1 = x

Next tactic:
convert this
instance Ring_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Ring A.X :=
  { (inferInstance : AddCommGroup A.X) with
    one := A.one (1 : R)
    mul := fun x y => A.mul (x ⊗ₜ y)
    one_mul := fun x => by
      have := LinearMap.congr_fun A.one_mul ((1 : R) ⊗ₜ x)
      convert this
      rw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
    mul_one := fun x => by
      have := LinearMap.congr_fun A.mul_one (x ⊗ₜ (1 : R))
      convert this
      

Proof state:
case h.e'_3
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : AddCommGroup ↑A.X := inferInstance
x : ↑A.X
this :
  (CategoryTheory.MonoidalCategory.tensorHom (𝟙 A.X) A.one ≫ A.mul) (x ⊗ₜ[R] 1) =
    (CategoryTheory.MonoidalCategory.rightUnitor A.X).hom (x ⊗ₜ[R] 1)
⊢ x = (CategoryTheory.MonoidalCategory.rightUnitor A.X).hom (x ⊗ₜ[R] 1)

Next tactic:
erw [MonoidalCategory.leftUnitor_hom_apply, one_smul]
instance Algebra_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Algebra R A.X :=
  { A.one with
    map_zero' := A.one.map_zero
    map_one' := rfl
    map_mul' := fun x y => by
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : 𝟙_ (ModuleCat R) ⟶ A.X := A.one
x y : R
⊢ OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = AddHom.toFun src✝.toAddHom 1) }
      (x * y) =
    OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = AddHom.toFun src✝.toAddHom 1) }
        x *
      OneHom.toFun
        { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = AddHom.toFun src✝.toAddHom 1) } y

Next tactic:
have h := LinearMap.congr_fun A.one_mul.symm (x ⊗ₜ A.one y)
instance Algebra_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Algebra R A.X :=
  { A.one with
    map_zero' := A.one.map_zero
    map_one' := rfl
    map_mul' := fun x y => by
      have h := LinearMap.congr_fun A.one_mul.symm (x ⊗ₜ A.one y)
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : 𝟙_ (ModuleCat R) ⟶ A.X := A.one
x y : R
h :
  (CategoryTheory.MonoidalCategory.leftUnitor A.X).hom (x ⊗ₜ[R] A.one y) =
    (CategoryTheory.MonoidalCategory.tensorHom A.one (𝟙 A.X) ≫ A.mul) (x ⊗ₜ[R] A.one y)
⊢ OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = AddHom.toFun src✝.toAddHom 1) }
      (x * y) =
    OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = AddHom.toFun src✝.toAddHom 1) }
        x *
      OneHom.toFun
        { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = AddHom.toFun src✝.toAddHom 1) } y

Next tactic:
rwa [MonoidalCategory.leftUnitor_hom_apply, ← A.one.map_smul] at h
instance Algebra_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Algebra R A.X :=
  { A.one with
    map_zero' := A.one.map_zero
    map_one' := rfl
    map_mul' := fun x y => by
      have h := LinearMap.congr_fun A.one_mul.symm (x ⊗ₜ A.one y)
      rwa [MonoidalCategory.leftUnitor_hom_apply, ← A.one.map_smul] at h
    commutes' := fun r a => by
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : 𝟙_ (ModuleCat R) ⟶ A.X := A.one
r : R
a : ↑A.X
⊢ {
          toMonoidHom :=
            {
              toOneHom :=
                { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = AddHom.toFun src✝.toAddHom 1) },
              map_mul' :=
                (_ :
                  ∀ (x y : R),
                    A.one (x • y) =
                      (CategoryTheory.MonoidalCategory.tensorHom A.one (𝟙 A.X) ≫ A.mul) (x ⊗ₜ[R] A.one y)) },
          map_zero' := (_ : A.one 0 = 0),
          map_add' :=
            (_ :
              ∀ (x y : ↑(𝟙_ (ModuleCat R))),
                AddHom.toFun src✝.toAddHom (x + y) = AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }
        r *
      a =
    a *
      {
          toMonoidHom :=
            {
              toOneHom :=
                { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = AddHom.toFun src✝.toAddHom 1) },
              map_mul' :=
                (_ :
                  ∀ (x y : R),
                    A.one (x • y) =
                      (CategoryTheory.MonoidalCategory.tensorHom A.one (𝟙 A.X) ≫ A.mul) (x ⊗ₜ[R] A.one y)) },
          map_zero' := (_ : A.one 0 = 0),
          map_add' :=
            (_ :
              ∀ (x y : ↑(𝟙_ (ModuleCat R))),
                AddHom.toFun src✝.toAddHom (x + y) = AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }
        r

Next tactic:
dsimp
instance Algebra_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Algebra R A.X :=
  { A.one with
    map_zero' := A.one.map_zero
    map_one' := rfl
    map_mul' := fun x y => by
      have h := LinearMap.congr_fun A.one_mul.symm (x ⊗ₜ A.one y)
      rwa [MonoidalCategory.leftUnitor_hom_apply, ← A.one.map_smul] at h
    commutes' := fun r a => by
      dsimp
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : 𝟙_ (ModuleCat R) ⟶ A.X := A.one
r : R
a : ↑A.X
⊢ AddHom.toFun A.one.toAddHom r * a = a * AddHom.toFun A.one.toAddHom r

Next tactic:
have h₁ := LinearMap.congr_fun A.one_mul (r ⊗ₜ a)