Skip to content

Conversation

@yahelmanor
Copy link
Collaborator

@yahelmanor yahelmanor commented Feb 1, 2025

Proof of theorem 1.17 from the the lecture notes. Closes #38.

The proof is slightly different for the lecture notes. As far as i understand, the original proof claims that given that #U ≤ 3 * r and ∀ a ∈ 𝒜, l + 1 ≤ #(a ∩ U) then #𝒜 ≤(3 * r).choose (l+1) * n.choose (r - (l+1)). I think this might be wrong as the bound should be something like the sum over i from 1 to r-l of (3 * r).choose (l+i) * (n-(l+i)).choose (r - (l+i)), and it is not clear to me how to recover the original bound from that. Instead i just bound this by the simpler bound of 2 ^ (3*r) * ((n - k).choose (r-(k+1)) * r).

@YaelDillies YaelDillies changed the title Plain combi: Upper bound on intersecting families PlainCombi: Upper bound on intersecting families Feb 1, 2025
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.

Great work! Here's a style review. I will review the proof later

Copy link
Owner

Choose a reason for hiding this comment

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

Can you follow the UpperCamelCase convention for file names?

Eq.symm (Nat.le_antisymm (inter A₁ A₁_in_𝒜 A₂ A₂_in_𝒜) (Nat.lt_succ.mp card_x₁_x₂))
by_cases s_eq_inter_all : ∃ s , (k ≤ s.card) ∧ (∀a∈𝒜, s ⊆ a)
. obtain ⟨s,_,s_inter_a⟩ := s_eq_inter_all
let mp : (Finset α) → Finset α := fun a' ↦ (a'\s)
Copy link
Owner

Choose a reason for hiding this comment

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

Instead of defining it with a let, you can write this function (\. \ s) wherever you need it (sorry, can't type unicode right now)

have k_le_inter := inter A₁ A₁_in_𝒜 A₂ A₂_in_𝒜
have inter_eq_k : #(A₁ ∩ A₂) = k :=
Eq.symm (Nat.le_antisymm (inter A₁ A₁_in_𝒜 A₂ A₂_in_𝒜) (Nat.lt_succ.mp card_x₁_x₂))
by_cases s_eq_inter_all : ∃ s , (k ≤ s.card) ∧ (∀a∈𝒜, s ⊆ a)
Copy link
Owner

Choose a reason for hiding this comment

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

You tend to write too many brackets

Suggested change
by_cases s_eq_inter_all : ∃ s , (k ≤ s.card)(∀a∈𝒜, s ⊆ a)
by_cases s_eq_inter_all : ∃ s, k ≤ #s ∧ ∀a∈𝒜, s ⊆ a

and can you make sure to use the # notation wherever possible?

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.

I think I figured out the argument you were missing. cf Zulip because typesetting on github seems a bit broken

Comment on lines 36 to 37
def IsIntersectingFamily (l : ℕ) (𝒜 : Finset (Finset α)) : Prop :=
∀ a ∈ 𝒜, ∀ b ∈ 𝒜, l ≤ (a ∩ b).card
Copy link
Owner

Choose a reason for hiding this comment

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

Can you move this out of the Finset namespace and generalise to

Suggested change
def IsIntersectingFamily (l : ℕ) (𝒜 : Finset (Finset α)) : Prop :=
∀ a ∈ 𝒜, ∀ b ∈ 𝒜, l ≤ (a ∩ b).card
def IsIntersectingFamilyWith (l : ℕ) (𝒜 : Set (Finset α)) : Prop :=
∀ a ∈ 𝒜, ∀ b ∈ 𝒜, l ≤ #(a ∩ b)

Comment on lines 69 to 84
_ = (Fintype.card α - (k + 1)).choose (Fintype.card α - (k + 1) - (r - (k + 1))) := by
rw [Nat.choose_symm];omega
_ = (Fintype.card α - (k + 1)).choose (Fintype.card α - r) := by congr 1;omega
_ = (Fintype.card α - k - 1).choose (Fintype.card α - r) := by congr 1
Copy link
Owner

Choose a reason for hiding this comment

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

I would expect something like the following to work

Suggested change
_ = (Fintype.card α - (k + 1)).choose (Fintype.card α - (k + 1) - (r - (k + 1))) := by
rw [Nat.choose_symm];omega
_ = (Fintype.card α - (k + 1)).choose (Fintype.card α - r) := by congr 1;omega
_ = (Fintype.card α - k - 1).choose (Fintype.card α - r) := by congr 1
_ = (Fintype.card α - k - 1).choose (Fintype.card α - r) := by
rw [Nat.choose_symm]; omega

mul_assoc,←Nat.choose_succ_right_eq,mul_assoc]
omega
_ = (2 ^ (3*r) * (r * (Fintype.card α - k).choose (r-k) * (r-k)) / (Fintype.card α - k - (r - (k + 1)))) := by congr<;>omega
_ ≤ ( (Fintype.card α - k).choose (r-k) * (r-k) * (2 ^ (3*r) * r) / (Fintype.card α - k - (r - (k + 1)))) := by simp [←mul_assoc,Nat.le_of_eq,Nat.div_le_div_right,mul_comm]
Copy link
Owner

Choose a reason for hiding this comment

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

Can you make sure not to exceed 100 characters per line?

Comment on lines 48 to 50
theorem IsIntersectingFamily.card_le_of_sized {l r:ℕ} {𝒜 : Finset (Finset α)} (sized𝒜 : @Set.Sized α r 𝒜)
(inter : IsIntersectingFamily l 𝒜) (n_much_bigger_r :2 ^ (3 * r) * r * r+ 5 * r ≤ Fintype.card α):
#𝒜 ≤ ((Fintype.card α)-l).choose (r-l) := by
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
theorem IsIntersectingFamily.card_le_of_sized {l r:ℕ} {𝒜 : Finset (Finset α)} (sized𝒜 : @Set.Sized α r 𝒜)
(inter : IsIntersectingFamily l 𝒜) (n_much_bigger_r :2 ^ (3 * r) * r * r+ 5 * r ≤ Fintype.card α):
#𝒜 ≤ ((Fintype.card α)-l).choose (r-l) := by
theorem IsIntersectingFamily.card_le_of_sized {l r : ℕ} {𝒜 : Finset (Finset α)}
(sized𝒜 : 𝒜.toSet.Sized r) (inter : IsIntersectingFamily l 𝒜)
(n_much_bigger_r : 2 ^ (3 * r) * r * r + 5 * r ≤ Fintype.card α) :
#𝒜 ≤ (Fintype.card α - l).choose (r - l) := by

rw [card_sdiff]
exact congrFun (congrArg HSub.hSub (sized𝒜 x_in_𝒜)) #s
exact s_inter_a x x_in_𝒜
rw [←card𝒜_eq_cardℬ]
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
rw [←card𝒜_eq_cardℬ]
rw [← card𝒜_eq_cardℬ]

and below

@YaelDillies
Copy link
Owner

Can you please merge master? I've turned on the mathlib linters in the project, so you will need to fix a few things.

@YaelDillies
Copy link
Owner

Can you make sure to resolve the conversations you've dealt with? Also don't forget https://github.com/YaelDillies/LeanCamCombi/pull/41/files#r1938239953

@YaelDillies
Copy link
Owner

Hey, coming back to this: Are you planning on working on this further? If not, I'll gladly take over 😄

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.

Upper bound on l-intersecting families

2 participants