bookshelf/Common/Nat/Basic.lean

24 lines
588 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import Mathlib.Data.Set.Basic
namespace Nat
/--
The following cancellation law holds for `m`, `n`, and `p` in `ω`:
```
m ⬝ p = n ⬝ p ∧ p ≠ 0 → m = n
```
-/
theorem mul_right_cancel (m n p : ) (hp : 0 < p) : m * p = n * p → m = n := by
intro hmn
match @trichotomous LT.lt _ m n with
| Or.inl h =>
have : m * p < n * p := Nat.mul_lt_mul_of_pos_right h hp
rw [hmn] at this
simp at this
| Or.inr (Or.inl h) => exact h
| Or.inr (Or.inr h) =>
have : n * p < m * p := Nat.mul_lt_mul_of_pos_right h hp
rw [hmn] at this
simp at this
end Nat