Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(data/fin): Add pred_{le,lt}_pred_iff #5121

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/data/fin.lean
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ by { simp only [le_iff_coe_le_coe, coe_succ], exact ⟨le_of_succ_le_succ, succ_
@[simp] lemma succ_lt_succ_iff : a.succ < b.succ ↔ a < b :=
by { simp only [lt_iff_coe_lt_coe, coe_succ], exact ⟨lt_of_succ_lt_succ, succ_lt_succ⟩ }

@[simp] lemma pred_le_pred_iff {n : ℕ} {a b : fin n.succ} {ha hb} : a.pred ha ≤ b.pred hb ↔ b ≤ b :=
by rw [←succ_le_succ_iff, succ_pred, succ_pred]

@[simp] lemma pred_lt_pred_iff {n : ℕ} {a b : fin n.succ} {ha hb} : a.pred ha < b.pred hb ↔ b < b :=
by rw [←succ_lt_succ_iff, succ_pred, succ_pred]
eric-wieser marked this conversation as resolved.
Show resolved Hide resolved

lemma succ_injective (n : ℕ) : injective (@fin.succ n) :=
λa b, succ.inj

Expand Down