Zulip Chat Archive
Stream: condensed mathematics
Topic: free abelian group norm
Johan Commelin (Jul 06 2022 at 09:01):
There is a map free_abelian_group X → ℕ
that sends ∑ a_i [x_i]
to ∑ |a_i|
.
Johan Commelin (Jul 06 2022 at 09:02):
We need a bunch of properties of this norm map. I pushed a bunch of self-contained sorries to free_abelian_exact.lean
.
Johan Commelin (Jul 06 2022 at 09:02):
Things like norm_add : (a+b).norm ≤ a.norm + b.norm
Johan Commelin (Jul 06 2022 at 09:03):
I will work on
lemma norm_eq_succ_iff (n : ℕ) :
a.norm = n.succ ↔ ∃ b x, (a = b + of x ∨ a = b - of x) ∧ b.norm = n :=
Sebastien Gouezel (Jul 06 2022 at 09:08):
The right to left implication is not true (if b = - of x
, for instance...)
Johan Commelin (Jul 06 2022 at 09:12):
Yes, I just realized.
Johan Commelin (Jul 06 2022 at 09:12):
Luckily I don't need it :rofl:
Johan Commelin (Jul 06 2022 at 09:57):
Ok, the left-to-right implication is done
Filippo A. E. Nuccio (Jul 06 2022 at 10:16):
I am taking on the first two norm_of
and norm_add
Eric Wieser (Jul 06 2022 at 13:45):
I wonder if this is an argument towards having an API for nat-valued norms, since @Wrenna Robson wanted one for hamming codes too.
Filippo A. E. Nuccio (Jul 06 2022 at 13:46):
It could be, in the meanwhile for what concerns this very file I have almost killed all sorry's.
Eric Wieser (Jul 06 2022 at 13:48):
Either that, or the norm in question ought to be defined as a real instead
Eric Wieser (Jul 06 2022 at 13:48):
(I mean this as a suggestion for a follow-up for reintegration into mathlib, not something LTE needs to care about right now)
Johan Commelin (Jul 06 2022 at 13:49):
I need it ℕ
-valued because I want to do induction on the norm
Eric Wieser (Jul 06 2022 at 13:49):
You could prove the norm is equal to a casted nat and do induction on that
Eric Wieser (Jul 06 2022 at 13:51):
But arguably it would be cleaner to just allow arbitrary-typed norms, since then the norm on docs#free_abelian_group would just be a special case of an L1-norm on finsupp.
Filippo A. E. Nuccio (Jul 06 2022 at 13:58):
OK, I am done, the file is sorry-free.
Wrenna Robson (Jul 06 2022 at 14:48):
Yeah, nat-valued norms are useful in compsci stuff.
Wrenna Robson (Jul 06 2022 at 14:50):
The difficulty would be, like, presumably you'd only want to allow for one has_norm instance for a type, but then how do you signify what its value type is?
Yaël Dillies (Jul 06 2022 at 16:36):
has_norm the_return_type the_normed_type
?
Johan Commelin (Jul 06 2022 at 16:39):
Sure, but what will the type of norm x
be? Or do you want the return type to be an out_param
? Or do you want to write norm ℝ x
and norm ℕ x
, etc?
Yaël Dillies (Jul 06 2022 at 17:00):
We already have this problem for docs#inner, right? And the answer there is "localized notation".
Sebastien Gouezel (Jul 06 2022 at 17:18):
Or a global notation for the real-valued norm (which is the right norm in 99% of the cases), and specialized notation like we have for nnnorm
.
Joël Riou (Jul 06 2022 at 17:42):
(deleted)
Eric Wieser (Jul 06 2022 at 18:08):
I think norm ℝ x
is reasonable, keeping the existing notation for the norm and nnnorm special cases
Eric Wieser (Jul 06 2022 at 18:09):
I think we might end up in a nasty diamond mess if we're not careful though
Eric Wieser (Jul 06 2022 at 18:10):
Every real-norm induces an nnreal-norm, but the nnreal-norm induced on the product won't end up defeq to the one induced from the real-norm on the product.
Eric Wieser (Jul 06 2022 at 18:10):
Same for nat-norms inducing both other norms
Wrenna Robson (Jul 07 2022 at 09:39):
You could use something a bit like that you use for linear maps, like, ||.||[N]
Last updated: Dec 20 2023 at 11:08 UTC