state
stringlengths
0
159k
srcUpToTactic
stringlengths
387
167k
nextTactic
stringlengths
3
9k
declUpToTactic
stringlengths
22
11.5k
declId
stringlengths
38
95
decl
stringlengths
16
1.89k
file_tag
stringlengths
17
73
case this.Hcont π•œ : Type u_1 inst✝⁡ : NontriviallyNormedField π•œ E : Type u_2 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace π•œ E F : Type u_3 inst✝² : NormedAddCommGroup F inst✝¹ : NormedSpace π•œ F p : FormalMultilinearSeries π•œ E F r : ℝβ‰₯0∞ f : E β†’ F x : E s : Set E inst✝ : CompleteSpace F h : AnalyticOn π•œ f s n : β„•βˆž t : Set E := {x | AnalyticAt π•œ f x} H : AnalyticOn π•œ f t t_open : IsOpen t m : β„• ⊒ ContinuousOn (fun x => iteratedFDerivWithin π•œ m f t x) t
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # Frechet derivatives of analytic functions. A function expressible as a power series at a point has a Frechet derivative there. Also the special case in terms of `deriv` when the domain is 1-dimensional. -/ open Filter Asymptotics open scoped ENNReal variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine' h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right _) refine' isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, _, EventuallyEq.rfl⟩ refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq /-- If a function has a power series on a ball, then so does its derivative. -/ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by suffices A : HasFPowerSeriesOnBall (fun z => continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r Β· apply A.congr intro z hz dsimp rw [← h.fderiv_eq, add_sub_cancel'_right] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz suffices B : HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r exact (continuousMultilinearCurryFin1 π•œ E F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall B simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv /-- If a function is analytic on a set `s`, so is its FrΓ©chet derivative. -/ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv /-- If a function is analytic on a set `s`, so are its successive FrΓ©chet derivative. -/ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert @ContinuousLinearMap.comp_analyticOn π•œ E ?_ (ContinuousMultilinearMap π•œ (fun _ : Fin (n + 1) ↦ E) F) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ s ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F) rfl #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv /-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m -
apply (H.iteratedFDeriv m).continuousOn.congr
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m -
Mathlib.Analysis.Calculus.FDeriv.Analytic.143_0.XLJ3uW4JYwyXQcn
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s
Mathlib_Analysis_Calculus_FDeriv_Analytic
case this.Hcont π•œ : Type u_1 inst✝⁡ : NontriviallyNormedField π•œ E : Type u_2 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace π•œ E F : Type u_3 inst✝² : NormedAddCommGroup F inst✝¹ : NormedSpace π•œ F p : FormalMultilinearSeries π•œ E F r : ℝβ‰₯0∞ f : E β†’ F x : E s : Set E inst✝ : CompleteSpace F h : AnalyticOn π•œ f s n : β„•βˆž t : Set E := {x | AnalyticAt π•œ f x} H : AnalyticOn π•œ f t t_open : IsOpen t m : β„• ⊒ Set.EqOn (fun x => iteratedFDerivWithin π•œ m f t x) (_root_.iteratedFDeriv π•œ m f) t
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # Frechet derivatives of analytic functions. A function expressible as a power series at a point has a Frechet derivative there. Also the special case in terms of `deriv` when the domain is 1-dimensional. -/ open Filter Asymptotics open scoped ENNReal variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine' h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right _) refine' isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, _, EventuallyEq.rfl⟩ refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq /-- If a function has a power series on a ball, then so does its derivative. -/ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by suffices A : HasFPowerSeriesOnBall (fun z => continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r Β· apply A.congr intro z hz dsimp rw [← h.fderiv_eq, add_sub_cancel'_right] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz suffices B : HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r exact (continuousMultilinearCurryFin1 π•œ E F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall B simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv /-- If a function is analytic on a set `s`, so is its FrΓ©chet derivative. -/ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv /-- If a function is analytic on a set `s`, so are its successive FrΓ©chet derivative. -/ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert @ContinuousLinearMap.comp_analyticOn π•œ E ?_ (ContinuousMultilinearMap π•œ (fun _ : Fin (n + 1) ↦ E) F) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ s ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F) rfl #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv /-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr
intro x hx
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr
Mathlib.Analysis.Calculus.FDeriv.Analytic.143_0.XLJ3uW4JYwyXQcn
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s
Mathlib_Analysis_Calculus_FDeriv_Analytic
case this.Hcont π•œ : Type u_1 inst✝⁡ : NontriviallyNormedField π•œ E : Type u_2 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace π•œ E F : Type u_3 inst✝² : NormedAddCommGroup F inst✝¹ : NormedSpace π•œ F p : FormalMultilinearSeries π•œ E F r : ℝβ‰₯0∞ f : E β†’ F x✝ : E s : Set E inst✝ : CompleteSpace F h : AnalyticOn π•œ f s n : β„•βˆž t : Set E := {x | AnalyticAt π•œ f x} H : AnalyticOn π•œ f t t_open : IsOpen t m : β„• x : E hx : x ∈ t ⊒ (fun x => iteratedFDerivWithin π•œ m f t x) x = _root_.iteratedFDeriv π•œ m f x
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # Frechet derivatives of analytic functions. A function expressible as a power series at a point has a Frechet derivative there. Also the special case in terms of `deriv` when the domain is 1-dimensional. -/ open Filter Asymptotics open scoped ENNReal variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine' h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right _) refine' isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, _, EventuallyEq.rfl⟩ refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq /-- If a function has a power series on a ball, then so does its derivative. -/ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by suffices A : HasFPowerSeriesOnBall (fun z => continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r Β· apply A.congr intro z hz dsimp rw [← h.fderiv_eq, add_sub_cancel'_right] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz suffices B : HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r exact (continuousMultilinearCurryFin1 π•œ E F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall B simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv /-- If a function is analytic on a set `s`, so is its FrΓ©chet derivative. -/ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv /-- If a function is analytic on a set `s`, so are its successive FrΓ©chet derivative. -/ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert @ContinuousLinearMap.comp_analyticOn π•œ E ?_ (ContinuousMultilinearMap π•œ (fun _ : Fin (n + 1) ↦ E) F) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ s ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F) rfl #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv /-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx
exact iteratedFDerivWithin_of_isOpen _ t_open hx
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx
Mathlib.Analysis.Calculus.FDeriv.Analytic.143_0.XLJ3uW4JYwyXQcn
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s
Mathlib_Analysis_Calculus_FDeriv_Analytic
case this.Hdiff π•œ : Type u_1 inst✝⁡ : NontriviallyNormedField π•œ E : Type u_2 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace π•œ E F : Type u_3 inst✝² : NormedAddCommGroup F inst✝¹ : NormedSpace π•œ F p : FormalMultilinearSeries π•œ E F r : ℝβ‰₯0∞ f : E β†’ F x : E s : Set E inst✝ : CompleteSpace F h : AnalyticOn π•œ f s n : β„•βˆž t : Set E := {x | AnalyticAt π•œ f x} H : AnalyticOn π•œ f t t_open : IsOpen t ⊒ βˆ€ (m : β„•), ↑m < n β†’ DifferentiableOn π•œ (fun x => iteratedFDerivWithin π•œ m f t x) t
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # Frechet derivatives of analytic functions. A function expressible as a power series at a point has a Frechet derivative there. Also the special case in terms of `deriv` when the domain is 1-dimensional. -/ open Filter Asymptotics open scoped ENNReal variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine' h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right _) refine' isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, _, EventuallyEq.rfl⟩ refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq /-- If a function has a power series on a ball, then so does its derivative. -/ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by suffices A : HasFPowerSeriesOnBall (fun z => continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r Β· apply A.congr intro z hz dsimp rw [← h.fderiv_eq, add_sub_cancel'_right] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz suffices B : HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r exact (continuousMultilinearCurryFin1 π•œ E F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall B simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv /-- If a function is analytic on a set `s`, so is its FrΓ©chet derivative. -/ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv /-- If a function is analytic on a set `s`, so are its successive FrΓ©chet derivative. -/ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert @ContinuousLinearMap.comp_analyticOn π•œ E ?_ (ContinuousMultilinearMap π•œ (fun _ : Fin (n + 1) ↦ E) F) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ s ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F) rfl #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv /-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β·
rintro m -
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β·
Mathlib.Analysis.Calculus.FDeriv.Analytic.143_0.XLJ3uW4JYwyXQcn
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s
Mathlib_Analysis_Calculus_FDeriv_Analytic
case this.Hdiff π•œ : Type u_1 inst✝⁡ : NontriviallyNormedField π•œ E : Type u_2 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace π•œ E F : Type u_3 inst✝² : NormedAddCommGroup F inst✝¹ : NormedSpace π•œ F p : FormalMultilinearSeries π•œ E F r : ℝβ‰₯0∞ f : E β†’ F x : E s : Set E inst✝ : CompleteSpace F h : AnalyticOn π•œ f s n : β„•βˆž t : Set E := {x | AnalyticAt π•œ f x} H : AnalyticOn π•œ f t t_open : IsOpen t m : β„• ⊒ DifferentiableOn π•œ (fun x => iteratedFDerivWithin π•œ m f t x) t
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # Frechet derivatives of analytic functions. A function expressible as a power series at a point has a Frechet derivative there. Also the special case in terms of `deriv` when the domain is 1-dimensional. -/ open Filter Asymptotics open scoped ENNReal variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine' h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right _) refine' isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, _, EventuallyEq.rfl⟩ refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq /-- If a function has a power series on a ball, then so does its derivative. -/ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by suffices A : HasFPowerSeriesOnBall (fun z => continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r Β· apply A.congr intro z hz dsimp rw [← h.fderiv_eq, add_sub_cancel'_right] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz suffices B : HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r exact (continuousMultilinearCurryFin1 π•œ E F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall B simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv /-- If a function is analytic on a set `s`, so is its FrΓ©chet derivative. -/ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv /-- If a function is analytic on a set `s`, so are its successive FrΓ©chet derivative. -/ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert @ContinuousLinearMap.comp_analyticOn π•œ E ?_ (ContinuousMultilinearMap π•œ (fun _ : Fin (n + 1) ↦ E) F) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ s ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F) rfl #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv /-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β· rintro m -
apply (H.iteratedFDeriv m).differentiableOn.congr
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β· rintro m -
Mathlib.Analysis.Calculus.FDeriv.Analytic.143_0.XLJ3uW4JYwyXQcn
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s
Mathlib_Analysis_Calculus_FDeriv_Analytic
case this.Hdiff π•œ : Type u_1 inst✝⁡ : NontriviallyNormedField π•œ E : Type u_2 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace π•œ E F : Type u_3 inst✝² : NormedAddCommGroup F inst✝¹ : NormedSpace π•œ F p : FormalMultilinearSeries π•œ E F r : ℝβ‰₯0∞ f : E β†’ F x : E s : Set E inst✝ : CompleteSpace F h : AnalyticOn π•œ f s n : β„•βˆž t : Set E := {x | AnalyticAt π•œ f x} H : AnalyticOn π•œ f t t_open : IsOpen t m : β„• ⊒ βˆ€ x ∈ t, iteratedFDerivWithin π•œ m f t x = _root_.iteratedFDeriv π•œ m f x
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # Frechet derivatives of analytic functions. A function expressible as a power series at a point has a Frechet derivative there. Also the special case in terms of `deriv` when the domain is 1-dimensional. -/ open Filter Asymptotics open scoped ENNReal variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine' h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right _) refine' isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, _, EventuallyEq.rfl⟩ refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq /-- If a function has a power series on a ball, then so does its derivative. -/ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by suffices A : HasFPowerSeriesOnBall (fun z => continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r Β· apply A.congr intro z hz dsimp rw [← h.fderiv_eq, add_sub_cancel'_right] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz suffices B : HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r exact (continuousMultilinearCurryFin1 π•œ E F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall B simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv /-- If a function is analytic on a set `s`, so is its FrΓ©chet derivative. -/ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv /-- If a function is analytic on a set `s`, so are its successive FrΓ©chet derivative. -/ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert @ContinuousLinearMap.comp_analyticOn π•œ E ?_ (ContinuousMultilinearMap π•œ (fun _ : Fin (n + 1) ↦ E) F) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ s ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F) rfl #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv /-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β· rintro m - apply (H.iteratedFDeriv m).differentiableOn.congr
intro x hx
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β· rintro m - apply (H.iteratedFDeriv m).differentiableOn.congr
Mathlib.Analysis.Calculus.FDeriv.Analytic.143_0.XLJ3uW4JYwyXQcn
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s
Mathlib_Analysis_Calculus_FDeriv_Analytic
case this.Hdiff π•œ : Type u_1 inst✝⁡ : NontriviallyNormedField π•œ E : Type u_2 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace π•œ E F : Type u_3 inst✝² : NormedAddCommGroup F inst✝¹ : NormedSpace π•œ F p : FormalMultilinearSeries π•œ E F r : ℝβ‰₯0∞ f : E β†’ F x✝ : E s : Set E inst✝ : CompleteSpace F h : AnalyticOn π•œ f s n : β„•βˆž t : Set E := {x | AnalyticAt π•œ f x} H : AnalyticOn π•œ f t t_open : IsOpen t m : β„• x : E hx : x ∈ t ⊒ iteratedFDerivWithin π•œ m f t x = _root_.iteratedFDeriv π•œ m f x
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # Frechet derivatives of analytic functions. A function expressible as a power series at a point has a Frechet derivative there. Also the special case in terms of `deriv` when the domain is 1-dimensional. -/ open Filter Asymptotics open scoped ENNReal variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine' h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right _) refine' isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, _, EventuallyEq.rfl⟩ refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq /-- If a function has a power series on a ball, then so does its derivative. -/ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by suffices A : HasFPowerSeriesOnBall (fun z => continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r Β· apply A.congr intro z hz dsimp rw [← h.fderiv_eq, add_sub_cancel'_right] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz suffices B : HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r exact (continuousMultilinearCurryFin1 π•œ E F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall B simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv /-- If a function is analytic on a set `s`, so is its FrΓ©chet derivative. -/ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv /-- If a function is analytic on a set `s`, so are its successive FrΓ©chet derivative. -/ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert @ContinuousLinearMap.comp_analyticOn π•œ E ?_ (ContinuousMultilinearMap π•œ (fun _ : Fin (n + 1) ↦ E) F) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ s ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F) rfl #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv /-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β· rintro m - apply (H.iteratedFDeriv m).differentiableOn.congr intro x hx
exact iteratedFDerivWithin_of_isOpen _ t_open hx
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β· rintro m - apply (H.iteratedFDeriv m).differentiableOn.congr intro x hx
Mathlib.Analysis.Calculus.FDeriv.Analytic.143_0.XLJ3uW4JYwyXQcn
/-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s
Mathlib_Analysis_Calculus_FDeriv_Analytic
π•œ : Type u_1 inst✝⁡ : NontriviallyNormedField π•œ E : Type u_2 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace π•œ E F : Type u_3 inst✝² : NormedAddCommGroup F inst✝¹ : NormedSpace π•œ F p : FormalMultilinearSeries π•œ E F r : ℝβ‰₯0∞ f : E β†’ F x : E s : Set E inst✝ : CompleteSpace F h : AnalyticAt π•œ f x n : β„•βˆž ⊒ ContDiffAt π•œ n f x
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # Frechet derivatives of analytic functions. A function expressible as a power series at a point has a Frechet derivative there. Also the special case in terms of `deriv` when the domain is 1-dimensional. -/ open Filter Asymptotics open scoped ENNReal variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine' h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right _) refine' isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, _, EventuallyEq.rfl⟩ refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq /-- If a function has a power series on a ball, then so does its derivative. -/ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by suffices A : HasFPowerSeriesOnBall (fun z => continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r Β· apply A.congr intro z hz dsimp rw [← h.fderiv_eq, add_sub_cancel'_right] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz suffices B : HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r exact (continuousMultilinearCurryFin1 π•œ E F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall B simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv /-- If a function is analytic on a set `s`, so is its FrΓ©chet derivative. -/ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv /-- If a function is analytic on a set `s`, so are its successive FrΓ©chet derivative. -/ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert @ContinuousLinearMap.comp_analyticOn π•œ E ?_ (ContinuousMultilinearMap π•œ (fun _ : Fin (n + 1) ↦ E) F) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ s ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F) rfl #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv /-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β· rintro m - apply (H.iteratedFDeriv m).differentiableOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx #align analytic_on.cont_diff_on AnalyticOn.contDiffOn theorem AnalyticAt.contDiffAt [CompleteSpace F] (h : AnalyticAt π•œ f x) {n : β„•βˆž} : ContDiffAt π•œ n f x := by
obtain ⟨s, hs, hf⟩ := h.exists_mem_nhds_analyticOn
theorem AnalyticAt.contDiffAt [CompleteSpace F] (h : AnalyticAt π•œ f x) {n : β„•βˆž} : ContDiffAt π•œ n f x := by
Mathlib.Analysis.Calculus.FDeriv.Analytic.161_0.XLJ3uW4JYwyXQcn
theorem AnalyticAt.contDiffAt [CompleteSpace F] (h : AnalyticAt π•œ f x) {n : β„•βˆž} : ContDiffAt π•œ n f x
Mathlib_Analysis_Calculus_FDeriv_Analytic
case intro.intro π•œ : Type u_1 inst✝⁡ : NontriviallyNormedField π•œ E : Type u_2 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace π•œ E F : Type u_3 inst✝² : NormedAddCommGroup F inst✝¹ : NormedSpace π•œ F p : FormalMultilinearSeries π•œ E F r : ℝβ‰₯0∞ f : E β†’ F x : E s✝ : Set E inst✝ : CompleteSpace F h : AnalyticAt π•œ f x n : β„•βˆž s : Set E hs : s ∈ nhds x hf : AnalyticOn π•œ f s ⊒ ContDiffAt π•œ n f x
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # Frechet derivatives of analytic functions. A function expressible as a power series at a point has a Frechet derivative there. Also the special case in terms of `deriv` when the domain is 1-dimensional. -/ open Filter Asymptotics open scoped ENNReal variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine' h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right _) refine' isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, _, EventuallyEq.rfl⟩ refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq /-- If a function has a power series on a ball, then so does its derivative. -/ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by suffices A : HasFPowerSeriesOnBall (fun z => continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r Β· apply A.congr intro z hz dsimp rw [← h.fderiv_eq, add_sub_cancel'_right] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz suffices B : HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r exact (continuousMultilinearCurryFin1 π•œ E F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall B simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv /-- If a function is analytic on a set `s`, so is its FrΓ©chet derivative. -/ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv /-- If a function is analytic on a set `s`, so are its successive FrΓ©chet derivative. -/ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert @ContinuousLinearMap.comp_analyticOn π•œ E ?_ (ContinuousMultilinearMap π•œ (fun _ : Fin (n + 1) ↦ E) F) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ s ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F) rfl #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv /-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β· rintro m - apply (H.iteratedFDeriv m).differentiableOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx #align analytic_on.cont_diff_on AnalyticOn.contDiffOn theorem AnalyticAt.contDiffAt [CompleteSpace F] (h : AnalyticAt π•œ f x) {n : β„•βˆž} : ContDiffAt π•œ n f x := by obtain ⟨s, hs, hf⟩ := h.exists_mem_nhds_analyticOn
exact hf.contDiffOn.contDiffAt hs
theorem AnalyticAt.contDiffAt [CompleteSpace F] (h : AnalyticAt π•œ f x) {n : β„•βˆž} : ContDiffAt π•œ n f x := by obtain ⟨s, hs, hf⟩ := h.exists_mem_nhds_analyticOn
Mathlib.Analysis.Calculus.FDeriv.Analytic.161_0.XLJ3uW4JYwyXQcn
theorem AnalyticAt.contDiffAt [CompleteSpace F] (h : AnalyticAt π•œ f x) {n : β„•βˆž} : ContDiffAt π•œ n f x
Mathlib_Analysis_Calculus_FDeriv_Analytic
π•œ : Type u_1 inst✝⁡ : NontriviallyNormedField π•œ E : Type u_2 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace π•œ E F : Type u_3 inst✝² : NormedAddCommGroup F inst✝¹ : NormedSpace π•œ F p : FormalMultilinearSeries π•œ π•œ F r : ℝβ‰₯0∞ f : π•œ β†’ F x : π•œ s : Set π•œ inst✝ : CompleteSpace F h : AnalyticOn π•œ f s n : β„• ⊒ AnalyticOn π•œ (_root_.deriv^[n] f) s
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # Frechet derivatives of analytic functions. A function expressible as a power series at a point has a Frechet derivative there. Also the special case in terms of `deriv` when the domain is 1-dimensional. -/ open Filter Asymptotics open scoped ENNReal variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine' h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right _) refine' isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, _, EventuallyEq.rfl⟩ refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq /-- If a function has a power series on a ball, then so does its derivative. -/ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by suffices A : HasFPowerSeriesOnBall (fun z => continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r Β· apply A.congr intro z hz dsimp rw [← h.fderiv_eq, add_sub_cancel'_right] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz suffices B : HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r exact (continuousMultilinearCurryFin1 π•œ E F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall B simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv /-- If a function is analytic on a set `s`, so is its FrΓ©chet derivative. -/ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv /-- If a function is analytic on a set `s`, so are its successive FrΓ©chet derivative. -/ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert @ContinuousLinearMap.comp_analyticOn π•œ E ?_ (ContinuousMultilinearMap π•œ (fun _ : Fin (n + 1) ↦ E) F) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ s ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F) rfl #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv /-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β· rintro m - apply (H.iteratedFDeriv m).differentiableOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx #align analytic_on.cont_diff_on AnalyticOn.contDiffOn theorem AnalyticAt.contDiffAt [CompleteSpace F] (h : AnalyticAt π•œ f x) {n : β„•βˆž} : ContDiffAt π•œ n f x := by obtain ⟨s, hs, hf⟩ := h.exists_mem_nhds_analyticOn exact hf.contDiffOn.contDiffAt hs end fderiv section deriv variable {p : FormalMultilinearSeries π•œ π•œ F} {r : ℝβ‰₯0∞} variable {f : π•œ β†’ F} {x : π•œ} {s : Set π•œ} protected theorem HasFPowerSeriesAt.hasStrictDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictDerivAt f (p 1 fun _ => 1) x := h.hasStrictFDerivAt.hasStrictDerivAt #align has_fpower_series_at.has_strict_deriv_at HasFPowerSeriesAt.hasStrictDerivAt protected theorem HasFPowerSeriesAt.hasDerivAt (h : HasFPowerSeriesAt f p x) : HasDerivAt f (p 1 fun _ => 1) x := h.hasStrictDerivAt.hasDerivAt #align has_fpower_series_at.has_deriv_at HasFPowerSeriesAt.hasDerivAt protected theorem HasFPowerSeriesAt.deriv (h : HasFPowerSeriesAt f p x) : deriv f x = p 1 fun _ => 1 := h.hasDerivAt.deriv #align has_fpower_series_at.deriv HasFPowerSeriesAt.deriv /-- If a function is analytic on a set `s`, so is its derivative. -/ theorem AnalyticOn.deriv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (deriv f) s := (ContinuousLinearMap.apply π•œ F (1 : π•œ)).comp_analyticOn h.fderiv #align analytic_on.deriv AnalyticOn.deriv /-- If a function is analytic on a set `s`, so are its successive derivatives. -/ theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (_root_.deriv^[n] f) s := by
induction' n with n IH
/-- If a function is analytic on a set `s`, so are its successive derivatives. -/ theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (_root_.deriv^[n] f) s := by
Mathlib.Analysis.Calculus.FDeriv.Analytic.194_0.XLJ3uW4JYwyXQcn
/-- If a function is analytic on a set `s`, so are its successive derivatives. -/ theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (_root_.deriv^[n] f) s
Mathlib_Analysis_Calculus_FDeriv_Analytic
case zero π•œ : Type u_1 inst✝⁡ : NontriviallyNormedField π•œ E : Type u_2 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace π•œ E F : Type u_3 inst✝² : NormedAddCommGroup F inst✝¹ : NormedSpace π•œ F p : FormalMultilinearSeries π•œ π•œ F r : ℝβ‰₯0∞ f : π•œ β†’ F x : π•œ s : Set π•œ inst✝ : CompleteSpace F h : AnalyticOn π•œ f s ⊒ AnalyticOn π•œ (_root_.deriv^[Nat.zero] f) s
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # Frechet derivatives of analytic functions. A function expressible as a power series at a point has a Frechet derivative there. Also the special case in terms of `deriv` when the domain is 1-dimensional. -/ open Filter Asymptotics open scoped ENNReal variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine' h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right _) refine' isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, _, EventuallyEq.rfl⟩ refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq /-- If a function has a power series on a ball, then so does its derivative. -/ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by suffices A : HasFPowerSeriesOnBall (fun z => continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r Β· apply A.congr intro z hz dsimp rw [← h.fderiv_eq, add_sub_cancel'_right] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz suffices B : HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r exact (continuousMultilinearCurryFin1 π•œ E F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall B simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv /-- If a function is analytic on a set `s`, so is its FrΓ©chet derivative. -/ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv /-- If a function is analytic on a set `s`, so are its successive FrΓ©chet derivative. -/ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert @ContinuousLinearMap.comp_analyticOn π•œ E ?_ (ContinuousMultilinearMap π•œ (fun _ : Fin (n + 1) ↦ E) F) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ s ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F) rfl #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv /-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β· rintro m - apply (H.iteratedFDeriv m).differentiableOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx #align analytic_on.cont_diff_on AnalyticOn.contDiffOn theorem AnalyticAt.contDiffAt [CompleteSpace F] (h : AnalyticAt π•œ f x) {n : β„•βˆž} : ContDiffAt π•œ n f x := by obtain ⟨s, hs, hf⟩ := h.exists_mem_nhds_analyticOn exact hf.contDiffOn.contDiffAt hs end fderiv section deriv variable {p : FormalMultilinearSeries π•œ π•œ F} {r : ℝβ‰₯0∞} variable {f : π•œ β†’ F} {x : π•œ} {s : Set π•œ} protected theorem HasFPowerSeriesAt.hasStrictDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictDerivAt f (p 1 fun _ => 1) x := h.hasStrictFDerivAt.hasStrictDerivAt #align has_fpower_series_at.has_strict_deriv_at HasFPowerSeriesAt.hasStrictDerivAt protected theorem HasFPowerSeriesAt.hasDerivAt (h : HasFPowerSeriesAt f p x) : HasDerivAt f (p 1 fun _ => 1) x := h.hasStrictDerivAt.hasDerivAt #align has_fpower_series_at.has_deriv_at HasFPowerSeriesAt.hasDerivAt protected theorem HasFPowerSeriesAt.deriv (h : HasFPowerSeriesAt f p x) : deriv f x = p 1 fun _ => 1 := h.hasDerivAt.deriv #align has_fpower_series_at.deriv HasFPowerSeriesAt.deriv /-- If a function is analytic on a set `s`, so is its derivative. -/ theorem AnalyticOn.deriv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (deriv f) s := (ContinuousLinearMap.apply π•œ F (1 : π•œ)).comp_analyticOn h.fderiv #align analytic_on.deriv AnalyticOn.deriv /-- If a function is analytic on a set `s`, so are its successive derivatives. -/ theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (_root_.deriv^[n] f) s := by induction' n with n IH Β·
exact h
/-- If a function is analytic on a set `s`, so are its successive derivatives. -/ theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (_root_.deriv^[n] f) s := by induction' n with n IH Β·
Mathlib.Analysis.Calculus.FDeriv.Analytic.194_0.XLJ3uW4JYwyXQcn
/-- If a function is analytic on a set `s`, so are its successive derivatives. -/ theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (_root_.deriv^[n] f) s
Mathlib_Analysis_Calculus_FDeriv_Analytic
case succ π•œ : Type u_1 inst✝⁡ : NontriviallyNormedField π•œ E : Type u_2 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace π•œ E F : Type u_3 inst✝² : NormedAddCommGroup F inst✝¹ : NormedSpace π•œ F p : FormalMultilinearSeries π•œ π•œ F r : ℝβ‰₯0∞ f : π•œ β†’ F x : π•œ s : Set π•œ inst✝ : CompleteSpace F h : AnalyticOn π•œ f s n : β„• IH : AnalyticOn π•œ (_root_.deriv^[n] f) s ⊒ AnalyticOn π•œ (_root_.deriv^[Nat.succ n] f) s
/- Copyright (c) 2021 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # Frechet derivatives of analytic functions. A function expressible as a power series at a point has a Frechet derivative there. Also the special case in terms of `deriv` when the domain is 1-dimensional. -/ open Filter Asymptotics open scoped ENNReal variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine' h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right _) refine' isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, _, EventuallyEq.rfl⟩ refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq /-- If a function has a power series on a ball, then so does its derivative. -/ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by suffices A : HasFPowerSeriesOnBall (fun z => continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ((continuousMultilinearCurryFin1 π•œ E F : (E[Γ—1]β†’L[π•œ] F) β†’L[π•œ] E β†’L[π•œ] F).compFormalMultilinearSeries (p.changeOriginSeries 1)) x r Β· apply A.congr intro z hz dsimp rw [← h.fderiv_eq, add_sub_cancel'_right] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz suffices B : HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r exact (continuousMultilinearCurryFin1 π•œ E F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall B simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv /-- If a function is analytic on a set `s`, so is its FrΓ©chet derivative. -/ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv /-- If a function is analytic on a set `s`, so are its successive FrΓ©chet derivative. -/ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert @ContinuousLinearMap.comp_analyticOn π•œ E ?_ (ContinuousMultilinearMap π•œ (fun _ : Fin (n + 1) ↦ E) F) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ s ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F) rfl #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv /-- An analytic function is infinitely differentiable. -/ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn π•œ f s) {n : β„•βˆž} : ContDiffOn π•œ n f s := by let t := { x | AnalyticAt π•œ f x } suffices : ContDiffOn π•œ n f t; exact this.mono h have H : AnalyticOn π•œ f t := fun x hx => hx have t_open : IsOpen t := isOpen_analyticAt π•œ f apply contDiffOn_of_continuousOn_differentiableOn Β· rintro m - apply (H.iteratedFDeriv m).continuousOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx Β· rintro m - apply (H.iteratedFDeriv m).differentiableOn.congr intro x hx exact iteratedFDerivWithin_of_isOpen _ t_open hx #align analytic_on.cont_diff_on AnalyticOn.contDiffOn theorem AnalyticAt.contDiffAt [CompleteSpace F] (h : AnalyticAt π•œ f x) {n : β„•βˆž} : ContDiffAt π•œ n f x := by obtain ⟨s, hs, hf⟩ := h.exists_mem_nhds_analyticOn exact hf.contDiffOn.contDiffAt hs end fderiv section deriv variable {p : FormalMultilinearSeries π•œ π•œ F} {r : ℝβ‰₯0∞} variable {f : π•œ β†’ F} {x : π•œ} {s : Set π•œ} protected theorem HasFPowerSeriesAt.hasStrictDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictDerivAt f (p 1 fun _ => 1) x := h.hasStrictFDerivAt.hasStrictDerivAt #align has_fpower_series_at.has_strict_deriv_at HasFPowerSeriesAt.hasStrictDerivAt protected theorem HasFPowerSeriesAt.hasDerivAt (h : HasFPowerSeriesAt f p x) : HasDerivAt f (p 1 fun _ => 1) x := h.hasStrictDerivAt.hasDerivAt #align has_fpower_series_at.has_deriv_at HasFPowerSeriesAt.hasDerivAt protected theorem HasFPowerSeriesAt.deriv (h : HasFPowerSeriesAt f p x) : deriv f x = p 1 fun _ => 1 := h.hasDerivAt.deriv #align has_fpower_series_at.deriv HasFPowerSeriesAt.deriv /-- If a function is analytic on a set `s`, so is its derivative. -/ theorem AnalyticOn.deriv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (deriv f) s := (ContinuousLinearMap.apply π•œ F (1 : π•œ)).comp_analyticOn h.fderiv #align analytic_on.deriv AnalyticOn.deriv /-- If a function is analytic on a set `s`, so are its successive derivatives. -/ theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (_root_.deriv^[n] f) s := by induction' n with n IH Β· exact h Β·
simpa only [Function.iterate_succ', Function.comp_apply] using IH.deriv
/-- If a function is analytic on a set `s`, so are its successive derivatives. -/ theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (_root_.deriv^[n] f) s := by induction' n with n IH Β· exact h Β·
Mathlib.Analysis.Calculus.FDeriv.Analytic.194_0.XLJ3uW4JYwyXQcn
/-- If a function is analytic on a set `s`, so are its successive derivatives. -/ theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (_root_.deriv^[n] f) s
Mathlib_Analysis_Calculus_FDeriv_Analytic
F : Type u K : Type v A : Type w inst✝¹⁰ : CommRing F inst✝⁹ : Ring K inst✝⁸ : AddCommGroup A inst✝⁷ : Algebra F K inst✝⁢ : Module K A inst✝⁡ : Module F A inst✝⁴ : IsScalarTower F K A inst✝³ : StrongRankCondition F inst✝² : StrongRankCondition K inst✝¹ : Module.Free F K inst✝ : Module.Free K A ⊒ lift.{w, v} (Module.rank F K) * lift.{v, w} (Module.rank K A) = lift.{v, w} (Module.rank F A)
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection.
obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K)
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection.
Mathlib.FieldTheory.Tower.51_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A)
Mathlib_FieldTheory_Tower
case intro.mk F : Type u K : Type v A : Type w inst✝¹⁰ : CommRing F inst✝⁹ : Ring K inst✝⁸ : AddCommGroup A inst✝⁷ : Algebra F K inst✝⁢ : Module K A inst✝⁡ : Module F A inst✝⁴ : IsScalarTower F K A inst✝³ : StrongRankCondition F inst✝² : StrongRankCondition K inst✝¹ : Module.Free F K inst✝ : Module.Free K A fst✝ : Type v b : Basis fst✝ F K ⊒ lift.{w, v} (Module.rank F K) * lift.{v, w} (Module.rank K A) = lift.{v, w} (Module.rank F A)
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K)
obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A)
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K)
Mathlib.FieldTheory.Tower.51_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A)
Mathlib_FieldTheory_Tower
case intro.mk.intro.mk F : Type u K : Type v A : Type w inst✝¹⁰ : CommRing F inst✝⁹ : Ring K inst✝⁸ : AddCommGroup A inst✝⁷ : Algebra F K inst✝⁢ : Module K A inst✝⁡ : Module F A inst✝⁴ : IsScalarTower F K A inst✝³ : StrongRankCondition F inst✝² : StrongRankCondition K inst✝¹ : Module.Free F K inst✝ : Module.Free K A fst✝¹ : Type v b : Basis fst✝¹ F K fst✝ : Type w c : Basis fst✝ K A ⊒ lift.{w, v} (Module.rank F K) * lift.{v, w} (Module.rank K A) = lift.{v, w} (Module.rank F A)
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A)
rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}]
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A)
Mathlib.FieldTheory.Tower.51_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A)
Mathlib_FieldTheory_Tower
F✝ : Type u K✝ : Type v A✝ : Type w inst✝²¹ : CommRing F✝ inst✝²⁰ : Ring K✝ inst✝¹⁹ : AddCommGroup A✝ inst✝¹⁸ : Algebra F✝ K✝ inst✝¹⁷ : Module K✝ A✝ inst✝¹⁢ : Module F✝ A✝ inst✝¹⁡ : IsScalarTower F✝ K✝ A✝ inst✝¹⁴ : StrongRankCondition F✝ inst✝¹³ : StrongRankCondition K✝ inst✝¹² : Module.Free F✝ K✝ inst✝¹¹ : Module.Free K✝ A✝ F : Type u K A : Type v inst✝¹⁰ : CommRing F inst✝⁹ : Ring K inst✝⁸ : AddCommGroup A inst✝⁷ : Algebra F K inst✝⁢ : Module K A inst✝⁡ : Module F A inst✝⁴ : IsScalarTower F K A inst✝³ : StrongRankCondition F inst✝² : StrongRankCondition K inst✝¹ : Module.Free F K inst✝ : Module.Free K A ⊒ Module.rank F K * Module.rank K A = Module.rank F A
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by
convert lift_rank_mul_lift_rank F K A
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by
Mathlib.FieldTheory.Tower.65_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A
Mathlib_FieldTheory_Tower
case h.e'_2.h.e'_5 F✝ : Type u K✝ : Type v A✝ : Type w inst✝²¹ : CommRing F✝ inst✝²⁰ : Ring K✝ inst✝¹⁹ : AddCommGroup A✝ inst✝¹⁸ : Algebra F✝ K✝ inst✝¹⁷ : Module K✝ A✝ inst✝¹⁢ : Module F✝ A✝ inst✝¹⁡ : IsScalarTower F✝ K✝ A✝ inst✝¹⁴ : StrongRankCondition F✝ inst✝¹³ : StrongRankCondition K✝ inst✝¹² : Module.Free F✝ K✝ inst✝¹¹ : Module.Free K✝ A✝ F : Type u K A : Type v inst✝¹⁰ : CommRing F inst✝⁹ : Ring K inst✝⁸ : AddCommGroup A inst✝⁷ : Algebra F K inst✝⁢ : Module K A inst✝⁡ : Module F A inst✝⁴ : IsScalarTower F K A inst✝³ : StrongRankCondition F inst✝² : StrongRankCondition K inst✝¹ : Module.Free F K inst✝ : Module.Free K A ⊒ Module.rank F K = lift.{v, v} (Module.rank F K)
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;>
rw [lift_id]
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;>
Mathlib.FieldTheory.Tower.65_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A
Mathlib_FieldTheory_Tower
case h.e'_2.h.e'_6 F✝ : Type u K✝ : Type v A✝ : Type w inst✝²¹ : CommRing F✝ inst✝²⁰ : Ring K✝ inst✝¹⁹ : AddCommGroup A✝ inst✝¹⁸ : Algebra F✝ K✝ inst✝¹⁷ : Module K✝ A✝ inst✝¹⁢ : Module F✝ A✝ inst✝¹⁡ : IsScalarTower F✝ K✝ A✝ inst✝¹⁴ : StrongRankCondition F✝ inst✝¹³ : StrongRankCondition K✝ inst✝¹² : Module.Free F✝ K✝ inst✝¹¹ : Module.Free K✝ A✝ F : Type u K A : Type v inst✝¹⁰ : CommRing F inst✝⁹ : Ring K inst✝⁸ : AddCommGroup A inst✝⁷ : Algebra F K inst✝⁢ : Module K A inst✝⁡ : Module F A inst✝⁴ : IsScalarTower F K A inst✝³ : StrongRankCondition F inst✝² : StrongRankCondition K inst✝¹ : Module.Free F K inst✝ : Module.Free K A ⊒ Module.rank K A = lift.{v, v} (Module.rank K A)
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;>
rw [lift_id]
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;>
Mathlib.FieldTheory.Tower.65_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A
Mathlib_FieldTheory_Tower
case h.e'_3 F✝ : Type u K✝ : Type v A✝ : Type w inst✝²¹ : CommRing F✝ inst✝²⁰ : Ring K✝ inst✝¹⁹ : AddCommGroup A✝ inst✝¹⁸ : Algebra F✝ K✝ inst✝¹⁷ : Module K✝ A✝ inst✝¹⁢ : Module F✝ A✝ inst✝¹⁡ : IsScalarTower F✝ K✝ A✝ inst✝¹⁴ : StrongRankCondition F✝ inst✝¹³ : StrongRankCondition K✝ inst✝¹² : Module.Free F✝ K✝ inst✝¹¹ : Module.Free K✝ A✝ F : Type u K A : Type v inst✝¹⁰ : CommRing F inst✝⁹ : Ring K inst✝⁸ : AddCommGroup A inst✝⁷ : Algebra F K inst✝⁢ : Module K A inst✝⁡ : Module F A inst✝⁴ : IsScalarTower F K A inst✝³ : StrongRankCondition F inst✝² : StrongRankCondition K inst✝¹ : Module.Free F K inst✝ : Module.Free K A ⊒ Module.rank F A = lift.{v, v} (Module.rank F A)
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;>
rw [lift_id]
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;>
Mathlib.FieldTheory.Tower.65_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A
Mathlib_FieldTheory_Tower
F : Type u K : Type v A : Type w inst✝¹² : CommRing F inst✝¹¹ : Ring K inst✝¹⁰ : AddCommGroup A inst✝⁹ : Algebra F K inst✝⁸ : Module K A inst✝⁷ : Module F A inst✝⁢ : IsScalarTower F K A inst✝⁡ : StrongRankCondition F inst✝⁴ : StrongRankCondition K inst✝³ : Module.Free F K inst✝² : Module.Free K A inst✝¹ : Module.Finite F K inst✝ : Module.Finite K A ⊒ finrank F K * finrank K A = finrank F A
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by
letI := nontrivial_of_invariantBasisNumber F
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by
Mathlib.FieldTheory.Tower.76_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A
Mathlib_FieldTheory_Tower
F : Type u K : Type v A : Type w inst✝¹² : CommRing F inst✝¹¹ : Ring K inst✝¹⁰ : AddCommGroup A inst✝⁹ : Algebra F K inst✝⁸ : Module K A inst✝⁷ : Module F A inst✝⁢ : IsScalarTower F K A inst✝⁡ : StrongRankCondition F inst✝⁴ : StrongRankCondition K inst✝³ : Module.Free F K inst✝² : Module.Free K A inst✝¹ : Module.Finite F K inst✝ : Module.Finite K A this : Nontrivial F := nontrivial_of_invariantBasisNumber F ⊒ finrank F K * finrank K A = finrank F A
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F
let b := Module.Free.chooseBasis F K
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F
Mathlib.FieldTheory.Tower.76_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A
Mathlib_FieldTheory_Tower
F : Type u K : Type v A : Type w inst✝¹² : CommRing F inst✝¹¹ : Ring K inst✝¹⁰ : AddCommGroup A inst✝⁹ : Algebra F K inst✝⁸ : Module K A inst✝⁷ : Module F A inst✝⁢ : IsScalarTower F K A inst✝⁡ : StrongRankCondition F inst✝⁴ : StrongRankCondition K inst✝³ : Module.Free F K inst✝² : Module.Free K A inst✝¹ : Module.Finite F K inst✝ : Module.Finite K A this : Nontrivial F := nontrivial_of_invariantBasisNumber F b : Basis (Module.Free.ChooseBasisIndex F K) F K := Module.Free.chooseBasis F K ⊒ finrank F K * finrank K A = finrank F A
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K
let c := Module.Free.chooseBasis K A
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K
Mathlib.FieldTheory.Tower.76_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A
Mathlib_FieldTheory_Tower
F : Type u K : Type v A : Type w inst✝¹² : CommRing F inst✝¹¹ : Ring K inst✝¹⁰ : AddCommGroup A inst✝⁹ : Algebra F K inst✝⁸ : Module K A inst✝⁷ : Module F A inst✝⁢ : IsScalarTower F K A inst✝⁡ : StrongRankCondition F inst✝⁴ : StrongRankCondition K inst✝³ : Module.Free F K inst✝² : Module.Free K A inst✝¹ : Module.Finite F K inst✝ : Module.Finite K A this : Nontrivial F := nontrivial_of_invariantBasisNumber F b : Basis (Module.Free.ChooseBasisIndex F K) F K := Module.Free.chooseBasis F K c : Basis (Module.Free.ChooseBasisIndex K A) K A := Module.Free.chooseBasis K A ⊒ finrank F K * finrank K A = finrank F A
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A
rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod]
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A
Mathlib.FieldTheory.Tower.76_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A
Mathlib_FieldTheory_Tower
F : Type u K : Type v A : Type w inst✝⁢ : Field F inst✝⁡ : DivisionRing K inst✝⁴ : AddCommGroup A inst✝³ : Algebra F K inst✝² : Module K A inst✝¹ : Module F A inst✝ : IsScalarTower F K A hf : FiniteDimensional F A b : Finset A hb : span F ↑b = ⊀ ⊒ restrictScalars F (span K ↑b) = restrictScalars F ⊀
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod] #align finite_dimensional.finrank_mul_finrank' FiniteDimensional.finrank_mul_finrank' end Ring section Field variable [Field F] [DivisionRing K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] namespace FiniteDimensional open IsNoetherian theorem trans [FiniteDimensional F K] [FiniteDimensional K A] : FiniteDimensional F A := Module.Finite.trans K A #align finite_dimensional.trans FiniteDimensional.trans /-- In a tower of field extensions `L / K / F`, if `L / F` is finite, so is `K / F`. (In fact, it suffices that `L` is a nontrivial ring.) Note this cannot be an instance as Lean cannot infer `L`. -/ theorem left (K L : Type*) [Field K] [Algebra F K] [Ring L] [Nontrivial L] [Algebra F L] [Algebra K L] [IsScalarTower F K L] [FiniteDimensional F L] : FiniteDimensional F K := FiniteDimensional.of_injective (IsScalarTower.toAlgHom F K L).toLinearMap (RingHom.injective _) #align finite_dimensional.left FiniteDimensional.left theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by
rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le]
theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by
Mathlib.FieldTheory.Tower.114_0.ihtkOmbgx804u7P
theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A
Mathlib_FieldTheory_Tower
F : Type u K : Type v A : Type w inst✝⁢ : Field F inst✝⁡ : DivisionRing K inst✝⁴ : AddCommGroup A inst✝³ : Algebra F K inst✝² : Module K A inst✝¹ : Module F A inst✝ : IsScalarTower F K A hf : FiniteDimensional F A b : Finset A hb : span F ↑b = ⊀ ⊒ ↑b βŠ† ↑(restrictScalars F (span K ↑b))
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod] #align finite_dimensional.finrank_mul_finrank' FiniteDimensional.finrank_mul_finrank' end Ring section Field variable [Field F] [DivisionRing K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] namespace FiniteDimensional open IsNoetherian theorem trans [FiniteDimensional F K] [FiniteDimensional K A] : FiniteDimensional F A := Module.Finite.trans K A #align finite_dimensional.trans FiniteDimensional.trans /-- In a tower of field extensions `L / K / F`, if `L / F` is finite, so is `K / F`. (In fact, it suffices that `L` is a nontrivial ring.) Note this cannot be an instance as Lean cannot infer `L`. -/ theorem left (K L : Type*) [Field K] [Algebra F K] [Ring L] [Nontrivial L] [Algebra F L] [Algebra K L] [IsScalarTower F K L] [FiniteDimensional F L] : FiniteDimensional F K := FiniteDimensional.of_injective (IsScalarTower.toAlgHom F K L).toLinearMap (RingHom.injective _) #align finite_dimensional.left FiniteDimensional.left theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le]
exact Submodule.subset_span
theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le]
Mathlib.FieldTheory.Tower.114_0.ihtkOmbgx804u7P
theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A
Mathlib_FieldTheory_Tower
F : Type u K : Type v A : Type w inst✝⁷ : Field F inst✝⁢ : DivisionRing K inst✝⁡ : AddCommGroup A inst✝⁴ : Algebra F K inst✝³ : Module K A inst✝² : Module F A inst✝¹ : IsScalarTower F K A inst✝ : FiniteDimensional F K ⊒ finrank F K * finrank K A = finrank F A
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod] #align finite_dimensional.finrank_mul_finrank' FiniteDimensional.finrank_mul_finrank' end Ring section Field variable [Field F] [DivisionRing K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] namespace FiniteDimensional open IsNoetherian theorem trans [FiniteDimensional F K] [FiniteDimensional K A] : FiniteDimensional F A := Module.Finite.trans K A #align finite_dimensional.trans FiniteDimensional.trans /-- In a tower of field extensions `L / K / F`, if `L / F` is finite, so is `K / F`. (In fact, it suffices that `L` is a nontrivial ring.) Note this cannot be an instance as Lean cannot infer `L`. -/ theorem left (K L : Type*) [Field K] [Algebra F K] [Ring L] [Nontrivial L] [Algebra F L] [Algebra K L] [IsScalarTower F K L] [FiniteDimensional F L] : FiniteDimensional F K := FiniteDimensional.of_injective (IsScalarTower.toAlgHom F K L).toLinearMap (RingHom.injective _) #align finite_dimensional.left FiniteDimensional.left theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le] exact Submodule.subset_span⟩⟩ #align finite_dimensional.right FiniteDimensional.right /-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by
by_cases hA : FiniteDimensional K A
/-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by
Mathlib.FieldTheory.Tower.121_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A
Mathlib_FieldTheory_Tower
case pos F : Type u K : Type v A : Type w inst✝⁷ : Field F inst✝⁢ : DivisionRing K inst✝⁡ : AddCommGroup A inst✝⁴ : Algebra F K inst✝³ : Module K A inst✝² : Module F A inst✝¹ : IsScalarTower F K A inst✝ : FiniteDimensional F K hA : FiniteDimensional K A ⊒ finrank F K * finrank K A = finrank F A
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod] #align finite_dimensional.finrank_mul_finrank' FiniteDimensional.finrank_mul_finrank' end Ring section Field variable [Field F] [DivisionRing K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] namespace FiniteDimensional open IsNoetherian theorem trans [FiniteDimensional F K] [FiniteDimensional K A] : FiniteDimensional F A := Module.Finite.trans K A #align finite_dimensional.trans FiniteDimensional.trans /-- In a tower of field extensions `L / K / F`, if `L / F` is finite, so is `K / F`. (In fact, it suffices that `L` is a nontrivial ring.) Note this cannot be an instance as Lean cannot infer `L`. -/ theorem left (K L : Type*) [Field K] [Algebra F K] [Ring L] [Nontrivial L] [Algebra F L] [Algebra K L] [IsScalarTower F K L] [FiniteDimensional F L] : FiniteDimensional F K := FiniteDimensional.of_injective (IsScalarTower.toAlgHom F K L).toLinearMap (RingHom.injective _) #align finite_dimensional.left FiniteDimensional.left theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le] exact Submodule.subset_span⟩⟩ #align finite_dimensional.right FiniteDimensional.right /-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β·
replace hA : FiniteDimensional K A := hA
/-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β·
Mathlib.FieldTheory.Tower.121_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A
Mathlib_FieldTheory_Tower
case pos F : Type u K : Type v A : Type w inst✝⁷ : Field F inst✝⁢ : DivisionRing K inst✝⁡ : AddCommGroup A inst✝⁴ : Algebra F K inst✝³ : Module K A inst✝² : Module F A inst✝¹ : IsScalarTower F K A inst✝ : FiniteDimensional F K hA : FiniteDimensional K A ⊒ finrank F K * finrank K A = finrank F A
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod] #align finite_dimensional.finrank_mul_finrank' FiniteDimensional.finrank_mul_finrank' end Ring section Field variable [Field F] [DivisionRing K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] namespace FiniteDimensional open IsNoetherian theorem trans [FiniteDimensional F K] [FiniteDimensional K A] : FiniteDimensional F A := Module.Finite.trans K A #align finite_dimensional.trans FiniteDimensional.trans /-- In a tower of field extensions `L / K / F`, if `L / F` is finite, so is `K / F`. (In fact, it suffices that `L` is a nontrivial ring.) Note this cannot be an instance as Lean cannot infer `L`. -/ theorem left (K L : Type*) [Field K] [Algebra F K] [Ring L] [Nontrivial L] [Algebra F L] [Algebra K L] [IsScalarTower F K L] [FiniteDimensional F L] : FiniteDimensional F K := FiniteDimensional.of_injective (IsScalarTower.toAlgHom F K L).toLinearMap (RingHom.injective _) #align finite_dimensional.left FiniteDimensional.left theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le] exact Submodule.subset_span⟩⟩ #align finite_dimensional.right FiniteDimensional.right /-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β· replace hA : FiniteDimensional K A := hA -- porting note: broken instance cache
rw [finrank_mul_finrank']
/-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β· replace hA : FiniteDimensional K A := hA -- porting note: broken instance cache
Mathlib.FieldTheory.Tower.121_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A
Mathlib_FieldTheory_Tower
case neg F : Type u K : Type v A : Type w inst✝⁷ : Field F inst✝⁢ : DivisionRing K inst✝⁡ : AddCommGroup A inst✝⁴ : Algebra F K inst✝³ : Module K A inst✝² : Module F A inst✝¹ : IsScalarTower F K A inst✝ : FiniteDimensional F K hA : ¬FiniteDimensional K A ⊒ finrank F K * finrank K A = finrank F A
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod] #align finite_dimensional.finrank_mul_finrank' FiniteDimensional.finrank_mul_finrank' end Ring section Field variable [Field F] [DivisionRing K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] namespace FiniteDimensional open IsNoetherian theorem trans [FiniteDimensional F K] [FiniteDimensional K A] : FiniteDimensional F A := Module.Finite.trans K A #align finite_dimensional.trans FiniteDimensional.trans /-- In a tower of field extensions `L / K / F`, if `L / F` is finite, so is `K / F`. (In fact, it suffices that `L` is a nontrivial ring.) Note this cannot be an instance as Lean cannot infer `L`. -/ theorem left (K L : Type*) [Field K] [Algebra F K] [Ring L] [Nontrivial L] [Algebra F L] [Algebra K L] [IsScalarTower F K L] [FiniteDimensional F L] : FiniteDimensional F K := FiniteDimensional.of_injective (IsScalarTower.toAlgHom F K L).toLinearMap (RingHom.injective _) #align finite_dimensional.left FiniteDimensional.left theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le] exact Submodule.subset_span⟩⟩ #align finite_dimensional.right FiniteDimensional.right /-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β· replace hA : FiniteDimensional K A := hA -- porting note: broken instance cache rw [finrank_mul_finrank'] Β·
rw [finrank_of_infinite_dimensional hA, mul_zero, finrank_of_infinite_dimensional]
/-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β· replace hA : FiniteDimensional K A := hA -- porting note: broken instance cache rw [finrank_mul_finrank'] Β·
Mathlib.FieldTheory.Tower.121_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A
Mathlib_FieldTheory_Tower
case neg F : Type u K : Type v A : Type w inst✝⁷ : Field F inst✝⁢ : DivisionRing K inst✝⁡ : AddCommGroup A inst✝⁴ : Algebra F K inst✝³ : Module K A inst✝² : Module F A inst✝¹ : IsScalarTower F K A inst✝ : FiniteDimensional F K hA : ¬FiniteDimensional K A ⊒ ¬FiniteDimensional F A
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod] #align finite_dimensional.finrank_mul_finrank' FiniteDimensional.finrank_mul_finrank' end Ring section Field variable [Field F] [DivisionRing K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] namespace FiniteDimensional open IsNoetherian theorem trans [FiniteDimensional F K] [FiniteDimensional K A] : FiniteDimensional F A := Module.Finite.trans K A #align finite_dimensional.trans FiniteDimensional.trans /-- In a tower of field extensions `L / K / F`, if `L / F` is finite, so is `K / F`. (In fact, it suffices that `L` is a nontrivial ring.) Note this cannot be an instance as Lean cannot infer `L`. -/ theorem left (K L : Type*) [Field K] [Algebra F K] [Ring L] [Nontrivial L] [Algebra F L] [Algebra K L] [IsScalarTower F K L] [FiniteDimensional F L] : FiniteDimensional F K := FiniteDimensional.of_injective (IsScalarTower.toAlgHom F K L).toLinearMap (RingHom.injective _) #align finite_dimensional.left FiniteDimensional.left theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le] exact Submodule.subset_span⟩⟩ #align finite_dimensional.right FiniteDimensional.right /-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β· replace hA : FiniteDimensional K A := hA -- porting note: broken instance cache rw [finrank_mul_finrank'] Β· rw [finrank_of_infinite_dimensional hA, mul_zero, finrank_of_infinite_dimensional]
exact mt (@right F K A _ _ _ _ _ _ _) hA
/-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β· replace hA : FiniteDimensional K A := hA -- porting note: broken instance cache rw [finrank_mul_finrank'] Β· rw [finrank_of_infinite_dimensional hA, mul_zero, finrank_of_infinite_dimensional]
Mathlib.FieldTheory.Tower.121_0.ihtkOmbgx804u7P
/-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A
Mathlib_FieldTheory_Tower
F : Type u K✝ : Type v A✝ : Type w inst✝⁹ : Field F inst✝⁸ : DivisionRing K✝ inst✝⁷ : AddCommGroup A✝ inst✝⁢ : Algebra F K✝ inst✝⁡ : Module K✝ A✝ inst✝⁴ : Module F A✝ inst✝³ : IsScalarTower F K✝ A✝ A : Type u_1 inst✝² : Ring A inst✝¹ : IsDomain A inst✝ : Algebra F A hp : Nat.Prime (finrank F A) K : Subalgebra F A ⊒ K = βŠ₯ ∨ K = ⊀
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod] #align finite_dimensional.finrank_mul_finrank' FiniteDimensional.finrank_mul_finrank' end Ring section Field variable [Field F] [DivisionRing K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] namespace FiniteDimensional open IsNoetherian theorem trans [FiniteDimensional F K] [FiniteDimensional K A] : FiniteDimensional F A := Module.Finite.trans K A #align finite_dimensional.trans FiniteDimensional.trans /-- In a tower of field extensions `L / K / F`, if `L / F` is finite, so is `K / F`. (In fact, it suffices that `L` is a nontrivial ring.) Note this cannot be an instance as Lean cannot infer `L`. -/ theorem left (K L : Type*) [Field K] [Algebra F K] [Ring L] [Nontrivial L] [Algebra F L] [Algebra K L] [IsScalarTower F K L] [FiniteDimensional F L] : FiniteDimensional F K := FiniteDimensional.of_injective (IsScalarTower.toAlgHom F K L).toLinearMap (RingHom.injective _) #align finite_dimensional.left FiniteDimensional.left theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le] exact Submodule.subset_span⟩⟩ #align finite_dimensional.right FiniteDimensional.right /-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β· replace hA : FiniteDimensional K A := hA -- porting note: broken instance cache rw [finrank_mul_finrank'] Β· rw [finrank_of_infinite_dimensional hA, mul_zero, finrank_of_infinite_dimensional] exact mt (@right F K A _ _ _ _ _ _ _) hA #align finite_dimensional.finrank_mul_finrank FiniteDimensional.finrank_mul_finrank theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A) := { toNontrivial := ⟨⟨βŠ₯, ⊀, fun he => Nat.not_prime_one ((Subalgebra.bot_eq_top_iff_finrank_eq_one.1 he).subst hp)⟩⟩ eq_bot_or_eq_top := fun K => by
haveI : FiniteDimensional _ _ := finiteDimensional_of_finrank hp.pos
theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A) := { toNontrivial := ⟨⟨βŠ₯, ⊀, fun he => Nat.not_prime_one ((Subalgebra.bot_eq_top_iff_finrank_eq_one.1 he).subst hp)⟩⟩ eq_bot_or_eq_top := fun K => by
Mathlib.FieldTheory.Tower.133_0.ihtkOmbgx804u7P
theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A)
Mathlib_FieldTheory_Tower
F : Type u K✝ : Type v A✝ : Type w inst✝⁹ : Field F inst✝⁸ : DivisionRing K✝ inst✝⁷ : AddCommGroup A✝ inst✝⁢ : Algebra F K✝ inst✝⁡ : Module K✝ A✝ inst✝⁴ : Module F A✝ inst✝³ : IsScalarTower F K✝ A✝ A : Type u_1 inst✝² : Ring A inst✝¹ : IsDomain A inst✝ : Algebra F A hp : Nat.Prime (finrank F A) K : Subalgebra F A this : FiniteDimensional F A ⊒ K = βŠ₯ ∨ K = ⊀
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod] #align finite_dimensional.finrank_mul_finrank' FiniteDimensional.finrank_mul_finrank' end Ring section Field variable [Field F] [DivisionRing K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] namespace FiniteDimensional open IsNoetherian theorem trans [FiniteDimensional F K] [FiniteDimensional K A] : FiniteDimensional F A := Module.Finite.trans K A #align finite_dimensional.trans FiniteDimensional.trans /-- In a tower of field extensions `L / K / F`, if `L / F` is finite, so is `K / F`. (In fact, it suffices that `L` is a nontrivial ring.) Note this cannot be an instance as Lean cannot infer `L`. -/ theorem left (K L : Type*) [Field K] [Algebra F K] [Ring L] [Nontrivial L] [Algebra F L] [Algebra K L] [IsScalarTower F K L] [FiniteDimensional F L] : FiniteDimensional F K := FiniteDimensional.of_injective (IsScalarTower.toAlgHom F K L).toLinearMap (RingHom.injective _) #align finite_dimensional.left FiniteDimensional.left theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le] exact Submodule.subset_span⟩⟩ #align finite_dimensional.right FiniteDimensional.right /-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β· replace hA : FiniteDimensional K A := hA -- porting note: broken instance cache rw [finrank_mul_finrank'] Β· rw [finrank_of_infinite_dimensional hA, mul_zero, finrank_of_infinite_dimensional] exact mt (@right F K A _ _ _ _ _ _ _) hA #align finite_dimensional.finrank_mul_finrank FiniteDimensional.finrank_mul_finrank theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A) := { toNontrivial := ⟨⟨βŠ₯, ⊀, fun he => Nat.not_prime_one ((Subalgebra.bot_eq_top_iff_finrank_eq_one.1 he).subst hp)⟩⟩ eq_bot_or_eq_top := fun K => by haveI : FiniteDimensional _ _ := finiteDimensional_of_finrank hp.pos
letI := divisionRingOfFiniteDimensional F K
theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A) := { toNontrivial := ⟨⟨βŠ₯, ⊀, fun he => Nat.not_prime_one ((Subalgebra.bot_eq_top_iff_finrank_eq_one.1 he).subst hp)⟩⟩ eq_bot_or_eq_top := fun K => by haveI : FiniteDimensional _ _ := finiteDimensional_of_finrank hp.pos
Mathlib.FieldTheory.Tower.133_0.ihtkOmbgx804u7P
theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A)
Mathlib_FieldTheory_Tower
F : Type u K✝ : Type v A✝ : Type w inst✝⁹ : Field F inst✝⁸ : DivisionRing K✝ inst✝⁷ : AddCommGroup A✝ inst✝⁢ : Algebra F K✝ inst✝⁡ : Module K✝ A✝ inst✝⁴ : Module F A✝ inst✝³ : IsScalarTower F K✝ A✝ A : Type u_1 inst✝² : Ring A inst✝¹ : IsDomain A inst✝ : Algebra F A hp : Nat.Prime (finrank F A) K : Subalgebra F A this✝ : FiniteDimensional F A this : DivisionRing β†₯K := divisionRingOfFiniteDimensional F β†₯K ⊒ K = βŠ₯ ∨ K = ⊀
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod] #align finite_dimensional.finrank_mul_finrank' FiniteDimensional.finrank_mul_finrank' end Ring section Field variable [Field F] [DivisionRing K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] namespace FiniteDimensional open IsNoetherian theorem trans [FiniteDimensional F K] [FiniteDimensional K A] : FiniteDimensional F A := Module.Finite.trans K A #align finite_dimensional.trans FiniteDimensional.trans /-- In a tower of field extensions `L / K / F`, if `L / F` is finite, so is `K / F`. (In fact, it suffices that `L` is a nontrivial ring.) Note this cannot be an instance as Lean cannot infer `L`. -/ theorem left (K L : Type*) [Field K] [Algebra F K] [Ring L] [Nontrivial L] [Algebra F L] [Algebra K L] [IsScalarTower F K L] [FiniteDimensional F L] : FiniteDimensional F K := FiniteDimensional.of_injective (IsScalarTower.toAlgHom F K L).toLinearMap (RingHom.injective _) #align finite_dimensional.left FiniteDimensional.left theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le] exact Submodule.subset_span⟩⟩ #align finite_dimensional.right FiniteDimensional.right /-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β· replace hA : FiniteDimensional K A := hA -- porting note: broken instance cache rw [finrank_mul_finrank'] Β· rw [finrank_of_infinite_dimensional hA, mul_zero, finrank_of_infinite_dimensional] exact mt (@right F K A _ _ _ _ _ _ _) hA #align finite_dimensional.finrank_mul_finrank FiniteDimensional.finrank_mul_finrank theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A) := { toNontrivial := ⟨⟨βŠ₯, ⊀, fun he => Nat.not_prime_one ((Subalgebra.bot_eq_top_iff_finrank_eq_one.1 he).subst hp)⟩⟩ eq_bot_or_eq_top := fun K => by haveI : FiniteDimensional _ _ := finiteDimensional_of_finrank hp.pos letI := divisionRingOfFiniteDimensional F K
refine' (hp.eq_one_or_self_of_dvd _ ⟨_, (finrank_mul_finrank F K A).symm⟩).imp _ fun h => _
theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A) := { toNontrivial := ⟨⟨βŠ₯, ⊀, fun he => Nat.not_prime_one ((Subalgebra.bot_eq_top_iff_finrank_eq_one.1 he).subst hp)⟩⟩ eq_bot_or_eq_top := fun K => by haveI : FiniteDimensional _ _ := finiteDimensional_of_finrank hp.pos letI := divisionRingOfFiniteDimensional F K
Mathlib.FieldTheory.Tower.133_0.ihtkOmbgx804u7P
theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A)
Mathlib_FieldTheory_Tower
case refine'_1 F : Type u K✝ : Type v A✝ : Type w inst✝⁹ : Field F inst✝⁸ : DivisionRing K✝ inst✝⁷ : AddCommGroup A✝ inst✝⁢ : Algebra F K✝ inst✝⁡ : Module K✝ A✝ inst✝⁴ : Module F A✝ inst✝³ : IsScalarTower F K✝ A✝ A : Type u_1 inst✝² : Ring A inst✝¹ : IsDomain A inst✝ : Algebra F A hp : Nat.Prime (finrank F A) K : Subalgebra F A this✝ : FiniteDimensional F A this : DivisionRing β†₯K := divisionRingOfFiniteDimensional F β†₯K ⊒ finrank F β†₯K = 1 β†’ K = βŠ₯
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod] #align finite_dimensional.finrank_mul_finrank' FiniteDimensional.finrank_mul_finrank' end Ring section Field variable [Field F] [DivisionRing K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] namespace FiniteDimensional open IsNoetherian theorem trans [FiniteDimensional F K] [FiniteDimensional K A] : FiniteDimensional F A := Module.Finite.trans K A #align finite_dimensional.trans FiniteDimensional.trans /-- In a tower of field extensions `L / K / F`, if `L / F` is finite, so is `K / F`. (In fact, it suffices that `L` is a nontrivial ring.) Note this cannot be an instance as Lean cannot infer `L`. -/ theorem left (K L : Type*) [Field K] [Algebra F K] [Ring L] [Nontrivial L] [Algebra F L] [Algebra K L] [IsScalarTower F K L] [FiniteDimensional F L] : FiniteDimensional F K := FiniteDimensional.of_injective (IsScalarTower.toAlgHom F K L).toLinearMap (RingHom.injective _) #align finite_dimensional.left FiniteDimensional.left theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le] exact Submodule.subset_span⟩⟩ #align finite_dimensional.right FiniteDimensional.right /-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β· replace hA : FiniteDimensional K A := hA -- porting note: broken instance cache rw [finrank_mul_finrank'] Β· rw [finrank_of_infinite_dimensional hA, mul_zero, finrank_of_infinite_dimensional] exact mt (@right F K A _ _ _ _ _ _ _) hA #align finite_dimensional.finrank_mul_finrank FiniteDimensional.finrank_mul_finrank theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A) := { toNontrivial := ⟨⟨βŠ₯, ⊀, fun he => Nat.not_prime_one ((Subalgebra.bot_eq_top_iff_finrank_eq_one.1 he).subst hp)⟩⟩ eq_bot_or_eq_top := fun K => by haveI : FiniteDimensional _ _ := finiteDimensional_of_finrank hp.pos letI := divisionRingOfFiniteDimensional F K refine' (hp.eq_one_or_self_of_dvd _ ⟨_, (finrank_mul_finrank F K A).symm⟩).imp _ fun h => _ Β·
exact Subalgebra.eq_bot_of_finrank_one
theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A) := { toNontrivial := ⟨⟨βŠ₯, ⊀, fun he => Nat.not_prime_one ((Subalgebra.bot_eq_top_iff_finrank_eq_one.1 he).subst hp)⟩⟩ eq_bot_or_eq_top := fun K => by haveI : FiniteDimensional _ _ := finiteDimensional_of_finrank hp.pos letI := divisionRingOfFiniteDimensional F K refine' (hp.eq_one_or_self_of_dvd _ ⟨_, (finrank_mul_finrank F K A).symm⟩).imp _ fun h => _ Β·
Mathlib.FieldTheory.Tower.133_0.ihtkOmbgx804u7P
theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A)
Mathlib_FieldTheory_Tower
case refine'_2 F : Type u K✝ : Type v A✝ : Type w inst✝⁹ : Field F inst✝⁸ : DivisionRing K✝ inst✝⁷ : AddCommGroup A✝ inst✝⁢ : Algebra F K✝ inst✝⁡ : Module K✝ A✝ inst✝⁴ : Module F A✝ inst✝³ : IsScalarTower F K✝ A✝ A : Type u_1 inst✝² : Ring A inst✝¹ : IsDomain A inst✝ : Algebra F A hp : Nat.Prime (finrank F A) K : Subalgebra F A this✝ : FiniteDimensional F A this : DivisionRing β†₯K := divisionRingOfFiniteDimensional F β†₯K h : finrank F β†₯K = finrank F A ⊒ K = ⊀
/- Copyright (c) 2020 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau -/ import Mathlib.Data.Nat.Prime import Mathlib.RingTheory.AlgebraTower import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix #align_import field_theory.tower from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" /-! # Tower of field extensions In this file we prove the tower law for arbitrary extensions and finite extensions. Suppose `L` is a field extension of `K` and `K` is a field extension of `F`. Then `[L:F] = [L:K] [K:F]` where `[E₁:Eβ‚‚]` means the `Eβ‚‚`-dimension of `E₁`. In fact we generalize it to rings and modules, where `L` is not necessarily a field, but just a free module over `K`. ## Implementation notes We prove two versions, since there are two notions of dimensions: `Module.rank` which gives the dimension of an arbitrary vector space as a cardinal, and `FiniteDimensional.finrank` which gives the dimension of a finite-dimensional vector space as a natural number. ## Tags tower law -/ universe u v w u₁ v₁ w₁ open BigOperators Cardinal Submodule variable (F : Type u) (K : Type v) (A : Type w) section Ring variable [CommRing F] [Ring K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] variable [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem lift_rank_mul_lift_rank : Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) = Cardinal.lift.{v} (Module.rank F A) := by -- porting note: `Module.Free.exists_basis` now has implicit arguments, but this is annoying -- to fix as it is a projection. obtain ⟨_, b⟩ := Module.Free.exists_basis (R := F) (M := K) obtain ⟨_, c⟩ := Module.Free.exists_basis (R := K) (M := A) rw [← (Module.rank F K).lift_id, ← b.mk_eq_rank, ← (Module.rank K A).lift_id, ← c.mk_eq_rank, ← lift_umax.{w, v}, ← (b.smul c).mk_eq_rank, mk_prod, lift_mul, lift_lift, lift_lift, lift_lift, lift_lift, lift_umax.{v, w}] #align lift_rank_mul_lift_rank lift_rank_mul_lift_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. This is a simpler version of `lift_rank_mul_lift_rank` with `K` and `A` in the same universe. -/ theorem rank_mul_rank (F : Type u) (K A : Type v) [CommRing F] [Ring K] [AddCommGroup A] [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] [StrongRankCondition F] [StrongRankCondition K] [Module.Free F K] [Module.Free K A] : Module.rank F K * Module.rank K A = Module.rank F A := by convert lift_rank_mul_lift_rank F K A <;> rw [lift_id] #align rank_mul_rank rank_mul_rank /-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then $\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$. -/ theorem FiniteDimensional.finrank_mul_finrank' [Module.Finite F K] [Module.Finite K A] : finrank F K * finrank K A = finrank F A := by letI := nontrivial_of_invariantBasisNumber F let b := Module.Free.chooseBasis F K let c := Module.Free.chooseBasis K A rw [finrank_eq_card_basis b, finrank_eq_card_basis c, finrank_eq_card_basis (b.smul c), Fintype.card_prod] #align finite_dimensional.finrank_mul_finrank' FiniteDimensional.finrank_mul_finrank' end Ring section Field variable [Field F] [DivisionRing K] [AddCommGroup A] variable [Algebra F K] [Module K A] [Module F A] [IsScalarTower F K A] namespace FiniteDimensional open IsNoetherian theorem trans [FiniteDimensional F K] [FiniteDimensional K A] : FiniteDimensional F A := Module.Finite.trans K A #align finite_dimensional.trans FiniteDimensional.trans /-- In a tower of field extensions `L / K / F`, if `L / F` is finite, so is `K / F`. (In fact, it suffices that `L` is a nontrivial ring.) Note this cannot be an instance as Lean cannot infer `L`. -/ theorem left (K L : Type*) [Field K] [Algebra F K] [Ring L] [Nontrivial L] [Algebra F L] [Algebra K L] [IsScalarTower F K L] [FiniteDimensional F L] : FiniteDimensional F K := FiniteDimensional.of_injective (IsScalarTower.toAlgHom F K L).toLinearMap (RingHom.injective _) #align finite_dimensional.left FiniteDimensional.left theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A := let ⟨⟨b, hb⟩⟩ := hf ⟨⟨b, Submodule.restrictScalars_injective F _ _ <| by rw [Submodule.restrictScalars_top, eq_top_iff, ← hb, Submodule.span_le] exact Submodule.subset_span⟩⟩ #align finite_dimensional.right FiniteDimensional.right /-- Tower law: if `A` is a `K`-vector space and `K` is a field extension of `F` then `dim_F(A) = dim_F(K) * dim_K(A)`. This is `FiniteDimensional.finrank_mul_finrank'` with one fewer finiteness assumption. -/ theorem finrank_mul_finrank [FiniteDimensional F K] : finrank F K * finrank K A = finrank F A := by by_cases hA : FiniteDimensional K A Β· replace hA : FiniteDimensional K A := hA -- porting note: broken instance cache rw [finrank_mul_finrank'] Β· rw [finrank_of_infinite_dimensional hA, mul_zero, finrank_of_infinite_dimensional] exact mt (@right F K A _ _ _ _ _ _ _) hA #align finite_dimensional.finrank_mul_finrank FiniteDimensional.finrank_mul_finrank theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A) := { toNontrivial := ⟨⟨βŠ₯, ⊀, fun he => Nat.not_prime_one ((Subalgebra.bot_eq_top_iff_finrank_eq_one.1 he).subst hp)⟩⟩ eq_bot_or_eq_top := fun K => by haveI : FiniteDimensional _ _ := finiteDimensional_of_finrank hp.pos letI := divisionRingOfFiniteDimensional F K refine' (hp.eq_one_or_self_of_dvd _ ⟨_, (finrank_mul_finrank F K A).symm⟩).imp _ fun h => _ Β· exact Subalgebra.eq_bot_of_finrank_one Β·
exact Algebra.toSubmodule_eq_top.1 (eq_top_of_finrank_eq <| K.finrank_toSubmodule.trans h)
theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A) := { toNontrivial := ⟨⟨βŠ₯, ⊀, fun he => Nat.not_prime_one ((Subalgebra.bot_eq_top_iff_finrank_eq_one.1 he).subst hp)⟩⟩ eq_bot_or_eq_top := fun K => by haveI : FiniteDimensional _ _ := finiteDimensional_of_finrank hp.pos letI := divisionRingOfFiniteDimensional F K refine' (hp.eq_one_or_self_of_dvd _ ⟨_, (finrank_mul_finrank F K A).symm⟩).imp _ fun h => _ Β· exact Subalgebra.eq_bot_of_finrank_one Β·
Mathlib.FieldTheory.Tower.133_0.ihtkOmbgx804u7P
theorem Subalgebra.isSimpleOrder_of_finrank_prime (A) [Ring A] [IsDomain A] [Algebra F A] (hp : (finrank F A).Prime) : IsSimpleOrder (Subalgebra F A)
Mathlib_FieldTheory_Tower
k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a : k ⊒ slope f a a = 0
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by
rw [slope, sub_self, inv_zero, zero_smul]
@[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by
Mathlib.LinearAlgebra.AffineSpace.Slope.46_0.R1BInF4Gl9ffltx
@[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0
Mathlib_LinearAlgebra_AffineSpace_Slope
k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b : k ⊒ (b - a) β€’ slope f a b = f b -α΅₯ f a
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by
rcases eq_or_ne a b with (rfl | hne)
@[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by
Mathlib.LinearAlgebra.AffineSpace.Slope.55_0.R1BInF4Gl9ffltx
@[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a
Mathlib_LinearAlgebra_AffineSpace_Slope
case inl k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a : k ⊒ (a - a) β€’ slope f a a = f a -α΅₯ f a
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β·
rw [sub_self, zero_smul, vsub_self]
@[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β·
Mathlib.LinearAlgebra.AffineSpace.Slope.55_0.R1BInF4Gl9ffltx
@[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a
Mathlib_LinearAlgebra_AffineSpace_Slope
case inr k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b : k hne : a β‰  b ⊒ (b - a) β€’ slope f a b = f b -α΅₯ f a
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β·
rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)]
@[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β·
Mathlib.LinearAlgebra.AffineSpace.Slope.55_0.R1BInF4Gl9ffltx
@[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a
Mathlib_LinearAlgebra_AffineSpace_Slope
k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b : k ⊒ (b - a) β€’ slope f a b +α΅₯ f a = f b
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by
rw [sub_smul_slope, vsub_vadd]
theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by
Mathlib.LinearAlgebra.AffineSpace.Slope.62_0.R1BInF4Gl9ffltx
theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b
Mathlib_LinearAlgebra_AffineSpace_Slope
k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ E c : PE ⊒ (slope fun x => f x +α΅₯ c) = slope f
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by
ext a b
@[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by
Mathlib.LinearAlgebra.AffineSpace.Slope.66_0.R1BInF4Gl9ffltx
@[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f
Mathlib_LinearAlgebra_AffineSpace_Slope
case h.h k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ E c : PE a b : k ⊒ slope (fun x => f x +α΅₯ c) a b = slope f a b
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b
simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub]
@[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b
Mathlib.LinearAlgebra.AffineSpace.Slope.66_0.R1BInF4Gl9ffltx
@[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f
Mathlib_LinearAlgebra_AffineSpace_Slope
k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ E a b : k h : a β‰  b ⊒ slope (fun x => (x - a) β€’ f x) a b = f b
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by
simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)]
@[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by
Mathlib.LinearAlgebra.AffineSpace.Slope.72_0.R1BInF4Gl9ffltx
@[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b
Mathlib_LinearAlgebra_AffineSpace_Slope
k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b : k h : slope f a b = 0 ⊒ f a = f b
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by
rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd]
theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by
Mathlib.LinearAlgebra.AffineSpace.Slope.78_0.R1BInF4Gl9ffltx
theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b
Mathlib_LinearAlgebra_AffineSpace_Slope
k : Type u_1 E : Type u_2 PE : Type u_3 inst✝⁢ : Field k inst✝⁡ : AddCommGroup E inst✝⁴ : Module k E inst✝³ : AddTorsor E PE F : Type u_4 PF : Type u_5 inst✝² : AddCommGroup F inst✝¹ : Module k F inst✝ : AddTorsor F PF f : PE →ᡃ[k] PF g : k β†’ PE a b : k ⊒ slope (⇑f ∘ g) a b = f.linear (slope g a b)
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by
simp only [slope, (· ∘ ·), f.linear.map_smul, f.linearMap_vsub]
theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by
Mathlib.LinearAlgebra.AffineSpace.Slope.82_0.R1BInF4Gl9ffltx
theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b)
Mathlib_LinearAlgebra_AffineSpace_Slope
k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b : k ⊒ slope f a b = slope f b a
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by
rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub]
theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by
Mathlib.LinearAlgebra.AffineSpace.Slope.92_0.R1BInF4Gl9ffltx
theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a
Mathlib_LinearAlgebra_AffineSpace_Slope
k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b c : k ⊒ ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by
by_cases hab : a = b
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by
Mathlib.LinearAlgebra.AffineSpace.Slope.96_0.R1BInF4Gl9ffltx
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
Mathlib_LinearAlgebra_AffineSpace_Slope
case pos k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b c : k hab : a = b ⊒ ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β·
subst hab
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β·
Mathlib.LinearAlgebra.AffineSpace.Slope.96_0.R1BInF4Gl9ffltx
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
Mathlib_LinearAlgebra_AffineSpace_Slope
case pos k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a c : k ⊒ ((a - a) / (c - a)) β€’ slope f a a + ((c - a) / (c - a)) β€’ slope f a c = slope f a c
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab
rw [sub_self, zero_div, zero_smul, zero_add]
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab
Mathlib.LinearAlgebra.AffineSpace.Slope.96_0.R1BInF4Gl9ffltx
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
Mathlib_LinearAlgebra_AffineSpace_Slope
case pos k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a c : k ⊒ ((c - a) / (c - a)) β€’ slope f a c = slope f a c
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add]
by_cases hac : a = c
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add]
Mathlib.LinearAlgebra.AffineSpace.Slope.96_0.R1BInF4Gl9ffltx
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
Mathlib_LinearAlgebra_AffineSpace_Slope
case pos k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a c : k hac : a = c ⊒ ((c - a) / (c - a)) β€’ slope f a c = slope f a c
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β·
simp [hac]
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β·
Mathlib.LinearAlgebra.AffineSpace.Slope.96_0.R1BInF4Gl9ffltx
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
Mathlib_LinearAlgebra_AffineSpace_Slope
case neg k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a c : k hac : Β¬a = c ⊒ ((c - a) / (c - a)) β€’ slope f a c = slope f a c
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β·
rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul]
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β·
Mathlib.LinearAlgebra.AffineSpace.Slope.96_0.R1BInF4Gl9ffltx
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
Mathlib_LinearAlgebra_AffineSpace_Slope
case neg k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b c : k hab : Β¬a = b ⊒ ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul]
by_cases hbc : b = c
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul]
Mathlib.LinearAlgebra.AffineSpace.Slope.96_0.R1BInF4Gl9ffltx
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
Mathlib_LinearAlgebra_AffineSpace_Slope
case pos k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b c : k hab : Β¬a = b hbc : b = c ⊒ ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β·
subst hbc
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β·
Mathlib.LinearAlgebra.AffineSpace.Slope.96_0.R1BInF4Gl9ffltx
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
Mathlib_LinearAlgebra_AffineSpace_Slope
case pos k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b : k hab : Β¬a = b ⊒ ((b - a) / (b - a)) β€’ slope f a b + ((b - b) / (b - a)) β€’ slope f b b = slope f a b
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β· subst hbc
simp [sub_ne_zero.2 (Ne.symm hab)]
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β· subst hbc
Mathlib.LinearAlgebra.AffineSpace.Slope.96_0.R1BInF4Gl9ffltx
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
Mathlib_LinearAlgebra_AffineSpace_Slope
case neg k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b c : k hab : Β¬a = b hbc : Β¬b = c ⊒ ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β· subst hbc simp [sub_ne_zero.2 (Ne.symm hab)]
rw [add_comm]
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β· subst hbc simp [sub_ne_zero.2 (Ne.symm hab)]
Mathlib.LinearAlgebra.AffineSpace.Slope.96_0.R1BInF4Gl9ffltx
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
Mathlib_LinearAlgebra_AffineSpace_Slope
case neg k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b c : k hab : Β¬a = b hbc : Β¬b = c ⊒ ((c - b) / (c - a)) β€’ slope f b c + ((b - a) / (c - a)) β€’ slope f a b = slope f a c
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β· subst hbc simp [sub_ne_zero.2 (Ne.symm hab)] rw [add_comm]
simp_rw [slope, div_eq_inv_mul, mul_smul, ← smul_add, smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hab), smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hbc), vsub_add_vsub_cancel]
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β· subst hbc simp [sub_ne_zero.2 (Ne.symm hab)] rw [add_comm]
Mathlib.LinearAlgebra.AffineSpace.Slope.96_0.R1BInF4Gl9ffltx
/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c
Mathlib_LinearAlgebra_AffineSpace_Slope
k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b c : k h : a β‰  c ⊒ (lineMap (slope f a b) (slope f b c)) ((c - b) / (c - a)) = slope f a c
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β· subst hbc simp [sub_ne_zero.2 (Ne.symm hab)] rw [add_comm] simp_rw [slope, div_eq_inv_mul, mul_smul, ← smul_add, smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hab), smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hbc), vsub_add_vsub_cancel] #align sub_div_sub_smul_slope_add_sub_div_sub_smul_slope sub_div_sub_smul_slope_add_sub_div_sub_smul_slope /-- `slope f a c` is an affine combination of `slope f a b` and `slope f b c`. This version uses `lineMap` to express this property. -/ theorem lineMap_slope_slope_sub_div_sub (f : k β†’ PE) (a b c : k) (h : a β‰  c) : lineMap (slope f a b) (slope f b c) ((c - b) / (c - a)) = slope f a c := by
field_simp [sub_ne_zero.2 h.symm, ← sub_div_sub_smul_slope_add_sub_div_sub_smul_slope f a b c, lineMap_apply_module]
/-- `slope f a c` is an affine combination of `slope f a b` and `slope f b c`. This version uses `lineMap` to express this property. -/ theorem lineMap_slope_slope_sub_div_sub (f : k β†’ PE) (a b c : k) (h : a β‰  c) : lineMap (slope f a b) (slope f b c) ((c - b) / (c - a)) = slope f a c := by
Mathlib.LinearAlgebra.AffineSpace.Slope.116_0.R1BInF4Gl9ffltx
/-- `slope f a c` is an affine combination of `slope f a b` and `slope f b c`. This version uses `lineMap` to express this property. -/ theorem lineMap_slope_slope_sub_div_sub (f : k β†’ PE) (a b c : k) (h : a β‰  c) : lineMap (slope f a b) (slope f b c) ((c - b) / (c - a)) = slope f a c
Mathlib_LinearAlgebra_AffineSpace_Slope
k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b r : k ⊒ (lineMap (slope f ((lineMap a b) r) b) (slope f a ((lineMap a b) r))) r = slope f a b
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β· subst hbc simp [sub_ne_zero.2 (Ne.symm hab)] rw [add_comm] simp_rw [slope, div_eq_inv_mul, mul_smul, ← smul_add, smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hab), smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hbc), vsub_add_vsub_cancel] #align sub_div_sub_smul_slope_add_sub_div_sub_smul_slope sub_div_sub_smul_slope_add_sub_div_sub_smul_slope /-- `slope f a c` is an affine combination of `slope f a b` and `slope f b c`. This version uses `lineMap` to express this property. -/ theorem lineMap_slope_slope_sub_div_sub (f : k β†’ PE) (a b c : k) (h : a β‰  c) : lineMap (slope f a b) (slope f b c) ((c - b) / (c - a)) = slope f a c := by field_simp [sub_ne_zero.2 h.symm, ← sub_div_sub_smul_slope_add_sub_div_sub_smul_slope f a b c, lineMap_apply_module] #align line_map_slope_slope_sub_div_sub lineMap_slope_slope_sub_div_sub /-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b := by
obtain rfl | hab : a = b ∨ a β‰  b := Classical.em _
/-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b := by
Mathlib.LinearAlgebra.AffineSpace.Slope.124_0.R1BInF4Gl9ffltx
/-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b
Mathlib_LinearAlgebra_AffineSpace_Slope
case inl k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a r : k ⊒ (lineMap (slope f ((lineMap a a) r) a) (slope f a ((lineMap a a) r))) r = slope f a a
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β· subst hbc simp [sub_ne_zero.2 (Ne.symm hab)] rw [add_comm] simp_rw [slope, div_eq_inv_mul, mul_smul, ← smul_add, smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hab), smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hbc), vsub_add_vsub_cancel] #align sub_div_sub_smul_slope_add_sub_div_sub_smul_slope sub_div_sub_smul_slope_add_sub_div_sub_smul_slope /-- `slope f a c` is an affine combination of `slope f a b` and `slope f b c`. This version uses `lineMap` to express this property. -/ theorem lineMap_slope_slope_sub_div_sub (f : k β†’ PE) (a b c : k) (h : a β‰  c) : lineMap (slope f a b) (slope f b c) ((c - b) / (c - a)) = slope f a c := by field_simp [sub_ne_zero.2 h.symm, ← sub_div_sub_smul_slope_add_sub_div_sub_smul_slope f a b c, lineMap_apply_module] #align line_map_slope_slope_sub_div_sub lineMap_slope_slope_sub_div_sub /-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b := by obtain rfl | hab : a = b ∨ a β‰  b := Classical.em _; Β·
simp
/-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b := by obtain rfl | hab : a = b ∨ a β‰  b := Classical.em _; Β·
Mathlib.LinearAlgebra.AffineSpace.Slope.124_0.R1BInF4Gl9ffltx
/-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b
Mathlib_LinearAlgebra_AffineSpace_Slope
case inr k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b r : k hab : a β‰  b ⊒ (lineMap (slope f ((lineMap a b) r) b) (slope f a ((lineMap a b) r))) r = slope f a b
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β· subst hbc simp [sub_ne_zero.2 (Ne.symm hab)] rw [add_comm] simp_rw [slope, div_eq_inv_mul, mul_smul, ← smul_add, smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hab), smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hbc), vsub_add_vsub_cancel] #align sub_div_sub_smul_slope_add_sub_div_sub_smul_slope sub_div_sub_smul_slope_add_sub_div_sub_smul_slope /-- `slope f a c` is an affine combination of `slope f a b` and `slope f b c`. This version uses `lineMap` to express this property. -/ theorem lineMap_slope_slope_sub_div_sub (f : k β†’ PE) (a b c : k) (h : a β‰  c) : lineMap (slope f a b) (slope f b c) ((c - b) / (c - a)) = slope f a c := by field_simp [sub_ne_zero.2 h.symm, ← sub_div_sub_smul_slope_add_sub_div_sub_smul_slope f a b c, lineMap_apply_module] #align line_map_slope_slope_sub_div_sub lineMap_slope_slope_sub_div_sub /-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b := by obtain rfl | hab : a = b ∨ a β‰  b := Classical.em _; Β· simp
rw [slope_comm _ a, slope_comm _ a, slope_comm _ _ b]
/-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b := by obtain rfl | hab : a = b ∨ a β‰  b := Classical.em _; Β· simp
Mathlib.LinearAlgebra.AffineSpace.Slope.124_0.R1BInF4Gl9ffltx
/-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b
Mathlib_LinearAlgebra_AffineSpace_Slope
case inr k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b r : k hab : a β‰  b ⊒ (lineMap (slope f b ((lineMap a b) r)) (slope f ((lineMap a b) r) a)) r = slope f b a
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β· subst hbc simp [sub_ne_zero.2 (Ne.symm hab)] rw [add_comm] simp_rw [slope, div_eq_inv_mul, mul_smul, ← smul_add, smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hab), smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hbc), vsub_add_vsub_cancel] #align sub_div_sub_smul_slope_add_sub_div_sub_smul_slope sub_div_sub_smul_slope_add_sub_div_sub_smul_slope /-- `slope f a c` is an affine combination of `slope f a b` and `slope f b c`. This version uses `lineMap` to express this property. -/ theorem lineMap_slope_slope_sub_div_sub (f : k β†’ PE) (a b c : k) (h : a β‰  c) : lineMap (slope f a b) (slope f b c) ((c - b) / (c - a)) = slope f a c := by field_simp [sub_ne_zero.2 h.symm, ← sub_div_sub_smul_slope_add_sub_div_sub_smul_slope f a b c, lineMap_apply_module] #align line_map_slope_slope_sub_div_sub lineMap_slope_slope_sub_div_sub /-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b := by obtain rfl | hab : a = b ∨ a β‰  b := Classical.em _; Β· simp rw [slope_comm _ a, slope_comm _ a, slope_comm _ _ b]
convert lineMap_slope_slope_sub_div_sub f b (lineMap a b r) a hab.symm using 2
/-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b := by obtain rfl | hab : a = b ∨ a β‰  b := Classical.em _; Β· simp rw [slope_comm _ a, slope_comm _ a, slope_comm _ _ b]
Mathlib.LinearAlgebra.AffineSpace.Slope.124_0.R1BInF4Gl9ffltx
/-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b
Mathlib_LinearAlgebra_AffineSpace_Slope
case h.e'_2.h.e'_6 k : Type u_1 E : Type u_2 PE : Type u_3 inst✝³ : Field k inst✝² : AddCommGroup E inst✝¹ : Module k E inst✝ : AddTorsor E PE f : k β†’ PE a b r : k hab : a β‰  b ⊒ r = (a - (lineMap a b) r) / (a - b)
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" /-! # Slope of a function In this file we define the slope of a function `f : k β†’ PE` taking values in an affine space over `k` and prove some basic theorems about `slope`. The `slope` function naturally appears in the Mean Value Theorem, and in the proof of the fact that a function with nonnegative second derivative on an interval is convex on this interval. ## Tags affine space, slope -/ open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] /-- `slope f a b = (b - a)⁻¹ β€’ (f b -α΅₯ f a)` is the slope of a function `f` on the interval `[a, b]`. Note that `slope f a a = 0`, not the derivative of `f` at `a`. -/ def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by rw [sub_smul_slope, vsub_vadd] #align sub_smul_slope_vadd sub_smul_slope_vadd @[simp] theorem slope_vadd_const (f : k β†’ E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by ext a b simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub] #align slope_vadd_const slope_vadd_const @[simp] theorem slope_sub_smul (f : k β†’ E) {a b : k} (h : a β‰  b) : slope (fun x => (x - a) β€’ f x) a b = f b := by simp [slope, inv_smul_smulβ‚€ (sub_ne_zero.2 h.symm)] #align slope_sub_smul slope_sub_smul theorem eq_of_slope_eq_zero {f : k β†’ PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by rw [← sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd] #align eq_of_slope_eq_zero eq_of_slope_eq_zero theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF] (f : PE →ᡃ[k] PF) (g : k β†’ PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b) := by simp only [slope, (Β· ∘ Β·), f.linear.map_smul, f.linearMap_vsub] #align affine_map.slope_comp AffineMap.slope_comp theorem LinearMap.slope_comp {F : Type*} [AddCommGroup F] [Module k F] (f : E β†’β‚—[k] F) (g : k β†’ E) (a b : k) : slope (f ∘ g) a b = f (slope g a b) := f.toAffineMap.slope_comp g a b #align linear_map.slope_comp LinearMap.slope_comp theorem slope_comm (f : k β†’ PE) (a b : k) : slope f a b = slope f b a := by rw [slope, slope, ← neg_vsub_eq_vsub_rev, smul_neg, ← neg_smul, neg_inv, neg_sub] #align slope_comm slope_comm /-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version explicitly provides coefficients. If `a β‰  c`, then the sum of the coefficients is `1`, so it is actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k β†’ PE) (a b c : k) : ((b - a) / (c - a)) β€’ slope f a b + ((c - b) / (c - a)) β€’ slope f b c = slope f a c := by by_cases hab : a = b Β· subst hab rw [sub_self, zero_div, zero_smul, zero_add] by_cases hac : a = c Β· simp [hac] Β· rw [div_self (sub_ne_zero.2 <| Ne.symm hac), one_smul] by_cases hbc : b = c; Β· subst hbc simp [sub_ne_zero.2 (Ne.symm hab)] rw [add_comm] simp_rw [slope, div_eq_inv_mul, mul_smul, ← smul_add, smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hab), smul_inv_smulβ‚€ (sub_ne_zero.2 <| Ne.symm hbc), vsub_add_vsub_cancel] #align sub_div_sub_smul_slope_add_sub_div_sub_smul_slope sub_div_sub_smul_slope_add_sub_div_sub_smul_slope /-- `slope f a c` is an affine combination of `slope f a b` and `slope f b c`. This version uses `lineMap` to express this property. -/ theorem lineMap_slope_slope_sub_div_sub (f : k β†’ PE) (a b c : k) (h : a β‰  c) : lineMap (slope f a b) (slope f b c) ((c - b) / (c - a)) = slope f a c := by field_simp [sub_ne_zero.2 h.symm, ← sub_div_sub_smul_slope_add_sub_div_sub_smul_slope f a b c, lineMap_apply_module] #align line_map_slope_slope_sub_div_sub lineMap_slope_slope_sub_div_sub /-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b := by obtain rfl | hab : a = b ∨ a β‰  b := Classical.em _; Β· simp rw [slope_comm _ a, slope_comm _ a, slope_comm _ _ b] convert lineMap_slope_slope_sub_div_sub f b (lineMap a b r) a hab.symm using 2
rw [lineMap_apply_ring, eq_div_iff (sub_ne_zero.2 hab), sub_mul, one_mul, mul_sub, ← sub_sub, sub_sub_cancel]
/-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b := by obtain rfl | hab : a = b ∨ a β‰  b := Classical.em _; Β· simp rw [slope_comm _ a, slope_comm _ a, slope_comm _ _ b] convert lineMap_slope_slope_sub_div_sub f b (lineMap a b r) a hab.symm using 2
Mathlib.LinearAlgebra.AffineSpace.Slope.124_0.R1BInF4Gl9ffltx
/-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k β†’ PE) (a b r : k) : lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b
Mathlib_LinearAlgebra_AffineSpace_Slope
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C ⊒ (πŸ™ (πŸ™_ C) βŠ— πŸ™ (πŸ™_ C)) ≫ (Ξ»_ (πŸ™_ C)).hom = (ρ_ (πŸ™_ C)).hom
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by
coherence
/-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by
Mathlib.CategoryTheory.Monoidal.Mon_.55_0.NTUMzhXPwXsmsYt
/-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C ⊒ ((Ξ»_ (πŸ™_ C)).hom βŠ— πŸ™ (πŸ™_ C)) ≫ (Ξ»_ (πŸ™_ C)).hom = (Ξ±_ (πŸ™_ C) (πŸ™_ C) (πŸ™_ C)).hom ≫ (πŸ™ (πŸ™_ C) βŠ— (Ξ»_ (πŸ™_ C)).hom) ≫ (Ξ»_ (πŸ™_ C)).hom
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by
coherence
/-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by
Mathlib.CategoryTheory.Monoidal.Mon_.55_0.NTUMzhXPwXsmsYt
/-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M : Mon_ C Z : C f : Z ⟢ M.X ⊒ (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by
rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality]
@[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by
Mathlib.CategoryTheory.Monoidal.Mon_.72_0.NTUMzhXPwXsmsYt
@[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M : Mon_ C Z : C f : Z ⟢ M.X ⊒ (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by
rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality]
@[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by
Mathlib.CategoryTheory.Monoidal.Mon_.77_0.NTUMzhXPwXsmsYt
@[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M : Mon_ C ⊒ (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by
simp
theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by
Mathlib.CategoryTheory.Monoidal.Mon_.82_0.NTUMzhXPwXsmsYt
theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M A✝ B✝ : Mon_ C f : A✝ ⟢ B✝ e : IsIso ((forget C).map f) ⊒ B✝.mul ≫ inv f.hom = (inv f.hom βŠ— inv f.hom) ≫ A✝.mul
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by
simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp]
/-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by
Mathlib.CategoryTheory.Monoidal.Mon_.152_0.NTUMzhXPwXsmsYt
/-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M A✝ B✝ : Mon_ C f : A✝ ⟢ B✝ e : IsIso ((forget C).map f) ⊒ f ≫ Hom.mk (inv f.hom) = πŸ™ A✝ ∧ Hom.mk (inv f.hom) ≫ f = πŸ™ B✝
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by
aesop_cat
/-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by
Mathlib.CategoryTheory.Monoidal.Mon_.152_0.NTUMzhXPwXsmsYt
/-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M✝ M N : Mon_ C f : M.X β‰… N.X one_f : M.one ≫ f.hom = N.one mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul ⊒ N.one ≫ f.inv = M.one
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by
rw [← one_f]
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by
Mathlib.CategoryTheory.Monoidal.Mon_.161_0.NTUMzhXPwXsmsYt
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M✝ M N : Mon_ C f : M.X β‰… N.X one_f : M.one ≫ f.hom = N.one mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul ⊒ (M.one ≫ f.hom) ≫ f.inv = M.one
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f];
simp
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f];
Mathlib.CategoryTheory.Monoidal.Mon_.161_0.NTUMzhXPwXsmsYt
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M✝ M N : Mon_ C f : M.X β‰… N.X one_f : M.one ≫ f.hom = N.one mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul ⊒ N.mul ≫ f.inv = (f.inv βŠ— f.inv) ≫ M.mul
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by
rw [← cancel_mono f.hom]
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by
Mathlib.CategoryTheory.Monoidal.Mon_.161_0.NTUMzhXPwXsmsYt
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M✝ M N : Mon_ C f : M.X β‰… N.X one_f : M.one ≫ f.hom = N.one mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul ⊒ (N.mul ≫ f.inv) ≫ f.hom = ((f.inv βŠ— f.inv) ≫ M.mul) ≫ f.hom
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom]
slice_rhs 2 3 => rw [mul_f]
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom]
Mathlib.CategoryTheory.Monoidal.Mon_.161_0.NTUMzhXPwXsmsYt
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom
Mathlib_CategoryTheory_Monoidal_Mon_
case a C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M✝ M N : Mon_ C f : M.X β‰… N.X one_f : M.one ≫ f.hom = N.one mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul | M.mul ≫ f.hom case a C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M✝ M N : Mon_ C f : M.X β‰… N.X one_f : M.one ≫ f.hom = N.one mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul | f.inv βŠ— f.inv
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 =>
rw [mul_f]
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 =>
Mathlib.CategoryTheory.Monoidal.Mon_.161_0.NTUMzhXPwXsmsYt
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom
Mathlib_CategoryTheory_Monoidal_Mon_
case a C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M✝ M N : Mon_ C f : M.X β‰… N.X one_f : M.one ≫ f.hom = N.one mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul | M.mul ≫ f.hom case a C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M✝ M N : Mon_ C f : M.X β‰… N.X one_f : M.one ≫ f.hom = N.one mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul | f.inv βŠ— f.inv
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 =>
rw [mul_f]
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 =>
Mathlib.CategoryTheory.Monoidal.Mon_.161_0.NTUMzhXPwXsmsYt
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom
Mathlib_CategoryTheory_Monoidal_Mon_
case a C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M✝ M N : Mon_ C f : M.X β‰… N.X one_f : M.one ≫ f.hom = N.one mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul | M.mul ≫ f.hom case a C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M✝ M N : Mon_ C f : M.X β‰… N.X one_f : M.one ≫ f.hom = N.one mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul | f.inv βŠ— f.inv
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 =>
rw [mul_f]
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 =>
Mathlib.CategoryTheory.Monoidal.Mon_.161_0.NTUMzhXPwXsmsYt
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M✝ M N : Mon_ C f : M.X β‰… N.X one_f : M.one ≫ f.hom = N.one mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul ⊒ (N.mul ≫ f.inv) ≫ f.hom = (f.inv βŠ— f.inv) ≫ (f.hom βŠ— f.hom) ≫ N.mul
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f]
simp
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f]
Mathlib.CategoryTheory.Monoidal.Mon_.161_0.NTUMzhXPwXsmsYt
/-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M A : Mon_ C ⊒ (trivial C).one ≫ A.one = A.one
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by
dsimp
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by
Mathlib.CategoryTheory.Monoidal.Mon_.179_0.NTUMzhXPwXsmsYt
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M A : Mon_ C ⊒ πŸ™ (πŸ™_ C) ≫ A.one = A.one
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp;
simp
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp;
Mathlib.CategoryTheory.Monoidal.Mon_.179_0.NTUMzhXPwXsmsYt
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M A : Mon_ C ⊒ (trivial C).mul ≫ A.one = (A.one βŠ— A.one) ≫ A.mul
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by
dsimp
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by
Mathlib.CategoryTheory.Monoidal.Mon_.179_0.NTUMzhXPwXsmsYt
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M A : Mon_ C ⊒ (Ξ»_ (πŸ™_ C)).hom ≫ A.one = (A.one βŠ— A.one) ≫ A.mul
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp;
simp [A.one_mul, unitors_equal]
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp;
Mathlib.CategoryTheory.Monoidal.Mon_.179_0.NTUMzhXPwXsmsYt
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M A : Mon_ C f : trivial C ⟢ A ⊒ f = default
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by
ext
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by
Mathlib.CategoryTheory.Monoidal.Mon_.179_0.NTUMzhXPwXsmsYt
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default
Mathlib_CategoryTheory_Monoidal_Mon_
case w C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M A : Mon_ C f : trivial C ⟢ A ⊒ f.hom = default.hom
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext;
simp
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext;
Mathlib.CategoryTheory.Monoidal.Mon_.179_0.NTUMzhXPwXsmsYt
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default
Mathlib_CategoryTheory_Monoidal_Mon_
case w C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M A : Mon_ C f : trivial C ⟢ A ⊒ f.hom = A.one
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp
rw [← Category.id_comp f.hom]
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp
Mathlib.CategoryTheory.Monoidal.Mon_.179_0.NTUMzhXPwXsmsYt
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default
Mathlib_CategoryTheory_Monoidal_Mon_
case w C : Type u₁ inst✝¹ : Category.{v₁, u₁} C inst✝ : MonoidalCategory C M A : Mon_ C f : trivial C ⟢ A ⊒ πŸ™ (trivial C).X ≫ f.hom = A.one
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom]
erw [f.one_hom]
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom]
Mathlib.CategoryTheory.Monoidal.Mon_.179_0.NTUMzhXPwXsmsYt
instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C ⊒ (F.Ξ΅ ≫ F.map A.one βŠ— πŸ™ (F.obj A.X)) ≫ ΞΌ F A.X A.X ≫ F.map A.mul = (Ξ»_ (F.obj A.X)).hom
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by
conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | (F.Ξ΅ ≫ F.map A.one βŠ— πŸ™ (F.obj A.X)) ≫ ΞΌ F A.X A.X ≫ F.map A.mul
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs =>
rw [comp_tensor_id, ← F.toFunctor.map_id]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs =>
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | (F.Ξ΅ ≫ F.map A.one βŠ— πŸ™ (F.obj A.X)) ≫ ΞΌ F A.X A.X ≫ F.map A.mul
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs =>
rw [comp_tensor_id, ← F.toFunctor.map_id]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs =>
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | (F.Ξ΅ ≫ F.map A.one βŠ— πŸ™ (F.obj A.X)) ≫ ΞΌ F A.X A.X ≫ F.map A.mul
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs =>
rw [comp_tensor_id, ← F.toFunctor.map_id]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs =>
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C ⊒ ((F.Ξ΅ βŠ— F.map (πŸ™ A.X)) ≫ (F.map A.one βŠ— F.map (πŸ™ A.X))) ≫ ΞΌ F A.X A.X ≫ F.map A.mul = (Ξ»_ (F.obj A.X)).hom
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id]
slice_lhs 2 3 => rw [F.ΞΌ_natural]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id]
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
case a.a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | (F.map A.one βŠ— F.map (πŸ™ A.X)) ≫ ΞΌ F A.X A.X case a.a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | F.map A.mul case a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | F.Ξ΅ βŠ— F.map (πŸ™ A.X)
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 =>
rw [F.ΞΌ_natural]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 =>
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
case a.a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | (F.map A.one βŠ— F.map (πŸ™ A.X)) ≫ ΞΌ F A.X A.X case a.a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | F.map A.mul case a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | F.Ξ΅ βŠ— F.map (πŸ™ A.X)
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 =>
rw [F.ΞΌ_natural]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 =>
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
case a.a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | (F.map A.one βŠ— F.map (πŸ™ A.X)) ≫ ΞΌ F A.X A.X case a.a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | F.map A.mul case a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | F.Ξ΅ βŠ— F.map (πŸ™ A.X)
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 =>
rw [F.ΞΌ_natural]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 =>
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C ⊒ (F.Ξ΅ βŠ— F.map (πŸ™ A.X)) ≫ (ΞΌ F (πŸ™_ C) A.X ≫ F.map (A.one βŠ— πŸ™ A.X)) ≫ F.map A.mul = (Ξ»_ (F.obj A.X)).hom
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 => rw [F.ΞΌ_natural]
slice_lhs 3 4 => rw [← F.toFunctor.map_comp, A.one_mul]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 => rw [F.ΞΌ_natural]
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
case a.a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | F.map (A.one βŠ— πŸ™ A.X) ≫ F.map A.mul case a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | F.Ξ΅ βŠ— F.map (πŸ™ A.X) case a.a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | ΞΌ F (πŸ™_ C) A.X
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 => rw [F.ΞΌ_natural] slice_lhs 3 4 =>
rw [← F.toFunctor.map_comp, A.one_mul]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 => rw [F.ΞΌ_natural] slice_lhs 3 4 =>
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
case a.a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | F.map (A.one βŠ— πŸ™ A.X) ≫ F.map A.mul case a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | F.Ξ΅ βŠ— F.map (πŸ™ A.X) case a.a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | ΞΌ F (πŸ™_ C) A.X
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 => rw [F.ΞΌ_natural] slice_lhs 3 4 =>
rw [← F.toFunctor.map_comp, A.one_mul]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 => rw [F.ΞΌ_natural] slice_lhs 3 4 =>
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
case a.a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | F.map (A.one βŠ— πŸ™ A.X) ≫ F.map A.mul case a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | F.Ξ΅ βŠ— F.map (πŸ™ A.X) case a.a C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C | ΞΌ F (πŸ™_ C) A.X
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 => rw [F.ΞΌ_natural] slice_lhs 3 4 =>
rw [← F.toFunctor.map_comp, A.one_mul]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 => rw [F.ΞΌ_natural] slice_lhs 3 4 =>
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C ⊒ (F.Ξ΅ βŠ— F.map (πŸ™ A.X)) ≫ ΞΌ F (πŸ™_ C) A.X ≫ F.map (Ξ»_ A.X).hom = (Ξ»_ (F.obj A.X)).hom
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 => rw [F.ΞΌ_natural] slice_lhs 3 4 => rw [← F.toFunctor.map_comp, A.one_mul]
rw [F.toFunctor.map_id]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 => rw [F.ΞΌ_natural] slice_lhs 3 4 => rw [← F.toFunctor.map_comp, A.one_mul]
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_
C : Type u₁ inst✝³ : Category.{v₁, u₁} C inst✝² : MonoidalCategory C D : Type uβ‚‚ inst✝¹ : Category.{vβ‚‚, uβ‚‚} D inst✝ : MonoidalCategory D F : LaxMonoidalFunctor C D A : Mon_ C ⊒ (F.Ξ΅ βŠ— πŸ™ (F.obj A.X)) ≫ ΞΌ F (πŸ™_ C) A.X ≫ F.map (Ξ»_ A.X).hom = (Ξ»_ (F.obj A.X)).hom
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison -/ import Mathlib.CategoryTheory.Monoidal.Braided import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" /-! # The category of monoids in a monoidal category. We define monoids in a monoidal category `C` and show that the category of monoids is equivalent to the category of lax monoidal functors from the unit monoidal category to `C`. We also show that if `C` is braided, then the category of monoids is naturally monoidal. -/ set_option linter.uppercaseLean3 false universe v₁ vβ‚‚ u₁ uβ‚‚ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] /-- A monoid object internal to a monoidal category. When the monoidal category is preadditive, this is also sometimes called an "algebra object". -/ structure Mon_ where X : C one : πŸ™_ C ⟢ X mul : X βŠ— X ⟢ X one_mul : (one βŠ— πŸ™ X) ≫ mul = (Ξ»_ X).hom := by aesop_cat mul_one : (πŸ™ X βŠ— one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul βŠ— πŸ™ X) ≫ mul = (Ξ±_ X X X).hom ≫ (πŸ™ X βŠ— mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ /-- The trivial monoid object. We later show this is initial in `Mon_ C`. -/ @[simps] def trivial : Mon_ C where X := πŸ™_ C one := πŸ™ _ mul := (Ξ»_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp] theorem one_mul_hom {Z : C} (f : Z ⟢ M.X) : (M.one βŠ— f) ≫ M.mul = (Ξ»_ Z).hom ≫ f := by rw [← id_tensor_comp_tensor_id, Category.assoc, M.one_mul, leftUnitor_naturality] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟢ M.X) : (f βŠ— M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [← tensor_id_comp_id_tensor, Category.assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom theorem assoc_flip : (πŸ™ M.X βŠ— M.mul) ≫ M.mul = (Ξ±_ M.X M.X M.X).inv ≫ (M.mul βŠ— πŸ™ M.X) ≫ M.mul := by simp #align Mon_.assoc_flip Mon_.assoc_flip /-- A morphism of monoid objects. -/ @[ext] structure Hom (M N : Mon_ C) where hom : M.X ⟢ N.X one_hom : M.one ≫ hom = N.one := by aesop_cat mul_hom : M.mul ≫ hom = (hom βŠ— hom) ≫ N.mul := by aesop_cat #align Mon_.hom Mon_.Hom attribute [reassoc (attr := simp)] Hom.one_hom Hom.mul_hom /-- The identity morphism on a monoid object. -/ @[simps] def id (M : Mon_ C) : Hom M M where hom := πŸ™ M.X #align Mon_.id Mon_.id instance homInhabited (M : Mon_ C) : Inhabited (Hom M M) := ⟨id M⟩ #align Mon_.hom_inhabited Mon_.homInhabited /-- Composition of morphisms of monoid objects. -/ @[simps] def comp {M N O : Mon_ C} (f : Hom M N) (g : Hom N O) : Hom M O where hom := f.hom ≫ g.hom #align Mon_.comp Mon_.comp instance : Category (Mon_ C) where Hom M N := Hom M N id := id comp f g := comp f g -- Porting note: added, as `Hom.ext` does not apply to a morphism. @[ext] lemma ext {X Y : Mon_ C} {f g : X ⟢ Y} (w : f.hom = g.hom) : f = g := Hom.ext _ _ w @[simp] theorem id_hom' (M : Mon_ C) : (πŸ™ M : Hom M M).hom = πŸ™ M.X := rfl #align Mon_.id_hom' Mon_.id_hom' @[simp] theorem comp_hom' {M N K : Mon_ C} (f : M ⟢ N) (g : N ⟢ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := rfl #align Mon_.comp_hom' Mon_.comp_hom' section variable (C) /-- The forgetful functor from monoid objects to the ambient category. -/ @[simps] def forget : Mon_ C β₯€ C where obj A := A.X map f := f.hom #align Mon_.forget Mon_.forget end instance forget_faithful : Faithful (@forget C _ _) where #align Mon_.forget_faithful Mon_.forget_faithful instance {A B : Mon_ C} (f : A ⟢ B) [e : IsIso ((forget C).map f)] : IsIso f.hom := e /-- The forgetful functor from monoid objects to the ambient category reflects isomorphisms. -/ instance : ReflectsIsomorphisms (forget C) where reflects f e := ⟨⟨{ hom := inv f.hom mul_hom := by simp only [IsIso.comp_inv_eq, Hom.mul_hom, Category.assoc, ← tensor_comp_assoc, IsIso.inv_hom_id, tensor_id, Category.id_comp] }, by aesop_cat⟩⟩ /-- Construct an isomorphism of monoids by giving an isomorphism between the underlying objects and checking compatibility with unit and multiplication only in the forward direction. -/ def isoOfIso {M N : Mon_ C} (f : M.X β‰… N.X) (one_f : M.one ≫ f.hom = N.one) (mul_f : M.mul ≫ f.hom = (f.hom βŠ— f.hom) ≫ N.mul) : M β‰… N where hom := { hom := f.hom one_hom := one_f mul_hom := mul_f } inv := { hom := f.inv one_hom := by rw [← one_f]; simp mul_hom := by rw [← cancel_mono f.hom] slice_rhs 2 3 => rw [mul_f] simp } #align Mon_.iso_of_iso Mon_.isoOfIso instance uniqueHomFromTrivial (A : Mon_ C) : Unique (trivial C ⟢ A) where default := { hom := A.one one_hom := by dsimp; simp mul_hom := by dsimp; simp [A.one_mul, unitors_equal] } uniq f := by ext; simp rw [← Category.id_comp f.hom] erw [f.one_hom] #align Mon_.unique_hom_from_trivial Mon_.uniqueHomFromTrivial open CategoryTheory.Limits instance : HasInitial (Mon_ C) := hasInitial_of_unique (trivial C) end Mon_ namespace CategoryTheory.LaxMonoidalFunctor variable {C} {D : Type uβ‚‚} [Category.{vβ‚‚} D] [MonoidalCategory.{vβ‚‚} D] -- TODO: mapMod F A : Mod A β₯€ Mod (F.mapMon A) /-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 => rw [F.ΞΌ_natural] slice_lhs 3 4 => rw [← F.toFunctor.map_comp, A.one_mul] rw [F.toFunctor.map_id]
rw [F.left_unitality]
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A := { X := F.obj A.X one := F.Ξ΅ ≫ F.map A.one mul := F.ΞΌ _ _ ≫ F.map A.mul one_mul := by conv_lhs => rw [comp_tensor_id, ← F.toFunctor.map_id] slice_lhs 2 3 => rw [F.ΞΌ_natural] slice_lhs 3 4 => rw [← F.toFunctor.map_comp, A.one_mul] rw [F.toFunctor.map_id]
Mathlib.CategoryTheory.Monoidal.Mon_.202_0.NTUMzhXPwXsmsYt
/-- A lax monoidal functor takes monoid objects to monoid objects. That is, a lax monoidal functor `F : C β₯€ D` induces a functor `Mon_ C β₯€ Mon_ D`. -/ @[simps] def mapMon (F : LaxMonoidalFunctor C D) : Mon_ C β₯€ Mon_ D where obj A
Mathlib_CategoryTheory_Monoidal_Mon_