(I changed my mind and created this new topic to discuss the friendship theorem instead of discussing about it in the general topic "Graph Theory" (https://groups.google.com/d/topic/metamath/KdVXdL3IH3k/discussion).
Currently, there are two approaches to prove the friendship theorem from the "100 theorem list" (#83).
First approach
The first approach is described in topic "Best way to define things" (r00nk 16.01.2017 04:21, https://groups.google.com/d/topic/metamath/05rpwBurSmc/discussion).
This approach bases on the definitions and theorems for "Undirected Multigraphs" (~ df-umgra to ~ konigsberg in Mario's Mathbox, see also topic "set.mm update" (Mario Carneiro 16.04.2015 11:10, https://groups.google.com/d/topic/metamath/VAGNmzFkHCs/discussion). It uses the following definitions:
$( Undirected Simple Graph. This definition is loosely based on the UMGrph definition $)
${
$d e v x $.
df-usgra $a |- USGrph = { <. v , e >. | e : dom e -1-1-> { x e. ( ~P v \ { (/) } ) | ( # ` x ) = 2 } } $.
$}
${
$d x y z v e $.
df-cfrng $a |- FRNDGrph = { <. v , e >. | ( <. v , e >. e. USGrph ) /\ ( A. x e. v A. y e. v E! z ( ( ( z , x ) e. e ) /\ ( ( z , y ) e. e ) ) ) } $.
$}
The friendship theorem is formalized as follows:
${
$d x y z $.
frndshp $p |- ( <. v , e >. e. FRNDGrph ) -> ( E x ( ( x e. v ) /\ ( VDeg ` x = card ` ( v / x ) ) $= ? $.
$}
Second approach
I follow a different approach. My goal is to formailze the proof published in the paper "The friendship problem on graphs" of G.B. Mertizios and W. Unger (ROGICS'08, 12-17 May 2008, Mahida, Tunisia, pp 152-158), which is based on a purely combinatorial approach.
Although I use exactly the same definition (and name!) for undirected simple graphs (without loops) as r00nk, I need a definition for the neighbors of a vertex in an undirected simple graphs without loops ("called "graph" in short in the following):
${
$d e v x k n g f p $.
$( Define the class of all Neighbors of a vertex in a graph.
The neighbors of a vertex are all vertices which are connected with
this vertex by an edge.
(Contributed by Alexander van der Vekens, 11-Aug-2017.) $)
df-nbgra $a |- Neighbors = ( k e. _V , g e. ( _V X. _V )
|-> { n e. ( 1st ` g ) | [. ( 1st ` g ) / v ]. [. ( 2nd ` g ) / e ].
( v USGrph e /\ E. x e. dom e ( e ` x ) = { k , n } ) } ) $.
$}
Using this definition, I define the friendship graphs as follows:
${
$d e v k l f $.
$( Define the class of all Friendship Graphs.
A graph is called a friendship graph if every pair of its vertices has
exactly one common neighbor.
(Contributed by Alexander van der Vekens, 10-Aug-2017.) $)
df-frgra $a |- FriendGrph = { <. v , e >. | ( v USGrph e
/\ A. k e. v A. l e. v E. f e. v ( k =/= l
-> ( ( k Neighbors <. v , e >. ) i^i ( l Neighbors <. v , e >. ) ) = { f } ) ) } $.
$}
As in the paper of Mertizios and Unger, I want to show that "every friengship graph is a windmill graph", in Metamath syntax:
$( Any friendship graph is a windmill graph.
friswmgra $p |- ( V FriendGrph E -> V WindmillGrph E ) $=
? $.
with the following definition of a windmill graph:
${
$d e v k l f $.
$( Define the class of all Windmill Graphs.
A graph is called a windmill graph if there is one vertex which is a
neighbor of all other vertices, and the other vertices have exactly one
additional neighbor.
(Contributed by Alexander van der Vekens, 10-Aug-2017.) $)
df-wmgra $a |- WindmillGrph = { <. v , e >. | ( v USGrph e
/\ E. f e. v A. k e. v ( k =/= f -> E. l e. v
( l =/= f /\ ( k Neighbors <. v , e >. ) = { l , f } ) ) ) } $.
Second approach
I follow a different approach. My goal is to formailze the proof published in the paper "The friendship problem on graphs" of G.B. Mertizios and W. Unger (ROGICS'08, 12-17 May 2008, Mahida, Tunisia, pp 152-158), which is based on a purely combinatorial approach.
Although I use exactly the same definition (and name!) for undirected simple graphs (without loops) as r00nk, I need a definition for the neighbors of a vertex in an undirected simple graphs without loops ("called "graph" in short in the following):
${
$d e v x k n g f p $.
$( Define the class of all Neighbors of a vertex in a graph.
The neighbors of a vertex are all vertices which are connected with
this vertex by an edge.
(Contributed by Alexander van der Vekens, 11-Aug-2017.) $)
df-nbgra $a |- Neighbors = ( k e. _V , g e. ( _V X. _V )
|-> { n e. ( 1st ` g ) | [. ( 1st ` g ) / v ]. [. ( 2nd ` g ) / e ].
( v USGrph e /\ E. x e. dom e ( e ` x ) = { k , n } ) } ) $.This definition generalizes to UMGrph:df-nbgra $a |- Neighbors = ( g e. UMGrph , k e. ( 1st ` g ) |-> { n e. ( 1st ` g ) | { k , n } e. ran ( 2nd ` g ) ) } ) $.(I've reordered the arguments because of the dependency order.) Because of its generality, you probably shouldn't use this statement for reverse closure, meaning that the mention of UMGrph here can also just be replaced with _V.$}
Using this definition, I define the friendship graphs as follows:
${
$d e v k l f $.
$( Define the class of all Friendship Graphs.
A graph is called a friendship graph if every pair of its vertices has
exactly one common neighbor.
(Contributed by Alexander van der Vekens, 10-Aug-2017.) $)
df-frgra $a |- FriendGrph = { <. v , e >. | ( v USGrph e
/\ A. k e. v A. l e. v E. f e. v ( k =/= l
-> ( ( k Neighbors <. v , e >. ) i^i ( l Neighbors <. v , e >. ) ) = { f } ) ) } $.The quantifier order is a bit funky here. Shouldn't the E. f come after the k =/= l?df-frgra $a |- FriendGrph = { <. v , e >. | ( v USGrph e /\ A. k e. v A. l e. ( v \ { k } ) ( ( <. v , e >. Neighbors k ) i^i ( <. v , e >. Neighbors l ) ) ~~ 1o ) ) } $.
I don't like that this is more work to say than the first attempt without the definition:df-frgra $a |- FriendGrph = { <. v , e >. | ( v USGrph e /\ A. k e. v A. l e. ( v \ { k } ) E! x { { x , k } , { x , l } } C_ ran e ) } $.
Hopefully "Neighbors" pays for itself elsewhere.$}
As in the paper of Mertizios and Unger, I want to show that "every friengship graph is a windmill graph", in Metamath syntax:
$( Any friendship graph is a windmill graph.
friswmgra $p |- ( V FriendGrph E -> V WindmillGrph E ) $=? $.
with the following definition of a windmill graph:
${
$d e v k l f $.
$( Define the class of all Windmill Graphs.
A graph is called a windmill graph if there is one vertex which is a
neighbor of all other vertices, and the other vertices have exactly one
additional neighbor.
(Contributed by Alexander van der Vekens, 10-Aug-2017.) $)
df-wmgra $a |- WindmillGrph = { <. v , e >. | ( v USGrph e
/\ E. f e. v A. k e. v ( k =/= f -> E. l e. v
( l =/= f /\ ( k Neighbors <. v , e >. ) = { l , f } ) ) ) } $.Not a fan of the WindmillGrph definition, because it will probably only be used here. I also don't like it when 100 theorems are too obfuscated by definitions - they should try to be clear about the content of the theorem where feasible.
I will suggest this version again:friswmgra $p |- ( V FriendGrph E -> E. x e. V A. y e. ( V \ { x } ) { x , y } e. ran E ) $=One might argue that this doesn't fully specify the edge structure (specifically that every spoke vertex is connected only to the hub), but this follows trivially enough from the definition of FriendGrph that I think this is sufficient for the claim of "proving the friendship theorem".
I want to emphasize that this statement of friswmgra (are we calling it that? I'd much prefer something snappier like "friendship")
allows for infinite graphs, in which both the concept of a friendship graph and a windmill graph make sense, but I don't know if the theorem or the proof holds in this regime (I haven't researched the theorem). If you are interested in the infinite case, then you should not use VDeg, because that only makes sense in the finite case.
Mario
Hi Mario,
thank you very much for your comments and hints - they show that you have really much more experience with Metamath than I have, and it is a good advice to ask you for your opinion. On the other hand, it is always good to get a second opinion in general, because the other one sees problems/improvements to which oneself is "blind". I will consider your suggestions for my further work.
However, I have some remarks on your comments, see below.
Best regards,
Alexander
On Monday, October 2, 2017 at 12:51:51 PM UTC+2, Mario Carneiro wrote:On Mon, Oct 2, 2017 at 5:39 AM, 'Alexander van der Vekens' via Metamath <meta...@googlegroups.com> wrote:df-nbgra $a |- Neighbors = ( k e. _V , g e. ( _V X. _V )
|-> { n e. ( 1st ` g ) | [. ( 1st ` g ) / v ]. [. ( 2nd ` g ) / e ].
( v USGrph e /\ E. x e. dom e ( e ` x ) = { k , n } ) } ) $.This definition generalizes to UMGrph:df-nbgra $a |- Neighbors = ( g e. UMGrph , k e. ( 1st ` g ) |-> { n e. ( 1st ` g ) | { k , n } e. ran ( 2nd ` g ) ) } ) $.(I've reordered the arguments because of the dependency order.) Because of its generality, you probably shouldn't use this statement for reverse closure, meaning that the mention of UMGrph here can also just be replaced with _V.
I like your definition - it is very concise, much shorter and maybe easier to use. However, it may be useful to assume that ( G Neighbors k ) = (/) if G e/ UMGrph in some proofs, and I do not see any meaning of the term "neighbor" outside the context of a graph.
df-frgra $a |- FriendGrph = { <. v , e >. | ( v USGrph e
/\ A. k e. v A. l e. v E. f e. v ( k =/= l
-> ( ( k Neighbors <. v , e >. ) i^i ( l Neighbors <. v , e >. ) ) = { f } ) ) } $.The quantifier order is a bit funky here. Shouldn't the E. f come after the k =/= l?df-frgra $a |- FriendGrph = { <. v , e >. | ( v USGrph e /\ A. k e. v A. l e. ( v \ { k } ) ( ( <. v , e >. Neighbors k ) i^i ( <. v , e >. Neighbors l ) ) ~~ 1o ) ) } $.Because of ~ r19.37zv, both definitions should be equivalent, since if v = (/), A. k e. v ... is always true (see ~ ral0 ), aren't they?
I don't like that this is more work to say than the first attempt without the definition:df-frgra $a |- FriendGrph = { <. v , e >. | ( v USGrph e /\ A. k e. v A. l e. ( v \ { k } ) E! x { { x , k } , { x , l } } C_ ran e ) } $.OK, this could be an alternative definition. I'll check if this will save effort during the proofs. However, I do not see yet if ` A. l e. ( v \ { k } ) ph ` is easier to use than ` A. l e. v ( l =/= k -> ph ) `
df-wmgra $a |- WindmillGrph = { <. v , e >. | ( v USGrph e
/\ E. f e. v A. k e. v ( k =/= f -> E. l e. v
( l =/= f /\ ( k Neighbors <. v , e >. ) = { l , f } ) ) ) } $.Not a fan of the WindmillGrph definition, because it will probably only be used here. I also don't like it when 100 theorems are too obfuscated by definitions - they should try to be clear about the content of the theorem where feasible.I think the concept of a windmill graph is very helpful for visualizing the graphs (in one's mind and on paper).Therfore, it could help to understand certain problems. Additionally, the proof in the paper of Mertzios and Unger relies on windmill graphs. Therefore I do not know how difficult it will be to prove the theorem without that concept.
I will suggest this version again:friswmgra $p |- ( V FriendGrph E -> E. x e. V A. y e. ( V \ { x } ) { x , y } e. ran E ) $=One might argue that this doesn't fully specify the edge structure (specifically that every spoke vertex is connected only to the hub), but this follows trivially enough from the definition of FriendGrph that I think this is sufficient for the claim of "proving the friendship theorem".Although it should be sufficient to prove this theorem to count for the 100 theorem list, it can be proven that ( V =/= (/) -> ( V FriendGrph E <-> V WindmillGrph E ) ) (sorry, my previously mentioned theorem friswmgra, which represent only one direction of the equivalence, is also valid only for V =/= (/), because (/) FriendGrph E can be true, while (/) WindmillGrph E is always false).
I want to emphasize that this statement of friswmgra (are we calling it that? I'd much prefer something snappier like "friendship")... I called the theorem ( V =/= (/) -> ( V FriendGrph E <-> V WindmillGrph E ) ) "friendship" ...allows for infinite graphs, in which both the concept of a friendship graph and a windmill graph make sense, but I don't know if the theorem or the proof holds in this regime (I haven't researched the theorem). If you are interested in the infinite case, then you should not use VDeg, because that only makes sense in the finite case.Unfortunately, I didn't read anything about the special case of infinite graphs yet. In the original paper of Erdös at al., it is explictly assumed that only finite graphs are considered. I'll continue not to distinguish between finite and infinite graphs as long as this causes no problems within any proof...
Unfortunately, finishing my version of the metamath proof has been tumblingaround the bottom of my to do list for a rather long time now. I think it's safeto say mine is not going to be finished, so your version wont be a repeat.However, I'd like to share the paper version of my proof. I'm not sure if itsbeen done like this before, I've (re)discovered this version myself. Here's arough outline of it:
1. In any graph where there exists a n-path between any 2 vertices, if thereexits a k-cycle, where k > n, then there must exist a (k-1)-cycle also in thatgraph.
2. There is no 4-cycle in a friendship graph.
3. Due to steps 1 and 2, there is no cycle in a friendship graph higher then 3.
4. Every element of a friendship graph must have degree >= 2.
5. Due to step 3 and 4, friendship graphs are entirely composed of 3-cycles.
6. The only way to merge any number of 3-cycles without creating a 4-cycle isto connect them at one vertice.
7. Thus, a friendship graph is composed of cycles connected by one vertice.
If we succeed in proving the friendship theorem in this way, we shoul publish it in a paper ;-).
1. In any graph where there exists a n-path between any 2 vertices, if thereexits a k-cycle, where k > n, then there must exist a (k-1)-cycle also in thatgraph.I think this is valid only for n>1 and k>3 (maybe depending on how a cycle is defined - do you think two nodes connected by an edge should be regared as 2-cycle? Using my definition, this is not possible).Furthermore, to prove the friendship theorem, it should be sufficient to consider the case n=2 (see step 3.).
To prove this statement for n=2, we take a k-cycle and construct a (k-1)-cycle from it by cutting short two vertices:k-cycle: ... - v_(k-1) - v_k - v_1 - v_2 - v_3 - ...(k-1)-cycle: ... - v_(k-1) - v_k - v_x - v_3 - ...The edge { v_k , v_x } exists because there is a path of length 2 between v_k and v_3,and therefore there must be a vertex v_x with the edges { v_k , v_x }.
However, this argument is only valid for k >=6! For k=5, v_x could be v_4, so the constructed "(5-1)-cycle" would be the path v_5 - v_4 - v_3 which is not a 4-cycle (unless you regard a 2-path x-y-z as a 4-cycle ... x - y - z - y - x ... , which is not possible with my definition). Since the case k=5 is essential for step 3, this must be clarified first.
Hi Mario,
I started to prove some theorems for Neighbors defined as you proposed:
df-nbgra $a |- Neighbors = ( g e. _V , k e. ( 1st ` g ) |-> { n e. ( 1st ` g ) | { k , n } e. ran ( 2nd ` g ) } ) $)
But I got stuck because of the usage of the first argument in the base set of the second argument ( k e. ( 1st ` g ) ).
I tried to prove something analogous to ~ elmpt2cl, like
elmpt2clop.f $e |- F = ( x e. A , y e. ( 1st ` x ) |-> C ) $.
elmpt2clop $p |- ( X e. ( <. R , S >. F T ) -> ( <. R , S >. e. A /\ T e. R ) ) $=
but I ended up in disjoint variable violations in all of my attempts. I found your theorems ~ cbvmpt2x and ~ dmmpt2ssx which go in the same direction, but I found no way to apply them.
It would be very great if you can give me a hint how to solve this problem.
My goal of all of this is to prove
nbusgra $p |- ( V USGrph E -> ( <. V , E >. Neighbors N ) = { n e. V | { N , n } e. ran E } ) $=
for an arbitrary N ( for N e. V this is easy; for N e/ V, there should be no neighbors: ( <. V , E >. Neighbors N ) = (/) ). With my previous definition of Neighbors, I could prove a theorem of that kind.
I made some progress in proving the friendship theorem. At least I could prove Proposition 1 of Mertzios and Unger, see de, see 2pthfrgrarn2 and n4cyclfrgra. Furthermore, I tried different approaches to prove the assumption of r00nk that in a friendship graph there are no 5-cycles. However, I did not succeed in any case. Starting with a 5-cycle and adding new common neighbors to reach a contradiction (ie. to get an 4-cycle) results in more and more new vertices. But maybe this could be a promising approach: To show that if a friendship graph contains a 5-cycle, it must be non-finite, by constructing an endless chain of vertices to be added to this cycle to fulfill the friendship condition.
Does anybody has an idea how to prove that in a friendship graph there are no 5-cycles (without using the friendship theorem, of course)?