Type  Label  Description 
Statement 

Theorem  frgrwopreglem5 27301* 
Lemma 5 for frgrwopreg 27303. If 𝐴 as well as 𝐵 contain at least
two vertices, there is a 4cycle in a friendship graph. This
corresponds to statement 6 in [Huneke]
p. 2: "... otherwise, there
are two different vertices in A, and they have two common neighbors in
B, ...". (Contributed by Alexander van der Vekens, 31Dec2017.)
(Proof shortened by AV, 5Feb2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐷 = (VtxDeg‘𝐺)
& ⊢ 𝐴 = {𝑥 ∈ 𝑉 ∣ (𝐷‘𝑥) = 𝐾}
& ⊢ 𝐵 = (𝑉 ∖ 𝐴)
& ⊢ 𝐸 = (Edg‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 1 <
(#‘𝐴) ∧ 1 <
(#‘𝐵)) →
∃𝑎 ∈ 𝐴 ∃𝑥 ∈ 𝐴 ∃𝑏 ∈ 𝐵 ∃𝑦 ∈ 𝐵 ((𝑎 ≠ 𝑥 ∧ 𝑏 ≠ 𝑦) ∧ ({𝑎, 𝑏} ∈ 𝐸 ∧ {𝑏, 𝑥} ∈ 𝐸) ∧ ({𝑥, 𝑦} ∈ 𝐸 ∧ {𝑦, 𝑎} ∈ 𝐸))) 

Theorem  frgrwopreglem5ALT 27302* 
Alternate direct proof of frgrwopreglem5 27301, not using
frgrwopreglem5a 27291. This proof would be even a little bit
shorter
than the proof of frgrwopreglem5 27301 without using frgrwopreglem5lem 27300.
(Contributed by Alexander van der Vekens, 31Dec2017.) (Revised by
AV, 3Jan2022.) (Proof shortened by AV, 5Feb2022.)
(New usage is discouraged.) (Proof modification is discouraged.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐷 = (VtxDeg‘𝐺)
& ⊢ 𝐴 = {𝑥 ∈ 𝑉 ∣ (𝐷‘𝑥) = 𝐾}
& ⊢ 𝐵 = (𝑉 ∖ 𝐴)
& ⊢ 𝐸 = (Edg‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 1 <
(#‘𝐴) ∧ 1 <
(#‘𝐵)) →
∃𝑎 ∈ 𝐴 ∃𝑥 ∈ 𝐴 ∃𝑏 ∈ 𝐵 ∃𝑦 ∈ 𝐵 ((𝑎 ≠ 𝑥 ∧ 𝑏 ≠ 𝑦) ∧ ({𝑎, 𝑏} ∈ 𝐸 ∧ {𝑏, 𝑥} ∈ 𝐸) ∧ ({𝑥, 𝑦} ∈ 𝐸 ∧ {𝑦, 𝑎} ∈ 𝐸))) 

Theorem  frgrwopreg 27303* 
In a friendship graph there are either no vertices (𝐴 = ∅) or
exactly one vertex ((#‘𝐴) = 1) having degree 𝐾, or all
(𝐵
= ∅) or all except one vertices ((#‘𝐵) = 1) have
degree 𝐾. (Contributed by Alexander van der
Vekens, 31Dec2017.)
(Revised by AV, 10May2021.) (Proof shortened by AV, 3Jan2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐷 = (VtxDeg‘𝐺)
& ⊢ 𝐴 = {𝑥 ∈ 𝑉 ∣ (𝐷‘𝑥) = 𝐾}
& ⊢ 𝐵 = (𝑉 ∖ 𝐴) ⇒ ⊢ (𝐺 ∈ FriendGraph → (((#‘𝐴) = 1 ∨ 𝐴 = ∅) ∨ ((#‘𝐵) = 1 ∨ 𝐵 = ∅))) 

Theorem  frgrregorufr0 27304* 
In a friendship graph there are either no vertices having degree 𝐾,
or all vertices have degree 𝐾 for any (nonnegative integer) 𝐾,
unless there is a universal friend. This corresponds to claim 2 in
[Huneke] p. 2: "... all vertices
have degree k, unless there is a
universal friend." (Contributed by Alexander van der Vekens,
1Jan2018.) (Revised by AV, 11May2021.) (Proof shortened by AV,
3Jan2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐸 = (Edg‘𝐺)
& ⊢ 𝐷 = (VtxDeg‘𝐺) ⇒ ⊢ (𝐺 ∈ FriendGraph → (∀𝑣 ∈ 𝑉 (𝐷‘𝑣) = 𝐾 ∨ ∀𝑣 ∈ 𝑉 (𝐷‘𝑣) ≠ 𝐾 ∨ ∃𝑣 ∈ 𝑉 ∀𝑤 ∈ (𝑉 ∖ {𝑣}){𝑣, 𝑤} ∈ 𝐸)) 

Theorem  frgrregorufr 27305* 
If there is a vertex having degree 𝐾 for each (nonnegative integer)
𝐾 in a friendship graph, then either
all vertices have degree 𝐾
or there is a universal friend. This corresponds to claim 2 in [Huneke]
p. 2: "Suppose there is a vertex of degree k > 1. ... all
vertices have
degree k, unless there is a universal friend. ... It follows that G is
kregular, i.e., the degree of every vertex is k". (Contributed by
Alexander van der Vekens, 1Jan2018.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐸 = (Edg‘𝐺)
& ⊢ 𝐷 = (VtxDeg‘𝐺) ⇒ ⊢ (𝐺 ∈ FriendGraph → (∃𝑎 ∈ 𝑉 (𝐷‘𝑎) = 𝐾 → (∀𝑣 ∈ 𝑉 (𝐷‘𝑣) = 𝐾 ∨ ∃𝑣 ∈ 𝑉 ∀𝑤 ∈ (𝑉 ∖ {𝑣}){𝑣, 𝑤} ∈ 𝐸))) 

Theorem  frgrregorufrg 27306* 
If there is a vertex having degree 𝑘 for each nonnegative integer
𝑘 in a friendship graph, then there is
a universal friend. This
corresponds to claim 2 in [Huneke] p. 2:
"Suppose there is a vertex of
degree k > 1. ... all vertices have degree k, unless there is a
universal friend. ... It follows that G is kregular, i.e., the degree
of every vertex is k". Variant of frgrregorufr 27305 with generalization.
(Contributed by Alexander van der Vekens, 6Sep2018.) (Revised by AV,
26May2021.) (Proof shortened by AV, 12Jan2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐸 = (Edg‘𝐺) ⇒ ⊢ (𝐺 ∈ FriendGraph → ∀𝑘 ∈ ℕ_{0}
(∃𝑎 ∈ 𝑉 ((VtxDeg‘𝐺)‘𝑎) = 𝑘 → (𝐺RegUSGraph𝑘 ∨ ∃𝑣 ∈ 𝑉 ∀𝑤 ∈ (𝑉 ∖ {𝑣}){𝑣, 𝑤} ∈ 𝐸))) 

Theorem  frgr2wwlkeu 27307* 
For two different vertices in a friendship graph, there is exactly one
third vertex being the middle vertex of a (simple) path/walk of length 2
between the two vertices. (Contributed by Alexander van der Vekens,
18Feb2018.) (Revised by AV, 12May2021.) (Proof shortened by AV,
4Jan2022.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ (𝐴 ∈ 𝑉 ∧ 𝐵 ∈ 𝑉) ∧ 𝐴 ≠ 𝐵) → ∃!𝑐 ∈ 𝑉 ⟨“𝐴𝑐𝐵”⟩ ∈ (𝐴(2 WWalksNOn 𝐺)𝐵)) 

Theorem  frgr2wwlkn0 27308 
In a friendship graph, there is always a path/walk of length 2 between
two different vertices. (Contributed by Alexander van der Vekens,
18Feb2018.) (Revised by AV, 12May2021.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ (𝐴 ∈ 𝑉 ∧ 𝐵 ∈ 𝑉) ∧ 𝐴 ≠ 𝐵) → (𝐴(2 WWalksNOn 𝐺)𝐵) ≠ ∅) 

Theorem  frgr2wwlk1 27309 
In a friendship graph, there is exactly one walk of length 2 between two
different vertices. (Contributed by Alexander van der Vekens,
19Feb2018.) (Revised by AV, 13May2021.) (Proof shortened by AV,
16Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ (𝐴 ∈ 𝑉 ∧ 𝐵 ∈ 𝑉) ∧ 𝐴 ≠ 𝐵) → (#‘(𝐴(2 WWalksNOn 𝐺)𝐵)) = 1) 

Theorem  frgr2wsp1 27310 
In a friendship graph, there is exactly one simple path of length 2
between two different vertices. (Contributed by Alexander van der
Vekens, 3Mar2018.) (Revised by AV, 13May2021.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ (𝐴 ∈ 𝑉 ∧ 𝐵 ∈ 𝑉) ∧ 𝐴 ≠ 𝐵) → (#‘(𝐴(2 WSPathsNOn 𝐺)𝐵)) = 1) 

Theorem  frgr2wwlkeqm 27311 
If there is a (simple) path of length 2 from one vertex to another
vertex and a (simple) path of length 2 from the other vertex back to the
first vertex in a friendship graph, then the middle vertex is the same.
This is only an observation, which is not required to proof the
friendship theorem. (Contributed by Alexander van der Vekens,
20Feb2018.) (Revised by AV, 13May2021.) (Proof shortened by AV,
7Jan2022.)

⊢ ((𝐺 ∈ FriendGraph ∧ 𝐴 ≠ 𝐵 ∧ (𝑃 ∈ 𝑋 ∧ 𝑄 ∈ 𝑌)) → ((⟨“𝐴𝑃𝐵”⟩ ∈ (𝐴(2 WWalksNOn 𝐺)𝐵) ∧ ⟨“𝐵𝑄𝐴”⟩ ∈ (𝐵(2 WWalksNOn 𝐺)𝐴)) → 𝑄 = 𝑃)) 

Theorem  frgrhash2wsp 27312 
The number of simple paths of length 2 is n*(n1) in a friendship graph
with n vertices. This corresponds to the proof of claim 3 in [Huneke]
p. 2: "... the paths of length two in G: by assumption there are (
n
2 ) such paths.". However, Huneke counts undirected paths, so
obtains
the result ((𝑛C2) = ((𝑛 · (𝑛 − 1)) / 2)), whereas we
count directed paths, obtaining twice that number. (Contributed by
Alexander van der Vekens, 6Mar2018.) (Revised by AV, 10Jan2022.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑉 ∈ Fin) → (#‘(2 WSPathsN
𝐺)) = ((#‘𝑉) · ((#‘𝑉) − 1))) 

Theorem  fusgreg2wsplem 27313* 
Lemma for fusgreg2wsp 27316 and related theorems. (Contributed by AV,
8Jan2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑀 = (𝑎 ∈ 𝑉 ↦ {𝑤 ∈ (2 WSPathsN 𝐺) ∣ (𝑤‘1) = 𝑎}) ⇒ ⊢ (𝑁 ∈ 𝑉 → (𝑝 ∈ (𝑀‘𝑁) ↔ (𝑝 ∈ (2 WSPathsN 𝐺) ∧ (𝑝‘1) = 𝑁))) 

Theorem  fusgr2wsp2nb 27314* 
The set of paths of length 2 with a given vertex in the middle for a
finite simple graph is the union of all paths of length 2 from one
neighbor to another neighbor of this vertex via this vertex.
(Contributed by Alexander van der Vekens, 9Mar2018.) (Revised by AV,
17May2021.) (Proof shortened by AV, 16Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑀 = (𝑎 ∈ 𝑉 ↦ {𝑤 ∈ (2 WSPathsN 𝐺) ∣ (𝑤‘1) = 𝑎}) ⇒ ⊢ ((𝐺 ∈ FinUSGraph ∧ 𝑁 ∈ 𝑉) → (𝑀‘𝑁) = ∪
𝑥 ∈ (𝐺 NeighbVtx 𝑁)∪ 𝑦 ∈ ((𝐺 NeighbVtx 𝑁) ∖ {𝑥}){⟨“𝑥𝑁𝑦”⟩}) 

Theorem  fusgreghash2wspv 27315* 
According to statement 7 in [Huneke] p. 2:
"For each vertex v, there
are exactly ( k 2 ) paths with length two having v in the middle,
..."
in a finite kregular graph. For directed simple paths of length 2
represented by length 3 strings, we have again k*(k1) such paths, see
also comment of frgrhash2wsp 27312. (Contributed by Alexander van der
Vekens, 10Mar2018.) (Revised by AV, 17May2021.) (Proof shortened
by AV, 12Feb2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑀 = (𝑎 ∈ 𝑉 ↦ {𝑤 ∈ (2 WSPathsN 𝐺) ∣ (𝑤‘1) = 𝑎}) ⇒ ⊢ (𝐺 ∈ FinUSGraph → ∀𝑣 ∈ 𝑉 (((VtxDeg‘𝐺)‘𝑣) = 𝐾 → (#‘(𝑀‘𝑣)) = (𝐾 · (𝐾 − 1)))) 

Theorem  fusgreg2wsp 27316* 
In a finite simple graph, the set of all paths of length 2 is the union
of all the paths of length 2 over the vertices which are in the middle
of such a path. (Contributed by Alexander van der Vekens, 10Mar2018.)
(Revised by AV, 18May2021.) (Proof shortened by AV, 10Jan2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑀 = (𝑎 ∈ 𝑉 ↦ {𝑤 ∈ (2 WSPathsN 𝐺) ∣ (𝑤‘1) = 𝑎}) ⇒ ⊢ (𝐺 ∈ FinUSGraph → (2 WSPathsN 𝐺) = ∪ 𝑥 ∈ 𝑉 (𝑀‘𝑥)) 

Theorem  2wspmdisj 27317* 
The sets of paths of length 2 with a given vertex in the middle are
distinct for different vertices in the middle. (Contributed by
Alexander van der Vekens, 11Mar2018.) (Revised by AV, 18May2021.)
(Proof shortened by AV, 10Jan2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑀 = (𝑎 ∈ 𝑉 ↦ {𝑤 ∈ (2 WSPathsN 𝐺) ∣ (𝑤‘1) = 𝑎}) ⇒ ⊢ Disj 𝑥 ∈ 𝑉 (𝑀‘𝑥) 

Theorem  fusgreghash2wsp 27318* 
In a finite kregular graph with N vertices there are N times "k choose
2" paths with length 2, according to statement 8 in [Huneke] p. 2: "...
giving n * ( k 2 ) total paths of length two.", if the direction of
traversing the path is not respected. For simple paths of length 2
represented by length 3 strings, however, we have again n*k*(k1) such
paths. (Contributed by Alexander van der Vekens, 11Mar2018.)
(Revised by AV, 19May2021.) (Proof shortened by AV, 12Jan2022.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FinUSGraph ∧ 𝑉 ≠ ∅) → (∀𝑣 ∈ 𝑉 ((VtxDeg‘𝐺)‘𝑣) = 𝐾 → (#‘(2 WSPathsN 𝐺)) = ((#‘𝑉) · (𝐾 · (𝐾 − 1))))) 

Theorem  frrusgrord0lem 27319* 
Lemma for frrusgrord0 27320. (Contributed by AV, 12Jan2022.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ (((𝐺 ∈ FriendGraph ∧ 𝑉 ∈ Fin ∧ 𝑉 ≠ ∅) ∧ ∀𝑣 ∈ 𝑉 ((VtxDeg‘𝐺)‘𝑣) = 𝐾) → (𝐾 ∈ ℂ ∧ (#‘𝑉) ∈ ℂ ∧
(#‘𝑉) ≠
0)) 

Theorem  frrusgrord0 27320* 
If a nonempty finite friendship graph is kregular, its order is
k(k1)+1. This corresponds to claim 3 in [Huneke] p. 2: "Next we claim
that the number n of vertices in G is exactly k(k1)+1.".
(Contributed
by Alexander van der Vekens, 11Mar2018.) (Revised by AV,
26May2021.) (Proof shortened by AV, 12Jan2022.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑉 ∈ Fin ∧ 𝑉 ≠ ∅) → (∀𝑣 ∈ 𝑉 ((VtxDeg‘𝐺)‘𝑣) = 𝐾 → (#‘𝑉) = ((𝐾 · (𝐾 − 1)) + 1))) 

Theorem  frrusgrord 27321 
If a nonempty finite friendship graph is kregular, its order is
k(k1)+1. This corresponds to claim 3 in [Huneke] p. 2: "Next we claim
that the number n of vertices in G is exactly k(k1)+1.". Variant
of
frrusgrord0 27320, using the definition RegUSGraph (dfrusgr 26510).
(Contributed by Alexander van der Vekens, 25Aug2018.) (Revised by AV,
26May2021.) (Proof shortened by AV, 12Jan2022.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝑉 ∈ Fin ∧ 𝑉 ≠ ∅) → ((𝐺 ∈ FriendGraph ∧ 𝐺RegUSGraph𝐾) → (#‘𝑉) = ((𝐾 · (𝐾 − 1)) + 1))) 

Theorem  numclwlk3lem3 27322 
Lemma 3 for numclwwlk3 27372. (Contributed by Alexander van der Vekens,
26Aug2018.) (Proof shortened by AV, 23Jan2022.)

⊢ ((𝐾 ∈ ℂ ∧ 𝑌 ∈ ℂ ∧ 𝑁 ∈ (ℤ_{≥}‘2))
→ (((𝐾↑(𝑁 − 2)) − 𝑌) + (𝐾 · 𝑌)) = (((𝐾 − 1) · 𝑌) + (𝐾↑(𝑁 − 2)))) 

Theorem  extwwlkfablem1OLD 27323 
Obsolete version of clwwlknlbonbgr1 27002 as of 17Feb2022. (Contributed
by Alexander van der Vekens, 15Sep2018.) (Revised by AV,
27May2021.) (Proof shortened by AV, 29Jan2022.)
(New usage is discouraged.) (Proof modification is discouraged.)

⊢ (((𝐺 ∈ USGraph ∧ 𝑁 ∈ (ℤ_{≥}‘2))
∧ 𝑊 ∈ (𝑁 ClWWalksN 𝐺) ∧ (𝑊‘(𝑁 − 2)) = (𝑊‘0)) → (𝑊‘(𝑁 − 1)) ∈ (𝐺 NeighbVtx (𝑊‘0))) 

Theorem  numclwwlk2lem1lem 27324 
Lemma for numclwwlk2lem1 27356. (Contributed by Alexander van der Vekens,
3Oct2018.) (Revised by AV, 27May2021.) (Revised by AV,
15Mar2022.)

⊢ ((𝑋 ∈ (Vtx‘𝐺) ∧ 𝑊 ∈ (𝑁 WWalksN 𝐺) ∧ ( lastS ‘𝑊) ≠ (𝑊‘0)) → (((𝑊 ++ ⟨“𝑋”⟩)‘0) = (𝑊‘0) ∧ ((𝑊 ++ ⟨“𝑋”⟩)‘𝑁) ≠ (𝑊‘0))) 

Theorem  numclwwlk2lem1lemOLD 27325 
Obsolete version of numclwwlk2lem1lem 27324 as of 16Mar2022. (Contributed
by Alexander van der Vekens, 3Oct2018.) (Revised by AV, 27May2021.)
(New usage is discouraged.) (Proof modification is discouraged.)

⊢ (((𝑁 ∈ ℕ_{0} ∧ 𝑋 ∈ (Vtx‘𝐺)) ∧ (𝑊 ∈ (𝑁 WWalksN 𝐺) ∧ ( lastS ‘𝑊) ≠ (𝑊‘0))) → (((𝑊 ++ ⟨“𝑋”⟩)‘0) = (𝑊‘0) ∧ ((𝑊 ++ ⟨“𝑋”⟩)‘𝑁) ≠ (𝑊‘0))) 

Theorem  extwwlkfablem 27326 
Lemma 2 for extwwlkfab 27342. (Contributed by Alexander van der Vekens,
15Sep2018.) (Revised by AV, 28May2021.) (Revised by AV,
13Feb2022.) (Proof shortened by AV, 23Mar2022.)

⊢ ((𝑁 ∈ (ℤ_{≥}‘3)
∧ 𝑊 ∈ (𝑁 ClWWalksN 𝐺) ∧ (𝑊‘(𝑁 − 2)) = (𝑊‘0)) → (𝑊 substr ⟨0, (𝑁 − 2)⟩) ∈ ((𝑁 − 2) ClWWalksN 𝐺)) 

Theorem  2clwwlk2clwwlklem1 27327 
Lemma 1 for 2clwwlk2clwwlk 27338. (Contributed by AV, 24Apr2022.)

⊢ (((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3))
∧ 𝑊 ∈ (𝑋(ClWWalksNOn‘𝐺)𝑁) ∧ (𝑊‘(𝑁 − 2)) = (𝑊‘0)) → (𝑊 substr ⟨0, (𝑁 − 2)⟩) ∈ (𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2))) 

Theorem  2clwwlk2clwwlklem2lem1 27328 
Lemma 1 for 2clwwlk2clwwlklem2 27330. (Contributed by AV, 27Apr2022.)

⊢ ((𝑁 ∈ (ℤ_{≥}‘3)
∧ 𝑊 ∈ (𝑁 ClWWalksN 𝐺)) → ((𝑊 substr ⟨(𝑁 − 2), 𝑁⟩)‘0) = (𝑊‘(𝑁 − 2))) 

Theorem  2clwwlk2clwwlklem2lem2 27329 
Lemma 2 for 2clwwlk2clwwlklem2 27330. (Contributed by AV, 27Apr2022.)

⊢ ((𝑁 ∈ (ℤ_{≥}‘3)
∧ 𝑊 ∈ (𝑁 ClWWalksN 𝐺) ∧ (𝑊‘(𝑁 − 2)) = (𝑊‘0)) → (𝑊 substr ⟨(𝑁 − 2), 𝑁⟩) ∈ (2 ClWWalksN 𝐺)) 

Theorem  2clwwlk2clwwlklem2 27330 
Lemma 2 for 2clwwlk2clwwlk 27338. (Contributed by AV, 27Apr2022.)

⊢ ((𝑁 ∈ (ℤ_{≥}‘3)
∧ 𝑊 ∈ (𝑋(ClWWalksNOn‘𝐺)𝑁) ∧ (𝑊‘(𝑁 − 2)) = (𝑊‘0)) → (𝑊 substr ⟨(𝑁 − 2), 𝑁⟩) ∈ (𝑋(ClWWalksNOn‘𝐺)2)) 

Theorem  clwwlkccatlem 27331* 
Lemma for clwwlkccat 27332: index 𝑗 is shifted up by (#‘𝐴),
and the case 𝑖 = ((#‘𝐴) − 1) is covered by the
"bridge"
{( lastS ‘𝐴), (𝐵‘0)} = {( lastS ‘𝐴), (𝐴‘0)}
∈ (Edg‘𝐺). (Contributed by AV, 23Apr2022.)

⊢ ((((𝐴 ∈ Word (Vtx‘𝐺) ∧ 𝐴 ≠ ∅) ∧ ∀𝑖 ∈ (0..^((#‘𝐴) − 1)){(𝐴‘𝑖), (𝐴‘(𝑖 + 1))} ∈ (Edg‘𝐺) ∧ {( lastS ‘𝐴), (𝐴‘0)} ∈ (Edg‘𝐺)) ∧ ((𝐵 ∈ Word (Vtx‘𝐺) ∧ 𝐵 ≠ ∅) ∧ ∀𝑗 ∈ (0..^((#‘𝐵) − 1)){(𝐵‘𝑗), (𝐵‘(𝑗 + 1))} ∈ (Edg‘𝐺) ∧ {( lastS ‘𝐵), (𝐵‘0)} ∈ (Edg‘𝐺)) ∧ (𝐴‘0) = (𝐵‘0)) → ∀𝑖 ∈ (0..^((#‘(𝐴 ++ 𝐵)) − 1)){((𝐴 ++ 𝐵)‘𝑖), ((𝐴 ++ 𝐵)‘(𝑖 + 1))} ∈ (Edg‘𝐺)) 

Theorem  clwwlkccat 27332 
The concatenation of two words representing closed walks anchored at the
same vertex represents a closed walk. The resulting walk is a
"double
loop", starting at the common vertex, coming back to the common
vertex
by the first walk, following the second walk and finally coming back to
the common vertex again. (Contributed by AV, 23Apr2022.)

⊢ ((𝐴 ∈ (ClWWalks‘𝐺) ∧ 𝐵 ∈ (ClWWalks‘𝐺) ∧ (𝐴‘0) = (𝐵‘0)) → (𝐴 ++ 𝐵) ∈ (ClWWalks‘𝐺)) 

Theorem  clwwlknccat 27333 
The concatenation of two words representing closed walks anchored at the
same vertex represents a closed walk with a length which is the sum of the
lengths of the two walks. The resulting walk is a "double
loop", starting
at the common vertex, coming back to the common vertex by the first walk,
following the second walk and finally coming back to the common vertex
again. (Contributed by AV, 24Apr2022.)

⊢ ((𝐴 ∈ (𝑀 ClWWalksN 𝐺) ∧ 𝐵 ∈ (𝑁 ClWWalksN 𝐺) ∧ (𝐴‘0) = (𝐵‘0)) → (𝐴 ++ 𝐵) ∈ ((𝑀 + 𝑁) ClWWalksN 𝐺)) 

Theorem  clwwlknonccat 27334 
The concatenation of two words representing closed walks on a vertex 𝑋
represents a closed walk on vertex 𝑋. The resulting walk is a
"double loop", starting at vertex 𝑋, coming back to 𝑋 by the
first walk, following the second walk and finally coming back to 𝑋
again. (Contributed by AV, 24Apr2022.)

⊢ ((𝐴 ∈ (𝑋(ClWWalksNOn‘𝐺)𝑀) ∧ 𝐵 ∈ (𝑋(ClWWalksNOn‘𝐺)𝑁)) → (𝐴 ++ 𝐵) ∈ (𝑋(ClWWalksNOn‘𝐺)(𝑀 + 𝑁))) 

Theorem  2clwwlk 27335* 
Value of operation 𝐶, mapping a vertex v and an integer n
greater
than 1 to the "closed nwalks v(0) ... v(n2) v(n1) v(n) from v =
v(0)
= v(n) with v(n2) = v" according to definition 6 in [Huneke] p. 2.
Such closed walks are "double loops" consisting of a closed
(n2)walk v
= v(0) ... v(n2) = v and a closed 2walk v = v(n2) v(n1) v(n) = v.
(Contributed by Alexander van der Vekens, 14Sep2018.) (Revised by AV,
29May2021.) (Revised by AV, 20Apr2022.)

⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣}) ⇒ ⊢ ((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘2))
→ (𝑋𝐶𝑁) = {𝑤 ∈ (𝑋(ClWWalksNOn‘𝐺)𝑁) ∣ (𝑤‘(𝑁 − 2)) = 𝑋}) 

Theorem  2clwwlk2 27336* 
The set (𝑋𝐶2) of closed walks of length 2 on a
vertex 𝑋 with
the last but two vertex (which is the vertex 𝑋) being identical
with the first (and therefore last) vertex is equal to the set of closed
walks with length 2 on 𝑋. Considered as "double
loops", the first
of the two closed walks/loops is degenerated, i.e., has length 0.
(Contributed by AV, 18Feb2022.) (Revised by AV, 20Apr2022.)

⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣}) ⇒ ⊢ (𝑋 ∈ 𝑉 → (𝑋𝐶2) = (𝑋(ClWWalksNOn‘𝐺)2)) 

Theorem  2clwwlkel 27337* 
Characterization of an element of the value of operation 𝐶, i.e.,
of a word being a "double loop". (Contributed by Alexander
van der
Vekens, 24Sep2018.) (Revised by AV, 29May2021.) (Revised by AV,
20Apr2022.)

⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣}) ⇒ ⊢ ((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘2))
→ (𝑊 ∈ (𝑋𝐶𝑁) ↔ (𝑊 ∈ (𝑋(ClWWalksNOn‘𝐺)𝑁) ∧ (𝑊‘(𝑁 − 2)) = 𝑋))) 

Theorem  2clwwlk2clwwlk 27338* 
An element of the value of operation 𝐶, i.e., a word being a
"double loop", is composed of two closed walks. (Contributed
by AV,
28Apr2022.)

⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣}) ⇒ ⊢ ((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3))
→ (𝑊 ∈ (𝑋𝐶𝑁) ↔ ∃𝑎 ∈ (𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2))∃𝑏 ∈ (𝑋(ClWWalksNOn‘𝐺)2)𝑊 = (𝑎 ++ 𝑏))) 

Theorem  numclwwlkovgOLD 27339* 
Obsolete version of 2clwwlk 27335 as of 20Apr2022. (Contributed by
Alexander van der Vekens, 14Sep2018.) (Revised by AV, 29May2021.)
(New usage is discouraged.) (Proof modification is discouraged.)

⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑛 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (𝑤‘(𝑛 − 2)) = (𝑤‘0))}) ⇒ ⊢ ((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘2))
→ (𝑋𝐶𝑁) = {𝑤 ∈ (𝑁 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (𝑤‘(𝑁 − 2)) = (𝑤‘0))}) 

Theorem  numclwwlkovgelOLD 27340* 
Obsolete version of 2clwwlkel 27337 as of 20Apr2022. (Contributed by
Alexander van der Vekens, 24Sep2018.) (Revised by AV, 29May2021.)
(New usage is discouraged.) (Proof modification is discouraged.)

⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑛 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (𝑤‘(𝑛 − 2)) = (𝑤‘0))}) ⇒ ⊢ ((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘2))
→ (𝑊 ∈ (𝑋𝐶𝑁) ↔ (𝑊 ∈ (𝑁 ClWWalksN 𝐺) ∧ (𝑊‘0) = 𝑋 ∧ (𝑊‘(𝑁 − 2)) = (𝑊‘0)))) 

Theorem  numclwlk1lem2foalem 27341 
Lemma for numclwlk1lem2foa 27344. (Contributed by AV, 29May2021.)

⊢ (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) = (𝑁 − 2)) ∧ (𝑋 ∈ 𝑉 ∧ 𝑌 ∈ 𝑉) ∧ 𝑁 ∈ (ℤ_{≥}‘3))
→ ((((𝑊 ++
⟨“𝑋”⟩) ++ ⟨“𝑌”⟩) substr ⟨0,
(𝑁 − 2)⟩) =
𝑊 ∧ (((𝑊 ++ ⟨“𝑋”⟩) ++
⟨“𝑌”⟩)‘(𝑁 − 1)) = 𝑌 ∧ (((𝑊 ++ ⟨“𝑋”⟩) ++ ⟨“𝑌”⟩)‘(𝑁 − 2)) = 𝑋)) 

Theorem  extwwlkfab 27342* 
The set (𝑋𝐶𝑁) of closed walks (having a fixed
length 𝑁
greater than one and starting at a fixed vertex 𝑋) with the last
but two vertex being identical with the first (and therefore last)
vertex can be constructed from the set 𝐹 of closed walks on 𝑋
with length smaller by 2 than the fixed length by appending a neighbor
of the last vertex and afterwards the last vertex (which is the first
vertex) itself ("walking forth and back" from the last
vertex).
3 ≤ 𝑁 is required since for 𝑁 = 2:
𝐹 =
(𝑋(ClWWalksNOn‘𝐺)0) = ∅ (see clwwlk0on0 27067 stating
that a closed walk of length 0 is not represented as word), which would
result in an empty set on the right hand side, but (𝑋𝐶𝑁) needs
not be emoty, see 2clwwlk2 27336. (Contributed by Alexander van der
Vekens, 18Sep2018.) (Revised by AV, 29May2021.) (Revised by AV,
5Mar2022.) (Proof shortened by AV, 28Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣})
& ⊢ 𝐹 = (𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2)) ⇒ ⊢ ((𝐺 ∈ USGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3))
→ (𝑋𝐶𝑁) = {𝑤 ∈ (𝑁 ClWWalksN 𝐺) ∣ ((𝑤 substr ⟨0, (𝑁 − 2)⟩) ∈ 𝐹 ∧ (𝑤‘(𝑁 − 1)) ∈ (𝐺 NeighbVtx 𝑋) ∧ (𝑤‘(𝑁 − 2)) = 𝑋)}) 

Theorem  extwwlkfabel 27343* 
Characterization of an element of the set (𝑋𝐶𝑁), i.e., a closed
walk (having a fixed length 𝑁 greater than one and starting at a
fixed vertex 𝑋) with the last but two vertex being
identical with
the first (and therefore last) vertex with a construction from the set
𝐹 of closed walks on 𝑋 with
length smaller by 2 than the fixed
length by appending a neighbor of the last vertex and afterwards the
last vertex (which is the first vertex) itself ("walking forth and
back"
from the last vertex). (Contributed by AV, 22Feb2022.) (Revised by
AV, 5Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣})
& ⊢ 𝐹 = (𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2)) ⇒ ⊢ ((𝐺 ∈ USGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3))
→ (𝑊 ∈ (𝑋𝐶𝑁) ↔ (𝑊 ∈ (𝑁 ClWWalksN 𝐺) ∧ ((𝑊 substr ⟨0, (𝑁 − 2)⟩) ∈ 𝐹 ∧ (𝑊‘(𝑁 − 1)) ∈ (𝐺 NeighbVtx 𝑋) ∧ (𝑊‘(𝑁 − 2)) = 𝑋)))) 

Theorem  numclwlk1lem2foa 27344* 
Going forth and back from the end of a (closed) walk: 𝑊 represents
the closed walk p_{0}, ..., p_{(n}2), p_{0} =
p_{(n}2). With 𝑋 = p_{(n}2)
= p_{0} and 𝑌 = p_{(n}1), ((𝑊 ++ ⟨“𝑋”⟩) ++ ⟨“𝑌”⟩)
represents the closed walk p_{0}, ...,
p_{(n}2), p_{(n}1), p_{n} =
p_{0}.
(Contributed by Alexander van der Vekens, 22Sep2018.) (Revised by AV,
29May2021.) (Revised by AV, 5Mar2022.) (Proof shortened by AV,
28Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣})
& ⊢ 𝐹 = (𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2)) ⇒ ⊢ ((𝐺 ∈ USGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3))
→ ((𝑊 ∈ 𝐹 ∧ 𝑌 ∈ (𝐺 NeighbVtx 𝑋)) → ((𝑊 ++ ⟨“𝑋”⟩) ++ ⟨“𝑌”⟩) ∈ (𝑋𝐶𝑁))) 

Theorem  numclwlk1lem2f 27345* 
𝑇
is a function, mapping a closed walk 𝑢 (having a fixed
length 𝑁 and starting at a fixed vertex 𝑋) with
the last but
2 vertex being identical with the first (and therefore last) vertex to
the pair of the shorter closed walk and its successor in the longer
closed walk, which must be a neighbor of the first vertex.
(Contributed by Alexander van der Vekens, 19Sep2018.) (Revised by
AV, 29May2021.) (Proof shortened by AV, 23Feb2022.) (Revised by
AV, 6Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣})
& ⊢ 𝐹 = (𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2)) & ⊢ 𝑇 = (𝑢 ∈ (𝑋𝐶𝑁) ↦ ⟨(𝑢 substr ⟨0, (𝑁 − 2)⟩), (𝑢‘(𝑁 −
1))⟩) ⇒ ⊢ ((𝐺 ∈ USGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3))
→ 𝑇:(𝑋𝐶𝑁)⟶(𝐹 × (𝐺 NeighbVtx 𝑋))) 

Theorem  numclwlk1lem2fv 27346* 
Value of the function 𝑇. (Contributed by Alexander van der
Vekens, 20Sep2018.) (Revised by AV, 29May2021.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣})
& ⊢ 𝐹 = (𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2)) & ⊢ 𝑇 = (𝑢 ∈ (𝑋𝐶𝑁) ↦ ⟨(𝑢 substr ⟨0, (𝑁 − 2)⟩), (𝑢‘(𝑁 −
1))⟩) ⇒ ⊢ (𝑊 ∈ (𝑋𝐶𝑁) → (𝑇‘𝑊) = ⟨(𝑊 substr ⟨0, (𝑁 − 2)⟩), (𝑊‘(𝑁 − 1))⟩) 

Theorem  numclwlk1lem2f1 27347* 
𝑇
is a 11 function. (Contributed by AV, 26Sep2018.) (Revised
by AV, 29May2021.) (Proof shortened by AV, 23Feb2022.) (Revised
by AV, 6Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣})
& ⊢ 𝐹 = (𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2)) & ⊢ 𝑇 = (𝑢 ∈ (𝑋𝐶𝑁) ↦ ⟨(𝑢 substr ⟨0, (𝑁 − 2)⟩), (𝑢‘(𝑁 −
1))⟩) ⇒ ⊢ ((𝐺 ∈ USGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3))
→ 𝑇:(𝑋𝐶𝑁)–11→(𝐹 × (𝐺 NeighbVtx 𝑋))) 

