Documentation
ChipFiringWithLean
.
CFGraphExample
Search
return to top
source
Imports
Init
ChipFiringWithLean.Basic
Mathlib.LinearAlgebra.Matrix.Symmetric
Imported by
Person
instDecidableEqPerson
instFintypePerson
instNonemptyPerson
exampleEdges
loopless_example_edges
edgesWithLoop
loopless_test_edges_with_loop
example_graph
initial_wealth
vertex_degree_A
vertex_degree_B
vertex_degree_C
vertex_degree_E
edge_count_AB
edge_count_BA
edge_count_BC
edge_count_CB
edge_count_AC
edge_count_CA
edge_count_AE
edge_count_EA
edge_count_EC
edge_count_CE
edge_count_BE
edge_count_EB
edge_count_AA
edge_count_BB
edge_count_CC
edge_count_EE
after_charlie_lends
charlie_wealth_after_lending
bob_wealth_after_charlie_lends
W₁
after_W₁_firing
alice_wealth_after_W₁
bob_wealth_after_W₁
charlie_wealth_after_W₁
elise_wealth_after_W₁
W₂
after_W₂_firing
alice_wealth_after_W₂
bob_wealth_after_W₂
charlie_wealth_after_W₂
elise_wealth_after_W₂
W₃
after_W₃_firing
alice_wealth_after_W₃
bob_wealth_after_W₃
charlie_wealth_after_W₃
elise_wealth_after_W₃
after_bob_borrows
bob_wealth_after_borrowing
alice_wealth_after_bob_borrows
charlie_wealth_after_bob_borrows
initial_wealth_degree
after_W₁_degree
after_W₂_degree
after_W₃_degree
initial_not_effective
after_W₃_firing_effective
example_laplacian
laplacian_diagonal_A
laplacian_diagonal_B
laplacian_diagonal_C
laplacian_diagonal_E
laplacian_off_diagonal_AB
laplacian_off_diagonal_AC
laplacian_off_diagonal_AE
laplacian_off_diagonal_BC
laplacian_off_diagonal_BE
laplacian_off_diagonal_CE
check_example_laplacian_symmetry
firing_script_example
res_div_post_lap_based_script_firing
lap_based_script_firing_preserves_degree
non_q_reduced_example
non_q_reduced_example_is_invalid
source
inductive
Person
:
Type
A :
Person
B :
Person
C :
Person
E :
Person
Instances For
source
instance
instDecidableEqPerson
:
DecidableEq
Person
Equations
instDecidableEqPerson
x✝
y✝
=
if h :
x✝
.
ctorIdx
=
y✝
.
ctorIdx
then
isTrue
⋯
else
isFalse
⋯
source
instance
instFintypePerson
:
Fintype
Person
Equations
instFintypePerson
=
{
elems
:=
{
Person.A
,
Person.B
,
Person.C
,
Person.E
}
,
complete
:=
instFintypePerson._proof_1
}
source
instance
instNonemptyPerson
:
Nonempty
Person
source
def
exampleEdges
:
Multiset
(
Person
×
Person
)
Equations
exampleEdges
=
↑
[
(
Person.A
,
Person.B
)
,
(
Person.B
,
Person.C
)
,
(
Person.C
,
Person.E
)
]
Instances For
source
theorem
loopless_example_edges
:
isLoopless
exampleEdges
source
def
edgesWithLoop
:
Multiset
(
Person
×
Person
)
Equations
edgesWithLoop
=
↑
[
(
Person.A
,
Person.B
)
,
(
Person.A
,
Person.A
)
,
(
Person.B
,
Person.C
)
]
Instances For
source
theorem
loopless_test_edges_with_loop
:
¬
isLoopless
edgesWithLoop
source
def
example_graph
:
CFGraph
Person
Equations
One or more equations did not get rendered due to their size.
Instances For
source
def
initial_wealth
:
CFDiv
Person
Equations
initial_wealth
Person.A
=
2
initial_wealth
Person.B
=
-
3
initial_wealth
Person.C
=
4
initial_wealth
Person.E
=
-
1
Instances For
source
theorem
vertex_degree_A
:
vertex_degree
example_graph
Person.A
=
4
source
theorem
vertex_degree_B
:
vertex_degree
example_graph
Person.B
=
2
source
theorem
vertex_degree_C
:
vertex_degree
example_graph
Person.C
=
3
source
theorem
vertex_degree_E
:
vertex_degree
example_graph
Person.E
=
3
source
theorem
edge_count_AB
:
num_edges
example_graph
Person.A
Person.B
=
1
source
theorem
edge_count_BA
:
num_edges
example_graph
Person.B
Person.A
=
1
source
theorem
edge_count_BC
:
num_edges
example_graph
Person.B
Person.C
=
1
source
theorem
edge_count_CB
:
num_edges
example_graph
Person.C
Person.B
=
1
source
theorem
edge_count_AC
:
num_edges
example_graph
Person.A
Person.C
=
1
source
theorem
edge_count_CA
:
num_edges
example_graph
Person.C
Person.A
=
1
source
theorem
edge_count_AE
:
num_edges
example_graph
Person.A
Person.E
=
2
source
theorem
edge_count_EA
:
num_edges
example_graph
Person.E
Person.A
=
2
source
theorem
edge_count_EC
:
num_edges
example_graph
Person.E
Person.C
=
1
source
theorem
edge_count_CE
:
num_edges
example_graph
Person.C
Person.E
=
1
source
theorem
edge_count_BE
:
num_edges
example_graph
Person.B
Person.E
=
0
source
theorem
edge_count_EB
:
num_edges
example_graph
Person.E
Person.B
=
0
source
theorem
edge_count_AA
:
num_edges
example_graph
Person.A
Person.A
=
0
source
theorem
edge_count_BB
:
num_edges
example_graph
Person.B
Person.B
=
0
source
theorem
edge_count_CC
:
num_edges
example_graph
Person.C
Person.C
=
0
source
theorem
edge_count_EE
:
num_edges
example_graph
Person.E
Person.E
=
0
source
def
after_charlie_lends
:
CFDiv
Person
Equations
after_charlie_lends
=
firing_move
example_graph
initial_wealth
Person.C
Instances For
source
theorem
charlie_wealth_after_lending
:
after_charlie_lends
Person.C
=
1
source
theorem
bob_wealth_after_charlie_lends
:
after_charlie_lends
Person.B
=
-
2
source
def
W₁
:
Finset
Person
Equations
W₁
=
{
Person.A
,
Person.E
,
Person.C
}
Instances For
source
def
after_W₁_firing
:
CFDiv
Person
Equations
after_W₁_firing
=
set_firing
example_graph
initial_wealth
W₁
Instances For
source
theorem
alice_wealth_after_W₁
:
after_W₁_firing
Person.A
=
1
source
theorem
bob_wealth_after_W₁
:
after_W₁_firing
Person.B
=
-
1
source
theorem
charlie_wealth_after_W₁
:
after_W₁_firing
Person.C
=
3
source
theorem
elise_wealth_after_W₁
:
after_W₁_firing
Person.E
=
-
1
source
def
W₂
:
Finset
Person
Equations
W₂
=
W₁
Instances For
source
def
after_W₂_firing
:
CFDiv
Person
Equations
after_W₂_firing
=
set_firing
example_graph
after_W₁_firing
W₂
Instances For
source
theorem
alice_wealth_after_W₂
:
after_W₂_firing
Person.A
=
0
source
theorem
bob_wealth_after_W₂
:
after_W₂_firing
Person.B
=
1
source
theorem
charlie_wealth_after_W₂
:
after_W₂_firing
Person.C
=
2
source
theorem
elise_wealth_after_W₂
:
after_W₂_firing
Person.E
=
-
1
source
def
W₃
:
Finset
Person
Equations
W₃
=
{
Person.B
,
Person.C
}
Instances For
source
def
after_W₃_firing
:
CFDiv
Person
Equations
after_W₃_firing
=
set_firing
example_graph
after_W₂_firing
W₃
Instances For
source
theorem
alice_wealth_after_W₃
:
after_W₃_firing
Person.A
=
2
source
theorem
bob_wealth_after_W₃
:
after_W₃_firing
Person.B
=
0
source
theorem
charlie_wealth_after_W₃
:
after_W₃_firing
Person.C
=
0
source
theorem
elise_wealth_after_W₃
:
after_W₃_firing
Person.E
=
0
source
def
after_bob_borrows
:
CFDiv
Person
Equations
after_bob_borrows
=
borrowing_move
example_graph
initial_wealth
Person.B
Instances For
source
theorem
bob_wealth_after_borrowing
:
after_bob_borrows
Person.B
=
-
1
source
theorem
alice_wealth_after_bob_borrows
:
after_bob_borrows
Person.A
=
1
source
theorem
charlie_wealth_after_bob_borrows
:
after_bob_borrows
Person.C
=
3
source
theorem
initial_wealth_degree
:
deg
initial_wealth
=
2
source
theorem
after_W₁_degree
:
deg
after_W₁_firing
=
2
source
theorem
after_W₂_degree
:
deg
after_W₂_firing
=
2
source
theorem
after_W₃_degree
:
deg
after_W₃_firing
=
2
source
theorem
initial_not_effective
:
¬
effective
initial_wealth
source
theorem
after_W₃_firing_effective
:
effective
after_W₃_firing
source
def
example_laplacian
:
Matrix
Person
Person
ℤ
Equations
example_laplacian
=
laplacian_matrix
example_graph
Instances For
source
theorem
laplacian_diagonal_A
:
example_laplacian
Person.A
Person.A
=
4
source
theorem
laplacian_diagonal_B
:
example_laplacian
Person.B
Person.B
=
2
source
theorem
laplacian_diagonal_C
:
example_laplacian
Person.C
Person.C
=
3
source
theorem
laplacian_diagonal_E
:
example_laplacian
Person.E
Person.E
=
3
source
theorem
laplacian_off_diagonal_AB
:
example_laplacian
Person.A
Person.B
=
-
1
source
theorem
laplacian_off_diagonal_AC
:
example_laplacian
Person.A
Person.C
=
-
1
source
theorem
laplacian_off_diagonal_AE
:
example_laplacian
Person.A
Person.E
=
-
2
source
theorem
laplacian_off_diagonal_BC
:
example_laplacian
Person.B
Person.C
=
-
1
source
theorem
laplacian_off_diagonal_BE
:
example_laplacian
Person.B
Person.E
=
0
source
theorem
laplacian_off_diagonal_CE
:
example_laplacian
Person.C
Person.E
=
-
1
source
theorem
check_example_laplacian_symmetry
:
example_laplacian
.
IsSymm
source
def
firing_script_example
:
firing_script
Person
Equations
firing_script_example
Person.A
=
0
firing_script_example
Person.B
=
-
1
firing_script_example
Person.C
=
1
firing_script_example
Person.E
=
0
Instances For
source
def
res_div_post_lap_based_script_firing
:
CFDiv
Person
Equations
res_div_post_lap_based_script_firing
=
apply_laplacian
example_graph
firing_script_example
initial_wealth
Instances For
source
theorem
lap_based_script_firing_preserves_degree
:
deg
res_div_post_lap_based_script_firing
=
2
source
def
non_q_reduced_example
:
CFDiv
Person
Equations
non_q_reduced_example
Person.A
=
1
non_q_reduced_example
Person.B
=
-
1
non_q_reduced_example
Person.C
=
2
non_q_reduced_example
Person.E
=
1
Instances For
source
theorem
non_q_reduced_example_is_invalid
:
¬
q_reduced
example_graph
Person.A
non_q_reduced_example