Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit d5a1b46

Browse files
sgouezelChrisHughes24
authored andcommitted
to_nat_le_to_nat (#685)
1 parent 9f79d2e commit d5a1b46

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/data/int/basic.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,9 @@ by rw [to_nat_eq_max]; apply le_max_left
718718
by rw [(coe_nat_le_coe_nat_iff _ _).symm, to_nat_eq_max, max_le_iff];
719719
exact and_iff_left (coe_zero_le _)
720720

721+
theorem to_nat_le_to_nat {a b : ℤ} (h : a ≤ b) : to_nat a ≤ to_nat b :=
722+
by rw to_nat_le; exact le_trans h (le_to_nat b)
723+
721724
def to_nat' : ℤ → option ℕ
722725
| (n : ℕ) := some n
723726
| -[1+ n] := none

0 commit comments

Comments
 (0)