Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

feat(combinatorics/simple_graph): Construct a tripartite graph from its triangles #19202

Closed
wants to merge 2 commits into from

Conversation

YaelDillies
Copy link
Collaborator

@YaelDillies YaelDillies commented Jun 18, 2023

Both the lower bound of the Ruzsa-Szemerédi problem and the proof of the corners theorem define an auxiliary tripartite graph by specifying its triangles and showing that there are no more.

This PR provides the boilerplate for this construction. It greatly simplifies both proofs.

Co-authored-by: Bhavik Mehta [email protected]


Open in Gitpod

@YaelDillies YaelDillies requested a review from a team as a code owner June 18, 2023 09:27
@YaelDillies YaelDillies added awaiting-review The author would like community review of the PR blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. t-combinatorics Combinatorics labels Jun 18, 2023
@github-actions github-actions bot added the modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. label Jun 18, 2023
@kim-em kim-em added too-late This PR was ready too late for inclusion in mathlib3 not-too-late This PR was ready at the point mathlib3 was frozen: we will try to merge it and port it to mathlib4 and removed too-late This PR was ready too late for inclusion in mathlib3 labels Jul 16, 2023
Comment on lines +105 to +113
@[simp] lemma locally_linear_comap {G : simple_graph β} {e : α ≃ β} :
(G.comap e).locally_linear ↔ G.locally_linear :=
begin
refine ⟨λ h, _, _⟩,
{ rw [←comap_map_eq e.symm.to_embedding G, comap_symm, map_symm],
exact h.map _ },
{ rw [←equiv.coe_to_embedding, ←map_symm],
exact locally_linear.map _ }
end
Copy link
Member

Choose a reason for hiding this comment

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

Is one direction of this true for embeddings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This comment belongs to #19201.

I cannot really work on it because I need #19203 to be in, but I suspect the only implication that can be weakened is G.locally_linear → (G.map f).locally_linear.


instance : decidable G.edge_disjoint_triangles :=
decidable_of_iff ((G.clique_finset 3 : set (finset α)).pairwise $ λ x y, (x ∩ y).card ≤ 1) $
by simpa only [coe_clique_finset, edge_disjoint_triangles, finset.card_le_one, ←coe_inter]
Copy link
Member

Choose a reason for hiding this comment

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

This might be worth extracting as a lemma.


/-- The underlying relation of the tripartite-from-triangles graph. Two vertices are related iff
there exists a triangle index containing them both. -/
@[mk_iff] inductive rel (t : finset (α × β × γ)) : α ⊕ β ⊕ γ → α ⊕ β ⊕ γ → Prop
Copy link
Member

Choose a reason for hiding this comment

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

α × β × γ feels like a rather strange representation of a triangle, as it isn't order-invariant. Would it be correct to use "ordered triangles" in the docstring; and do you actually end up needing this ordering?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Those are not the triangles but the triangle indices. The triangle index (a, b, c) corresponds to the triangle {in₀ a, in₁ b, in₂ c} (which is unordered, even though the in₀, in₁, in₂ make it morally ordered). I definitely need the order in my applications, since α, β, γ won't even be the same.

Comment on lines +81 to +92
@[simp] lemma in₀₁_iff : (graph t).adj (in₀ a) (in₁ b) ↔ ∃ c, (a, b, c) ∈ t :=
⟨by { rintro ⟨⟩, exact ⟨_, ‹_›⟩ }, λ ⟨_, h⟩, in₀₁ h⟩
@[simp] lemma in₁₀_iff : (graph t).adj (in₁ b) (in₀ a) ↔ ∃ c, (a, b, c) ∈ t :=
⟨by { rintro ⟨⟩, exact ⟨_, ‹_›⟩ }, λ ⟨_, h⟩, in₁₀ h⟩
@[simp] lemma in₀₂_iff : (graph t).adj (in₀ a) (in₂ c) ↔ ∃ b, (a, b, c) ∈ t :=
⟨by { rintro ⟨⟩, exact ⟨_, ‹_›⟩ }, λ ⟨_, h⟩, in₀₂ h⟩
@[simp] lemma in₂₀_iff : (graph t).adj (in₂ c) (in₀ a) ↔ ∃ b, (a, b, c) ∈ t :=
⟨by { rintro ⟨⟩, exact ⟨_, ‹_›⟩ }, λ ⟨_, h⟩, in₂₀ h⟩
@[simp] lemma in₁₂_iff : (graph t).adj (in₁ b) (in₂ c) ↔ ∃ a, (a, b, c) ∈ t :=
⟨by { rintro ⟨⟩, exact ⟨_, ‹_›⟩ }, λ ⟨_, h⟩, in₁₂ h⟩
@[simp] lemma in₂₁_iff : (graph t).adj (in₂ c) (in₁ b) ↔ ∃ a, (a, b, c) ∈ t :=
⟨by { rintro ⟨⟩, exact ⟨_, ‹_›⟩ }, λ ⟨_, h⟩, in₂₁ h⟩
Copy link
Member

Choose a reason for hiding this comment

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

Is it definitely not worth generalizing to n-cliques (and sigma) so that you don't need to repeat things 3 times?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have exactly three applications in mind for this API, and they all use triangles (hell, even locally linear graphs are only about triangles). The point of this API is to repeat things 3 times only once (understand, not in the applications). In contrast, using sigma will result in an overhead in the applications.

@mathlib-dependent-issues-bot mathlib-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Nov 18, 2023
@mathlib-dependent-issues-bot
Copy link
Collaborator

This PR/issue depends on:

@YaelDillies
Copy link
Collaborator Author

Ported to LeanCamCombi

@YaelDillies YaelDillies deleted the tripartite_from_triangles branch November 18, 2023 11:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting-review The author would like community review of the PR modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. not-too-late This PR was ready at the point mathlib3 was frozen: we will try to merge it and port it to mathlib4 t-combinatorics Combinatorics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants