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

Commit 0e1c2bc

Browse files
committed
feat(algebra/add_torsor): more cancellation lemmas (#3368)
Add more cancellation lemmas for `vsub`, similar to lemmas already present for `vadd`.
1 parent b047396 commit 0e1c2bc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/algebra/add_torsor.lean

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,32 @@ end
244244
((v₁ +ᵥ p) -ᵥ (v₂ +ᵥ p) : G) = v₁ - v₂ :=
245245
by rw [vsub_vadd_eq_vsub_sub, vadd_vsub_assoc, vsub_self, add_zero]
246246

247+
/-- If the same point subtracted from two points produces equal
248+
results, those points are equal. -/
249+
lemma vsub_left_cancel {p1 p2 p : P} (h : (p1 -ᵥ p : G) = p2 -ᵥ p) : p1 = p2 :=
250+
by rwa [←sub_eq_zero, vsub_sub_vsub_cancel_right, vsub_eq_zero_iff_eq] at h
251+
252+
/-- The same point subtracted from two points produces equal results
253+
if and only if those points are equal. -/
254+
@[simp] lemma vsub_left_cancel_iff {p1 p2 p : P} : (p1 -ᵥ p : G) = p2 -ᵥ p ↔ p1 = p2 :=
255+
⟨vsub_left_cancel _, λ h, h ▸ rfl⟩
256+
257+
/-- If subtracting two points from the same point produces equal
258+
results, those points are equal. -/
259+
lemma vsub_right_cancel {p1 p2 p : P} (h : (p -ᵥ p1 : G) = p -ᵥ p2) : p1 = p2 :=
260+
begin
261+
have h2 : (p -ᵥ p2 : G) +ᵥ p1 = (p -ᵥ p1 : G) +ᵥ p1, { rw h },
262+
conv_rhs at h2 {
263+
rw [vsub_vadd, ←vsub_vadd G p p2],
264+
},
265+
rwa vadd_left_cancel_iff at h2
266+
end
267+
268+
/-- Subtracting two points from the same point produces equal results
269+
if and only if those points are equal. -/
270+
@[simp] lemma vsub_right_cancel_iff {p1 p2 p : P} : (p -ᵥ p1 : G) = p -ᵥ p2 ↔ p1 = p2 :=
271+
⟨vsub_right_cancel _, λ h, h ▸ rfl⟩
272+
247273
end general
248274

249275
section comm

0 commit comments

Comments
 (0)