Theorem  numclwlk1lem2fo 27348* 
𝑇
is an onto function. (Contributed by Alexander van der Vekens,
20Sep2018.) (Revised by AV, 29May2021.) (Proof shortened by AV,
13Feb2022.) (Revised by AV, 6Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣})
& ⊢ 𝐹 = (𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2)) & ⊢ 𝑇 = (𝑢 ∈ (𝑋𝐶𝑁) ↦ ⟨(𝑢 substr ⟨0, (𝑁 − 2)⟩), (𝑢‘(𝑁 −
1))⟩) ⇒ ⊢ ((𝐺 ∈ USGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3))
→ 𝑇:(𝑋𝐶𝑁)–onto→(𝐹 × (𝐺 NeighbVtx 𝑋))) 

Theorem  numclwlk1lem2f1o 27349* 
𝑇
is a 11 onto function. (Contributed by Alexander van der
Vekens, 26Sep2018.) (Revised by AV, 29May2021.) (Revised by AV,
6Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣})
& ⊢ 𝐹 = (𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2)) & ⊢ 𝑇 = (𝑢 ∈ (𝑋𝐶𝑁) ↦ ⟨(𝑢 substr ⟨0, (𝑁 − 2)⟩), (𝑢‘(𝑁 −
1))⟩) ⇒ ⊢ ((𝐺 ∈ USGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3))
→ 𝑇:(𝑋𝐶𝑁)–11onto→(𝐹 × (𝐺 NeighbVtx 𝑋))) 

Theorem  numclwlk1lem2 27350* 
There is a bijection between the set of closed walks (having a fixed
length greater than 2 and starting at a fixed vertex) with the last but
2 vertex identical with the first (and therefore last) vertex and the
set of closed walks (having a fixed length less by 2 and starting at the
same vertex) and the neighbors of this vertex. (Contributed by
Alexander van der Vekens, 6Jul2018.) (Revised by AV, 29May2021.)
(Revised by AV, 6Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣})
& ⊢ 𝐹 = (𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2)) ⇒ ⊢ ((𝐺 ∈ USGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3))
→ ∃𝑓 𝑓:(𝑋𝐶𝑁)–11onto→(𝐹 × (𝐺 NeighbVtx 𝑋))) 

Theorem  numclwwlk1 27351* 
Statement 9 in [Huneke] p. 2: "If n >
1, then the number of closed
nwalks v(0) ... v(n2) v(n1) v(n) from v = v(0) = v(n) with v(n2) = v
is kf(n2)". Since 𝐺 is kregular, the vertex v(n2) = v
has k
neighbors v(n1), so there are k walks from v(n2) = v to v(n) = v (via
each of v's neighbors) completing each of the f(n2) walks from v=v(0)
to v(n2)=v. This theorem holds even for k=0. (Contributed by
Alexander van der Vekens, 26Sep2018.) (Revised by AV, 29May2021.)
(Revised by AV, 6Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣})
& ⊢ 𝐹 = (𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2)) ⇒ ⊢ (((𝑉 ∈ Fin ∧ 𝐺RegUSGraph𝐾) ∧ (𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3)))
→ (#‘(𝑋𝐶𝑁)) = (𝐾 · (#‘𝐹))) 

Theorem  numclwwlkovh0 27352* 
Value of operation 𝐻, mapping a vertex 𝑣 and an
integer 𝑛
greater than 1 to the "closed nwalks v(0) ... v(n2) v(n1) v(n)
from v
= v(0) = v(n) ... with v(n2) =/= v" according to definition 7 in
[Huneke] p. 2. (Contributed by AV,
1May2022.)

⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) ≠ 𝑣}) ⇒ ⊢ ((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘2))
→ (𝑋𝐻𝑁) = {𝑤 ∈ (𝑋(ClWWalksNOn‘𝐺)𝑁) ∣ (𝑤‘(𝑁 − 2)) ≠ 𝑋}) 

Theorem  numclwwlkovh 27353* 
Value of operation 𝐻, mapping a vertex 𝑣 and an
integer 𝑛
greater than 1 to the "closed nwalks v(0) ... v(n2) v(n1) v(n)
from v
= v(0) = v(n) ... with v(n2) =/= v" according to definition 7 in
[Huneke] p. 2. Definition of ClWWalksNOn resolved. (Contributed by
Alexander van der Vekens, 26Aug2018.) (Revised by AV, 30May2021.)
(Revised by AV, 1May2022.)

⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) ≠ 𝑣}) ⇒ ⊢ ((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘2))
→ (𝑋𝐻𝑁) = {𝑤 ∈ (𝑁 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (𝑤‘(𝑁 − 2)) ≠ (𝑤‘0))}) 

Theorem  numclwwlkovq 27354* 
Value of operation 𝑄, mapping a vertex 𝑣 and a
positive integer
𝑛 to the not closed walks v(0) ... v(n)
of length 𝑛 from a fixed
vertex 𝑣 = v(0). "Not closed" means
v(n) =/= v(0). Remark:
𝑛
∈ ℕ_{0} would not be useful: numclwwlkqhash 27355 would not hold,
because (𝐾↑0) = 1! (Contributed by
Alexander van der Vekens,
27Sep2018.) (Revised by AV, 30May2021.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) ⇒ ⊢ ((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ) → (𝑋𝑄𝑁) = {𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋)}) 

