Skip to content

Commit

Permalink
chore(Order.Grade): protect GradedOrder.grade (#10558)
Browse files Browse the repository at this point in the history
In #10496, a better fix was suggested in the comments by @Ruben-VandeVelde: make `GradedOrder.grade` `protected` to freely use `grade` for `_root_.grade`. This implements that fix.
  • Loading branch information
mattrobball committed Feb 23, 2024
1 parent 23cc9c4 commit 496a4b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Mathlib/Order/Grade.lean
Expand Up @@ -63,7 +63,7 @@ variable {𝕆 β„™ Ξ± Ξ² : Type*}
`grade 𝕆 : Ξ± β†’ 𝕆` which preserves order covering (`CovBy`). -/
class GradeOrder (𝕆 Ξ± : Type*) [Preorder 𝕆] [Preorder Ξ±] where
/-- The grading function. -/
grade : Ξ± β†’ 𝕆
protected grade : Ξ± β†’ 𝕆
/-- `grade` is strictly monotonic. -/
grade_strictMono : StrictMono grade
/-- `grade` preserves `CovBy`. -/
Expand Down Expand Up @@ -266,7 +266,7 @@ theorem grade_ofDual [GradeOrder 𝕆 Ξ±] (a : Ξ±α΅’α΅ˆ) : grade 𝕆 (ofDual a)
@[reducible]
def GradeOrder.liftLeft [GradeOrder 𝕆 Ξ±] (f : 𝕆 β†’ β„™) (hf : StrictMono f)
(hcovBy : βˆ€ a b, a β‹– b β†’ f a β‹– f b) : GradeOrder β„™ Ξ± where
grade := f ∘ _root_.grade 𝕆
grade := f ∘ grade 𝕆
grade_strictMono := hf.comp grade_strictMono
covBy_grade _ _ h := hcovBy _ _ <| h.grade _
#align grade_order.lift_left GradeOrder.liftLeft
Expand Down Expand Up @@ -301,7 +301,7 @@ def GradeBoundedOrder.liftLeft [GradeBoundedOrder 𝕆 Ξ±] (f : 𝕆 β†’ β„™) (h
@[reducible]
def GradeOrder.liftRight [GradeOrder 𝕆 Ξ²] (f : Ξ± β†’ Ξ²) (hf : StrictMono f)
(hcovBy : βˆ€ a b, a β‹– b β†’ f a β‹– f b) : GradeOrder 𝕆 Ξ± where
grade := _root_.grade 𝕆 ∘ f
grade := grade 𝕆 ∘ f
grade_strictMono := grade_strictMono.comp hf
covBy_grade _ _ h := (hcovBy _ _ h).grade _
#align grade_order.lift_right GradeOrder.liftRight
Expand Down

0 comments on commit 496a4b4

Please sign in to comment.