@@ -743,37 +743,54 @@ by { cases a; cases b; simp [← with_top.coe_sub] }
743
743
lemma sub_ne_top (ha : a ≠ ∞) : a - b ≠ ∞ :=
744
744
mt sub_eq_top_iff.mp $ mt and.left ha
745
745
746
- protected lemma sub_lt_of_lt_add (hac : c ≤ a) (h : a < b + c) : a - c < b :=
747
- ((cancel_of_lt' $ hac.trans_lt h).tsub_lt_iff_right hac).mpr h
746
+ protected lemma sub_eq_of_eq_add (hb : b ≠ ∞) : a = c + b → a - b = c :=
747
+ (cancel_of_ne hb).tsub_eq_of_eq_add
748
748
749
- @[simp] lemma add_sub_self (hb : b ≠ ∞) : ( a + b) - b = a :=
750
- (cancel_of_ne hb).add_tsub_cancel_right
749
+ protected lemma eq_sub_of_add_eq (hc : c ≠ ∞) : a + c = b → a = b - c :=
750
+ (cancel_of_ne hc).eq_tsub_of_add_eq
751
751
752
- @[simp] lemma add_sub_self' (ha : a ≠ ∞) : (a + b) - a = b :=
753
- (cancel_of_ne ha).add_tsub_cancel_left
752
+ protected lemma sub_eq_of_eq_add_rev (hb : b ≠ ∞) : a = b + c → a - b = c :=
753
+ (cancel_of_ne hb).tsub_eq_of_eq_add_rev
754
754
755
755
lemma sub_eq_of_add_eq (hb : b ≠ ∞) (hc : a + b = c) : c - b = a :=
756
- (cancel_of_ne hb).tsub_eq_of_eq_add hc.symm
756
+ ennreal.sub_eq_of_eq_add hb hc.symm
757
757
758
- protected lemma lt_add_of_sub_lt (ht : a ≠ ∞ ∨ b ≠ ∞) (h : a - b < c) : a < c + b :=
758
+ @[simp] protected lemma add_sub_cancel_left (ha : a ≠ ∞) : a + b - a = b :=
759
+ (cancel_of_ne ha).add_tsub_cancel_left
760
+
761
+ @[simp] protected lemma add_sub_cancel_right (hb : b ≠ ∞) : a + b - b = a :=
762
+ (cancel_of_ne hb).add_tsub_cancel_right
763
+
764
+ protected lemma lt_add_of_sub_lt_left (h : a ≠ ∞ ∨ b ≠ ∞) : a - b < c → a < b + c :=
759
765
begin
760
- rcases eq_or_ne b ∞ with rfl|hb,
761
- { rw [add_top, lt_top_iff_ne_top], exact ht.resolve_right (not_not.2 rfl) },
762
- { exact (cancel_of_ne hb).lt_add_of_tsub_lt_right h }
766
+ obtain rfl | hb := eq_or_ne b ∞,
767
+ { rw [top_add, lt_top_iff_ne_top],
768
+ exact λ _, h.resolve_right (not_not.2 rfl) },
769
+ { exact (cancel_of_ne hb).lt_add_of_tsub_lt_left }
763
770
end
764
771
765
- protected lemma sub_lt_iff_lt_add (hb : b ≠ ∞) (hab : b ≤ a) : a - b < c ↔ a < c + b :=
766
- (cancel_of_ne hb).tsub_lt_iff_right hab
767
-
768
- protected lemma sub_lt_self (hat : a ≠ ∞) (ha0 : a ≠ 0 ) (hb : b ≠ 0 ) : a - b < a :=
772
+ protected lemma lt_add_of_sub_lt_right (h : a ≠ ∞ ∨ c ≠ ∞) : a - c < b → a < b + c :=
769
773
begin
770
- cases b, { simp [pos_iff_ne_zero, ha0] },
771
- exact (cancel_of_ne hat).tsub_lt_self cancel_coe (pos_iff_ne_zero.mpr ha0)
772
- (pos_iff_ne_zero.mpr hb)
774
+ obtain rfl | hc := eq_or_ne c ∞,
775
+ { rw [add_top, lt_top_iff_ne_top],
776
+ exact λ _, h.resolve_right (not_not.2 rfl) },
777
+ { exact (cancel_of_ne hc).lt_add_of_tsub_lt_right }
773
778
end
774
779
780
+ protected lemma sub_lt_of_lt_add (hac : c ≤ a) (h : a < b + c) : a - c < b :=
781
+ ((cancel_of_lt' $ hac.trans_lt h).tsub_lt_iff_right hac).mpr h
782
+
783
+ protected lemma sub_lt_iff_lt_right (hb : b ≠ ∞) (hab : b ≤ a) : a - b < c ↔ a < c + b :=
784
+ (cancel_of_ne hb).tsub_lt_iff_right hab
785
+
786
+ protected lemma sub_lt_self (ha : a ≠ ∞) (ha₀ : a ≠ 0 ) (hb : b ≠ 0 ) : a - b < a :=
787
+ (cancel_of_ne ha).tsub_lt_self (pos_iff_ne_zero.2 ha₀) (pos_iff_ne_zero.2 hb)
788
+
789
+ protected lemma sub_lt_self_iff (ha : a ≠ ∞) : a - b < a ↔ 0 < a ∧ 0 < b :=
790
+ (cancel_of_ne ha).tsub_lt_self_iff
791
+
775
792
lemma sub_lt_of_sub_lt (h₂ : c ≤ a) (h₃ : a ≠ ∞ ∨ b ≠ ∞) (h₁ : a - b < c) : a - c < b :=
776
- ennreal.sub_lt_of_lt_add h₂ (add_comm c b ▸ ennreal.lt_add_of_sub_lt h₃ h₁)
793
+ ennreal.sub_lt_of_lt_add h₂ (add_comm c b ▸ ennreal.lt_add_of_sub_lt_right h₃ h₁)
777
794
778
795
lemma sub_sub_cancel (h : a ≠ ∞) (h2 : b ≤ a) : a - (a - b) = b :=
779
796
(cancel_of_ne $ sub_ne_top h).tsub_tsub_cancel_of_le h2
@@ -1190,8 +1207,7 @@ le_of_forall_nnreal_lt $ λ r hr, (zero_le r).eq_or_lt.elim (λ h, h ▸ zero_le
1190
1207
lemma eq_top_of_forall_nnreal_le {x : ℝ≥0 ∞} (h : ∀ r : ℝ≥0 , ↑r ≤ x) : x = ∞ :=
1191
1208
top_unique $ le_of_forall_nnreal_lt $ λ r hr, h r
1192
1209
1193
- lemma add_div {a b c : ℝ≥0 ∞} : (a + b) / c = a / c + b / c :=
1194
- right_distrib a b (c⁻¹)
1210
+ lemma add_div : (a + b) / c = a / c + b / c := right_distrib a b (c⁻¹)
1195
1211
1196
1212
lemma div_add_div_same {a b c : ℝ≥0 ∞} : a / c + b / c = (a + b) / c :=
1197
1213
eq.symm $ right_distrib a b (c⁻¹)
0 commit comments