Theorem  numclwwlkqhash 27355* 
In a 𝐾regular graph, the size of the set
of walks of length 𝑁
starting with a fixed vertex 𝑋 and ending not at this vertex is the
difference between 𝐾 to the power of 𝑁 and the
size of the set
of closed walks of length 𝑁 on vertex 𝑋. (Contributed by
Alexander van der Vekens, 30Sep2018.) (Revised by AV, 30May2021.)
(Revised by AV, 5Mar2022.) (Proof shortened by AV, 16Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) ⇒ ⊢ (((𝐺RegUSGraph𝐾 ∧ 𝑉 ∈ Fin) ∧ (𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ)) → (#‘(𝑋𝑄𝑁)) = ((𝐾↑𝑁) − (#‘(𝑋(ClWWalksNOn‘𝐺)𝑁)))) 

Theorem  numclwwlk2lem1 27356* 
In a friendship graph, for each walk of length 𝑛 starting at a fixed
vertex 𝑣 and ending not at this vertex, there
is a unique vertex so
that the walk extended by an edge to this vertex and an edge from this
vertex to the first vertex of the walk is a value of operation 𝐻.
If the walk is represented as a word, it is sufficient to add one vertex
to the word to obtain the closed walk contained in the value of
operation 𝐻, since in a word representing a
closed walk the
starting vertex is not repeated at the end. This theorem generally
holds only for friendship graphs, because these guarantee that for the
first and last vertex there is a (unique) third vertex "in
between".
(Contributed by Alexander van der Vekens, 3Oct2018.) (Revised by AV,
30May2021.) (Revised by AV, 1May2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) ≠ 𝑣}) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ) → (𝑊 ∈ (𝑋𝑄𝑁) → ∃!𝑣 ∈ 𝑉 (𝑊 ++ ⟨“𝑣”⟩) ∈ (𝑋𝐻(𝑁 + 2)))) 

Theorem  numclwlk2lem2f 27357* 
𝑅
is a function mapping the "closed (n+2)walks v(0) ... v(n2)
v(n1) v(n) v(n+1) v(n+2) starting at 𝑋 = v(0) = v(n+2) with
v(n)
=/= X" to the words representing the prefix v(0) ... v(n2)
v(n1)
v(n) of the walk. (Contributed by Alexander van der Vekens,
5Oct2018.) (Revised by AV, 31May2021.) (Proof shortened by AV,
23Mar2022.) (Revised by AV, 1May2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) ≠ 𝑣})
& ⊢ 𝑅 = (𝑥 ∈ (𝑋𝐻(𝑁 + 2)) ↦ (𝑥 substr ⟨0, (𝑁 + 1)⟩))
⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ) → 𝑅:(𝑋𝐻(𝑁 + 2))⟶(𝑋𝑄𝑁)) 

Theorem  numclwlk2lem2fv 27358* 
Value of the function 𝑅. (Contributed by Alexander van der
Vekens, 6Oct2018.) (Revised by AV, 31May2021.) (Revised by AV,
1May2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) ≠ 𝑣})
& ⊢ 𝑅 = (𝑥 ∈ (𝑋𝐻(𝑁 + 2)) ↦ (𝑥 substr ⟨0, (𝑁 + 1)⟩))
⇒ ⊢ ((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ) → (𝑊 ∈ (𝑋𝐻(𝑁 + 2)) → (𝑅‘𝑊) = (𝑊 substr ⟨0, (𝑁 + 1)⟩))) 

Theorem  numclwlk2lem2f1o 27359* 
𝑅
is a 11 onto function. (Contributed by Alexander van der
Vekens, 6Oct2018.) (Revised by AV, 21Jan2022.) (Proof shortened
by AV, 17Mar2022.) (Revised by AV, 1May2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) ≠ 𝑣})
& ⊢ 𝑅 = (𝑥 ∈ (𝑋𝐻(𝑁 + 2)) ↦ (𝑥 substr ⟨0, (𝑁 + 1)⟩))
⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ) → 𝑅:(𝑋𝐻(𝑁 + 2))–11onto→(𝑋𝑄𝑁)) 

Theorem  numclwwlk2lem3 27360* 
In a friendship graph, the size of the set of walks of length 𝑁
starting with a fixed vertex 𝑋 and ending not at this vertex equals
the size of the set of all closed walks of length (𝑁 + 2)
starting
at this vertex 𝑋 and not having this vertex as last
but 2 vertex.
(Contributed by Alexander van der Vekens, 6Oct2018.) (Revised by AV,
31May2021.) (Proof shortened by AV, 21Jan2022.) (Revised by AV,
1May2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) ≠ 𝑣}) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ) → (#‘(𝑋𝑄𝑁)) = (#‘(𝑋𝐻(𝑁 + 2)))) 

Theorem  numclwwlk2 27361* 
Statement 10 in [Huneke] p. 2: "If n >
1, then the number of closed
nwalks v(0) ... v(n2) v(n1) v(n) from v = v(0) = v(n) ... with v(n2)
=/= v is k^(n2)  f(n2)." According to rusgrnumwlkg 26944, we have
k^(n2) different walks of length (n2): v(0) ... v(n2). From this
number, the number of closed walks of length (n2), which is f(n2) per
definition, must be subtracted, because for these walks v(n2) =/= v(0)
= v would hold. Because of the friendship condition, there is exactly
one vertex v(n1) which is a neighbor of v(n2) as well as of
v(n)=v=v(0), because v(n2) and v(n)=v are different, so the number of
walks v(0) ... v(n2) is identical with the number of walks v(0) ...
v(n), that means each (not closed) walk v(0) ... v(n2) can be extended
by two edges to a closed walk v(0) ... v(n)=v=v(0) in exactly one way.
(Contributed by Alexander van der Vekens, 6Oct2018.) (Revised by AV,
31May2021.) (Revised by AV, 1May2022.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) ≠ 𝑣}) ⇒ ⊢ (((𝐺RegUSGraph𝐾 ∧ 𝐺 ∈ FriendGraph ) ∧ (𝑉 ∈ Fin ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3)))
→ (#‘(𝑋𝐻𝑁)) = ((𝐾↑(𝑁 − 2)) − (#‘(𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2))))) 

Theorem  numclwwlkovhOLD 27362* 
Obsolete version of numclwwlkovh0 27352 as of 1May2022. (Contributed by
Alexander van der Vekens, 26Aug2018.) (Revised by AV, 30May2021.)
(New usage is discouraged.) (Proof modification is discouraged.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (𝑤‘(𝑛 − 2)) ≠ (𝑤‘0))}) ⇒ ⊢ ((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ) → (𝑋𝐻𝑁) = {𝑤 ∈ (𝑁 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (𝑤‘(𝑁 − 2)) ≠ (𝑤‘0))}) 

Theorem  numclwwlk2lem1OLD 27363* 
Obsolete version of numclwwlk2lem1 27356 as of 1May2022. (Contributed by
Alexander van der Vekens, 3Oct2018.) (Revised by AV, 30May2021.)
(New usage is discouraged.) (Proof modification is discouraged.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (𝑤‘(𝑛 − 2)) ≠ (𝑤‘0))}) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ) → (𝑊 ∈ (𝑋𝑄𝑁) → ∃!𝑣 ∈ 𝑉 (𝑊 ++ ⟨“𝑣”⟩) ∈ (𝑋𝐻(𝑁 + 2)))) 

Theorem  numclwlk2lem2fOLD 27364* 
Obsolete version of numclwlk2lem2f 27357 as of 1May2022. (Contributed
by Alexander van der Vekens, 5Oct2018.) (Revised by AV,
31May2021.) (Proof shortened by AV, 23Mar2022.)
(New usage is discouraged.) (Proof modification is discouraged.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (𝑤‘(𝑛 − 2)) ≠ (𝑤‘0))}) & ⊢ 𝑅 = (𝑥 ∈ (𝑋𝐻(𝑁 + 2)) ↦ (𝑥 substr ⟨0, (𝑁 + 1)⟩))
⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ) → 𝑅:(𝑋𝐻(𝑁 + 2))⟶(𝑋𝑄𝑁)) 

Theorem  numclwlk2lem2fvOLD 27365* 
Obsolete version of numclwlk2lem2fv 27358 as of 1May2022. (Contributed
by Alexander van der Vekens, 6Oct2018.) (Revised by AV,
31May2021.) (New usage is discouraged.)
(Proof modification is discouraged.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (𝑤‘(𝑛 − 2)) ≠ (𝑤‘0))}) & ⊢ 𝑅 = (𝑥 ∈ (𝑋𝐻(𝑁 + 2)) ↦ (𝑥 substr ⟨0, (𝑁 + 1)⟩))
⇒ ⊢ ((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ) → (𝑊 ∈ (𝑋𝐻(𝑁 + 2)) → (𝑅‘𝑊) = (𝑊 substr ⟨0, (𝑁 + 1)⟩))) 

Theorem  numclwlk2lem2f1oOLD 27366* 
Obsolete version of numclwlk2lem2f1o 27359 as of 1May2022. (Contributed
by Alexander van der Vekens, 6Oct2018.) (Revised by AV,
21Jan2022.) (Proof shortened by AV, 17Mar2022.)
(New usage is discouraged.) (Proof modification is discouraged.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (𝑤‘(𝑛 − 2)) ≠ (𝑤‘0))}) & ⊢ 𝑅 = (𝑥 ∈ (𝑋𝐻(𝑁 + 2)) ↦ (𝑥 substr ⟨0, (𝑁 + 1)⟩))
⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ) → 𝑅:(𝑋𝐻(𝑁 + 2))–11onto→(𝑋𝑄𝑁)) 

Theorem  numclwwlk2lem3OLD 27367* 
Obsolete version of numclwwlk2lem3 27360 as of 1May2022. (Contributed by
Alexander van der Vekens, 6Oct2018.) (Revised by AV, 31May2021.)
(Proof shortened by AV, 21Jan2022.) (New usage is discouraged.)
(Proof modification is discouraged.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (𝑤‘(𝑛 − 2)) ≠ (𝑤‘0))}) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ ℕ) → (#‘(𝑋𝑄𝑁)) = (#‘(𝑋𝐻(𝑁 + 2)))) 

Theorem  numclwwlk2OLD 27368* 
Obsolete version of numclwwlk2 27361 as of 1May2022. (Contributed by
Alexander van der Vekens, 6Oct2018.) (Revised by AV, 31May2021.)
(Revised by AV, 6Mar2022.) (New usage is discouraged.)
(Proof modification is discouraged.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (𝑤‘(𝑛 − 2)) ≠ (𝑤‘0))}) ⇒ ⊢ (((𝐺RegUSGraph𝐾 ∧ 𝐺 ∈ FriendGraph ) ∧ (𝑉 ∈ Fin ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3)))
→ (#‘(𝑋𝐻𝑁)) = ((𝐾↑(𝑁 − 2)) − (#‘(𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2))))) 

Theorem  numclwwlk3lemOLD 27369* 
Obsolete version of numclwwlk3lem 27371 as of 1May2022. (Contributed by
Alexander van der Vekens, 6Oct2018.) (Revised by AV, 1Jun2021.)
(Revised by AV, 6Mar2022.) (Proof shortened by AV, 28Mar2022.)
(New usage is discouraged.) (Proof modification is discouraged.)

⊢ 𝑉 = (Vtx‘𝐺)
& ⊢ 𝑄 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ ( lastS ‘𝑤) ≠ 𝑣)}) & ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (𝑤‘(𝑛 − 2)) ≠ (𝑤‘0))}) & ⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑛 ClWWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (𝑤‘(𝑛 − 2)) = (𝑤‘0))}) ⇒ ⊢ (((𝐺 ∈ FinUSGraph ∧ 𝑋 ∈ 𝑉) ∧ 𝑁 ∈ (ℤ_{≥}‘2))
→ (#‘(𝑋(ClWWalksNOn‘𝐺)𝑁)) = ((#‘(𝑋𝐻𝑁)) + (#‘(𝑋𝐶𝑁)))) 

Theorem  numclwwlk3lemlem 27370* 
Lemma for numclwwlk3lem 27371: The set of closed vertices of a fixed
length 𝑁 on a fixed vertex 𝑉 is the
union of the set of closed
walks of length 𝑁 at 𝑉 with the last but one
vertex being 𝑉
and the set of closed walks of length 𝑁 at 𝑉 with the last but
one vertex not being 𝑉. (Contributed by AV, 1May2022.)

⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣})
& ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) ≠ 𝑣}) ⇒ ⊢ ((𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘2))
→ (𝑋(ClWWalksNOn‘𝐺)𝑁) = ((𝑋𝐻𝑁) ∪ (𝑋𝐶𝑁))) 

Theorem  numclwwlk3lem 27371* 
Lemma for numclwwlk3 27372: The number of closed vertices of a fixed
length 𝑁 on a fixed vertex 𝑉 is the
sum of the number of closed
walks of length 𝑁 at 𝑉 with the last but one
vertex being 𝑉
and the set of closed walks of length 𝑁 at 𝑉 with the last but
one vertex not being 𝑉. (Contributed by Alexander van der
Vekens,
6Oct2018.) (Revised by AV, 1Jun2021.) (Revised by AV,
1May2022.)

