Skip to content

Conversation

@ctchou
Copy link
Collaborator

@ctchou ctchou commented Feb 13, 2025

Per Yaël's suggestion:

https://leanprover.zulipchat.com/#narrow/channel/116395-maths/topic/Proof.20of.20the.20LYM.20inequality.20using.20probability.20theory

I'm contributing this proof. I'm not sure I'm putting the file in the right directory, though. Let me know where I should place it and I'll update the PR.

Copy link
Owner

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

Below is a first round of comments, and here are a few general remarks:

  • You are not following the naming convention wrt to lowerCamelCasing definitions in lemma names and prefixing head operations (eg foo.card should become card_foo in a lemma name)
  • Since it's a result from the Combinatorics course, it should go in the PlainCombi folder.
  • All the numbering stuff not specific to antichains is the Katona circle method. Could you move it to a new file? (also in the PlainCombi folder)
  • I dislike calling this the "probability theory" proof of LYM: It's neither probabilistic in the sense that it shows some object exists because it exists with positive probability, nor is it the only proof that manipulates probabilities (although I can't remember which other proof I am thinking off). A better description would be that it is a double-counting argument on maximal chains passing through a point of the antichain (note that the Katona circle method is precisely double-counting with maximal chains)
  • Nice work! 😁

@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes label Feb 13, 2025
@ctchou
Copy link
Collaborator Author

ctchou commented Feb 14, 2025

@YaelDillies, If I split out the code not related to anti-chains to a different file, what should I call it?

More generally, I may need you write the comments, since I don't know much combinatorics yet. Currently I don't really know what terms like "double counting" and "Katona circle method" mean.

@ctchou ctchou force-pushed the personal/ctchou/prob-lym branch from 06acfa6 to e0f7088 Compare February 14, 2025 03:10
@ctchou
Copy link
Collaborator Author

ctchou commented Feb 14, 2025

@YaelDillies, I incorporated most of your comments and changed the naming convention. However, I did not change the definition of NumberIngOn as you suggested, because the proof of the theorem equiv_IsPrefix_Numbering2 (previously is_prefix_equiv) is very fragile and I do not yet know how much impact your suggested definition will have.

@YaelDillies YaelDillies force-pushed the personal/ctchou/prob-lym branch from e0f7088 to 0bc5775 Compare February 14, 2025 13:27
@YaelDillies YaelDillies changed the title A proof of LYM inequality using probability PlainCombi: LYM inequality using the Katona circle method Feb 14, 2025
@YaelDillies
Copy link
Owner

If I split out the code not related to anti-chains to a different file, what should I call it?

Keep it in the current file. Split out the rest to PlainCombi.KatonaCircle.

More generally, I may need you write the comments, since I don't know much combinatorics yet. Currently I don't really know what terms like "double counting" and "Katona circle method" mean.

I am happy to do that when I have time.

I did not change the definition of NumberIngOn as you suggested, because the proof of the theorem equiv_IsPrefix_Numbering2 (previously is_prefix_equiv) is very fragile and I do not yet know how much impact your suggested definition will have.

Working on it!

@ctchou
Copy link
Collaborator Author

ctchou commented Feb 14, 2025

I can give your NumberingOn suggestion a try today. I didn't have time yesterday.

@ctchou
Copy link
Collaborator Author

ctchou commented Feb 15, 2025

@YaelDillies, I just pushed a new commit, in which I tried to use Numbering to define NumberingOn, as you suggested. I was able to fix the first few failures in the proof of equiv_IsPrefix_NumberingOn2, but I got stuck on the failures on lines 100 and 107. Without fixing them, the remaining failures cannot be fixed. Lines 100 and 107 are in the term mode, where I don't know my way around. I need your help on this.

@ctchou
Copy link
Collaborator Author

ctchou commented Feb 15, 2025

Instead of fixing each failure in the proof of equiv_IsPrefix_NumberingOn2, I think I'm going to prove the equivalence of the old and new definitions of NumberingOn and connect the old proof with the new definition via the equivalence. This way I don't have to touch the tricky proof. It will take me some time to do this, as I have other commitments.

