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

Commit ccf646d

Browse files
committed
chore(set_theory/ordinal): use a protected lemma to drop a nolint (#2805)
1 parent a3b3aa6 commit ccf646d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/set_theory/ordinal.lean

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,20 +1561,22 @@ begin
15611561
{ exact mul_is_limit l.pos lb }
15621562
end
15631563

1564+
protected lemma div_aux (a b : ordinal.{u}) (h : b ≠ 0) : set.nonempty {o | a < b * succ o} :=
1565+
⟨a, succ_le.1 $
1566+
by simpa only [succ_zero, one_mul]
1567+
using mul_le_mul_right (succ a) (succ_le.2 (pos_iff_ne_zero.2 h))⟩
1568+
15641569
/-- `a / b` is the unique ordinal `o` satisfying
15651570
`a = b * o + o'` with `o' < b`. -/
15661571
protected def div (a b : ordinal.{u}) : ordinal.{u} :=
1567-
if h : b = 0 then 0 else
1568-
omin {o | a < b * succ o} ⟨a, succ_le.1 $
1569-
by simpa only [succ_zero, one_mul] using mul_le_mul_right (succ a) (succ_le.2 (pos_iff_ne_zero.2 h))⟩
1572+
if h : b = 0 then 0 else omin {o | a < b * succ o} (ordinal.div_aux a b h)
15701573

15711574
instance : has_div ordinal := ⟨ordinal.div⟩
15721575

15731576
@[simp] theorem div_zero (a : ordinal) : a / 0 = 0 := dif_pos rfl
15741577

1575-
@[nolint def_lemma doc_blame] -- TODO: This should be a theorem but Lean fails to synthesize the placeholder
1576-
def div_def (a) {b : ordinal} (h : b ≠ 0) :
1577-
a / b = omin {o | a < b * succ o} _ := dif_neg h
1578+
lemma div_def (a) {b : ordinal} (h : b ≠ 0) :
1579+
a / b = omin {o | a < b * succ o} (ordinal.div_aux a b h) := dif_neg h
15781580

15791581
theorem lt_mul_succ_div (a) {b : ordinal} (h : b ≠ 0) : a < b * succ (a / b) :=
15801582
by rw div_def a h; exact omin_mem {o | a < b * succ o} _

0 commit comments

Comments
 (0)