⊢ 𝐶 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) = 𝑣})
& ⊢ 𝐻 = (𝑣 ∈ 𝑉, 𝑛 ∈ (ℤ_{≥}‘2)
↦ {𝑤 ∈ (𝑣(ClWWalksNOn‘𝐺)𝑛) ∣ (𝑤‘(𝑛 − 2)) ≠ 𝑣}) ⇒ ⊢ (((𝐺 ∈ FinUSGraph ∧ 𝑋 ∈ 𝑉) ∧ 𝑁 ∈ (ℤ_{≥}‘2))
→ (#‘(𝑋(ClWWalksNOn‘𝐺)𝑁)) = ((#‘(𝑋𝐻𝑁)) + (#‘(𝑋𝐶𝑁)))) 

Theorem  numclwwlk3 27372 
Statement 12 in [Huneke] p. 2: "Thus f(n)
= (k  1)f(n  2) + k^(n2)."
 the number of the closed walks v(0) ... v(n2) v(n1) v(n) is the sum
of the number of the closed walks v(0) ... v(n2) v(n1) v(n) with
v(n2) = v(n) (see numclwwlk1 27351) and with v(n2) =/= v(n) (see
numclwwlk2 27361): f(n) = kf(n2) + k^(n2)  f(n2) =
(k1)f(n2) +
k^(n2). (Contributed by Alexander van der Vekens, 26Aug2018.)
(Revised by AV, 6Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ (((𝐺RegUSGraph𝐾 ∧ 𝐺 ∈ FriendGraph ) ∧ (𝑉 ∈ Fin ∧ 𝑋 ∈ 𝑉 ∧ 𝑁 ∈ (ℤ_{≥}‘3)))
→ (#‘(𝑋(ClWWalksNOn‘𝐺)𝑁)) = (((𝐾 − 1) · (#‘(𝑋(ClWWalksNOn‘𝐺)(𝑁 − 2)))) + (𝐾↑(𝑁 − 2)))) 

Theorem  numclwwlk4 27373* 
The total number of closed walks in a finite simple graph is the sum of
the numbers of closed walks starting at each of its vertices.
(Contributed by Alexander van der Vekens, 7Oct2018.) (Revised by AV,
2Jun2021.) (Revised by AV, 7Mar2022.) (Proof shortened by AV,
28Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FinUSGraph ∧ 𝑁 ∈ ℕ) → (#‘(𝑁 ClWWalksN 𝐺)) = Σ𝑥 ∈ 𝑉 (#‘(𝑥(ClWWalksNOn‘𝐺)𝑁))) 

Theorem  numclwwlk5lem 27374 
Lemma for numclwwlk5 27375. (Contributed by Alexander van der Vekens,
7Oct2018.) (Revised by AV, 2Jun2021.) (Revised by AV,
7Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺RegUSGraph𝐾 ∧ 𝑋 ∈ 𝑉 ∧ 𝐾 ∈ ℕ_{0}) → (2
∥ (𝐾 − 1)
→ ((#‘(𝑋(ClWWalksNOn‘𝐺)2)) mod 2) = 1)) 

Theorem  numclwwlk5 27375 
Statement 13 in [Huneke] p. 2: "Let p be
a prime divisor of k1; then
f(p) = 1 (mod p) [for each vertex v]". (Contributed by Alexander
van
der Vekens, 7Oct2018.) (Revised by AV, 2Jun2021.) (Revised by AV,
7Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ (((𝐺RegUSGraph𝐾 ∧ 𝐺 ∈ FriendGraph ∧ 𝑉 ∈ Fin) ∧ (𝑋 ∈ 𝑉 ∧ 𝑃 ∈ ℙ ∧ 𝑃 ∥ (𝐾 − 1))) → ((#‘(𝑋(ClWWalksNOn‘𝐺)𝑃)) mod 𝑃) = 1) 

Theorem  numclwwlk7lem 27376 
Lemma for numclwwlk7 27378, frgrreggt1 27380 and frgrreg 27381: If a finite,
nonempty friendship graph is 𝐾regular, the 𝐾 is a nonnegative
integer. (Contributed by AV, 3Jun2021.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ (((𝐺RegUSGraph𝐾 ∧ 𝐺 ∈ FriendGraph ) ∧ (𝑉 ≠ ∅ ∧ 𝑉 ∈ Fin)) → 𝐾 ∈
ℕ_{0}) 

Theorem  numclwwlk6 27377 
For a prime divisor 𝑃 of 𝐾 − 1, the total
number of closed
walks of length 𝑃 in a 𝐾regular friendship graph
is equal
modulo 𝑃 to the number of vertices.
(Contributed by Alexander van
der Vekens, 7Oct2018.) (Revised by AV, 3Jun2021.) (Proof shortened
by AV, 7Mar2022.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ (((𝐺RegUSGraph𝐾 ∧ 𝐺 ∈ FriendGraph ∧ 𝑉 ∈ Fin) ∧ (𝑃 ∈ ℙ ∧ 𝑃 ∥ (𝐾 − 1))) → ((#‘(𝑃 ClWWalksN 𝐺)) mod 𝑃) = ((#‘𝑉) mod 𝑃)) 

Theorem  numclwwlk7 27378 
Statement 14 in [Huneke] p. 2: "The total
number of closed walks of
length p [in a friendship graph] is (k(k1)+1)f(p)=1 (mod p)",
since the
number of vertices in a friendship graph is (k(k1)+1), see
frrusgrord0 27320 or frrusgrord 27321, and p divides (k1), i.e. (k1) mod p =
0 => k(k1) mod p = 0 => k(k1)+1 mod p = 1. Since the null graph
is a
friendship graph, see frgr0 27244, as well as kregular (for any k), see
0vtxrgr 26528, but has no closed walk, see 0clwlk0 27110, this theorem would
be false for a null graph: ((#‘(𝑃 ClWWalksN 𝐺)) mod 𝑃) = 0
≠ 1, so this case must be excluded (by
assuming 𝑉
≠ ∅).
(Contributed by Alexander van der Vekens, 1Sep2018.) (Revised by AV,
3Jun2021.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ (((𝐺RegUSGraph𝐾 ∧ 𝐺 ∈ FriendGraph ) ∧ (𝑉 ≠ ∅ ∧ 𝑉 ∈ Fin) ∧ (𝑃 ∈ ℙ ∧ 𝑃 ∥ (𝐾 − 1))) → ((#‘(𝑃 ClWWalksN 𝐺)) mod 𝑃) = 1) 

Theorem  numclwwlk8 27379 
The size of the set of closed walks of length 𝑃, 𝑃 prime, is
divisible by 𝑃. This corresponds to statement 9 in
[Huneke] p. 2:
"It follows that, if p is a prime number, then the number of closed
walks
of length p is divisible by p", see also clwlksndivn 27059. (Contributed by
Alexander van der Vekens, 7Oct2018.) (Revised by AV, 3Jun2021.)
(Proof shortened by AV, 2Mar2022.)

⊢ ((𝐺 ∈ FinUSGraph ∧ 𝑃 ∈ ℙ) → ((#‘(𝑃 ClWWalksN 𝐺)) mod 𝑃) = 0) 

Theorem  frgrreggt1 27380 
If a finite nonempty friendship graph is 𝐾regular with 𝐾 > 1,
then 𝐾 must be 2.
(Contributed by Alexander van der Vekens,
7Oct2018.) (Revised by AV, 3Jun2021.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑉 ∈ Fin ∧ 𝑉 ≠ ∅) → ((𝐺RegUSGraph𝐾 ∧ 1 < 𝐾) → 𝐾 = 2)) 

Theorem  frgrreg 27381 
If a finite nonempty friendship graph is 𝐾regular, then 𝐾 must
be 2 (or 0).
(Contributed by Alexander van der Vekens,
9Oct2018.) (Revised by AV, 3Jun2021.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝑉 ∈ Fin ∧ 𝑉 ≠ ∅) → ((𝐺 ∈ FriendGraph ∧ 𝐺RegUSGraph𝐾) → (𝐾 = 0 ∨ 𝐾 = 2))) 

Theorem  frgrregord013 27382 
If a finite friendship graph is 𝐾regular, then it must have order
0, 1 or 3. (Contributed by Alexander van der Vekens, 9Oct2018.)
(Revised by AV, 4Jun2021.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑉 ∈ Fin ∧ 𝐺RegUSGraph𝐾) → ((#‘𝑉) = 0 ∨ (#‘𝑉) = 1 ∨ (#‘𝑉) = 3)) 

Theorem  frgrregord13 27383 
If a nonempty finite friendship graph is 𝐾regular, then it must
have order 1 or 3. Special case of frgrregord013 27382. (Contributed by
Alexander van der Vekens, 9Oct2018.) (Revised by AV, 4Jun2021.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ (((𝐺 ∈ FriendGraph ∧ 𝑉 ∈ Fin ∧ 𝑉 ≠ ∅) ∧ 𝐺RegUSGraph𝐾) → ((#‘𝑉) = 1 ∨ (#‘𝑉) = 3)) 

Theorem  frgrogt3nreg 27384* 
If a finite friendship graph has an order greater than 3, it cannot be
𝑘regular for any 𝑘.
(Contributed by Alexander van der Vekens,
9Oct2018.) (Revised by AV, 4Jun2021.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑉 ∈ Fin ∧ 3 < (#‘𝑉)) → ∀𝑘 ∈ ℕ_{0}
¬ 𝐺RegUSGraph𝑘) 

Theorem  friendshipgt3 27385* 
The friendship theorem for big graphs: In every finite friendship graph
with order greater than 3 there is a vertex which is adjacent to all
other vertices. (Contributed by Alexander van der Vekens, 9Oct2018.)
(Revised by AV, 4Jun2021.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑉 ∈ Fin ∧ 3 < (#‘𝑉)) → ∃𝑣 ∈ 𝑉 ∀𝑤 ∈ (𝑉 ∖ {𝑣}){𝑣, 𝑤} ∈ (Edg‘𝐺)) 

Theorem  friendship 27386* 
The friendship theorem: In every finite (nonempty) friendship graph
there is a vertex which is adjacent to all other vertices. This is
Metamath 100 proof #83. (Contributed by Alexander van der Vekens,
9Oct2018.)

⊢ 𝑉 = (Vtx‘𝐺) ⇒ ⊢ ((𝐺 ∈ FriendGraph ∧ 𝑉 ≠ ∅ ∧ 𝑉 ∈ Fin) → ∃𝑣 ∈ 𝑉 ∀𝑤 ∈ (𝑉 ∖ {𝑣}){𝑣, 𝑤} ∈ (Edg‘𝐺)) 

PART 17 GUIDES AND
MISCELLANEA


17.1 Guides (conventions, explanations, and
examples)


17.1.1 Conventions
This section describes the conventions we use. These conventions often refer
to existing mathematical practices, which are discussed in more detail in
other references.
For the general conventions see conventions 27387, for conventions related
to labels see conventionslabel 27388, and for conventions directed more
specifically towards contributors see conventionscontrib 27389.
Logic and set theory provide a foundation for all of mathematics. To learn
about them, you should study one or more of the references listed below. We
indicate references using square brackets. The textbooks provide a
motivation for what we are doing, whereas Metamath lets you see in detail all
hidden and implicit steps. Most standard theorems are accompanied by
citations. Some closely followed texts include the following:
 Axioms of propositional calculus  [Margaris].
 Axioms of predicate calculus  [Megill] (System S3' in the article
referenced).
 Theorems of propositional calculus  [WhiteheadRussell].
 Theorems of pure predicate calculus  [Margaris].
 Theorems of equality and substitution  [Monk2], [Tarski], [Megill].
 Axioms of set theory  [BellMachover].
 Development of set theory  [TakeutiZaring]. (The first part of [Quine]
has a good explanation of the powerful device of "virtual" or
class abstractions, which is essential to our development.)
 Construction of real and complex numbers  [Gleason]
 Theorems about real numbers  [Apostol]


Theorem  conventions 27387 
Here are some of the conventions we use in the Metamath Proof Explorer
(aka "set.mm"), and how they correspond to typical textbook language
(skipping the many cases where they are identical).
For conventions related to labels, see conventionslabel 27388.
For additional conventions more specifically directed towards
contributors see conventionscontrib 27389.
 Notation.
Where possible, the notation attempts to conform to modern
conventions, with variations due to our choice of the axiom system
or to make proofs shorter. However, our notation is strictly
sequential (lefttoright). For example, summation is written in the
form Σ𝑘 ∈ 𝐴𝐵 (dfsum 14461) which denotes that index
variable 𝑘 ranges over 𝐴 when evaluating 𝐵. Thus,
Σ𝑘 ∈ ℕ (1 / (2↑𝑘)) = 1 means 1/2 + 1/4 + 1/8 + ...
= 1 (geoihalfsum 14658).
The notation is usually explained in more detail when first introduced.
 Axiomatic assertions ($a).
All axiomatic assertions ($a statements)
starting with " ⊢ " have labels starting
with "ax" (axioms) or "df" (definitions). A statement with a
label starting with "ax" corresponds to what is traditionally
called an axiom. A statement with a label starting with "df"
introduces new symbols or a new relationship among symbols
that can be eliminated; they always extend the definition of
a wff or class. Metamath blindly treats $a statements as new
given facts but does not try to justify them. The mmj2 program
will justify the definitions as sound as discussed below,
except for 4 definitions (dfbi 197, dfcleq 2644, dfclel 2647, dfclab 2638)
that require a more complex metalogical justification by hand.
 Proven axioms.
In some cases we wish to treat an expression as an axiom in
later theorems, even though it can be proved. For example,
we derive the postulates or axioms of complex arithmetic as
theorems of ZFC set theory. For convenience, after deriving
the postulates, we reintroduce them as new axioms on
top of set theory. This lets us easily identify which axioms
are needed for a particular complex number proof, without the
obfuscation of the set theory used to derive them. For more, see
mmcomplex.html. When we wish
to use a previouslyproven assertion as an axiom, our convention
is that we use the
regular "axNAME" label naming convention to define the axiom,
but we precede it with a proof of the same statement with the label
"axNAME" . An example is complex arithmetic axiom ax1cn 10032,
proven by the preceding theorem ax1cn 10008.
The metamath.exe program will warn if an axiom does not match the
preceding theorem that justifies it if the names match in this way.
 Definitions (df...).
We encourage definitions to include hypertext links to proven examples.
 Statements with hypotheses. Many theorems and some axioms,
such as axmp 5, have hypotheses that must be satisfied in order for
the conclusion to hold, in this case min and maj. When presented in
summarized form such as in the Theorem List (click on "Nearby theorems"
on the axmp 5 page), the hypotheses are connected with an ampersand and
separated from the conclusion with a big arrow, such as in " ⊢ 𝜑
& ⊢ (𝜑 → 𝜓) => ⊢ 𝜓". These symbols are _not_
part of the Metamath language but are just informal notation meaning
"and" and "implies".
 Discouraged use and modification.
If something should only be used in limited ways, it is marked with
"(New usage is discouraged.)". This is used, for example, when something
can be constructed in more than one way, and we do not want later
theorems to depend on that specific construction.
This marking is also used if we want later proofs to use proven axioms.
For example, we want later proofs to
use ax1cn 10032 (not ax1cn 10008) and ax1ne0 10043 (not ax1ne0 10019), as these
are proven axioms for complex arithmetic. Thus, both
ax1cn 10008 and ax1ne0 10019 are marked as "(New usage is discouraged.)".
In some cases a proof should not normally be changed, e.g., when it
demonstrates some specific technique.
These are marked with "(Proof modification is discouraged.)".
 New definitions infrequent.
Typically, we are minimalist when introducing new definitions; they are
introduced only when a clear advantage becomes apparent for reducing
the number of symbols, shortening proofs, etc. We generally avoid
the introduction of gratuitous definitions because each one requires
associated theorems and additional elimination steps in proofs.
For example, we use < and ≤ for inequality expressions, and
use ((sin‘(i · 𝐴)) / i) instead of (sinh‘𝐴)
for the hyperbolic sine.
 Minimizing axioms and the axiom of choice.
We prefer proofs that depend on fewer and/or weaker axioms,
even if the proofs are longer. In particular, we prefer proofs that do
not use the axiom of choice (dfac 8977) where such proofs can be found.
The axiom of choice is widely accepted, and ZFC is the most
commonlyaccepted fundamental set of axioms for mathematics.
However, there have been and still are some lingering controversies
about the Axiom of Choice. Therefore, where a proof
does not require the axiom of choice, we prefer that proof instead.
E.g., our proof of the SchroederBernstein Theorem (sbth 8121)
does not use the axiom of choice.
In some cases, the weaker axiom of countable choice (axcc 9295)
or axiom of dependent choice (axdc 9306) can be used instead.
Similarly, any theorem in first order logic (FOL) that
contains only set variables that are all mutually distinct,
and has no wff variables, can be proved *without* using
ax10 2059 through ax13 2282, by invoking ax10w 2046 through ax13w 2053.
We encourage proving theorems *without* ax10 2059 through ax13 2282
and moving them up to the ax4 1777 through ax9 2039 section.
 Alternative (ALT) proofs.
If a different proof is significantly shorter or clearer but
uses more or stronger axioms, we prefer to make that proof an
"alternative" proof (marked with an ALT label suffix), even if
this alternative proof was formalized first.
We then make the proof that requires fewer axioms the main proof.
This has the effect of reducing (over time)
the number and strength of axioms used by any particular proof.
There can be multiple alternatives if it makes sense to do so.
Alternative (*ALT) theorems should have "(Proof modification is
discouraged.) (New usage is discouraged.)" in their comment and should
follow the main statement, so that people reading the text in order will
see the main statement first. The alternative and main statement
comments should use hyperlinks to refer to each other (so that a reader
of one will become easily aware of the other).
 Alternative (ALTV) versions.
If a theorem or definition is an alternative/variant of an already
existing theorem resp. definition, its label should have the same name
with suffix ALTV. Such alternatives should be temporary only, until it
is decided which alternative should be used in the future. Alternative
(*ALTV) theorems or definitions are usually contained in mathboxes.
Their comments need not to contain "(Proof modification is discouraged.)
(New usage is discouraged.)". Alternative statements should follow the
main statement, so that people reading the text in order will see the
main statement first.
 Old (OLD) versions or proofs.
If a proof, definition, axiom, or theorem is going to be removed,
we often stage that change by first renaming its
label with an OLD suffix (to make it clear that it is going to
be removed). Old (*OLD) statements should have "(Proof modification is
discouraged.) (New usage is discouraged.)" and "Obsolete version of
~ xxx as of ddmmmyyyy." (not enclosed in parentheses) in the comment.
An old statement should follow the main statement, so that people
reading the text in order will see the main statement first.
This typically happens when a shorter proof to an existing theorem is
found: the existing theorem is kept as an *OLD statement for one year.
When a proof is shortened automatically (using Metamath's minimize_with
command), then it is not necessary to keep the old proof, nor to add
credit for the shortening.
 Variables.
Propositional variables (variables for wellformed formulas or wffs) are
represented with lowercase Greek letters and are normally used
in this order:
𝜑 = phi, 𝜓 = psi, 𝜒 = chi, 𝜃 = theta,
𝜏 = tau, 𝜂 = eta, 𝜁 = zeta, and 𝜎 = sigma.
Individual setvar variables are represented with lowercase Latin letters
and are normally used in this order:
𝑥, 𝑦, 𝑧, 𝑤, 𝑣, 𝑢, and 𝑡.
Variables that represent classes are often represented by
uppercase Latin letters:
𝐴, 𝐵, 𝐶, 𝐷, 𝐸, and so on.
There are other symbols that also represent class variables and suggest
specific purposes, e.g., 0 for poset zero (see p0val 17088) and
connective symbols such as + for some group addition operation.
(See prdsplusgval 16180 for an example of the use of +).
Class variables are selected in alphabetical order starting
from 𝐴 if there is no reason to do otherwise, but many
assertions select different class variables or a different order
to make their intended meaning clearer.
 Turnstile.
"⊢ ", meaning "It is provable that," is the first token
of all assertions
and hypotheses that aren't syntax constructions. This is a standard
convention in logic. For us, it also prevents any ambiguity with
statements that are syntax constructions, such as "wff ¬ 𝜑".
 Biconditional (↔).
There are basically two ways to maximize the effectiveness of
biconditionals (↔):
you can either have onedirectional simplifications of all theorems
that produce biconditionals, or you can have onedirectional
simplifications of theorems that consume biconditionals.
Some tools (like Lean) follow the first approach, but set.mm follows
the second approach. Practically, this means that in set.mm, for
every theorem that uses an implication in the hypothesis, like
axmp 5, there is a corresponding version with a biconditional or a
reversed biconditional, like mpbi 220 or mpbir 221. We prefer this
second approach because the number of duplications in the second
approach is bounded by the size of the propositional calculus section,
which is much smaller than the number of possible theorems in all later
sections that produce biconditionals. So although theorems like
biimpi 206 are available, in most cases there is already a theorem that
combines it with your theorem of choice, like mpbir2an 975, sylbir 225,
or 3imtr4i 281.
 Substitution.
"[𝑦 / 𝑥]𝜑" should be read "the wff that results from the
proper substitution of 𝑦 for 𝑥 in wff 𝜑." See dfsb 1938
and the related dfsbc 3469 and dfcsb 3567.
One way to remember this notation is to notice that it looks like
division and recall that (𝑦 / 𝑥) · 𝑥 is 𝑦 when 𝑥 ≠ 0.
 Isaset.
"𝐴 ∈ V" should be read "Class 𝐴 is a set (i.e. exists)."
This is a convention based on Definition 2.9 of [Quine] p. 19.
See dfv 3233 and isset 3238.
However, instead of using 𝐼 ∈ V in the antecedent of a theorem for
some variable 𝐼, we now prefer to use 𝐼 ∈ 𝑉 (or another
variable if 𝑉 is not available) to make it more general. That way we
can often avoid needing extra uses of elex 3243 and syl 17 in the common
case where 𝐼 is already a member of something.
For hypotheses ($e statement) of theorems (mostly in inference form),
however, ⊢ 𝐴 ∈ V is used rather than ⊢ 𝐴 ∈ 𝑉 (e.g.
difexi 4842). This is because 𝐴 ∈ V is almost always satisfied using
an existence theorem stating "... ∈ V", and a hardcoded V in
the $e statement saves a couple of syntax building steps that substitute
V into 𝑉. Notice that this does not hold for hypotheses of
theorems in deduction form: Here still ⊢ (𝜑 → 𝐴 ∈ 𝑉) should be
used rather than ⊢ (𝜑 → 𝐴 ∈ V).
 Converse.
"^{◡}𝑅" should be read "converse of (relation) 𝑅"
and is the same as the more standard notation R^{1}
(the standard notation is ambiguous). See dfcnv 5151.
This can be used to define a subset, e.g., dftan 14846 notates
"the set of values whose cosine is a nonzero complex number" as
(^{◡}cos “ (ℂ ∖ {0})).
 Function application.
"(𝐹‘𝑥)" should be read "the value
of function 𝐹 at 𝑥" and has the same meaning as the more
familiar but ambiguous notation F(x). For example,
(cos‘0) = 1 (see cos0 14924). The left apostrophe notation
originated with Peano and was adopted in Definition *30.01 of
[WhiteheadRussell] p. 235, Definition 10.11 of [Quine] p. 68, and
Definition 6.11 of [TakeutiZaring] p. 26. See dffv 5934.
In the ASCII (input) representation there are spaces around the grave
accent; there is a single accent when it is used directly,
and it is doubled within comments.
 Infix and parentheses.
When a function that takes two classes and produces a class
is applied as part of an infix expression, the expression is always
surrounded by parentheses (see dfov 6693).
For example, the + in (2 + 2); see 2p2e4 11182.
Function application is itself an example of this.
Similarly, predicate expressions
in infix form that take two or three wffs and produce a wff
are also always surrounded by parentheses, such as
(𝜑 → 𝜓), (𝜑 ∨ 𝜓), (𝜑 ∧ 𝜓), and
(𝜑 ↔ 𝜓)
(see wi 4, dfor 384, dfan 385, and dfbi 197 respectively).
In contrast, a binary relation (which compares two _classes_ and
produces a _wff_) applied in an infix expression is _not_
surrounded by parentheses.
This includes set membership 𝐴 ∈ 𝐵 (see wel 2031),
equality 𝐴 = 𝐵 (see dfcleq 2644),
subset 𝐴 ⊆ 𝐵 (see dfss 3621), and
lessthan 𝐴 < 𝐵 (see dflt 9987). For the general definition
of a binary relation in the form 𝐴𝑅𝐵, see dfbr 4686.
For example, 0 < 1 (see 0lt1 10588) does not use parentheses.
 Unary minus.
The symbol  is used to indicate a unary minus, e.g., 1.
It is specially defined because it is so commonly used.
See cneg 10305.
 Function definition.
Functions are typically defined by first defining the constant symbol
(using $c) and declaring that its symbol is a class with the
label cNAME (e.g., ccos 14839).
The function is then defined labeled dfNAME; definitions
are typically given using the mapsto notation (e.g., dfcos 14845).
Typically, there are other proofs such as its
closure labeled NAMEcl (e.g., coscl 14901), its
function application form labeled NAMEval (e.g., cosval 14897),
and at least one simple value (e.g., cos0 14924).
 Factorial.
The factorial function is traditionally a postfix operation,
but we treat it as a normal function applied in prefix form, e.g.,
(!‘4) = ;24 (dffac 13101 and fac4 13108).
 Unambiguous symbols.
A given symbol has a single unambiguous meaning in general.
Thus, where the literature might use the same symbol with different
meanings, here we use different (variant) symbols for different
meanings. These variant symbols often have suffixes, subscripts,
or underlines to distinguish them. For example, here
"0" always means the value zero (df0 9981), while
"0_{g}" is the group identity element (df0g 16149),
"0." is the poset zero (dfp0 17086),
"0_{𝑝}" is the zero polynomial (df0p 23482),
"0_{vec}" is the zero vector in a normed subcomplex vector space
(df0v 27581), and
"0" is a class variable for use as a connective symbol
(this is used, for example, in p0val 17088).
There are other class variables used as connective symbols
where traditional notation would use ambiguous symbols, including
"1", "+", "∗", and "∥".
These symbols are very similar to traditional notation, but because
they are different symbols they eliminate ambiguity.
 ASCII representation of symbols.
We must have an ASCII representation for each symbol.
We generally choose short sequences, ideally digraphs, and generally
choose sequences that vaguely resemble the mathematical symbol.
Here are some of the conventions we use when selecting an
ASCII representation.
We generally do not include parentheses inside a symbol because
that confuses text editors (such as emacs).
Greek letters for wff variables always use the first two letters
of their English names, making them easy to type and easy to remember.
Symbols that almost look like letters, such as ∀,
are often represented by that letter followed by a period.
For example, "A." is used to represent ∀,
"e." is used to represent ∈, and
"E." is used to represent ∃.
Single letters are now always variable names, so constants that are
often shown as single letters are now typically preceded with "_"
in their ASCII representation, for example,
"_i" is the ASCII representation for the imaginary unit i.
A script font constant is often the letter
preceded by "~" meaning "curly", such as "~P" to represent
the power class 𝒫.
Originally, all setvar and class variables used only single letters
az and AZ, respectively. A big change in recent years was to
allow the use of certain symbols as variable names to make formulas
more readable, such as a variable representing an additive group
operation. The convention is to take the original constant token
(in this case "+" which means complex number addition) and put
a period in front of it to result in the ASCII representation of the
variable ".+", shown as +, that can
be used instead of say the letter "P" that had to be used before.
Choosing tokens for more advanced concepts that have no standard
symbols but are represented by words in books, is hard. A few are
reasonably obvious, like "Grp" for group and "Top" for topology,
but often they seem to end up being either too long or too
cryptic. It would be nice if the math community came up with
standardized short abbreviations for English math terminology,
like they have more or less done with symbols, but that probably
won't happen any time soon.
Another informal convention that we've somewhat followed, that is also
not uncommon in the literature, is to start tokens with a
capital letter for collectionlike objects and lower case for
functionlike objects. For example, we have the collections On
(ordinal numbers), Fin, Prime, Grp, and we have the functions sin,
tan, log, sup. Predicates like Ord and Lim also tend to start
with upper case, but in a sense they are really collectionlike,
e.g. Lim indirectly represents the collection of limit ordinals,
but it can't be an actual class since not all limit ordinals
are sets.
This initial capital vs. lower case letter convention is sometimes
ambiguous. In the past there's been a debate about whether
domain and range are collectionlike or functionlike, thus whether
we should use Dom, Ran or dom, ran. Both are used in the literature.
In the end dom, ran won out for aesthetic reasons
(Norm Megill simply just felt they looked nicer).
 Typography conventions.
Class symbols for functions (e.g., abs, sin)
should usually not have leading or trailing blanks in their
HTML/Latex representation.
This is in contrast to class symbols for operations
(e.g., gcd, sadd, eval), which usually do
include leading and trailing blanks in their representation.
If a class symbol is used for a function as well as an operation
(according to the definition dfov 6693, each operation value can be
written as function value of an ordered pair), the convention for its
primary usage should be used, e.g. (iEdg‘𝐺) versus
(𝑉iEdg𝐸) for the edges of a graph 𝐺 = ⟨𝑉, 𝐸⟩.
 Number construction independence.
There are many ways to model complex numbers.
After deriving the complex number postulates we
reintroduce them as new axioms on top of set theory.
This lets us easily identify which axioms are needed
for a particular complex number proof, without the obfuscation
of the set theory used to derive them.
This also lets us be independent of the specific construction,
which we believe is valuable.
See mmcomplex.html for details.
Thus, for example, we don't allow the use of ∅ ∉ ℂ,
as handy as that would be, because that would be
constructionspecific. We want proofs about ℂ to be independent
of whether or not ∅ ∈ ℂ.
 Minimize hypotheses
(except for construction independence and number theorem domains).
In most cases we try to minimize hypotheses, that is,
we eliminate or reduce what must be true to prove something, so that
the proof is more general and easier to use.
There are exceptions. For example, we intentionally add hypotheses
if they help make proofs independent of a particular construction
(e.g., the contruction of complex numbers ℂ).
We also intentionally add hypotheses for many real and complex
number theorems to expressly state their domains even when they
are not strictly needed. For example, we could show that
(𝐴 < 𝐵 → 𝐵 ≠ 𝐴) without any other hypotheses, but in
practice we also require proving at least some domains
(e.g., see ltnei 10199). Here are the reasons as discussed in
https://groups.google.com/g/metamath/c/2AW7T3d2YiQ:
 Having the hypotheses immediately shows the intended domain of
applicability (is it ℝ, ℝ^{*}, ω, or something else?),
without having to trace back to definitions.
 Having the hypotheses forces its use in the intended
domain, which generally is desirable.
 The behavior is dependent on accidental behavior of definitions
outside of their domains, so the theorems are nonportable and
"brittle".
 Only a few theorems can have their hypotheses removed
in this fashion due to happy coincidences for our particular
settheoretical definitions. The poor user (especially a
novice learning real number arithmetic) is going to be
confused not knowing when hypotheses are needed and when
they are not. For someone who hasn't traced back the
settheoretical foundations of the definitions, it is
seemingly random and isn't intuitive at all.
 The consensus of opinion of people on this group seemed to be
against doing this.
 Natural numbers.
There are different definitions of "natural" numbers in the literature.
We use ℕ (dfnn 11059) for the set of positive integers starting
from 1, and ℕ_{0} (dfn0 11331) for the set of nonnegative integers
starting at zero.
 Decimal numbers.
Numbers larger than nine are often expressed in base 10 using the
decimal constructor dfdec 11532, e.g., ;;;4001 (see 4001prm 15899
for a proof that 4001 is prime).
 Theorem forms.
We will use the following descriptive terms to categorize theorems:
 A theorem is in "closed form" if it has no $e hypotheses
(e.g., unss 3820). The term "tautology" is also used, especially in
propositional calculus. This form was formerly called "theorem form"
or "closed theorem form".
 A theorem is in "deduction form" (or is a "deduction") if it
has zero or more $e hypotheses, and the hypotheses and the conclusion
are implications that share the same antecedent. More precisely, the
conclusion is an implication with a wff variable as the antecedent
(usually 𝜑), and every hypothesis ($e statement) is either:
 an implication with the same antecedent as the conclusion, or
 a definition. A definition can be for a class variable (this is a
class variable followed by =, e.g. the definition of 𝐷 in
lhop 23824) or a wff variable (this is a wff variable followed by
↔); class variable definitions are more common.
In practice, a proof of a theorem in deduction form will also contain
many steps that are implications where the antecedent is either that
wff variable (usually 𝜑) or is a conjunction (𝜑 ∩ ...)
including that wff variable (𝜑). E.g. a1d 25, unssd 3822.
Although they are no real deductions, theorems without $e hypotheses,
but in the form (𝜑 → ...), are also said to be in "deduction
form". Such theorems usually have a two step proof, applying a1i 11 to a
given theorem, and are used as convenience theorems to shorten many
proofs. E.g. eqidd 2652, which is used more than 1500 times.
 A theorem is in "inference form" (or is an "inference") if
it has one or more $e hypotheses, but is not in deduction form,
i.e. there is no common antecedent (e.g., unssi 3821).
Any theorem whose conclusion is an implication has an associated
inference, whose hypotheses are the hypotheses of that theorem
together with the antecedent of its conclusion, and whose conclusion is
the consequent of that conclusion. When both theorems are in set.mm,
then the associated inference is often labeled by adding the suffix "i"
to the label of the original theorem (for instance, con3i 150 is the
inference associated with con3 149). The inference associated with a
theorem is easily derivable from that theorem by a simple use of
axmp 5. The other direction is the subject of the Deduction Theorem
discussed below. We may also use the term "associated inference" when
the above process is iterated. For instance, syl 17 is an
inference associated with imim1 83 because it is the inference
associated with imim1i 63 which is itself the inference
associated with imim1 83.
"Deduction form" is the preferred form for theorems because this form
allows us to easily use the theorem in places where (in traditional
textbook formalizations) the standard Deduction Theorem (see below)
would be used. We call this approach "deduction style".
In contrast, we usually avoid theorems in "inference form" when that
would end up requiring us to use the deduction theorem.
Deductions have a label suffix of "d", especially if there are other
forms of the same theorem (e.g., pm2.43d 53). The labels for inferences
usually have the suffix "i" (e.g., pm2.43i 52). The labels of theorems
in "closed form" would have no special suffix (e.g., pm2.43 56). When
an inference is converted to a theorem by eliminating an "is a set"
hypothesis, we sometimes suffix the closed form with "g" (for "more
general") as in uniex 6995 vs. uniexg 6997.
 Deduction theorem.
The Deduction Theorem is a metalogical theorem that provides an
algorithm for constructing a proof of a theorem from the proof of its
corresponding deduction (its associated inference). See for instance
Theorem 3 in [Margaris] p. 56. In ordinary mathematics, no one actually
carries out the algorithm, because (in its most basic form) it involves
an exponential explosion of the number of proof steps as more hypotheses
are eliminated. Instead, in ordinary mathematics the Deduction Theorem
is invoked simply to claim that something can be done in principle,
without actually doing it. For more details, see mmdeduction.html.
The Deduction Theorem is a metalogical theorem that cannot be applied
directly in metamath, and the explosion of steps would be a problem
anyway, so alternatives are used. One alternative we use sometimes is
the "weak deduction theorem" dedth 4172, which works in certain cases in
set theory. We also sometimes use dedhb 3409. However, the primary
mechanism we use today for emulating the deduction theorem is to write
proofs in deduction form (aka "deduction style") as described earlier;
the prefixed 𝜑 → mimics the context in a deduction proof system.
In practice this mechanism works very well. This approach is described
in the deduction form and natural deduction page mmnatded.html; a
list of translations for common natural deduction rules is given in
natded 27390.
 Recursion.
We define recursive functions using various "recursion constructors".
These allow us to define, with compact direct definitions, functions
that are usually defined in textbooks with indirect selfreferencing
recursive definitions. This produces compact definition and much
simpler proofs, and greatly reduces the risk of creating unsound
definitions. Examples of recursion constructors include
recs(𝐹) in dfrecs 7513, rec(𝐹, 𝐼) in dfrdg 7551,
seq_{𝜔}(𝐹, 𝐼) in dfseqom 7588, and seq𝑀( + , 𝐹) in
dfseq 12842. These have characteristic function 𝐹 and initial value
𝐼. (Σ_{g} in dfgsum 16150 isn't really designed for arbitrary
recursion, but you could do it with the right magma.) The logically
primary one is dfrecs 7513, but for the "average user" the most useful
one is probably dfseq 12842 provided that a countable sequence is
sufficient for the recursion.
 Extensible structures.
Mathematics includes many structures such as ring, group, poset, etc.
We define an "extensible structure" which is then used to define group,
ring, poset, etc. This allows theorems from more general structures
(groups) to be reused for more specialized structures (rings) without
having to reprove them. See dfstruct 15906.
 Undefined results and "junk theorems".
Some expressions are only expected to be meaningful in certain contexts.
For example, consider Russell's definition description binder iota,
where (℩𝑥𝜑) is meant to be "the 𝑥 such that 𝜑"
(where 𝜑 typically depends on x).
What should that expression produce when there is no such 𝑥?
In set.mm we primarily use one of two approaches.
One approach is to make the expression evaluate to the empty set
whenever the expression is being used outside of its expected context.
While not perfect, it makes it a bit more clear when something
is undefined, and it has the advantage that it makes more
things equal outside their domain which can remove hypotheses when
you feel like exploiting these socalled junk theorems.
Note that Quine does this with iota (his definition of iota
evaluates to the empty set when there is no unique value of 𝑥).
Quine has no problem with that and we don't see why we should,
so we define iota exactly the same way that Quine does.
The main place where you see this being systematically exploited is in
"reverse closure" theorems like 𝐴 ∈ (𝐹‘𝐵) → 𝐵 ∈ dom 𝐹,
which is useful when 𝐹 is a family of sets. (by this we
mean it's a set set even in a type theoretic interpretation.)
The second approach uses "(New usage is discouraged.)" to prevent
unintentional uses of certain properties.
For example, you could define some construct dfNAME whose
usage is discouraged, and prove only the specific properties
you wish to use (and add those proofs to the list of permitted uses
of "discouraged" information). From then on, you can only use
those specific properties without a warning.
Other approaches often have hidden problems.
For example, you could try to "not define undefined terms"
by creating definitions like ${ $d 𝑦𝑥 $. $d 𝑦𝜑 $.
dfiota $a ⊢ (∃!𝑥𝜑 → (℩𝑥𝜑) = ∪ {𝑥 ∣ 𝜑}) $. $}.
This will be rejected by the definition checker, but the bigger
theoretical reason to reject this axiom is that it breaks equality 
the metatheorem (𝑥 = 𝑦 → P(x) = P(y) ) fails
to hold if definitions don't unfold without some assumptions.
(That is, iotabidv 5910 is no longer provable and must be added
as an axiom.) It is important for every syntax constructor to
satisfy equality theorems *unconditionally*, e.g., expressions
like (1 / 0) = (1 / 0) should not be rejected.
This is forced on us by the context free term
language, and anything else requires a lot more infrastructure
(e.g., a type checker) to support without making everything else
more painful to use.
Another approach would be to try to make nonsensical
statements syntactically invalid, but that can create its own
complexities; in some cases that would make parsing itself undecidable.
In practice this does not seem to be a serious issue.
No one does these things deliberately in "real" situations,
and some knowledgeable people (such as Mario Carneiro)
have never seen this happen accidentally.
Norman Megill doesn't agree that these "junk" consequences are
necessarily bad anyway, and they can significantly shorten proofs
in some cases. This database would be much larger if, for example,
we had to condition fvex 6239 on the argument being in the domain
of the function. It is impossible to derive a contradiction
from sound definitions (i.e. that pass the definition check),
assuming ZFC is consistent, and he doesn't see the point of all the
extra busy work and huge increase in set.mm size that would result
from restricting *all* definitions.
So instead of implementing a complex system to counter a
problem that does not appear to occur in practice, we use
a significantly simpler set of approaches.
 Organizing proofs.
Humans have trouble understanding long proofs. It is often preferable
to break longer proofs into smaller parts (just as with traditional
proofs). In Metamath this is done by creating separate proofs of the
separate parts.
A proof with the sole purpose of supporting a final proof is a lemma;
the naming convention for a lemma is the final proof's name followed by
"lem", and a number if there is more than one. E.g., sbthlem1 8111 is the
first lemma for sbth 8121. The comment should begin with "Lemma for",
followed by the final proof's name, so that it can be suppressed in
theorem lists (see metamath command WRITE THEOREM_LIST).
Also, consider proving reusable results separately, so that others will
be able to easily reuse that part of your work.
 Limit proof size.
It is often preferable to break longer proofs into
smaller parts, just as you would do with traditional proofs.
One reason is that humans have trouble understanding long proofs.
Another reason is that it's generally best to prove
reusable results separately,
so that others will be able to easily reuse them.
Finally, the "minimize" routine can take much longer with
very long proofs.
We encourage proofs to be no more than 200 essential steps, and
generally no more than 500 essential steps,
though these are simply guidelines and not hardandfast rules.
Much smaller proofs are fine!
We also acknowledge that some proofs, especially autogenerated ones,
should sometimes not be broken up (e.g., because
breaking them up might be useless and inefficient due to many
interconnections and reused terms within the proof).
In Metamath, breaking up longer proofs is done by creating multiple
separate proofs of separate parts.
A proof with the sole purpose of supporting a final proof is a
lemma; the naming convention for a lemma is the final proof's name
followed by "lem", and a number if there is more than one. E.g.,
sbthlem1 8111 is the first lemma for sbth 8121.
 Hypertext links.
We strongly encourage comments to have many links to related material,
with accompanying text that explains the relationship. These can help
readers understand the context. Links to other statements, or to
HTTP/HTTPS URLs, can be inserted in ASCII source text by prepending a
spaceseparated tilde (e.g., " ~ dfprm " results in " dfprm 15433").
When metamath.exe is used to generate HTML it automatically inserts
hypertext links for syntax used (e.g., every symbol used), every axiom
and definition depended on, the justification for each step in a proof,
and to both the next and previous assertion.
 Hypertext links to section headers.
Some section headers have text under them that describes or explains the
section. However, they are not part of the description of axioms or
theorems, and there is no way to link to them directly. To provide for
this, section headers with accompanying text (indicated with "*"
prefixed to mmtheorems.html#mmdtoc entries) have an anchor in
mmtheorems.html whose name is the first $a or $p statement that
follows the header. For example there is a glossary under the section
heading called GRAPH THEORY. The first $a or $p statement that follows
is cedgf 25912. To reference it we link to the anchor using a
spaceseparated tilde followed by the spaceseparated link
mmtheorems.html#cedgf, which will become the hyperlink
mmtheorems.html#cedgf. Note that no theorem in set.mm is allowed to
begin with "mm" (enforced by "verify markup" in the metamath program).
Whenever the software sees a tilde reference beginning with "http:",
"https:", or "mm", the reference is assumed to be a link to something
other than a statement label, and the tilde reference is used as is.
This can also be useful for relative links to other pages such as
mmcomplex.html.
 Bibliography references.
Please include a bibliographic reference to any external material used.
A name in square brackets in a comment indicates a
bibliographic reference. The full reference must be of the form
KEYWORD IDENTIFIER? NOISEWORD(S)* [AUTHOR(S)] p. NUMBER 
note that this is a very specific form that requires a page number.
There should be no comma between the author reference and the
"p." (a constant indicator).
Whitespace, comma, period, or semicolon should follow NUMBER.
An example is Theorem 3.1 of [Monk1] p. 22,
The KEYWORD, which is not casesensitive,
must be one of the following: Axiom, Chapter, Compare, Condition,
Corollary, Definition, Equation, Example, Exercise, Figure, Item,
Lemma, Lemmas, Line, Lines, Notation, Part, Postulate, Problem,
Property, Proposition, Remark, Rule, Scheme, Section, or Theorem.
The IDENTIFIER is optional, as in for example
"Remark in [Monk1] p. 22".
The NOISEWORDS(S) are zero or more from the list: from, in, of, on.
The AUTHOR(S) must be present in the file identified with the
htmlbibliography assignment (e.g., mmset.html) as a named anchor
(NAME=). If there is more than one document by the same author(s),
add a numeric suffix (as shown here).
The NUMBER is a page number, and may be any alphanumeric string such as
an integer or Roman numeral.
Note that we _require_ page numbers in comments for individual
$a or $p statements. We allow names in square brackets without
page numbers (a reference to an entire document) in
heading comments.
If this is a new reference, please also add it to the
"Bibliography" section of mmset.html.
(The file mmbiblio.html is automatically rebuilt, e.g.,
using the metamath.exe "write bibliography" command.)
 Acceptable shorter proofs
Shorter proofs are welcome, and any shorter proof we accept
will be acknowledged in the theorem's description. However,
in some cases a proof may be "shorter" or not depending on
how it is formatted. This section provides general guidelines.
Usually we automatically accept shorter proofs that (1)
shorten the set.mm file (with compressed proofs), (2) reduce
the size of the HTML file generated with SHOW STATEMENT xx
/ HTML, (3) use only existing, unmodified theorems in the
database (the order of theorems may be changed, though), and
(4) use no additional axioms.
Usually we will also automatically accept a _new_ theorem
that is used to shorten multiple proofs, if the total size
of set.mm (including the comment of the new theorem, not
including the acknowledgment) decreases as a result.
In borderline cases, we typically place more importance on
the number of compressed proof steps and less on the length
of the label section (since the names are in principle
arbitrary). If two proofs have the same number of compressed
proof steps, we will typically give preference to the one
with the smaller number of different labels, or if these
numbers are the same, the proof with the fewest number of
characters that the proofs happen to have by chance when
label lengths are included.
A few theorems have a longer proof than necessary in order
to avoid the use of certain axioms, for pedagogical purposes,
and for other reasons. These theorems will (or should) have
a "(Proof modification is discouraged.)" tag in their
description. For example, idALT 23 shows a proof directly from
axioms. Shorter proofs for such cases won't be accepted,
of course, unless the criteria described continues to be
satisfied.
 Information on syntax, axioms, and definitions.
For a hyperlinked list of syntax, axioms, and definitions, see
mmdefinitions.html.
If you have questions about a specific symbol or axiom, it is best
to go directly to its definition to learn more about it.
The generated HTML for each theorem and axiom includes hypertext
links to each symbol's definition.
 Reserved symbols: 'LETTER.
Some symbols are reserved for potential future use.
Symbols with the pattern 'LETTER are reserved for possibly
representing characters (this is somewhat similar to Lisp).
We would expect '\n to represent newline, 'sp for space, and perhaps
'\x24 for the dollar character.
 Language and spelling.
It is preferred to use American English for comments and symbols, e.g.
we use "neighborhood" instead of the British English "neighbourhood".
An exception is the word "analog", which can be either a noun or an
adjective. Furthermore, "analog" has the confounding meaning "not
digital", whereas "analogue" is often used in the sense something that
bears analogy to something else also in American English. Therefore,
"analogue" is used for the noun and "analogous" for the adjective in
set.mm.
The challenge of varying mathematical conventions
We try to follow mathematical conventions, but in many cases
different texts use different conventions.
In those cases we pick some reasonably common convention and stick to
it.
We have already mentioned that the term "natural number" has
varying definitions (some start from 0, others start from 1), but
that is not the only such case.
A useful example is the set of metavariables used to represent
arbitrary wellformed formulas (wffs).
We use an open phi, φ, to represent the first arbitrary wff in an
assertion with one or more wffs; this is a common convention and
this symbol is easily distinguished from the empty set symbol.
That said, it is impossible to please everyone or simply "follow
the literature" because there are many different conventions for
a variable that represents any arbitrary wff.
To demonstrate the point,
here are some conventions for variables that represent an arbitrary
wff and some texts that use each convention:
 open phi φ (and so on): Tarski's papers,
Rasiowa & Sikorski's
The Mathematics of Metamathematics (1963),
Monk's Introduction to Set Theory (1969),
Enderton's Elements of Set Theory (1977),
Bell & Machover's A Course in Mathematical Logic (1977),
Jech's Set Theory (1978),
Takeuti & Zaring's
Introduction to Axiomatic Set Theory (1982).
 closed phi ϕ (and so on):
Levy's Basic Set Theory (1979),
Kunen's Set Theory (1980),
Paulson's Isabelle: A Generic Theorem Prover (1994),
Huth and Ryan's Logic in Computer Science (2004/2006).
 Greek α, β, γ:
Duffy's Principles of Automated Theorem Proving (1991).
 Roman A, B, C:
Kleene's Introduction to Metamathematics (1974),
Smullyan's FirstOrder Logic (1968/1995).
 script A, B, C:
Hamilton's Logic for Mathematicians (1988).
 italic A, B, C:
Mendelson's Introduction to Mathematical Logic (1997).
 italic P, Q, R:
Suppes's Axiomatic Set Theory (1972),
Gries and Schneider's A Logical Approach to Discrete Math
(1993/1994),
Rosser's Logic for Mathematicians (2008).
 italic p, q, r:
Quine's Set Theory and Its Logic (1969),
Kuratowski & Mostowski's Set Theory (1976).
 italic X, Y, Z:
Dijkstra and Scholten's
Predicate Calculus and Program Semantics (1990).
 Fraktur letters:
Fraenkel et. al's Foundations of Set Theory (1973).
Distinctness or freeness
Here are some conventions that address distinctness or freeness of a
variable:
 Ⅎ𝑥𝜑 is read " 𝑥 is not free in (wff) 𝜑";
see dfnf 1750 (whose description has some important technical
details). Similarly, Ⅎ𝑥𝐴 is read 𝑥 is not free in (class)
𝐴, see dfnfc 2782.
 "$d x y $." should be read "Assume x and y are distinct
variables."
 "$d x 𝜑 $." should be read "Assume x does not occur in phi $."
Sometimes a theorem is proved using
Ⅎ𝑥𝜑 (dfnf 1750) in place of
"$d 𝑥𝜑 $." when a more general result is desired;
ax5 1879 can be used to derive the $d version. For an example of
how to get from the $d version back to the $e version, see the
proof of euf 2506 from dfeu 2502.
 "$d x A $." should be read "Assume x is not a variable occurring in
class A."
 "$d x A $. $d x ps $. $e  (𝑥 = 𝐴 → (𝜑 ↔ 𝜓)) $."
is an idiom
often used instead of explicit substitution, meaning "Assume psi results
from the proper substitution of A for x in phi."
 " ⊢ (¬ ∀𝑥𝑥 = 𝑦 → ..." occurs early in some cases, and
should be read "If x and y are distinct
variables, then..." This antecedent provides us with a technical
device (called a "distinctor" in Section 7 of [Megill] p. 444)
to avoid the need for the
$d statement early in our development of predicate calculus, permitting
unrestricted substitutions as conceptually simple as those in
propositional calculus. However, the $d eventually becomes a
requirement, and after that this device is rarely used.
There is a general technique to replace a $d x A or
$d x ph condition in a theorem with the corresponding
Ⅎ𝑥𝐴 or Ⅎ𝑥𝜑; here it is.
⊢ T[x, A] where $d 𝑥𝐴,
and you wish to prove ⊢ Ⅎ𝑥𝐴 ⇒ ⊢ T[x, A].
You apply the theorem substituting 𝑦 for 𝑥 and 𝐴 for 𝐴,
where 𝑦 is a new dummy variable, so that
$d y A is satisfied.
You obtain ⊢ T[y, A], and apply chvar to obtain ⊢
T[x, A] (or just use mpbir 221 if T[x, A] binds 𝑥).
The side goal is ⊢ (𝑥 = 𝑦 → ( T[y, A] ↔ T[x, A] )),
where you can use equality theorems, except
that when you get to a bound variable you use a nondv bound variable
renamer theorem like cbval 2307. The section
mmtheorems32.html#mm3146s also describes the
metatheorem that underlies this.
Standard Metamath verifiers do not distinguish between axioms and
definitions (both are $a statements).
In practice, we require that definitions (1) be conservative
(a definition should not allow an expression
that previously qualified as a wff but was not provable
to become provable) and be eliminable
(there should exist an algorithmic method for converting any
expression using the definition into
a logically equivalent expression that previously qualified as a wff).
To ensure this, we have additional rules on almost all definitions
($a statements with a label that does not begin with ax).
These additional rules are not applied in a few cases where they
are too strict (dfbi 197, dfclab 2638, dfcleq 2644, and dfclel 2647);
see those definitions for more information.
These additional rules for definitions are checked by at least
mmj2's definition check (see
mmj2 master file mmj2jar/macros/definitionCheck.js).
This definition check relies on the database being very much like
set.mm, down to the names of certain constants and types, so it
cannot apply to all Metamath databases... but it is useful in set.mm.
In this definition check, a $astatement with a given label and
typecode ⊢ passes the test if and only if it
respects the following rules (these rules require that we have
an unambiguous tree parse, which is checked separately):
 The expression must be a biconditional or an equality (i.e. its
rootsymbol must be ↔ or =).
If the proposed definition passes this first rule, we then
define its definiendum as its left hand side (LHS) and
its definiens as its right hand side (RHS).
We define the *defined symbol* as the rootsymbol of the LHS.
We define a *dummy variable* as a variable occurring
in the RHS but not in the LHS.
Note that the "rootsymbol" is the root of the considered tree;
it need not correspond to a single token in the database
(e.g., see w3o 1053 or wsb 1937).
 The defined expression must not appear in any statement
between its syntax axiom ($a wff ) and its definition,
and the defined expression must not be used in its definiens.
See df3an 1056 for an example where the same symbol is used in
different ways (this is allowed).
 No two variables occurring in the LHS may share a
disjoint variable (DV) condition.
 All dummy variables are required to be disjoint from any
other (dummy or not) variable occurring in this labeled expression.
 Either
(a) there must be no nonsetvar dummy variables, or
(b) there must be a justification theorem.
The justification theorem must be of form
⊢ ( definiens rootsymbol definiens' )
where definiens' is definiens but the dummy variables are all
replaced with other unused dummy variables of the same type.
Note that rootsymbol is ↔ or =, and that setvar
variables are simply variables with the setvar typecode.
 One of the following must be true:
(a) there must be no setvar dummy variables,
(b) there must be a justification theorem as described in rule 5, or
(c) if there are setvar dummy variables, every one must not be free.
That is, it must be true that
(𝜑 → ∀𝑥𝜑) for each setvar dummy variable 𝑥
where 𝜑 is the definiens.
We use two different tests for nonfreeness; one must succeed
for each setvar dummy variable 𝑥.
The first test requires that the setvar dummy variable 𝑥
be syntactically bound
(this is sometimes called the "fast" test, and this implies
that we must track binding operators).
The second test requires a successful
search for the directlystated proof of (𝜑 → ∀𝑥𝜑)
Part c of this rule is how most setvar dummy variables
are handled.
Rule 3 may seem unnecessary, but it is needed.
Without this rule, you can define something like
cbar $a wff Foo x y $.
${ $d x y $. dffoo $a  ( Foo x y <> x = y ) $. $}
and now "Foo x x" is not eliminable;
there is no way to prove that it means anything in particular,
because the definitional theorem that is supposed to be
responsible for connecting it to the original language wants
nothing to do with this expression, even though it is well formed.
A justification theorem for a definition (if used this way)
must be proven before the definition that depends on it.
One example of a justification theorem is vjust 3232.
The definition dfv 3233 ⊢ V = {𝑥 ∣ 𝑥 = 𝑥} is justified
by the justification theorem vjust 3232
⊢ {𝑥 ∣ 𝑥 = 𝑥} = {𝑦 ∣ 𝑦 = 𝑦}.
Another example of a justification theorem is trujust 1525;
the definition dftru 1526 ⊢ (⊤ ↔ (∀𝑥𝑥 = 𝑥 → ∀𝑥𝑥 = 𝑥))
is justified by trujust 1525 ⊢ ((∀𝑥𝑥 = 𝑥 → ∀𝑥𝑥 = 𝑥) ↔ (∀𝑦𝑦 = 𝑦 → ∀𝑦𝑦 = 𝑦)).
Here is more information about our processes for checking and
contributing to this work:
 Multiple verifiers.
This entire file is verified by multiple independentlyimplemented
verifiers when it is checked in, giving us extremely high
confidence that all proofs follow from the assumptions.
The checkers also check for various other problems such as
overly long lines.
 Maximum text line length is 79 characters.
You can fix comment line length by running the commands scripts/rewrap
or metamath 'read set.mm' 'save proof */c/f'
'write source set.mm/rewrap' quit .
As a general rule, a math string in a comment should be surrounded
by backquotes on the same line, and if it is too long it should
be broken into multiple adjacent mathstrings on multiple lines.
Those commands don't modify the math content of statements.
In statements we try to break before the outermost important connective
(not including the typecode and perhaps not the antecedent).
For examples, see sqrtmulii 14170 and absmax 14113.
 Discouraged information.
A separate file named "discouraged" lists all
discouraged statements and uses of them, and this file is checked.
If you change the use of discouraged things, you will need to change
this file.
This makes it obvious when there is a change to anything discouraged
(triggering further review).
 LRParser check.
Metamath verifiers ensure that $p statements follow from previous
$a and $p statements.
However, by itself the Metamath language permits certain kinds of
syntactic ambiguity that we choose to avoid in this database.
Thus, we require that this database unambiguously parse
using the "LRParser" check (implemented by at least mmj2).
(For details, see mmj2 master file src/mmj/verify/LRParser.java).
This check
counters, for example, a devious ambiguous construct
developed by saueran at oregonstate dot edu
posted on Mon, 11 Feb 2019 17:32:32 0800 (PST)
based on creating definitions with mismatched parentheses.
 Proposing specific changes.
Please propose specific changes as pull requests (PRs) against the
"develop" branch of set.mm, at:
https://github.com/metamath/set.mm/tree/develop
 Community.
We encourage anyone interested in Metamath to join our mailing list:
https://groups.google.com/forum/#!forum/metamath.
(Contributed by DAW, 27Dec2016.) (New usage is discouraged.)

⊢ 𝜑 ⇒ ⊢ 𝜑 

Theorem  conventionslabel 27388 
The following explains some of the label conventions in use
in the Metamath Proof Explorer ("set.mm").
For the general conventions, see conventions 27387.
Every statement has a unique identifying label, which serves the
same purpose as an equation number in a book.
We use various label naming conventions to provide
easytoremember hints about their contents.
Labels are not a 1to1 mapping, because that would create
long names that would be difficult to remember and tedious to type.
Instead, label names are relatively short while
suggesting their purpose.
Names are occasionally changed to make them more consistent or
as we find better ways to name them.
Here are a few of the label naming conventions:
 Axioms, definitions, and wff syntax.
As noted earlier, axioms are named "axNAME",
proofs of proven axioms are named "axNAME", and
definitions are named "dfNAME".
Wff syntax declarations have labels beginning with "w"
followed by short fragment suggesting its purpose.
 Hypotheses.
Hypotheses have the name of the final axiom or theorem, followed by
".", followed by a unique id (these ids are usually consecutive integers
starting with 1, e.g. for rgen 2951"rgen.1 $e  ( x e. A > ph ) $."
or letters corresponding to the (main) class variable used in the
hypothesis, e.g. for mdet0 20460: "mdet0.d $e  D = ( N maDet R ) $.").
 Common names.
If a theorem has a wellknown name, that name (or a short version of it)
is sometimes used directly. Examples include
barbara 2592 and stirling 40624.
 Principia Mathematica.
Proofs of theorems from Principia Mathematica often use a special
naming convention: "pm" followed by its identifier.
For example, Theorem *2.27 of [WhiteheadRussell] p. 104 is named
pm2.27 42.
 19.x series of theorems.
Similar to the conventions for the theorems from Principia Mathematica,
theorems from Section 19 of [Margaris] p. 90 often use a special naming
convention: "19." resp. "r19." (for corresponding restricted quantifier
versions) followed by its identifier.
For example, Theorem 38 from Section 19 of [Margaris] p. 90 is labeled
19.38 1806, and the restricted quantifier version of Theorem 21 from
Section 19 of [Margaris] p. 90 is labeled r19.21 2985.
 Characters to be used for labels
Although the specification of Metamath allows for dots/periods "." in
any label, it is usually used only in labels for hypotheses (see above).
Exceptions are the labels of theorems from Principia Mathematica and the
19.x series of theorems from Section 19 of [Margaris] p. 90 (see above)
and 0.999... 14656. Furthermore, the underscore "_" should not be used.
 Syntax label fragments.
Most theorems are named using a concatenation of syntax label fragments
(omitting variables) that represent the important part of the theorem's
main conclusion. Almost every syntactic construct has a definition
labeled "dfNAME", and normally NAME is the syntax label fragment. For
example, the class difference construct (𝐴 ∖ 𝐵) is defined in
dfdif 3610, and thus its syntax label fragment is "dif". Similarly, the
subclass relation 𝐴 ⊆ 𝐵 has syntax label fragment "ss"
because it is defined in dfss 3621. Most theorem names follow from
these fragments, for example, the theorem proving (𝐴 ∖ 𝐵) ⊆ 𝐴
involves a class difference ("dif") of a subset ("ss"), and thus is
labeled difss 3770. There are many other syntax label fragments, e.g.,
singleton construct {𝐴} has syntax label fragment "sn" (because it
is defined in dfsn 4211), and the pair construct {𝐴, 𝐵} has
fragment "pr" ( from dfpr 4213). Digits are used to represent
themselves. Suffixes (e.g., with numbers) are sometimes used to
distinguish multiple theorems that would otherwise produce the same
label.
 Phantom definitions.
In some cases there are common label fragments for something that could
be in a definition, but for technical reasons is not. The iselementof
(is member of) construct 𝐴 ∈ 𝐵 does not have a dfNAME definition;
in this case its syntax label fragment is "el". Thus, because the
theorem beginning with (𝐴 ∈ (𝐵 ∖ {𝐶}) uses iselementof
("el") of a class difference ("dif") of a singleton ("sn"), it is
labeled eldifsn 4350. An "n" is often used for negation (¬), e.g.,
nan 603.
 Exceptions.
Sometimes there is a definition dfNAME but the label fragment is not
the NAME part. The definition should note this exception as part of its
definition. In addition, the table below attempts to list all such
cases and marks them in bold. For example, the label fragment "cn"
represents complex numbers ℂ (even though its definition is in
dfc 9980) and "re" represents real numbers ℝ ( definition dfr 9984).
The empty set ∅ often uses fragment 0, even though it is defined
in dfnul 3949. The syntax construct (𝐴 + 𝐵) usually uses the
fragment "add" (which is consistent with dfadd 9985), but "p" is used as
the fragment for constant theorems. Equality (𝐴 = 𝐵) often uses
"e" as the fragment. As a result, "two plus two equals four" is labeled
2p2e4 11182.
 Other markings.
In labels we sometimes use "com" for "commutative", "ass" for
"associative", "rot" for "rotation", and "di" for "distributive".
 Focus on the important part of the conclusion.
Typically the conclusion is the part the user is most interested in.
So, a rough guideline is that a label typically provides a hint
about only the conclusion; a label rarely says anything about the
hypotheses or antecedents.
If there are multiple theorems with the same conclusion
but different hypotheses/antecedents, then the labels will need
to differ; those label differences should emphasize what is different.
There is no need to always fully describe the conclusion; just
identify the important part. For example,
cos0 14924 is the theorem that provides the value for the cosine of 0;
we would need to look at the theorem itself to see what that value is.
The label "cos0" is concise and we use it instead of "cos0eq1".
There is no need to add the "eq1", because there will never be a case
where we have to disambiguate between different values produced by
the cosine of zero, and we generally prefer shorter labels if
they are unambiguous.
 Closures and values.
As noted above, if a function dfNAME is defined, there is typically a
proof of its value labeled "NAMEval" and of its closure labeld "NAMEcl".
E.g., for cosine (dfcos 14845) we have value cosval 14897 and closure
coscl 14901.
 Special cases.
Sometimes, syntax and related markings are insufficient to distinguish
different theorems. For example, there are over a hundred different
implicationonly theorems. They are grouped in a more adhoc way that
attempts to make their distinctions clearer. These often use
abbreviations such as "mp" for "modus ponens", "syl" for syllogism, and
"id" for "identity". It is especially hard to give good names in the
propositional calculus section because there are so few primitives.
However, in most cases this is not a serious problem. There are a few
very common theorems like axmp 5 and syl 17 that you will have no
trouble remembering, a few theorem series like syl*anc and simp* that
you can use parametrically, and a few other useful glue things for
destructuring 'and's and 'or's (see natded 27390 for a list), and that is
about all you need for most things. As for the rest, you can just
assume that if it involves at most three connectives, then it is
probably already proved in set.mm, and searching for it will give you
the label.
 Suffixes.
Suffixes are used to indicate the form of a theorem (see above).
Additionally, we sometimes suffix with "v" the label of a theorem
eliminating a hypothesis such as Ⅎ𝑥𝜑 in 19.21 2113 via the use of
disjoint variable conditions combined with nfv 1883. If two (or three)
such hypotheses are eliminated, the suffix "vv" resp. "vvv" is used,
e.g. exlimivv 1900.
Conversely, we sometimes suffix with "f" the label of a theorem
introducing such a hypothesis to eliminate the need for the disjoint
variable condition; e.g. euf 2506 derived from dfeu 2502. The "f" stands
for "not free in" which is less restrictive than "does not occur in."
The suffix "b" often means "biconditional" (↔, "iff" , "if and
only if"), e.g. sspwb 4947.
We sometimes suffix with "s" the label of an inference that manipulates
an antecedent, leaving the consequent unchanged. The "s" means that the
inference eliminates the need for a syllogism (syl 17) type inference
in a proof. A theorem label is suffixed with "ALT" if it provides an
alternate lesspreferred proof of a theorem (e.g., the proof is
clearer but uses more axioms than the preferred version).
The "ALT" may be further suffixed with a number if there is more
than one alternate theorem.
Furthermore, a theorem label is suffixed with "OLD" if there is a new
version of it and the OLD version is obsolete (and will be removed
within one year).
Finally, it should be mentioned that suffixes can be combined, for
example in cbvaldva 2317 (cbval 2307 in deduction form "d" with a not free
variable replaced by a disjoint variable condition "v" with a
conjunction as antecedent "a"). As a general rule, the suffixes for
the theorem forms ("i", "d" or "g") should be the first of multiple
suffixes, as for example in vtocldf 3287 or rabeqif 3222.
Here is a nonexhaustive list of common suffixes:
 a : theorem having a conjunction as antecedent
 b : theorem expressing a logical equivalence
 c : contraction (e.g., sylc 65, syl2anc 694), commutes
(e.g., biimpac 502)
 d : theorem in deduction form
 f : theorem with a hypothesis such as Ⅎ𝑥𝜑
 g : theorem in closed form having an "is a set" antecedent
 i : theorem in inference form
 l : theorem concerning something at the left
 r : theorem concerning something at the right
 r : theorem with something reversed (e.g., a biconditional)
 s : inference that manipulates an antecedent ("s" refers to an
application of syl 17 that is eliminated)
 v : theorem with one (main) disjoint variable condition
 vv : theorem with two (main) disjoint variable conditions
 w : weak(er) form of a theorem
 ALT : alternate proof of a theorem
 ALTV : alternate version of a theorem or definition
 OLD : old/obsolete version of a theorem/definition/proof
 Reuse.
When creating a new theorem or axiom, try to reuse abbreviations used
elsewhere. A comment should explain the first use of an abbreviation.
The following table shows some commonly used abbreviations in labels, in
alphabetical order. For each abbreviation we provide a mnenomic, the
source theorem or the assumption defining it, an expression showing what
it looks like, whether or not it is a "syntax fragment" (an abbreviation
that indicates a particular kind of syntax), and hyperlinks to label
examples that use the abbreviation. The abbreviation is bolded if there
is a dfNAME definition but the label fragment is not NAME. This is
not a complete list of abbreviations, though we do want this to
eventually be a complete list of exceptions.
Abbreviation  Mnenomic  Source 
Expression  Syntax?  Example(s) 
a  and (suffix)  
 No  biimpa 500, rexlimiva 3057 
abl  Abelian group  dfabl 18242 
Abel  Yes  ablgrp 18244, zringabl 19870 
abs  absorption    No 
ressabs 15986 
abs  absolute value (of a complex number) 
dfabs 14020  (abs‘𝐴)  Yes 
absval 14022, absneg 14061, abs1 14081 
ad  adding  
 No  adantr 480, ad2antlr 763 
add  add (see "p")  dfadd 9985 
(𝐴 + 𝐵)  Yes 
addcl 10056, addcom 10260, addass 10061 
al  "for all"  
∀𝑥𝜑  No  alim 1778, alex 1793 
ALT  alternative/less preferred (suffix)  
 No  idALT 23 
an  and  dfan 385 
(𝜑 ∧ 𝜓)  Yes 
anor 509, iman 439, imnan 437 
ant  antecedent  
 No  adantr 480 
ass  associative  
 No  biass 373, orass 545, mulass 10062 
asym  asymmetric, antisymmetric  
 No  intasym 5546, asymref 5547, posasymb 16999 
ax  axiom  
 No  ax6dgen 2045, ax1cn 10008 
bas, base 
base (set of an extensible structure)  dfbase 15910 
(Base‘𝑆)  Yes 
baseval 15965, ressbas 15977, cnfldbas 19798 
b, bi  biconditional ("iff", "if and only if")
 dfbi 197  (𝜑 ↔ 𝜓)  Yes 
impbid 202, sspwb 4947 
br  binary relation  dfbr 4686 
𝐴𝑅𝐵  Yes  brab1 4733, brun 4736 
cbv  change bound variable   
No  cbvalivw 1980, cbvrex 3198 
cl  closure    No 
ifclda 4153, ovrcl 6726, zaddcl 11455 
cn  complex numbers  dfc 9980 
ℂ  Yes  nnsscn 11063, nncn 11066 
cnfld  field of complex numbers  dfcnfld 19795 
ℂ_{fld}  Yes  cnfldbas 19798, cnfldinv 19825 
cntz  centralizer  dfcntz 17796 
(Cntz‘𝑀)  Yes 
cntzfval 17799, dprdfcntz 18460 
cnv  converse  dfcnv 5151 
^{◡}𝐴  Yes  opelcnvg 5334, f1ocnv 6187 
co  composition  dfco 5152 
(𝐴 ∘ 𝐵)  Yes  cnvco 5340, fmptco 6436 
com  commutative  
 No  orcom 401, bicomi 214, eqcomi 2660 
con  contradiction, contraposition  
 No  condan 852, con2d 129 
csb  class substitution  dfcsb 3567 
⦋𝐴 / 𝑥⦌𝐵  Yes 
csbid 3574, csbie2g 3597 
cyg  cyclic group  dfcyg 18326 
CycGrp  Yes 
iscyg 18327, zringcyg 19887 
d  deduction form (suffix)  
 No  idd 24, impbid 202 
df  (alternate) definition (prefix)  
 No  dfrel2 5618, dffn2 6085 
di, distr  distributive  
 No 
andi 929, imdi 377, ordi 926, difindi 3914, ndmovdistr 6865 
dif  class difference  dfdif 3610 
(𝐴 ∖ 𝐵)  Yes 
difss 3770, difindi 3914 
div  division  dfdiv 10723 
(𝐴 / 𝐵)  Yes 
divcl 10729, divval 10725, divmul 10726 
dm  domain  dfdm 5153 
dom 𝐴  Yes  dmmpt 5668, iswrddm0 13361 
e, eq, equ  equals  dfcleq 2644 
𝐴 = 𝐵  Yes 
2p2e4 11182, uneqri 3788, equtr 1994 
edg  edge  dfedg 25985 
(Edg‘𝐺)  Yes 
edgopval 25989, usgredgppr 26133 
el  element of  
𝐴 ∈ 𝐵  Yes 
eldif 3617, eldifsn 4350, elssuni 4499 
eu  "there exists exactly one"  dfeu 2502 
∃!𝑥𝜑  Yes  euex 2522, euabsn 4293 
ex  exists (i.e. is a set)  
 No  brrelex 5190, 0ex 4823 
ex  "there exists (at least one)"  dfex 1745 
∃𝑥𝜑  Yes  exim 1801, alex 1793 
exp  export  
 No  expt 168, expcom 450 
f  "not free in" (suffix)  
 No  equs45f 2378, sbf 2408 
f  function  dff 5930 
𝐹:𝐴⟶𝐵  Yes  fssxp 6098, opelf 6103 
fal  false  dffal 1529 
⊥  Yes  bifal 1537, falantru 1548 
fi  finite intersection  dffi 8358 
(fi‘𝐵)  Yes  fival 8359, inelfi 8365 
fi, fin  finite  dffin 8001 
Fin  Yes 
isfi 8021, snfi 8079, onfin 8192 
fld  field (Note: there is an alternative
definition Fld of a field, see dffld 33921)  dffield 18798 
Field  Yes  isfld 18804, fldidom 19353 
fn  function with domain  dffn 5929 
𝐴 Fn 𝐵  Yes  ffn 6083, fndm 6028 
frgp  free group  dffrgp 18169 
(freeGrp‘𝐼)  Yes 
frgpval 18217, frgpadd 18222 
fsupp  finitely supported function 
dffsupp 8317  𝑅 finSupp 𝑍  Yes 
isfsupp 8320, fdmfisuppfi 8325, fsuppco 8348 
fun  function  dffun 5928 
Fun 𝐹  Yes  funrel 5943, ffun 6086 
fv  function value  dffv 5934 
(𝐹‘𝐴)  Yes  fvres 6245, swrdfv 13469 
fz  finite set of sequential integers 
dffz 12365 
(𝑀...𝑁)  Yes  fzval 12366, eluzfz 12375 
fz0  finite set of sequential nonnegative integers 

(0...𝑁)  Yes  nn0fz0 12476, fz0tp 12479 
fzo  halfopen integer range  dffzo 12505 
(𝑀..^𝑁)  Yes 
elfzo 12511, elfzofz 12524 
g  more general (suffix); eliminates "is a set"
hypothsis  
 No  uniexg 6997 
gr  graph  
 No  uhgrf 26002, isumgr 26035, usgrres1 26252 
grp  group  dfgrp 17472 
Grp  Yes  isgrp 17475, tgpgrp 21929 
gsum  group sum  dfgsum 16150 
(𝐺 Σ_{g} 𝐹)  Yes 
gsumval 17318, gsumwrev 17842 
hash  size (of a set)  dfhash 13158 
(#‘𝐴)  Yes 
hashgval 13160, hashfz1 13174, hashcl 13185 
hb  hypothesis builder (prefix)  
 No  hbxfrbi 1792, hbald 2081, hbequid 34513 
hm  (monoid, group, ring) homomorphism  
 No  ismhm 17384, isghm 17707, isrhm 18769 
i  inference (suffix)  
 No  eleq1i 2721, tcsni 8657 
i  implication (suffix)  
 No  brwdomi 8514, infeq5i 8571 
id  identity  
 No  biid 251 
iedg  indexed edge  dfiedg 25922 
(iEdg‘𝐺)  Yes 
iedgval0 25977, edgiedgb 25992 
idm  idempotent  
 No  anidm 677, tpidm13 4323 
im, imp  implication (label often omitted) 
dfim 13885  (𝐴 → 𝐵)  Yes 
iman 439, imnan 437, impbidd 200 
ima  image  dfima 5156 
(𝐴 “ 𝐵)  Yes  resima 5466, imaundi 5580 
imp  import  
 No  biimpa 500, impcom 445 
in  intersection  dfin 3614 
(𝐴 ∩ 𝐵)  Yes  elin 3829, incom 3838 
inf  infimum  dfinf 8390 
inf(ℝ^{+}, ℝ^{*}, < )  Yes 
fiinfcl 8448, infiso 8454 
is...  is (something a) ...?  
 No  isring 18597 
j  joining, disjoining  
 No  jc 159, jaoi 393 
l  left  
 No  olcd 407, simpl 472 
map  mapping operation or set exponentiation 
dfmap 7901  (𝐴 ↑_{𝑚} 𝐵)  Yes 
mapvalg 7909, elmapex 7920 
mat  matrix  dfmat 20262 
(𝑁 Mat 𝑅)  Yes 
matval 20265, matring 20297 
mdet  determinant (of a square matrix) 
dfmdet 20439  (𝑁 maDet 𝑅)  Yes 
mdetleib 20441, mdetrlin 20456 
mgm  magma  dfmgm 17289 
Magma  Yes 
mgmidmo 17306, mgmlrid 17313, ismgm 17290 
mgp  multiplicative group  dfmgp 18536 
(mulGrp‘𝑅)  Yes 
mgpress 18546, ringmgp 18599 
mnd  monoid  dfmnd 17342 
Mnd  Yes  mndass 17349, mndodcong 18007 
mo  "there exists at most one"  dfmo 2503 
∃*𝑥𝜑  Yes  eumo 2527, moim 2548 
mp  modus ponens  axmp 5 
 No  mpd 15, mpi 20 
mpt  modus ponendo tollens  
 No  mptnan 1733, mptxor 1734 
mpt  mapsto notation for a function 
dfmpt 4763  (𝑥 ∈ 𝐴 ↦ 𝐵)  Yes 
fconstmpt 5197, resmpt 5484 
mpt2  mapsto notation for an operation 
dfmpt2 6695  (𝑥 ∈ 𝐴, 𝑦 ∈ 𝐵 ↦ 𝐶)  Yes 
mpt2mpt 6794, resmpt2 6800 
mul  multiplication (see "t")  dfmul 9986 
(𝐴 · 𝐵)  Yes 
mulcl 10058, divmul 10726, mulcom 10060, mulass 10062 
n, not  not  
¬ 𝜑  Yes 
nan 603, notnotr 125 
ne  not equal  dfne  𝐴 ≠ 𝐵 
Yes  exmidne 2833, neeqtrd 2892 
nel  not element of  dfnel  𝐴 ∉ 𝐵

Yes  neli 2928, nnel 2935 
ne0  not equal to zero (see n0)  
≠ 0  No 
negne0d 10428, ine0 10503, gt0ne0 10531 
nf  "not free in" (prefix)  
 No  nfnd 1825 
ngp  normed group  dfngp 22435 
NrmGrp  Yes  isngp 22447, ngptps 22453 
nm  norm (on a group or ring)  dfnm 22434 
(norm‘𝑊)  Yes 
nmval 22441, subgnm 22484 
nn  positive integers  dfnn 11059 
ℕ  Yes  nnsscn 11063, nncn 11066 
nn0  nonnegative integers  dfn0 11331 
ℕ_{0}  Yes  nnnn0 11337, nn0cn 11340 
n0  not the empty set (see ne0)  
≠ ∅  No  n0i 3953, vn0 3957, ssn0 4009 
OLD  old, obsolete (to be removed soon)  
 No  19.43OLD 1851 
op  ordered pair  dfop 4217 
⟨𝐴, 𝐵⟩  Yes  dfopif 4430, opth 4974 
or  or  dfor 384 
(𝜑 ∨ 𝜓)  Yes 
orcom 401, anor 509 
ot  ordered triple  dfot 4219 
⟨𝐴, 𝐵, 𝐶⟩  Yes 
euotd 5004, fnotovb 6735 
ov  operation value  dfov 6693 
(𝐴𝐹𝐵)  Yes
 fnotovb 6735, fnovrn 6851 
p  plus (see "add"), for allconstant
theorems  dfadd 9985 
(3 + 2) = 5  Yes 
3p2e5 11198 
pfx  prefix  dfpfx 41707 
(𝑊 prefix 𝐿)  Yes 
pfxlen 41716, ccatpfx 41734 
pm  Principia Mathematica  
 No  pm2.27 42 
pm  partial mapping (operation)  dfpm 7902 
(𝐴 ↑_{pm} 𝐵)  Yes  elpmi 7918, pmsspw 7934 
pr  pair  dfpr 4213 
{𝐴, 𝐵}  Yes 
elpr 4231, prcom 4299, prid1g 4327, prnz 4341 
prm, prime  prime (number)  dfprm 15433 
ℙ  Yes  1nprm 15439, dvdsprime 15447 
pss  proper subset  dfpss 3623 
𝐴 ⊊ 𝐵  Yes  pssss 3735, sspsstri 3742 
q  rational numbers ("quotients")  dfq 11827 
ℚ  Yes  elq 11828 
r  right  
 No  orcd 406, simprl 809 
rab  restricted class abstraction 
dfrab 2950  {𝑥 ∈ 𝐴 ∣ 𝜑}  Yes 
rabswap 3151, dfoprab 6694 
ral  restricted universal quantification 
dfral 2946  ∀𝑥 ∈ 𝐴𝜑  Yes 
ralnex 3021, ralrnmpt2 6817 
rcl  reverse closure  
 No  ndmfvrcl 6257, nnarcl 7741 
re  real numbers  dfr 9984 
ℝ  Yes  recn 10064, 0re 10078 
rel  relation  dfrel 5150  Rel 𝐴 
Yes  brrelex 5190, relmpt2opab 7304 
res  restriction  dfres 5155 
(𝐴 ↾ 𝐵)  Yes 
opelres 5436, f1ores 6189 
reu  restricted existential uniqueness 
dfreu 2948  ∃!𝑥 ∈ 𝐴𝜑  Yes 
nfreud 3141, reurex 3190 
rex  restricted existential quantification 
dfrex 2947  ∃𝑥 ∈ 𝐴𝜑  Yes 
rexnal 3024, rexrnmpt2 6818 
rmo  restricted "at most one" 
dfrmo 2949  ∃*𝑥 ∈ 𝐴𝜑  Yes 
nfrmod 3142, nrexrmo 3193 
rn  range  dfrn 5154  ran 𝐴 
Yes  elrng 5346, rncnvcnv 5381 
rng  (unital) ring  dfring 18595 
Ring  Yes 
ringidval 18549, isring 18597, ringgrp 18598 
rot  rotation  
 No  3anrot 1060, 3orrot 1061 
s  eliminates need for syllogism (suffix) 
  No  ancoms 468 
sb  (proper) substitution (of a set) 
dfsb 1938  [𝑦 / 𝑥]𝜑  Yes 
spsbe 1941, sbimi 1943 
sbc  (proper) substitution of a class 
dfsbc 3469  [𝐴 / 𝑥]𝜑  Yes 
sbc2or 3477, sbcth 3483 
sca  scalar  dfsca 16004 
(Scalar‘𝐻)  Yes 
resssca 16078, mgpsca 18542 
simp  simple, simplification  
 No  simpl 472, simp3r3 1191 
sn  singleton  dfsn 4211 
{𝐴}  Yes  eldifsn 4350 
sp  specialization  
 No  spsbe 1941, spei 2297 
ss  subset  dfss 3621 
𝐴 ⊆ 𝐵  Yes  difss 3770 
struct  structure  dfstruct 15906 
Struct  Yes  brstruct 15913, structfn 15921 
sub  subtract  dfsub 10306 
(𝐴 − 𝐵)  Yes 
subval 10310, subaddi 10406 
sup  supremum  dfsup 8389 
sup(𝐴, 𝐵, < )  Yes 
fisupcl 8416, supmo 8399 
supp  support (of a function)  dfsupp 7341 
(𝐹 supp 𝑍)  Yes 
ressuppfi 8342, mptsuppd 7363 
swap  swap (two parts within a theorem) 
  No  rabswap 3151, 2reuswap 3443 
syl  syllogism  syl 17 
 No  3syl 18 
sym  symmetric  
 No  dfsymdif 3877, cnvsym 5545 
symg  symmetric group  dfsymg 17844 
(SymGrp‘𝐴)  Yes 
symghash 17851, pgrpsubgsymg 17874 
t 
times (see "mul"), for allconstant theorems 
dfmul 9986 
(3 · 2) = 6  Yes 
3t2e6 11217 
th  theorem  
 No  nfth 1767, sbcth 3483, weth 9355 
tp  triple  dftp 4215 
{𝐴, 𝐵, 𝐶}  Yes 
eltpi 4261, tpeq1 4309 
tr  transitive  
 No  bitrd 268, biantr 992 
tru  true  dftru 1526 
⊤  Yes  bitru 1536, truanfal 1547 
un  union  dfun 3612 
(𝐴 ∪ 𝐵)  Yes 
uneqri 3788, uncom 3790 
unit  unit (in a ring) 
dfunit 18688  (Unit‘𝑅)  Yes 
isunit 18703, nzrunit 19315 
v  disjoint variable conditions used when
a notfree hypothesis (suffix) 
  No  spimv 2293 
vtx  vertex  dfvtx 25921 
(Vtx‘𝐺)  Yes 
vtxval0 25976, opvtxov 25930 
vv  2 disjoint variables (in a notfree hypothesis)
(suffix)    No  19.23vv 1912 
w  weak (version of a theorem) (suffix)  
 No  ax11w 2047, spnfw 1974 
wrd  word 
dfword 13331  Word 𝑆  Yes 
iswrdb 13343, wrdfn 13351, ffz0iswrd 13364 
xp  cross product (Cartesian product) 
dfxp 5149  (𝐴 × 𝐵)  Yes 
elxp 5165, opelxpi 5182, xpundi 5205 
xr  eXtended reals  dfxr 10116 
ℝ^{*}  Yes  ressxr 10121, rexr 10123, 0xr 10124 
z  integers (from German "Zahlen") 
dfz 11416  ℤ  Yes 
elz 11417, zcn 11420 
zn  ring of integers mod 𝑛  dfzn 19903 
(ℤ/nℤ‘𝑁)  Yes 
znval 19931, zncrng 19941, znhash 19955 
zring  ring of integers  dfzring 19867 
ℤ_{ring}  Yes  zringbas 19872, zringcrng 19868

0, z 
slashed zero (empty set) (see n0)  dfnul 3949 
∅  Yes 
n0i 3953, vn0 3957; snnz 4340, prnz 4341 
(Contributed by DAW, 27Dec2016.) (New usage is discouraged.)

⊢ 𝜑 ⇒ ⊢ 𝜑 

Theorem  conventionscontrib 27389 
These conventions are more specifically directed towards contributors.
For general conventions, see conventions 27387, and for conventions
related to labels, see conventionslabel 27388.
 Input format.
The input is in ASCII with twospace indents. Tab characters are not
allowed. Use embedded math comments or HTML entities for nonASCII
characters (e.g., "é" for "é").
 Comments and layout.
As for formatting of the file set.mm, and in particular formatting and
layout of the comments, the foremost rule is consistency. The first
sections of set.mm, in particular Part 1 "Classical firstorder logic
with equality" can serve as a model for contributors. Some formatting
rules are enforced when using the Metamath program's "WRITE SOURCE"
command with the "REWRAP" option. Here are a few other rules, which are
not enforced, but that we try follow:

The file set.mm should have a double blank line before each section
header, and at no other places. In particular, there are no triple
blank lines. If there is a "@( Begin $[ ... $] @)" comment (where "@"
is actually "$") before the section header, then the double blank line
should go before that comment.

The header comments should be spaced as those of Part 1, namely, with
a blank line before and after the comment, and an indentation of two
spaces.

Header comments are not rewrapped by the Metamath program [as of
24Oct2021], but similar spacing and wrapping should be used as for
other comments: double spaces after a period ending a sentence, line
wrapping with line width of 79, and no trailing spaces at the end of
lines.
 Format of section headers.
The database set.mm has a sectioning system with four levels of titles,
indicated by "decoration lines" which are 79character long repetitions
of ####, #*#*, ==, and .. (in descending order of sectioning level).
The format of section headers is as follows:
two blanks lines;
a line with '@(' (with the '@' replaced by '$');
decoration line;
section title indented with two spaces;
decoration line;
[blank line; header comment indented with two spaces; blank line;]
a line with '@)' (with the '@' replaced by '$');
one blank line.
As everywhere else, lines are hardwrapped to be 79character long.
It is expected that the "MM> write source set.mm/rewrap" command will
reformat section headers to automatically conform with this format.
(Contributed by BJ, 22Feb2022.) (New usage is discouraged.)

⊢ 𝜑 ⇒ ⊢ 𝜑 

17.1.2 Natural deduction


Theorem  natded 27390 
Here are typical natural deduction (ND) rules in the style of Gentzen
and Jaśkowski, along with MPE translations of them. This also
shows the recommended theorems when you find yourself needing these
rules (the recommendations encourage a slightly different proof style
that works more naturally with metamath). A decent list of the standard
rules of natural deduction can be found beginning with definition /\I in
[Pfenning] p. 18. For information about ND and Metamath, see the
page on Deduction Form and Natural Deduction
in Metamath Proof Explorer. Many more citations could be added.
Name  Natural Deduction Rule  Translation 
Recommendation  Comments 
IT 
Γ⊢ 𝜓 => Γ⊢ 𝜓 
idi 2 
nothing  Reiteration is always redundant in Metamath.
Definition "new rule" in [Pfenning] p. 18,
definition IT in [Clemente] p. 10. 
∧I 
Γ⊢ 𝜓 & Γ⊢ 𝜒 => Γ⊢ 𝜓 ∧ 𝜒 
jca 553 
jca 553, pm3.2i 470 
Definition ∧I in [Pfenning] p. 18,
definition I∧m,n in [Clemente] p. 10, and
definition ∧I in [Indrzejczak] p. 34
(representing both Gentzen's system NK and Jaśkowski) 
∧E_{L} 
Γ⊢ 𝜓 ∧ 𝜒 => Γ⊢ 𝜓 
simpld 474 
simpld 474, adantr 480 
Definition ∧E_{L} in [Pfenning] p. 18,
definition E∧(1) in [Clemente] p. 11, and
definition ∧E in [Indrzejczak] p. 34
(representing both Gentzen's system NK and Jaśkowski) 
∧E_{R} 
Γ⊢ 𝜓 ∧ 𝜒 => Γ⊢ 𝜒 
simprd 478 
simpr 476, adantl 481 
Definition ∧E_{R} in [Pfenning] p. 18,
definition E∧(2) in [Clemente] p. 11, and
definition ∧E in [Indrzejczak] p. 34
(representing both Gentzen's system NK and Jaśkowski) 
→I 
Γ, 𝜓⊢ 𝜒 => Γ⊢ 𝜓 → 𝜒 
ex 449  ex 449 
Definition →I in [Pfenning] p. 18,
definition I=>m,n in [Clemente] p. 11, and
definition →I in [Indrzejczak] p. 33. 
→E 
Γ⊢ 𝜓 → 𝜒 & Γ⊢ 𝜓 => Γ⊢ 𝜒 
mpd 15  axmp 5, mpd 15, mpdan 703, imp 444 
Definition →E in [Pfenning] p. 18,
definition E=>m,n in [Clemente] p. 11, and
definition →E in [Indrzejczak] p. 33. 
∨I_{L}  Γ⊢ 𝜓 =>
Γ⊢ 𝜓 ∨ 𝜒 
olcd 407 
olc 398, olci 405, olcd 407 
Definition ∨I in [Pfenning] p. 18,
definition I∨n(1) in [Clemente] p. 12 
∨I_{R}  Γ⊢ 𝜒 =>
Γ⊢ 𝜓 ∨ 𝜒 
orcd 406 
orc 399, orci 404, orcd 406 
Definition ∨I_{R} in [Pfenning] p. 18,
definition I∨n(2) in [Clemente] p. 12. 
∨E  Γ⊢ 𝜓 ∨ 𝜒 & Γ, 𝜓⊢ 𝜃 &
Γ, 𝜒⊢ 𝜃 => Γ⊢ 𝜃 
mpjaodan 844 
mpjaodan 844, jaodan 843, jaod 394 
Definition ∨E in [Pfenning] p. 18,
definition E∨m,n,p in [Clemente] p. 12. 
¬I  Γ, 𝜓⊢ ⊥ => Γ⊢ ¬ 𝜓 
inegd 1543  pm2.01d 181 

¬I  Γ, 𝜓⊢ 𝜃 & Γ⊢ ¬ 𝜃 =>
Γ⊢ ¬ 𝜓 
mtand 692  mtand 692 
definition I¬m,n,p in [Clemente] p. 13. 
¬I  Γ, 𝜓⊢ 𝜒 & Γ, 𝜓⊢ ¬ 𝜒 =>
Γ⊢ ¬ 𝜓 
pm2.65da 599  pm2.65da 599 
Contradiction. 
¬I 
Γ, 𝜓⊢ ¬ 𝜓 => Γ⊢ ¬ 𝜓 
pm2.01da 457  pm2.01d 181, pm2.65da 599, pm2.65d 187 
For an alternative falsumfree natural deduction ruleset 
¬E 
Γ⊢ 𝜓 & Γ⊢ ¬ 𝜓 => Γ⊢ ⊥ 
pm2.21fal 1545 
pm2.21dd 186  
¬E 
Γ, ¬ 𝜓⊢ ⊥ => Γ⊢ 𝜓 

pm2.21dd 186 
definition →E in [Indrzejczak] p. 33. 
¬E 
Γ⊢ 𝜓 & Γ⊢ ¬ 𝜓 => Γ⊢ 𝜃 
pm2.21dd 186  pm2.21dd 186, pm2.21d 118, pm2.21 120 
For an alternative falsumfree natural deduction ruleset.
Definition ¬E in [Pfenning] p. 18. 
⊤I  Γ⊢ ⊤ 
a1tru 1540  tru 1527, a1tru 1540, trud 1533 
Definition ⊤I in [Pfenning] p. 18. 
⊥E  Γ, ⊥⊢ 𝜃 
falimd 1539  falim 1538 
Definition ⊥E in [Pfenning] p. 18. 
∀I 
Γ⊢ [𝑎 / 𝑥]𝜓 => Γ⊢ ∀𝑥𝜓 
alrimiv 1895  alrimiv 1895, ralrimiva 2995 
Definition ∀I^{a} in [Pfenning] p. 18,
definition I∀n in [Clemente] p. 32. 
∀E 
Γ⊢ ∀𝑥𝜓 => Γ⊢ [𝑡 / 𝑥]𝜓 
spsbcd 3482  spcv 3330, rspcv 3336 
Definition ∀E in [Pfenning] p. 18,
definition E∀n,t in [Clemente] p. 32. 
∃I 
Γ⊢ [𝑡 / 𝑥]𝜓 => Γ⊢ ∃𝑥𝜓 
spesbcd 3555  spcev 3331, rspcev 3340 
Definition ∃I in [Pfenning] p. 18,
definition I∃n,t in [Clemente] p. 32. 
∃E 
Γ⊢ ∃𝑥𝜓 & Γ, [𝑎 / 𝑥]𝜓⊢ 𝜃 =>
Γ⊢ 𝜃 
exlimddv 1903  exlimddv 1903, exlimdd 2126,
exlimdv 1901, rexlimdva 3060 
Definition ∃E^{a,u} in [Pfenning] p. 18,
definition E∃m,n,p,a in [Clemente] p. 32. 
⊥C 
Γ, ¬ 𝜓⊢ ⊥ => Γ⊢ 𝜓 
efald 1544  efald 1544 
Proof by contradiction (classical logic),
definition ⊥C in [Pfenning] p. 17. 
⊥C 
Γ, ¬ 𝜓⊢ 𝜓 => Γ⊢ 𝜓 
pm2.18da 458  pm2.18da 458, pm2.18d 124, pm2.18 122 
For an alternative falsumfree natural deduction ruleset 
¬ ¬C 
Γ⊢ ¬ ¬ 𝜓 => Γ⊢ 𝜓 
notnotrd 128  notnotrd 128, notnotr 125 
Double negation rule (classical logic),
definition NNC in [Pfenning] p. 17,
definition E¬n in [Clemente] p. 14. 
EM  Γ⊢ 𝜓 ∨ ¬ 𝜓 
exmidd 431  exmid 430 
Excluded middle (classical logic),
definition XM in [Pfenning] p. 17,
proof 5.11 in [Clemente] p. 14. 
=I  Γ⊢ 𝐴 = 𝐴 
eqidd 2652  eqid 2651, eqidd 2652 
Introduce equality,
definition =I in [Pfenning] p. 127. 
=E  Γ⊢ 𝐴 = 𝐵 & Γ[𝐴 / 𝑥]𝜓 =>
Γ⊢ [𝐵 / 𝑥]𝜓 
sbceq1dd 3474  sbceq1d 3473, equality theorems 
Eliminate equality,
definition =E in [Pfenning] p. 127. (Both E1 and E2.) 
Note that MPE uses classical logic, not intuitionist logic. As is
conventional, the "I" rules are introduction rules, "E" rules are
elimination rules, the "C" rules are conversion rules, and Γ
represents the set of (current) hypotheses. We use wff variable names
beginning with 𝜓 to provide a closer representation
of the Metamath
equivalents (which typically use the antedent 𝜑 to represent the
context Γ).
Most of this information was developed by Mario Carneiro and posted on
3Feb2017. For more information, see the
page on Deduction Form and Natural Deduction
in Metamath Proof Explorer.
For annotated examples where some traditional ND rules
are directly applied in MPE, see exnatded5.2 27391, exnatded5.3 27394,
exnatded5.5 27397, exnatded5.7 27398, exnatded5.8 27400, exnatded5.13 27402,
exnatded9.20 27404, and exnatded9.26 27406.
(Contributed by DAW, 4Feb2017.) (New usage is discouraged.)

⊢ 𝜑 ⇒ ⊢ 𝜑 

17.1.3 Natural deduction examples
These are examples of how natural deduction rules can be applied in Metamath
(both as lineforline translations of ND rules, and as a way to apply
deduction forms without being limited to applying ND rules). For more
information, see natded 27390 and mmnatded.html 27390. Since these examples should
not be used within proofs of other theorems, especially in Mathboxes, they
are marked with "(New usage is discouraged.)".


Theorem  exnatded5.2 27391 
Theorem 5.2 of [Clemente] p. 15, translated line by line using the
interpretation of natural deduction in Metamath.
For information about ND and Metamath, see the
page on Deduction Form and Natural Deduction
in Metamath Proof Explorer.
The original proof, which uses Fitch style, was written as follows:
#  MPE#  ND Expression 
MPE Translation  ND Rationale 
MPE Rationale 
1  5  ((𝜓 ∧ 𝜒) → 𝜃) 
(𝜑 → ((𝜓 ∧ 𝜒) → 𝜃)) 
Given 
$e. 
2  2  (𝜒 → 𝜓) 
(𝜑 → (𝜒 → 𝜓)) 
Given 
$e. 
3  1  𝜒 
(𝜑 → 𝜒) 
Given 
$e. 
4  3  𝜓 
(𝜑 → 𝜓) 
→E 2,3 
mpd 15, the MPE equivalent of →E, 1,2 
5  4  (𝜓 ∧ 𝜒) 
(𝜑 → (𝜓 ∧ 𝜒)) 
∧I 4,3 
jca 553, the MPE equivalent of ∧I, 3,1 
6  6  𝜃 
(𝜑 → 𝜃) 
→E 1,5 
mpd 15, the MPE equivalent of →E, 4,5 
The original used Latin letters for predicates;
we have replaced them with
Greek letters to follow Metamath naming conventions and so that
it is easier to follow the Metamath translation.
The Metamath lineforline translation of this
natural deduction approach precedes every line with an antecedent
including 𝜑 and uses the Metamath equivalents
of the natural deduction rules.
Below is the final metamath proof (which reorders some steps).
A much more efficient proof, using more of Metamath and MPE's
capabilities, is shown in exnatded5.22 27392.
A proof without context is shown in exnatded5.2i 27393.
(Contributed by Mario Carneiro, 9Feb2017.)
(Proof modification is discouraged.) (New usage is discouraged.)

⊢ (𝜑 → ((𝜓 ∧ 𝜒) → 𝜃)) & ⊢ (𝜑 → (𝜒 → 𝜓)) & ⊢ (𝜑 → 𝜒) ⇒ ⊢ (𝜑 → 𝜃) 

Theorem  exnatded5.22 27392 
A more efficient proof of Theorem 5.2 of [Clemente] p. 15. Compare with
exnatded5.2 27391 and exnatded5.2i 27393. (Contributed by Mario Carneiro,
9Feb2017.) (Proof modification is discouraged.)
(New usage is discouraged.)

⊢ (𝜑 → ((𝜓 ∧ 𝜒) → 𝜃)) & ⊢ (𝜑 → (𝜒 → 𝜓)) & ⊢ (𝜑 → 𝜒) ⇒ ⊢ (𝜑 → 𝜃) 

Theorem  exnatded5.2i 27393 
The same as exnatded5.2 27391 and exnatded5.22 27392 but with no context.
(Contributed by Mario Carneiro, 9Feb2017.)
(Proof modification is discouraged.) (New usage is discouraged.)

⊢ ((𝜓 ∧ 𝜒) → 𝜃)
& ⊢ (𝜒 → 𝜓)
& ⊢ 𝜒 ⇒ ⊢ 𝜃 

Theorem  exnatded5.3 27394 
Theorem 5.3 of [Clemente] p. 16, translated line by line using an
interpretation of natural deduction in Metamath.
A much more efficient proof, using more of Metamath and MPE's
capabilities, is shown in exnatded5.32 27395.
A proof without context is shown in exnatded5.3i 27396.
For information about ND and Metamath, see the
page on Deduction Form and Natural Deduction
in Metamath Proof Explorer
.
The original proof, which uses Fitch style, was written as follows:
#  MPE#  ND Expression 
MPE Translation  ND Rationale 
MPE Rationale 
1  2;3  (𝜓 → 𝜒) 
(𝜑 → (𝜓 → 𝜒)) 
Given 
$e; adantr 480 to move it into the ND hypothesis 
2  5;6  (𝜒 → 𝜃) 
(𝜑 → (𝜒 → 𝜃)) 
Given 
$e; adantr 480 to move it into the ND hypothesis 
3  1  ... 𝜓 
((𝜑 ∧ 𝜓) → 𝜓) 
ND hypothesis assumption 
simpr 476, to access the new assumption 
4  4  ... 𝜒 
((𝜑 ∧ 𝜓) → 𝜒) 
→E 1,3 
mpd 15, the MPE equivalent of →E, 1.3.
adantr 480 was used to transform its dependency
(we could also use imp 444 to get this directly from 1)

5  7  ... 𝜃 
((𝜑 ∧ 𝜓) → 𝜃) 
→E 2,4 
mpd 15, the MPE equivalent of →E, 4,6.
adantr 480 was used to transform its dependency 
6  8  ... (𝜒 ∧ 𝜃) 
((𝜑 ∧ 𝜓) → (𝜒 ∧ 𝜃)) 
∧I 4,5 
jca 553, the MPE equivalent of ∧I, 4,7 
7  9  (𝜓 → (𝜒 ∧ 𝜃)) 
(𝜑 → (𝜓 → (𝜒 ∧ 𝜃))) 
→I 3,6 
ex 449, the MPE equivalent of →I, 8 
The original used Latin letters for predicates;
we have replaced them with
Greek letters to follow Metamath naming conventions and so that
it is easier to follow the Metamath translation.
The Metamath lineforline translation of this
natural deduction approach precedes every line with an antecedent
including 𝜑 and uses the Metamath equivalents
of the natural deduction rules.
(Contributed by Mario Carneiro, 9Feb2017.)
(Proof modification is discouraged.) (New usage is discouraged.)

⊢ (𝜑 → (𝜓 → 𝜒)) & ⊢ (𝜑 → (𝜒 → 𝜃)) ⇒ ⊢ (𝜑 → (𝜓 → (𝜒 ∧ 𝜃))) 

Theorem  exnatded5.32 27395 
A more efficient proof of Theorem 5.3 of [Clemente] p. 16. Compare with
exnatded5.3 27394 and exnatded5.3i 27396. (Contributed by Mario Carneiro,
9Feb2017.) (Proof modification is discouraged.)
(New usage is discouraged.)

⊢ (𝜑 → (𝜓 → 𝜒)) & ⊢ (𝜑 → (𝜒 → 𝜃)) ⇒ ⊢ (𝜑 → (𝜓 → (𝜒 ∧ 𝜃))) 

Theorem  exnatded5.3i 27396 
The same as exnatded5.3 27394 and exnatded5.32 27395 but with no context.
Identical to jccir 561, which should be used instead. (Contributed
by
Mario Carneiro, 9Feb2017.) (Proof modification is discouraged.)
(New usage is discouraged.)

⊢ (𝜓 → 𝜒)
& ⊢ (𝜒 → 𝜃) ⇒ ⊢ (𝜓 → (𝜒 ∧ 𝜃)) 

Theorem  exnatded5.5 27397 
Theorem 5.5 of [Clemente] p. 18, translated line by line using the
usual translation of natural deduction (ND) in the
Metamath Proof Explorer (MPE) notation.
For information about ND and Metamath, see the
page on Deduction Form and Natural Deduction
in Metamath Proof Explorer.
The original proof, which uses Fitch style, was written as follows
(the leading "..." shows an embedded ND hypothesis, beginning with
the initial assumption of the ND hypothesis):
#  MPE#  ND Expression 
MPE Translation  ND Rationale 
MPE Rationale 
1  2;3 
(𝜓 → 𝜒) 
(𝜑 → (𝜓 → 𝜒)) 
Given 
$e; adantr 480 to move it into the ND hypothesis 
2  5  ¬ 𝜒 
(𝜑 → ¬ 𝜒)  Given 
$e; we'll use adantr 480 to move it into the ND hypothesis 
3  1 
... 𝜓  ((𝜑 ∧ 𝜓) → 𝜓) 
ND hypothesis assumption 
simpr 476 
4  4  ... 𝜒 
((𝜑 ∧ 𝜓) → 𝜒) 
→E 1,3 
mpd 15 1,3 
5  6  ... ¬ 𝜒 
((𝜑 ∧ 𝜓) → ¬ 𝜒) 
IT 2 
adantr 480 5 
6  7  ¬ 𝜓 
(𝜑 → ¬ 𝜓) 
∧I 3,4,5 
pm2.65da 599 4,6 
The original used Latin letters; we have replaced them with
Greek letters to follow Metamath naming conventions and so that
it is easier to follow the Metamath translation.
The Metamath lineforline translation of this
natural deduction approach precedes every line with an antecedent
including 𝜑 and uses the Metamath equivalents
of the natural deduction rules.
To add an assumption, the antecedent is modified to include it
(typically by using adantr 480; simpr 476 is useful when you want to
depend directly on the new assumption).
Below is the final metamath proof (which reorders some steps).
A much more efficient proof is mtod 189;
a proof without context is shown in mto 188.
(Contributed by David A. Wheeler, 19Feb2017.)
(Proof modification is discouraged.) (New usage is discouraged.)

⊢ (𝜑 → (𝜓 → 𝜒)) & ⊢ (𝜑 → ¬ 𝜒) ⇒ ⊢ (𝜑 → ¬ 𝜓) 

Theorem  exnatded5.7 27398 
Theorem 5.7 of [Clemente] p. 19, translated line by line using the
interpretation of natural deduction in Metamath.
A much more efficient proof, using more of Metamath and MPE's
capabilities, is shown in exnatded5.72 27399.
For information about ND and Metamath, see the
page on Deduction Form and Natural Deduction
in Metamath Proof Explorer
.
The original proof, which uses Fitch style, was written as follows:
#  MPE#  ND Expression 
MPE Translation  ND Rationale 
MPE Rationale 
1  6 
(𝜓 ∨ (𝜒 ∧ 𝜃)) 
(𝜑 → (𝜓 ∨ (𝜒 ∧ 𝜃))) 
Given 
$e. No need for adantr 480 because we do not move this
into an ND hypothesis 
2  1  ... 𝜓 
((𝜑 ∧ 𝜓) → 𝜓) 
ND hypothesis assumption (new scope) 
simpr 476 
3  2  ... (𝜓 ∨ 𝜒) 
((𝜑 ∧ 𝜓) → (𝜓 ∨ 𝜒)) 
∨I_{L} 2 
orcd 406, the MPE equivalent of ∨I_{L}, 1 
4  3  ... (𝜒 ∧ 𝜃) 
((𝜑 ∧ (𝜒 ∧ 𝜃)) → (𝜒 ∧ 𝜃)) 
ND hypothesis assumption (new scope) 
simpr 476 
5  4  ... 𝜒 
((𝜑 ∧ (𝜒 ∧ 𝜃)) → 𝜒) 
∧E_{L} 4 
simpld 474, the MPE equivalent of ∧E_{L}, 3 
6  6  ... (𝜓 ∨ 𝜒) 
((𝜑 ∧ (𝜒 ∧ 𝜃)) → (𝜓 ∨ 𝜒)) 
∨I_{R} 5 
olcd 407, the MPE equivalent of ∨I_{R}, 4 
7  7  (𝜓 ∨ 𝜒) 
(𝜑 → (𝜓 ∨ 𝜒)) 
∨E 1,3,6 
mpjaodan 844, the MPE equivalent of ∨E, 2,5,6 
The original used Latin letters for predicates;
we have replaced them with
Greek letters to follow Metamath naming conventions and so that
it is easier to follow the Metamath translation.
The Metamath lineforline translation of this
natural deduction approach precedes every line with an antecedent
including 𝜑 and uses the Metamath equivalents
of the natural deduction rules.
(Contributed by Mario Carneiro, 9Feb2017.)
(Proof modification is discouraged.) (New usage is discouraged.)

⊢ (𝜑 → (𝜓 ∨ (𝜒 ∧ 𝜃))) ⇒ ⊢ (𝜑 → (𝜓 ∨ 𝜒)) 

Theorem  exnatded5.72 27399 
A more efficient proof of Theorem 5.7 of [Clemente] p. 19. Compare with
exnatded5.7 27398. (Contributed by Mario Carneiro,
9Feb2017.)
(Proof modification is discouraged.) (New usage is discouraged.)

⊢ (𝜑 → (𝜓 ∨ (𝜒 ∧ 𝜃))) ⇒ ⊢ (𝜑 → (𝜓 ∨ 𝜒)) 

Theorem  exnatded5.8 27400 
Theorem 5.8 of [Clemente] p. 20, translated line by line using the
usual translation of natural deduction (ND) in the
Metamath Proof Explorer (MPE) notation.
For information about ND and Metamath, see the
page on Deduction Form and Natural Deduction
in Metamath Proof Explorer.
The original proof, which uses Fitch style, was written as follows
(the leading "..." shows an embedded ND hypothesis, beginning with
the initial assumption of the ND hypothesis):
#  MPE#  ND Expression 
MPE Translation  ND Rationale 
MPE Rationale 
1  10;11 
((𝜓 ∧ 𝜒) → ¬ 𝜃) 
(𝜑 → ((𝜓 ∧ 𝜒) → ¬ 𝜃)) 
Given 
$e; adantr 480 to move it into the ND hypothesis 
2  3;4  (𝜏 → 𝜃) 
(𝜑 → (𝜏 → 𝜃))  Given 
$e; adantr 480 to move it into the ND hypothesis 
3  7;8 
𝜒  (𝜑 → 𝜒) 
Given 
$e; adantr 480 to move it into the ND hypothesis 
4  1;2  𝜏  (𝜑 → 𝜏) 
Given 
$e. adantr 480 to move it into the ND hypothesis 
5  6  ... 𝜓 
((𝜑 ∧ 𝜓) → 𝜓) 
ND Hypothesis/Assumption 
simpr 476. New ND hypothesis scope, each reference outside
the scope must change antecedent 𝜑 to (𝜑 ∧ 𝜓). 
6  9  ... (𝜓 ∧ 𝜒) 
((𝜑 ∧ 𝜓) → (𝜓 ∧ 𝜒)) 
∧I 5,3 
jca 553 (∧I), 6,8 (adantr 480 to bring in scope) 
7  5  ... ¬ 𝜃 
((𝜑 ∧ 𝜓) → ¬ 𝜃) 
→E 1,6 
mpd 15 (→E), 2,4 
8  12  ... 𝜃 
((𝜑 ∧ 𝜓) → 𝜃) 
→E 2,4 
mpd 15 (→E), 9,11;
note the contradiction with ND line 7 (MPE line 5) 
9  13  ¬ 𝜓 
(𝜑 → ¬ 𝜓) 
¬I 5,7,8 
pm2.65da 599 (¬I), 5,12; proof by contradiction.
MPE step 6 (ND#5) does not need a reference here, because
the assumption is embedded in the antecedents 
The original used Latin letters; we have replaced them with
Greek letters to follow Metamath naming conventions and so that
it is easier to follow the Metamath translation.
The Metamath lineforline translation of this
natural deduction approach precedes every line with an antecedent
including 𝜑 and uses the Metamath equivalents
of the natural deduction rules.
To add an assumption, the antecedent is modified to include it
(typically by using adantr 480; simpr 476 is useful when you want to
depend directly on the new assumption).
Below is the final metamath proof (which reorders some steps).
A much more efficient proof, using more of Metamath and MPE's
capabilities, is shown in exnatded5.82 27401.
(Contributed by Mario Carneiro, 9Feb2017.)
(Proof modification is discouraged.) (New usage is discouraged.)

⊢ (𝜑 → ((𝜓 ∧ 𝜒) → ¬ 𝜃)) & ⊢ (𝜑 → (𝜏 → 𝜃)) & ⊢ (𝜑 → 𝜒)
& ⊢ (𝜑 → 𝜏) ⇒ ⊢ (𝜑 → ¬ 𝜓) 