New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalize #668
Normalize #668
Conversation
Can you summarise the changes that have been made here? It takes a while to tell what is new code, and what is stuff that has just been moved. |
f623d34
to
1ed7ad1
Compare
old import tree: new import tree:
|
src/algebra/gcd_domain.lean
Outdated
@[simp] theorem norm_unit_one : norm_unit (1:α) = 1 := | ||
norm_unit_coe_units 1 | ||
|
||
variables (α) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be implicit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it creates metavariables which makes it impossible to use with \t
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with chris. Use rw
if \t
gives you trouble
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
@[simp] lemma normalize_eq_one {x : α} : normalize x = 1 ↔ is_unit x := | ||
⟨λ hx, is_unit_iff_exists_inv.2 ⟨_, hx⟩, λ ⟨u, hu⟩, hu.symm ▸ normalize_coe_units u⟩ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debatable whether this should be simp
. Equalities are good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
lemma normalize_nat_coe (n : ℕ) : normalize (n : ℤ) = n := | ||
normalize_of_nonneg (coe_nat_le_coe_nat_of_le $ nat.zero_le n) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
normalize_coe_nat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/ring_theory/multiplicity.lean
Outdated
@@ -3,7 +3,7 @@ Copyright (c) 2018 Robert Y. Lewis. All rights reserved. | |||
Released under Apache 2.0 license as described in the file LICENSE. | |||
Authors: Robert Y. Lewis, Chris Hughes | |||
-/ | |||
import data.nat.enat ring_theory.associated | |||
import algebra.gcd_domain data.nat.enat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this use anything from gcd_domain
or is a weaker import possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/algebra/gcd_domain.lean
Outdated
calc a * ↑(norm_unit a) = a * ↑(norm_unit a) * ↑u * ↑u⁻¹: | ||
(units.mul_inv_cancel_right _ _).symm | ||
... = a * ↑u * ↑(norm_unit a) * ↑u⁻¹ : by rw mul_right_comm a | ||
end | ||
|
||
theorem dvd_antisymm_of_norm {a b : α} | ||
(ha : norm_unit a = 1) (hb : norm_unit b = 1) (hab : a ∣ b) (hba : b ∣ a) : | ||
@[simp] lemma normalize_eq_normalize_iff {x y : α} : normalize x = normalize y ↔ x ∣ y ∧ y ∣ x := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't look like it should be a simp lemma either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
0b62a9b
to
14e360e
Compare
14e360e
to
5bf83a0
Compare
Updated summary: I just added |
https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/normalize
TO CONTRIBUTORS:
Make sure you have:
If this PR is related to a discussion on Zulip, please include a link in the discussion.
For reviewers: code review check list