Skip to content

Commit

Permalink
feat(algebra/order/sub): add tsub_tsub_tsub_cancel_left (#16887)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariainesdff committed Oct 12, 2022
1 parent 59de3c1 commit 5b4d38a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/algebra/order/sub.lean
Expand Up @@ -532,6 +532,10 @@ protected lemma tsub_tsub_cancel_of_le (hba : add_le_cancellable (b - a)) (h : a
b - (b - a) = a :=
hba.tsub_eq_of_eq_add (add_tsub_cancel_of_le h).symm

protected lemma tsub_tsub_tsub_cancel_left (hab : add_le_cancellable (a - b)) (h : b ≤ a) :
a - c - (a - b) = b - c :=
by rw [tsub_right_comm, hab.tsub_tsub_cancel_of_le h]

end add_le_cancellable

section contra
Expand Down Expand Up @@ -610,6 +614,9 @@ contravariant.add_le_cancellable.add_tsub_tsub_cancel h
lemma tsub_tsub_cancel_of_le (h : a ≤ b) : b - (b - a) = a :=
contravariant.add_le_cancellable.tsub_tsub_cancel_of_le h

lemma tsub_tsub_tsub_cancel_left (h : b ≤ a) : a - c - (a - b) = b - c :=
contravariant.add_le_cancellable.tsub_tsub_tsub_cancel_left h

end contra
end has_exists_add_of_le

Expand Down

0 comments on commit 5b4d38a

Please sign in to comment.