l3lab/ntp-mathlib huggingface dataset:
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  obtain ⟨a, ha, rfl⟩ := hx
  refine ⟨⟨a, ha⟩, ?_, ?_⟩
  · rw [ne_eq, AddSubgroup.mk_eq_zero_iff, map_eq_zero, ← ne_eq] at h_nzr
    exact Subtype.ne_of_val_ne h_nzr
  · rw [← rpow_nat_cast, ← rpow_le_rpow_iff (by simp only [Rat.cast_abs, abs_nonneg])
      (rpow_nonneg_of_nonneg h2 _) h1, ← rpow_mul h2,  mul_inv_cancel (Nat.cast_ne_zero.mpr
      (ne_of_gt finrank_pos)), rpow_one, le_div_iff' (Nat.cast_pos.mpr finrank_pos)]
    refine le_trans ?_ ((convexBodySum_mem K B).mp h_mem)
    rw [← le_div_iff' (Nat.cast_pos.mpr finrank_pos), ← sum_mult_eq, Nat.cast_sum]
    

Proof state:
case intro.mk.intro.intro.intro.refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
a : K
ha : a ∈ ↑(𝓞 K)
hx : (mixedEmbedding K) a ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : { val := (mixedEmbedding K) a, property := hx } ≠ 0
h_mem : ↑{ val := (mixedEmbedding K) a, property := hx } ∈ convexBodySum K B
⊢ ↑|(Algebra.norm ℚ) ↑{ val := a, property := ha }| ^ (Finset.sum Finset.univ fun x => ↑(mult x))⁻¹ ≤
    (Finset.sum Finset.univ fun w => ↑(mult w) * ↑w a) / Finset.sum Finset.univ fun x => ↑(mult x)

Next tactic:
refine le_trans ?_ (geom_mean_le_arith_mean Finset.univ _ _ (fun _ _ => Nat.cast_nonneg _)
      ?_ (fun _ _ => AbsoluteValue.nonneg _ _))
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  obtain ⟨a, ha, rfl⟩ := hx
  refine ⟨⟨a, ha⟩, ?_, ?_⟩
  · rw [ne_eq, AddSubgroup.mk_eq_zero_iff, map_eq_zero, ← ne_eq] at h_nzr
    exact Subtype.ne_of_val_ne h_nzr
  · rw [← rpow_nat_cast, ← rpow_le_rpow_iff (by simp only [Rat.cast_abs, abs_nonneg])
      (rpow_nonneg_of_nonneg h2 _) h1, ← rpow_mul h2,  mul_inv_cancel (Nat.cast_ne_zero.mpr
      (ne_of_gt finrank_pos)), rpow_one, le_div_iff' (Nat.cast_pos.mpr finrank_pos)]
    refine le_trans ?_ ((convexBodySum_mem K B).mp h_mem)
    rw [← le_div_iff' (Nat.cast_pos.mpr finrank_pos), ← sum_mult_eq, Nat.cast_sum]
    refine le_trans ?_ (geom_mean_le_arith_mean Finset.univ _ _ (fun _ _ => Nat.cast_nonneg _)
      ?_ (fun _ _ => AbsoluteValue.nonneg _ _))
    · 

Proof state:
case intro.mk.intro.intro.intro.refine_2.refine_1
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
a : K
ha : a ∈ ↑(𝓞 K)
hx : (mixedEmbedding K) a ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : { val := (mixedEmbedding K) a, property := hx } ≠ 0
h_mem : ↑{ val := (mixedEmbedding K) a, property := hx } ∈ convexBodySum K B
⊢ ↑|(Algebra.norm ℚ) ↑{ val := a, property := ha }| ^ (Finset.sum Finset.univ fun x => ↑(mult x))⁻¹ ≤
    (Finset.prod Finset.univ fun i => ↑i a ^ ↑(mult i)) ^ (Finset.sum Finset.univ fun i => ↑(mult i))⁻¹

Next tactic:
simp_rw [← prod_eq_abs_norm, rpow_nat_cast]
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  obtain ⟨a, ha, rfl⟩ := hx
  refine ⟨⟨a, ha⟩, ?_, ?_⟩
  · rw [ne_eq, AddSubgroup.mk_eq_zero_iff, map_eq_zero, ← ne_eq] at h_nzr
    exact Subtype.ne_of_val_ne h_nzr
  · rw [← rpow_nat_cast, ← rpow_le_rpow_iff (by simp only [Rat.cast_abs, abs_nonneg])
      (rpow_nonneg_of_nonneg h2 _) h1, ← rpow_mul h2,  mul_inv_cancel (Nat.cast_ne_zero.mpr
      (ne_of_gt finrank_pos)), rpow_one, le_div_iff' (Nat.cast_pos.mpr finrank_pos)]
    refine le_trans ?_ ((convexBodySum_mem K B).mp h_mem)
    rw [← le_div_iff' (Nat.cast_pos.mpr finrank_pos), ← sum_mult_eq, Nat.cast_sum]
    refine le_trans ?_ (geom_mean_le_arith_mean Finset.univ _ _ (fun _ _ => Nat.cast_nonneg _)
      ?_ (fun _ _ => AbsoluteValue.nonneg _ _))
    · simp_rw [← prod_eq_abs_norm, rpow_nat_cast]
      

Proof state:
case intro.mk.intro.intro.intro.refine_2.refine_1
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
a : K
ha : a ∈ ↑(𝓞 K)
hx : (mixedEmbedding K) a ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : { val := (mixedEmbedding K) a, property := hx } ≠ 0
h_mem : ↑{ val := (mixedEmbedding K) a, property := hx } ∈ convexBodySum K B
⊢ (Finset.prod Finset.univ fun w => w a ^ mult w) ^ (Finset.sum Finset.univ fun x => ↑(mult x))⁻¹ ≤
    (Finset.prod Finset.univ fun x => ↑x a ^ mult x) ^ (Finset.sum Finset.univ fun i => ↑(mult i))⁻¹

Next tactic:
exact le_of_eq rfl
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  obtain ⟨a, ha, rfl⟩ := hx
  refine ⟨⟨a, ha⟩, ?_, ?_⟩
  · rw [ne_eq, AddSubgroup.mk_eq_zero_iff, map_eq_zero, ← ne_eq] at h_nzr
    exact Subtype.ne_of_val_ne h_nzr
  · rw [← rpow_nat_cast, ← rpow_le_rpow_iff (by simp only [Rat.cast_abs, abs_nonneg])
      (rpow_nonneg_of_nonneg h2 _) h1, ← rpow_mul h2,  mul_inv_cancel (Nat.cast_ne_zero.mpr
      (ne_of_gt finrank_pos)), rpow_one, le_div_iff' (Nat.cast_pos.mpr finrank_pos)]
    refine le_trans ?_ ((convexBodySum_mem K B).mp h_mem)
    rw [← le_div_iff' (Nat.cast_pos.mpr finrank_pos), ← sum_mult_eq, Nat.cast_sum]
    refine le_trans ?_ (geom_mean_le_arith_mean Finset.univ _ _ (fun _ _ => Nat.cast_nonneg _)
      ?_ (fun _ _ => AbsoluteValue.nonneg _ _))
    · simp_rw [← prod_eq_abs_norm, rpow_nat_cast]
      exact le_of_eq rfl
    · 

Proof state:
case intro.mk.intro.intro.intro.refine_2.refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
a : K
ha : a ∈ ↑(𝓞 K)
hx : (mixedEmbedding K) a ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : { val := (mixedEmbedding K) a, property := hx } ≠ 0
h_mem : ↑{ val := (mixedEmbedding K) a, property := hx } ∈ convexBodySum K B
⊢ 0 < Finset.sum Finset.univ fun i => ↑(mult i)

Next tactic:
rw [← Nat.cast_sum, sum_mult_eq, Nat.cast_pos]
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  obtain ⟨a, ha, rfl⟩ := hx
  refine ⟨⟨a, ha⟩, ?_, ?_⟩
  · rw [ne_eq, AddSubgroup.mk_eq_zero_iff, map_eq_zero, ← ne_eq] at h_nzr
    exact Subtype.ne_of_val_ne h_nzr
  · rw [← rpow_nat_cast, ← rpow_le_rpow_iff (by simp only [Rat.cast_abs, abs_nonneg])
      (rpow_nonneg_of_nonneg h2 _) h1, ← rpow_mul h2,  mul_inv_cancel (Nat.cast_ne_zero.mpr
      (ne_of_gt finrank_pos)), rpow_one, le_div_iff' (Nat.cast_pos.mpr finrank_pos)]
    refine le_trans ?_ ((convexBodySum_mem K B).mp h_mem)
    rw [← le_div_iff' (Nat.cast_pos.mpr finrank_pos), ← sum_mult_eq, Nat.cast_sum]
    refine le_trans ?_ (geom_mean_le_arith_mean Finset.univ _ _ (fun _ _ => Nat.cast_nonneg _)
      ?_ (fun _ _ => AbsoluteValue.nonneg _ _))
    · simp_rw [← prod_eq_abs_norm, rpow_nat_cast]
      exact le_of_eq rfl
    · rw [← Nat.cast_sum, sum_mult_eq, Nat.cast_pos]
      

Proof state:
case intro.mk.intro.intro.intro.refine_2.refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
a : K
ha : a ∈ ↑(𝓞 K)
hx : (mixedEmbedding K) a ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : { val := (mixedEmbedding K) a, property := hx } ≠ 0
h_mem : ↑{ val := (mixedEmbedding K) a, property := hx } ∈ convexBodySum K B
⊢ 0 < finrank ℚ K

Next tactic:
exact finrank_pos
/-- The `adjoinOne`-forgetful adjunction from `SemigroupCat` to `MonCat`.-/
@[to_additive "The `adjoinZero`-forgetful adjunction from `AddSemigroupCat` to `AddMonCat`"]
def adjoinOneAdj : adjoinOne ⊣ forget₂ MonCat.{u} SemigroupCat.{u} :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun S M => WithOne.lift.symm
      homEquiv_naturality_left_symm := by
        

Proof state:
⊢ ∀ {X' X : SemigroupCat} {Y : MonCat} (f : X' ⟶ X) (g : X ⟶ (forget₂ MonCat SemigroupCat).obj Y),
    ((fun S M => WithOne.lift.symm) X' Y).symm (f ≫ g) = adjoinOne.map f ≫ ((fun S M => WithOne.lift.symm) X Y).symm g

Next tactic:
intro S T M f g
/-- The `adjoinOne`-forgetful adjunction from `SemigroupCat` to `MonCat`.-/
@[to_additive "The `adjoinZero`-forgetful adjunction from `AddSemigroupCat` to `AddMonCat`"]
def adjoinOneAdj : adjoinOne ⊣ forget₂ MonCat.{u} SemigroupCat.{u} :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun S M => WithOne.lift.symm
      homEquiv_naturality_left_symm := by
        intro S T M f g
        

Proof state:
S T : SemigroupCat
M : MonCat
f : S ⟶ T
g : T ⟶ (forget₂ MonCat SemigroupCat).obj M
⊢ ((fun S M => WithOne.lift.symm) S M).symm (f ≫ g) = adjoinOne.map f ≫ ((fun S M => WithOne.lift.symm) T M).symm g

Next tactic:
ext x
/-- The `adjoinOne`-forgetful adjunction from `SemigroupCat` to `MonCat`.-/
@[to_additive "The `adjoinZero`-forgetful adjunction from `AddSemigroupCat` to `AddMonCat`"]
def adjoinOneAdj : adjoinOne ⊣ forget₂ MonCat.{u} SemigroupCat.{u} :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun S M => WithOne.lift.symm
      homEquiv_naturality_left_symm := by
        intro S T M f g
        ext x
        

Proof state:
case w
S T : SemigroupCat
M : MonCat
f : S ⟶ T
g : T ⟶ (forget₂ MonCat SemigroupCat).obj M
x : ↑(adjoinOne.obj S)
⊢ (((fun S M => WithOne.lift.symm) S M).symm (f ≫ g)) x =
    (adjoinOne.map f ≫ ((fun S M => WithOne.lift.symm) T M).symm g) x

Next tactic:
simp only [Equiv.symm_symm, adjoinOne_map, coe_comp]
/-- The `adjoinOne`-forgetful adjunction from `SemigroupCat` to `MonCat`.-/
@[to_additive "The `adjoinZero`-forgetful adjunction from `AddSemigroupCat` to `AddMonCat`"]
def adjoinOneAdj : adjoinOne ⊣ forget₂ MonCat.{u} SemigroupCat.{u} :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun S M => WithOne.lift.symm
      homEquiv_naturality_left_symm := by
        intro S T M f g
        ext x
        simp only [Equiv.symm_symm, adjoinOne_map, coe_comp]
        

Proof state:
case w
S T : SemigroupCat
M : MonCat
f : S ⟶ T
g : T ⟶ (forget₂ MonCat SemigroupCat).obj M
x : ↑(adjoinOne.obj S)
⊢ (WithOne.lift (f ≫ g)) x = (WithOne.map f ≫ WithOne.lift g) x

Next tactic:
simp_rw [WithOne.map]
/-- The `adjoinOne`-forgetful adjunction from `SemigroupCat` to `MonCat`.-/
@[to_additive "The `adjoinZero`-forgetful adjunction from `AddSemigroupCat` to `AddMonCat`"]
def adjoinOneAdj : adjoinOne ⊣ forget₂ MonCat.{u} SemigroupCat.{u} :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun S M => WithOne.lift.symm
      homEquiv_naturality_left_symm := by
        intro S T M f g
        ext x
        simp only [Equiv.symm_symm, adjoinOne_map, coe_comp]
        simp_rw [WithOne.map]
        

Proof state:
case w
S T : SemigroupCat
M : MonCat
f : S ⟶ T
g : T ⟶ (forget₂ MonCat SemigroupCat).obj M
x : ↑(adjoinOne.obj S)
⊢ (WithOne.lift (f ≫ g)) x = (WithOne.lift (MulHom.comp WithOne.coeMulHom f) ≫ WithOne.lift g) x

Next tactic:
cases x
/-- The `adjoinOne`-forgetful adjunction from `SemigroupCat` to `MonCat`.-/
@[to_additive "The `adjoinZero`-forgetful adjunction from `AddSemigroupCat` to `AddMonCat`"]
def adjoinOneAdj : adjoinOne ⊣ forget₂ MonCat.{u} SemigroupCat.{u} :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun S M => WithOne.lift.symm
      homEquiv_naturality_left_symm := by
        intro S T M f g
        ext x
        simp only [Equiv.symm_symm, adjoinOne_map, coe_comp]
        simp_rw [WithOne.map]
        cases x
        · 

Proof state:
case w.none
S T : SemigroupCat
M : MonCat
f : S ⟶ T
g : T ⟶ (forget₂ MonCat SemigroupCat).obj M
⊢ (WithOne.lift (f ≫ g)) none = (WithOne.lift (MulHom.comp WithOne.coeMulHom f) ≫ WithOne.lift g) none

Next tactic:
rfl
/-- The `adjoinOne`-forgetful adjunction from `SemigroupCat` to `MonCat`.-/
@[to_additive "The `adjoinZero`-forgetful adjunction from `AddSemigroupCat` to `AddMonCat`"]
def adjoinOneAdj : adjoinOne ⊣ forget₂ MonCat.{u} SemigroupCat.{u} :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun S M => WithOne.lift.symm
      homEquiv_naturality_left_symm := by
        intro S T M f g
        ext x
        simp only [Equiv.symm_symm, adjoinOne_map, coe_comp]
        simp_rw [WithOne.map]
        cases x
        · rfl
        · 

Proof state:
case w.some
S T : SemigroupCat
M : MonCat
f : S ⟶ T
g : T ⟶ (forget₂ MonCat SemigroupCat).obj M
val✝ : ↑S
⊢ (WithOne.lift (f ≫ g)) (some val✝) = (WithOne.lift (MulHom.comp WithOne.coeMulHom f) ≫ WithOne.lift g) (some val✝)

Next tactic:
simp
/-- The `adjoinOne`-forgetful adjunction from `SemigroupCat` to `MonCat`.-/
@[to_additive "The `adjoinZero`-forgetful adjunction from `AddSemigroupCat` to `AddMonCat`"]
def adjoinOneAdj : adjoinOne ⊣ forget₂ MonCat.{u} SemigroupCat.{u} :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun S M => WithOne.lift.symm
      homEquiv_naturality_left_symm := by
        intro S T M f g
        ext x
        simp only [Equiv.symm_symm, adjoinOne_map, coe_comp]
        simp_rw [WithOne.map]
        cases x
        · rfl
        · simp
          

Proof state:
case w.some
S T : SemigroupCat
M : MonCat
f : S ⟶ T
g : T ⟶ (forget₂ MonCat SemigroupCat).obj M
val✝ : ↑S
⊢ (WithOne.lift (f ≫ g)) (some val✝) = (WithOne.lift g) ((WithOne.lift (MulHom.comp WithOne.coeMulHom f)) (some val✝))

Next tactic:
rfl
/-- Horizontal composition of monoidal natural transformations. -/
@[simps]
def hcomp {F G : LaxMonoidalFunctor C D} {H K : LaxMonoidalFunctor D E} (α : MonoidalNatTrans F G)
    (β : MonoidalNatTrans H K) : MonoidalNatTrans (F ⊗⋙ H) (G ⊗⋙ K) :=
  { NatTrans.hcomp α.toNatTrans β.toNatTrans with
    unit := by
      

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : MonoidalCategory C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
inst✝² : MonoidalCategory D
E : Type u₃
inst✝¹ : Category.{v₃, u₃} E
inst✝ : MonoidalCategory E
F G : LaxMonoidalFunctor C D
H K : LaxMonoidalFunctor D E
α : MonoidalNatTrans F G
β : MonoidalNatTrans H K
src✝ : F.toFunctor ⋙ H.toFunctor ⟶ G.toFunctor ⋙ K.toFunctor := α.toNatTrans ◫ β.toNatTrans
⊢ (F ⊗⋙ H).ε ≫ (NatTrans.mk src✝.app).app (𝟙_ C) = (G ⊗⋙ K).ε

Next tactic:
dsimp
/-- Horizontal composition of monoidal natural transformations. -/
@[simps]
def hcomp {F G : LaxMonoidalFunctor C D} {H K : LaxMonoidalFunctor D E} (α : MonoidalNatTrans F G)
    (β : MonoidalNatTrans H K) : MonoidalNatTrans (F ⊗⋙ H) (G ⊗⋙ K) :=
  { NatTrans.hcomp α.toNatTrans β.toNatTrans with
    unit := by
      dsimp; 

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : MonoidalCategory C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
inst✝² : MonoidalCategory D
E : Type u₃
inst✝¹ : Category.{v₃, u₃} E
inst✝ : MonoidalCategory E
F G : LaxMonoidalFunctor C D
H K : LaxMonoidalFunctor D E
α : MonoidalNatTrans F G
β : MonoidalNatTrans H K
src✝ : F.toFunctor ⋙ H.toFunctor ⟶ G.toFunctor ⋙ K.toFunctor := α.toNatTrans ◫ β.toNatTrans
⊢ (H.ε ≫ H.map F.ε) ≫ β.app (F.obj (𝟙_ C)) ≫ K.map (α.app (𝟙_ C)) = K.ε ≫ K.map G.ε

Next tactic:
simp
/-- Horizontal composition of monoidal natural transformations. -/
@[simps]
def hcomp {F G : LaxMonoidalFunctor C D} {H K : LaxMonoidalFunctor D E} (α : MonoidalNatTrans F G)
    (β : MonoidalNatTrans H K) : MonoidalNatTrans (F ⊗⋙ H) (G ⊗⋙ K) :=
  { NatTrans.hcomp α.toNatTrans β.toNatTrans with
    unit := by
      dsimp; simp
      

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : MonoidalCategory C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
inst✝² : MonoidalCategory D
E : Type u₃
inst✝¹ : Category.{v₃, u₃} E
inst✝ : MonoidalCategory E
F G : LaxMonoidalFunctor C D
H K : LaxMonoidalFunctor D E
α : MonoidalNatTrans F G
β : MonoidalNatTrans H K
src✝ : F.toFunctor ⋙ H.toFunctor ⟶ G.toFunctor ⋙ K.toFunctor := α.toNatTrans ◫ β.toNatTrans
⊢ K.ε ≫ K.map F.ε ≫ K.map (α.app (𝟙_ C)) = K.ε ≫ K.map G.ε

Next tactic:
conv_lhs => rw [← K.toFunctor.map_comp, α.unit]