@YaelDillies
Copy link
Owner

"Working on it" is usually shorthand for "I have 100 lines of uncommitted edits. Please don't edit simultaneously so that we avoid conflicts" 😅

@ctchou
Copy link
Collaborator Author

ctchou commented Feb 15, 2025

OK, I'll revert my commit and wait for you.

@ctchou
Copy link
Collaborator Author

ctchou commented Feb 15, 2025

Just pushed the revert. In the meantime, I'll play in the branch personal/ctchou/prob-lym-OLD-*, so that the PR is not impacted.

@ctchou
Copy link
Collaborator Author

ctchou commented Feb 16, 2025

In the branch personal/ctchou/prob-lym-OLD-2, NumberingOn is removed altogether. I did not try to fix the proof of equiv_IsPrefix_NumberingOn2, but kept the old proof with its old goal and used that result to prove the new equiv_IsPrefix_Numbering2.

@YaelDillies YaelDillies force-pushed the personal/ctchou/prob-lym branch from d1de62c to 3f2c83a Compare February 16, 2025 00:31
@YaelDillies
Copy link
Owner

Okay, done. Could you now do the KatonaCircle split?

@ctchou
Copy link
Collaborator Author

ctchou commented Feb 16, 2025

I just did the split. I did not touch the comments, which are duplicated in both files. I guess you want to call ProbLYM.lean some other name now.

@ctchou
Copy link
Collaborator Author

ctchou commented Feb 16, 2025

I'm a bit mystified by your code: how did you manage to get rid of NumberingOn without invoking the theorem Fintype.card_coe anywhere? I found it necessary to use the theorem in many places in the proof of equiv_IsPrefix_Numbering2 when I tried it.

@YaelDillies
Copy link
Owner

I'm a bit mystified by your code: how did you manage to get rid of NumberingOn without invoking the theorem Fintype.card_coe anywhere?

🧙 (I used simp)

@YaelDillies YaelDillies force-pushed the personal/ctchou/prob-lym branch from f05e5b7 to 5867643 Compare February 16, 2025 12:44
@YaelDillies
Copy link
Owner

Not sure how that happened, but you managed to do the exact opposite split to what I had in mind. I've turned it around and golfed your proof to use Finset.dens instead of the much heavier probability theoretic setup (they are wholly equivalent, but the former only imports basic finiteness).

Thanks for everything! Looking forward to the next one.

@YaelDillies YaelDillies merged commit da0f82e into master Feb 16, 2025
4 checks passed
@YaelDillies YaelDillies deleted the personal/ctchou/prob-lym branch February 16, 2025 12:48
@YaelDillies YaelDillies removed the awaiting-author A reviewer has asked the author a question or requested changes label Feb 16, 2025
@ctchou
Copy link
Collaborator Author

ctchou commented Feb 16, 2025

Not sure how that happened, but you managed to do the exact opposite split to what I had in mind.

Because of what you wrote above:

[I asked:] If I split out the code not related to anti-chains to a different file, what should I call it?
Keep it in the current file. Split out the rest to PlainCombi.KatonaCircle.

Either I misread your answer, or you misread my question.

@YaelDillies
Copy link
Owner

Ooh, I had read "related to antichains" instead of "not related to antichains".

@ctchou
Copy link
Collaborator Author

ctchou commented Feb 16, 2025

One more question for my education: What is the difference between simps [...] using e and simps [..., e]? I realize that the latter doesn't work in many places where you have used the former, but I don't understand why.

@YaelDillies
Copy link
Owner

I assume you mean simpa, not simps.

simpa [lemmas] using term is the same as

have hyp := term
simp [lemmas] at hyp ⊢
exact hyp

You can see how this is more powerful than simp [lemmas, term], because it gets to simplify term and also unify up to defeq at the end (instead of just synteq).

@ctchou
Copy link
Collaborator Author

ctchou commented Feb 17, 2025

Thanks for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants