Zulip Chat Archive
Stream: new members
Topic: Sylvester-Schur Basic Term Comparison Lemma: where to start?
J. J. Issai (project started by GRP) (Jul 08 2025 at 23:37):
I have a basic Lemma I am attempting formalize. It is about sequences of distinct natural numbers. The form is : Given natural numbers , and many naturals , and suppose are distinct. If , then the maximum of the is , with equality only if (after some rearranging) the are the set .
Aaron Liu (Jul 08 2025 at 23:40):
Do you have an informal proof? Maybe you can start there.
J. J. Issai (project started by GRP) (Jul 08 2025 at 23:41):
I think so, but my questions are a little different.
J. J. Issai (project started by GRP) (Jul 08 2025 at 23:42):
My first question is: should I try to formalize it with the equality condition in the same unit/object/proof, or should I settle for nonstrict inequality, and prove strictness in a different unit/object/proof?
Kenny Lau (Jul 08 2025 at 23:42):
depends on your proof
Kenny Lau (Jul 08 2025 at 23:42):
most likely you'll have a separate lemma that you use for the equality condition
Kenny Lau (Jul 08 2025 at 23:42):
so factor that lemma out
Kenny Lau (Jul 08 2025 at 23:43):
in general, every step in your proof should ideally be factored out as a separate lemma, if possible
Kenny Lau (Jul 08 2025 at 23:43):
it's better to have 100 short lemmas than to have 1 long theorem
J. J. Issai (project started by GRP) (Jul 08 2025 at 23:43):
OK. Is there something similar to this in MathLib that I can study?
Aaron Liu (Jul 08 2025 at 23:43):
In file#Analysis/InnerProductSpace/Basic, cauchy schwartz inequality and equality are proved separately
J. J. Issai (project started by GRP) (Jul 08 2025 at 23:46):
OK. My use case is the following: I have n+1 through n+k, I have some distinct numbers a_i, and I know max(a_i)-min(a_i)>k, so that there is a gap. I want to use that fact along with this Term Comparison tool to conclude n+k < max(a_i), where I want strictness.
J. J. Issai (project started by GRP) (Jul 08 2025 at 23:46):
Is there a way I can package the separate parts so that I can use the thing I really want, which is the strict inequality?
J. J. Issai (project started by GRP) (Jul 08 2025 at 23:47):
of course, I have prod a_i >= prod (n+i)
J. J. Issai (project started by GRP) (Jul 08 2025 at 23:51):
Or do I need to develop a use case tactic, like: show a_i are distinct, show product a_i \ge \prod(n+i) , deduce n+k<= max a_k, show max(a_i) - min(a_i)>k, deduce max a_k > n+k?
And then reuse this tactic every time I need to use the tool?
J. J. Issai (project started by GRP) (Jul 08 2025 at 23:51):
Perhaps tactic is the wrong word here. Repeated inline code template perhaps?
Kenny Lau (Jul 08 2025 at 23:52):
what you call a tactic is what i call a lemma
J. J. Issai (project started by GRP) (Jul 08 2025 at 23:54):
OK. Then I guess in addition to the Term Comparison Lemma, I need a Get strictness lemma as well.
J. J. Issai (project started by GRP) (Jul 08 2025 at 23:55):
So that if I satisfy the conditions of the strictness Lemma, I get a strictness result. Is there somewhere in MathLib which expresses that a sequence of naturals is distinct, i.e. if a_i=a_j then i=j?
J. J. Issai (project started by GRP) (Jul 09 2025 at 00:17):
Right now my informal proof is by contraposition: If I have many distinct naturals , and I relabel them to where now iff , and if for all the , and there is at least one such that , then .
J. J. Issai (project started by GRP) (Jul 09 2025 at 00:21):
However, when I take the contrapositive, I get something not far from implies either there is no with , or else there is one with . It is hard to unwrap this to get a statement like max . Perhaps I should just make a Lemma using ordered sequences?
Matt Diamond (Jul 09 2025 at 01:53):
Is there somewhere in MathLib which expresses that a sequence of naturals is distinct, i.e. if a_i=a_j then i=j?
I can't help with the rest but this is docs#Function.Injective
J. J. Issai (project started by GRP) (Jul 09 2025 at 18:15):
Hmm. It's sounding like I have to take my sequence and turn it into a function, and work with that internally. Will I be able to set up an interface so that I can pass a sequence into a Lemma (along with , say, four other parameters) and get out the result? I would prefer not to have to rephrase all my other work into functions.
Aaron Liu (Jul 09 2025 at 18:22):
What do you mean by this?
Aaron Liu (Jul 09 2025 at 18:23):
How are you representing your sequences right now?
Aaron Liu (Jul 09 2025 at 18:23):
The standard way is using a function.
Kenny Lau (Jul 09 2025 at 18:24):
i hope you aren't using List
Aaron Liu (Jul 09 2025 at 18:26):
List is hard to work with
Aaron Liu (Jul 09 2025 at 18:26):
You should use Fin k → Nat
J. J. Issai (project started by GRP) (Jul 09 2025 at 18:26):
I have not committed to a Lean representation. I would like to hear options.
J. J. Issai (project started by GRP) (Jul 09 2025 at 18:28):
As the "natural" proof is written, I have a number N which I can factor into many divisors, since N is the RHS of an inequality and the lefthandside is a product of $k-t$ many consecutive terms of the form .
Aaron Liu (Jul 09 2025 at 18:28):
If you use a function you get to have fun with docs#Finset.prod
J. J. Issai (project started by GRP) (Jul 09 2025 at 18:29):
and the divisors are tweaked into a sequence which I use to conclude that max(sequence) > max(n+i) where I take the maximum of the left hand side (usually n+k-t).
J. J. Issai (project started by GRP) (Jul 09 2025 at 18:30):
And so if I use a function I guess I can take advantage of things like Finset.prod. But it is unclear if the Lemma I seek already exists in mathlib, after several search attempts.
J. J. Issai (project started by GRP) (Jul 09 2025 at 18:35):
It may be that I have to deal with Finset.prod and related objects. Who has experience using it to compare it with other similar representations? I am willing to use it if it is relatively fast. I also wouldn't mind building some things from scratch if I have a good example to trim down to what I need.
Last updated: Dec 20 2025 at 21:32 UTC