@@ -38,24 +38,23 @@ add_decl_doc PositiveLinearMap.toOrderHom
3838/-- Notation for a `PositiveLinearMap`. -/
3939notation :25 E " →ₚ[" R:25 "] " F:0 => PositiveLinearMap R E F
4040
41- namespace PositiveLinearMapClass
41+ section PositiveLinearMapClass
4242
4343variable {F R E₁ E₂ : Type *} [Semiring R]
4444 [AddCommMonoid E₁] [PartialOrder E₁] [AddCommMonoid E₂] [PartialOrder E₂]
4545 [Module R E₁] [Module R E₂] [FunLike F E₁ E₂] [LinearMapClass F R E₁ E₂]
4646 [OrderHomClass F E₁ E₂]
4747
4848/-- Reinterpret an element of a type of positive linear maps as a positive linear map. -/
49- def toPositiveLinearMap (f : F) : E₁ →ₚ[R] E₂ :=
49+ def PositiveLinearMap.ofClass (f : F) : E₁ →ₚ[R] E₂ :=
5050 { (f : E₁ →ₗ[R] E₂), (f : E₁ →o E₂) with }
5151
52- /-- Reinterpret an element of a type of positive linear maps as a positive linear map. -/
53- instance instCoeToLinearMap : CoeHead F (E₁ →ₚ[R] E₂) where
54- coe f := toPositiveLinearMap f
52+ @ [deprecated (since := "2026-06-10" )]
53+ alias PositiveLinearMapClass.toPositiveLinearMap := PositiveLinearMap.ofClass
5554
56- /-- An additive group homomorphism that maps nonnegative elements to nonnegative elements
57- is an order homomorphism . -/
58- lemma _root_. OrderHomClass.of_addMonoidHom {F' E₁' E₂' : Type *} [FunLike F' E₁' E₂'] [AddGroup E₁']
55+ /-- A type of additive group homomorphisms that map nonnegative elements to nonnegative elements
56+ is also a type of order homomorphisms . -/
57+ lemma OrderHomClass.of_addMonoidHom {F' E₁' E₂' : Type *} [FunLike F' E₁' E₂'] [AddGroup E₁']
5958 [LE E₁'] [AddRightMono E₁'] [AddGroup E₂'] [LE E₂'] [AddRightMono E₂']
6059 [AddMonoidHomClass F' E₁' E₂']
6160 (h : ∀ f : F', ∀ x, 0 ≤ x → 0 ≤ f x) : OrderHomClass F' E₁' E₂' where
@@ -67,9 +66,11 @@ namespace PositiveLinearMap
6766
6867section general
6968
70- variable {R E₁ E₂ : Type *} [Semiring R]
71- [AddCommMonoid E₁] [PartialOrder E₁] [AddCommMonoid E₂] [PartialOrder E₂]
72- [Module R E₁] [Module R E₂]
69+ variable {R E₁ E₂ E₃ : Type *} [Semiring R]
70+ [AddCommMonoid E₁] [PartialOrder E₁]
71+ [AddCommMonoid E₂] [PartialOrder E₂]
72+ [AddCommMonoid E₃] [PartialOrder E₃]
73+ [Module R E₁] [Module R E₂] [Module R E₃]
7374
7475instance : FunLike (E₁ →ₚ[R] E₂) E₁ E₂ where
7576 coe f := f.toFun
@@ -80,10 +81,33 @@ instance : FunLike (E₁ →ₚ[R] E₂) E₁ E₂ where
8081 apply DFunLike.coe_injective
8182 exact h
8283
84+ initialize_simps_projections PositiveLinearMap (toFun → apply, as_prefix toLinearMap)
85+
8386@[ext]
8487lemma ext {f g : E₁ →ₚ[R] E₂} (h : ∀ x, f x = g x) : f = g :=
8588 DFunLike.ext f g h
8689
90+ variable (R E₁) in
91+ /-- The identity as a positive linear map. -/
92+ @ [simps! apply toLinearMap] protected def id : E₁ →ₚ[R] E₁ where
93+ __ := LinearMap.id
94+ __ := OrderHom.id
95+
96+ @[simp] lemma toOrderHom_id : (PositiveLinearMap.id R E₁).toOrderHom = .id := rfl
97+
98+ /-- The composition of positive linear maps is again a positive linear map. -/
99+ @ [simps! apply toLinearMap]
100+ def comp (g : E₂ →ₚ[R] E₃) (f : E₁ →ₚ[R] E₂) : E₁ →ₚ[R] E₃ where
101+ toLinearMap := g.toLinearMap.comp f.toLinearMap
102+ monotone' := g.monotone'.comp f.monotone'
103+
104+ @[simp] lemma toOrderHom_comp (g : E₂ →ₚ[R] E₃) (f : E₁ →ₚ[R] E₂) :
105+ (g.comp f).toOrderHom = g.toOrderHom.comp f.toOrderHom :=
106+ rfl
107+
108+ @[simp] lemma comp_id (f : E₁ →ₚ[R] E₂) : f.comp (.id R E₁) = f := rfl
109+ @[simp] lemma id_comp (f : E₁ →ₚ[R] E₂) : (PositiveLinearMap.id R E₂).comp f = f := rfl
110+
87111instance : LinearMapClass (E₁ →ₚ[R] E₂) R E₁ E₂ where
88112 map_add f := map_add f.toLinearMap
89113 map_smulₛₗ f := f.toLinearMap.map_smul'
0 commit comments