Metamath Proof Explorer


Definition df-pths

Description: Define the set of all paths (in an undirected graph).

According to Wikipedia ("Path (graph theory)", https://en.wikipedia.org/wiki/Path_(graph_theory) , 3-Oct-2017): "A path is a trail in which all vertices (except possibly the first and last) are distinct. ... use the term simple path to refer to a path which contains no repeated vertices."

According to Bollobas: "... a path is a walk with distinct vertices.", see Notation of Bollobas p. 5. (A walk with distinct vertices is actually a simple path, see upgrwlkdvspth ).

Therefore, a path can be represented by an injective mapping f from { 1 , ... , n } and a mapping p from { 0 , ... , n }, which is injective restricted to the set { 1 , ... , n }, where f enumerates the (indices of the) different edges, and p enumerates the vertices. So the path is also represented by the following sequence: p(0) e(f(1)) p(1) e(f(2)) ... p(n-1) e(f(n)) p(n). (Contributed by Alexander van der Vekens and Mario Carneiro, 4-Oct-2017) (Revised by AV, 9-Jan-2021)

Ref Expression
Assertion df-pths
|- Paths = ( g e. _V |-> { <. f , p >. | ( f ( Trails ` g ) p /\ Fun `' ( p |` ( 1 ..^ ( # ` f ) ) ) /\ ( ( p " { 0 , ( # ` f ) } ) i^i ( p " ( 1 ..^ ( # ` f ) ) ) ) = (/) ) } )

Detailed syntax breakdown

Step Hyp Ref Expression
0 cpths
 |-  Paths
1 vg
 |-  g
2 cvv
 |-  _V
3 vf
 |-  f
4 vp
 |-  p
5 3 cv
 |-  f
6 ctrls
 |-  Trails
7 1 cv
 |-  g
8 7 6 cfv
 |-  ( Trails ` g )
9 4 cv
 |-  p
10 5 9 8 wbr
 |-  f ( Trails ` g ) p
11 c1
 |-  1
12 cfzo
 |-  ..^
13 chash
 |-  #
14 5 13 cfv
 |-  ( # ` f )
15 11 14 12 co
 |-  ( 1 ..^ ( # ` f ) )
16 9 15 cres
 |-  ( p |` ( 1 ..^ ( # ` f ) ) )
17 16 ccnv
 |-  `' ( p |` ( 1 ..^ ( # ` f ) ) )
18 17 wfun
 |-  Fun `' ( p |` ( 1 ..^ ( # ` f ) ) )
19 cc0
 |-  0
20 19 14 cpr
 |-  { 0 , ( # ` f ) }
21 9 20 cima
 |-  ( p " { 0 , ( # ` f ) } )
22 9 15 cima
 |-  ( p " ( 1 ..^ ( # ` f ) ) )
23 21 22 cin
 |-  ( ( p " { 0 , ( # ` f ) } ) i^i ( p " ( 1 ..^ ( # ` f ) ) ) )
24 c0
 |-  (/)
25 23 24 wceq
 |-  ( ( p " { 0 , ( # ` f ) } ) i^i ( p " ( 1 ..^ ( # ` f ) ) ) ) = (/)
26 10 18 25 w3a
 |-  ( f ( Trails ` g ) p /\ Fun `' ( p |` ( 1 ..^ ( # ` f ) ) ) /\ ( ( p " { 0 , ( # ` f ) } ) i^i ( p " ( 1 ..^ ( # ` f ) ) ) ) = (/) )
27 26 3 4 copab
 |-  { <. f , p >. | ( f ( Trails ` g ) p /\ Fun `' ( p |` ( 1 ..^ ( # ` f ) ) ) /\ ( ( p " { 0 , ( # ` f ) } ) i^i ( p " ( 1 ..^ ( # ` f ) ) ) ) = (/) ) }
28 1 2 27 cmpt
 |-  ( g e. _V |-> { <. f , p >. | ( f ( Trails ` g ) p /\ Fun `' ( p |` ( 1 ..^ ( # ` f ) ) ) /\ ( ( p " { 0 , ( # ` f ) } ) i^i ( p " ( 1 ..^ ( # ` f ) ) ) ) = (/) ) } )
29 0 28 wceq
 |-  Paths = ( g e. _V |-> { <. f , p >. | ( f ( Trails ` g ) p /\ Fun `' ( p |` ( 1 ..^ ( # ` f ) ) ) /\ ( ( p " { 0 , ( # ` f ) } ) i^i ( p " ( 1 ..^ ( # ` f ) ) ) ) = (/) ) } )