The uniform random graph G(n, 1/2) #
Cslib.Logic.FO.graph.randomGraph n is the uniform distribution on the labelled simple graphs
with vertex set Fin n, the random graph G(n, 1/2) of the 0-1 law for first-order logic
[Fag76] [Libkin2004, Section 12.1]. Cslib.Logic.FO.graph.randomGraphProb n P is the
probability that it has the property P, that is, the fraction of the labelled graphs on Fin n
with P.
Besides the basic API (complement, monotonicity, union bound), this file records a counting
principle: a property exchanged with its negation by an involution of the graphs on Fin n has
probability exactly 1/2. Toggling one potential edge is such an involution, so every potential
edge is present with probability 1/2, and for n ≥ 2 the number of edges is even with
probability exactly 1/2.
randomGraph n is Mathlib's binomial random graph G(Fin n, p) (SimpleGraph.binomialRandom) at
p = 1/2: under both, every labelled graph on Fin n has the same probability
(Cslib.Logic.FO.graph.binomialRandom_real_eq_randomGraphProb).
Main definitions #
Cslib.Logic.FO.graph.randomGraph: the uniform distribution onSimpleGraph (Fin n).Cslib.Logic.FO.graph.randomGraphProb: the probability of a graph property under it.
Main results #
Cslib.Logic.FO.graph.randomGraphProb_eq: the probability is a ratio of graph counts.Cslib.Logic.FO.graph.randomGraphProb_not,Cslib.Logic.FO.graph.randomGraphProb_mono,Cslib.Logic.FO.graph.randomGraphProb_exists_le: complement, monotonicity, union bound.Cslib.Logic.FO.graph.randomGraphProb_eq_half_of_involutive: probability1/2from an involution exchanging a property and its negation.Cslib.Logic.FO.graph.randomGraphProb_adj: each potential edge has probability1/2.Cslib.Logic.FO.graph.randomGraphProb_evenEdges: an even number of edges has probability1/2.Cslib.Logic.FO.graph.binomialRandom_real_eq_randomGraphProb:G(Fin n, 1/2)is the uniform random graph.
References #
The uniform random graph G(n, 1/2): the uniform distribution on the labelled simple
graphs with vertex set Fin n [Libkin2004, Section 12.1].
The probability that G(n, 1/2) has the property P.
The probability of P is the fraction of labelled graphs on Fin n with property P.
The probability of ¬ P is one minus the probability of P.
A property of positive probability holds for some graph.
Union bound.
If an involution of the graphs on Fin n exchanges P and ¬ P, then P has probability
exactly 1/2.
In G(n, 1/2), each potential edge is present with probability 1/2.
For n ≥ 2, G(n, 1/2) has an even number of edges with probability exactly 1/2.
G(n, 1/2) is the uniform random graph #
G(n, 1/2) is the uniform random graph. At p = 1/2 every labelled graph on Fin n has
the same probability 2 ^ (-n (n - 1) / 2), so the probability of a graph property in
G(Fin n, p) is its probability randomGraphProb n P in Cslib.Logic.FO.graph.randomGraph.