# What is the proper way to write logic formula, say concerning graph theory?

Say for example I'd like to state that there exists a pair of vertices such that they form an edge in one graph but not some other graph. I'd go about it as follows:

$$\exists u, v \in V, (u,v) \in G, (u,v) \not\in H$$

My main question here is: Is my use of commas fine (it seems odd, since there's commas between $$u$$ and $$v$$ already which don't seem to be used in the same manner), or should I use vertical lines, colons, semicolons, logical $$\land$$ ... and if so where exactly? Is there a proper way to do this which I just haven't found or is me assuming everyone has their own distinct way correct?

• I think people often use "$:$", i.e. $u, v \in V\colon\ \ldots$. I think here spacing is more important than punctuation marks. Is there a compelling reason to overuse math? I personally always write it as "There exist $u, v \in V$ such that $(u,v) \in G$ and $(u,v) \not\in H$". (Also, just in case, you can write $(u,v) \in G \setminus H$) Feb 6, 2023 at 18:41
• Or you could avoid the bound variables altogether with $G \setminus H\ne\emptyset$
– rici
Feb 6, 2023 at 20:16
• @Dmitry I agree it may be clearer to just write out some parts Feb 7, 2023 at 14:25

The standard logical notation I have seen among computer scientists for saying there exists $$x \in X$$ such that $$\varphi(x)$$ holds is to write

$$\exists x \in X . \varphi(x).$$

In other words, we use a period. Sometimes people will instead write

$$\exists x \in X \; \varphi(x)$$

i.e., they use no separator (just some space). There are many more variants, for instance I have seen $$(\exists x \in X) (\varphi(x))$$ in communities that are more focused on mathematics or logic.

So, in short, there are many conventions. Ultimately, I think if you use a comma, people will understand what you mean.

If it were me, I would write something like

$$\exists u,v \in V . (u,v) \in G \land (u,v) \notin H,$$

and use logical connectives (like $$\land$$) to express a series of statements that must be true, rather than listing them with commas. But I think people will understand what you wrote.