Skip to content

Commit 8a851dd

Browse files
committed
feat(Data/PNat/Basic): add order-related instances to PNat (#26453)
Add `SuccAddOrder ℕ+` and `NoMaxOrder ℕ+` instances. Co-authored-by: jburroni <jburroni@users.noreply.github.com>
1 parent 70d200f commit 8a851dd

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,6 +3656,7 @@ import Mathlib.Data.PNat.Factors
36563656
import Mathlib.Data.PNat.Find
36573657
import Mathlib.Data.PNat.Interval
36583658
import Mathlib.Data.PNat.Notation
3659+
import Mathlib.Data.PNat.Order
36593660
import Mathlib.Data.PNat.Prime
36603661
import Mathlib.Data.PNat.Xgcd
36613662
import Mathlib.Data.PSigma.Order

Mathlib/Data/PNat/Order.lean

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/-
2+
Copyright (c) 2025 Javier Burroni. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Javier Burroni
5+
-/
6+
import Mathlib.Algebra.Order.SuccPred
7+
import Mathlib.Data.PNat.Basic
8+
9+
/-!
10+
# Order related instances for `ℕ+`
11+
-/
12+
13+
namespace PNat
14+
open Nat
15+
16+
instance instSuccOrder : SuccOrder ℕ+ :=
17+
.ofSuccLeIff (· + 1) Iff.rfl
18+
19+
instance instSuccAddOrder : SuccAddOrder ℕ+ where
20+
succ_eq_add_one _ := rfl
21+
22+
instance instNoMaxOrder : NoMaxOrder ℕ+ where
23+
exists_gt n := ⟨n + 1, lt_succ_self n⟩
24+
25+
@[simp]
26+
lemma succ_eq_add_one (n : ℕ+) : Order.succ n = n + 1 := rfl
27+
28+
end PNat

0 commit comments

Comments
 (0)