@@ -5,6 +5,7 @@ Authors: Alexander Bentkamp, Yury Kudryashov, Yaël Dillies
55-/
66module
77
8+ public import Mathlib.Algebra.Order.Nonneg.Ring
89public import Mathlib.LinearAlgebra.AffineSpace.Midpoint
910public import Mathlib.LinearAlgebra.LinearIndependent.Lemmas
1011public import Mathlib.LinearAlgebra.Ray
@@ -575,6 +576,30 @@ theorem Convex.mem_Ico (h : x < y) :
575576
576577end LinearOrderedField
577578
579+ namespace Nonneg
580+
581+ variable [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] {x y z : 𝕜}
582+
583+ protected lemma Icc_subset_segment {x y : {t : 𝕜 // 0 ≤ t}} :
584+ Icc x y ⊆ segment {t : 𝕜 // 0 ≤ t} x y := by
585+ intro a ⟨hxa, hay⟩
586+ rw [← Subtype.coe_le_coe] at hxa hay
587+ rcases Icc_subset_segment ⟨hxa, hay⟩ with ⟨t₁, t₂, t₁_nonneg, t₂_nonneg, t_add, hta⟩
588+ refine ⟨⟨t₁, t₁_nonneg⟩, ⟨t₂, t₂_nonneg⟩, zero_le _, zero_le _, ?_, ?_⟩ <;>
589+ ext <;> simpa
590+
591+ protected lemma segment_eq_Icc {x y : {t : 𝕜 // 0 ≤ t}} (hxy : x ≤ y) :
592+ segment {t : 𝕜 // 0 ≤ t} x y = Icc x y := by
593+ refine subset_antisymm (segment_subset_Icc hxy) Nonneg.Icc_subset_segment
594+
595+ protected lemma segment_eq_uIcc {x y : {t : 𝕜 // 0 ≤ t}} :
596+ segment {t : 𝕜 // 0 ≤ t} x y = uIcc x y := by
597+ rcases le_total x y with h | h
598+ · simp [h, Nonneg.segment_eq_Icc]
599+ · simp [h, segment_symm _ x y, Nonneg.segment_eq_Icc]
600+
601+ end Nonneg
602+
578603namespace Prod
579604
580605variable [Semiring 𝕜] [PartialOrder 𝕜] [AddCommMonoid E] [AddCommMonoid F] [Module 𝕜 E] [Module 𝕜 F]
0 commit comments