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

Commit

Permalink
chore(data/real/nnreal): avoid abusing inequalities in nnreals (#7872)
Browse files Browse the repository at this point in the history
I removed the use of `@`, so that all implicit arguments stay implicit.

The main motivation is to reduce the diff in the bigger PR #7645: by only having the explicit arguments, the same proof works, without having to fiddle around with underscores.
  • Loading branch information
adomani committed Jun 11, 2021
1 parent d570596 commit 1b0e5ee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/data/real/nnreal.lean
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,15 @@ instance : order_bot ℝ≥0 :=
{ bot := ⊥, bot_le := assume ⟨a, h⟩, h, .. nnreal.linear_order }

instance : canonically_linear_ordered_add_monoid ℝ≥0 :=
{ add_le_add_left := assume a b h c, @add_le_add_left ℝ a b _ _ _ h c,
lt_of_add_lt_add_left := assume a b c, @lt_of_add_lt_add_left ℝ a b c _ _ _,
{ add_le_add_left := assume a b h c,
nnreal.coe_le_coe.mp $ (add_le_add_left (nnreal.coe_le_coe.mpr h) c),
lt_of_add_lt_add_left := assume a b c bc,
nnreal.coe_lt_coe.mp $ lt_of_add_lt_add_left (nnreal.coe_lt_coe.mpr bc),
le_iff_exists_add := assume ⟨a, ha⟩ ⟨b, hb⟩,
iff.intro
(assume h : a ≤ b,
⟨⟨b - a, le_sub_iff_add_le.2 $ by simp [h]⟩,
nnreal.eq $ show b = a + (b - a), by rw [add_sub_cancel'_right]⟩)
⟨⟨b - a, le_sub_iff_add_le.2 $ (zero_add _).le.trans h⟩,
nnreal.eq $ show b = a + (b - a), from (add_sub_cancel'_right _ _).symm⟩)
(assume ⟨⟨c, hc⟩, eq⟩, eq.symm ▸ show a ≤ a + c, from (le_add_iff_nonneg_right a).2 hc),
..nnreal.comm_semiring,
..nnreal.order_bot,
Expand Down

0 comments on commit 1b0e5ee

Please sign in to comment.