Documentation
Projects
.
System
.
Basic
Search
return to top
source
Imports
Init
Projects.System.Defs
Imported by
System
.
instInhabited
System
.
dfltSimFn
System
.
mkSimFn
System
.
instSimFnDfltSimFn
System
.
validTr_of_simFn_and_hasTr
System
.
instSimFnMkSimFn
System
.
Reachable
.
refl'
System
.
Reachable
.
trans
System
.
validTr_of_eq_some
System
.
hasTr_of_eq_some
System
.
reachable_of_simulate'
System
.
reachable_of_simulate
System
.
reachable_left
System
.
reachable_right
System
.
reachable_of_tr
System
.
hasTr_of_reachable_and_ne
System
.
eq_of_reachable_and_not_hasTr
System
.
exi_tr_right_of_reachable_and_ne
System
.
reachable_ind_left
System
.
trs_empty
System
.
simulate_zero
System
.
reachable_of_trs'
System
.
reachable_of_trs
System
.
exi_trs_of_reachable
System
.
reachable_iff_exi_trs
System
.
trs_append
System
.
reachable_trs_aux
System
.
reachable_trs
System
.
simulate_add
System
.
simulate_add_full
System
.
trs_append_full
System
.
trs_cons_full
System
.
trs_snoc_full
System
.
reachable_ind_right
System
.
simulate_snd_le
System
.
simulate_snd_mono
System
.
simulate_sub_simulate_snd_eq
System
.
simFn_def
System
.
acyclic_def
System
.
tree_def
System
.
wf_def
System
.
wf_of_initial
System
.
instWFOfInitial
System
.
wf_of_reachable
System
.
initial_def
System
.
validTr_iff_isSome
System
.
hasTr_iff
System
.
instDecidableValidTr
System
.
reachable_of_fst_trs
System
.
wf_of_tr
System
.
wf_of_trs
System
.
wf_of_acyclic
System
.
wf_of_tree
System
.
instWFOfAcyclic
System
.
instWFOfTree
System
.
simulate_eq_of_not_hasTr
System
.
WFTrans
System
.
WFTrans_def
System
.
wfTrans_of_validTr
System
.
wfTrans_of_tr
System
.
simulate_snd_le_of_eq
System
.
simulate_snd_ne_zero_of
System
.
snd_simulate_add_eq_zero_iff
System
.
snd_trs_append_eq_nil_iff
System
.
snd_trs_cons_eq_nil_iff
System
.
snd_trs_snoc_eq_nil_iff
System
.
simulate_succ_full'
System
.
simulate_succ_full
System
.
simulate_add_one_full'
System
.
simulate_add_one_full
System
.
simulate_one_of_snd_succ
System
.
simulate_one_of_snd_add_one
System
.
snd_simulate_add_one_eq_zero_iff'
System
.
simulate_eq_snd_add_right_iff
System
.
simulate_eq_snd_add_left_iff
System
.
simulate_eq_same_iff
System
.
tr_simFn_eq_none_iff
System
.
tr_eq_none_of_simulate_eq
source
@[instance_reducible]
instance
System
.
instInhabited
{
S
T
:
Type
u}
:
Inhabited
(
System
S
T
)
Equations
System.instInhabited
=
{
default
:=
{
initial
:=
∅
,
tr
:=
default
}
}
source
noncomputable def
System
.
dfltSimFn
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
[
Inhabited
(
S
→
T
)
]
:
S
→
T
Equations
System.dfltSimFn
s
=
if h :
sys
.
hasTr
s
then
Exists.choose
h
else
default
s
Instances For
source
noncomputable def
System
.
mkSimFn
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
(
f
:
S
→
T
)
:
S
→
T
Equations
System.mkSimFn
f
s
=
if h :
sys
.
validTr
s
(
f
s
)
then
f
s
else
System.dfltSimFn
s
Instances For
source
@[simp]
instance
System
.
instSimFnDfltSimFn
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
[
Inhabited
(
S
→
T
)
]
:
sys
.
SimFn
dfltSimFn
source
theorem
System
.
validTr_of_simFn_and_hasTr
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
{
f
:
S
→
T
}
[
hs
:
sys
.
WF
s
]
[
hf
:
sys
.
SimFn
f
]
(
h
:
sys
.
hasTr
s
)
:
sys
.
validTr
s
(
f
s
)
source
@[simp]
instance
System
.
instSimFnMkSimFn
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
:
sys
.
SimFn
(
mkSimFn
f
)
source
@[simp]
theorem
System
.
Reachable
.
refl'
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
:
S
}
:
sys
.
Reachable
a
a
source
theorem
System
.
Reachable
.
trans
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
b
c
:
S
}
(
h₁
:
sys
.
Reachable
a
b
)
(
h₂
:
sys
.
Reachable
b
c
)
:
sys
.
Reachable
a
c
source
theorem
System
.
validTr_of_eq_some
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
{
t
:
T
}
{
s₁
:
S
}
(
h
:
sys
.
tr
s
t
=
some
s₁
)
:
sys
.
validTr
s
t
source
theorem
System
.
hasTr_of_eq_some
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
{
t
:
T
}
{
s₁
:
S
}
(
h
:
sys
.
tr
s
t
=
some
s₁
)
:
sys
.
hasTr
s
source
theorem
System
.
reachable_of_simulate'
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s₁
s₂
:
S
}
{
n
:
ℕ
}
(
h
:
(
sys
.
simulate
f
s₁
n
)
.1
=
s₂
)
:
sys
.
Reachable
s₁
s₂
source
theorem
System
.
reachable_of_simulate
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s₁
s₂
:
S
}
{
n
r
:
ℕ
}
(
h
:
sys
.
simulate
f
s₁
n
=
(
s₂
,
r
)
)
:
sys
.
Reachable
s₁
s₂
source
theorem
System
.
reachable_left
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
b
c
:
S
}
{
t
:
T
}
(
h₁
:
sys
.
tr
a
t
=
some
b
)
(
h₂
:
sys
.
Reachable
b
c
)
:
sys
.
Reachable
a
c
source
theorem
System
.
reachable_right
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
b
c
:
S
}
{
t
:
T
}
(
h₁
:
sys
.
Reachable
a
b
)
(
h₂
:
sys
.
tr
b
t
=
some
c
)
:
sys
.
Reachable
a
c
source
theorem
System
.
reachable_of_tr
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
b
:
S
}
{
t
:
T
}
(
h
:
sys
.
tr
a
t
=
some
b
)
:
sys
.
Reachable
a
b
source
theorem
System
.
hasTr_of_reachable_and_ne
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s₁
s₂
:
S
}
(
h₁
:
sys
.
Reachable
s₁
s₂
)
(
h₂
:
s₁
≠
s₂
)
:
sys
.
hasTr
s₁
source
theorem
System
.
eq_of_reachable_and_not_hasTr
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s₁
s₂
:
S
}
(
h₁
:
sys
.
Reachable
s₁
s₂
)
(
h₂
:
¬
sys
.
hasTr
s₁
)
:
s₁
=
s₂
source
theorem
System
.
exi_tr_right_of_reachable_and_ne
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
b
:
S
}
(
h₁
:
sys
.
Reachable
a
b
)
(
h₂
:
a
≠
b
)
:
∃ (
c
:
S
) (
t
:
T
),
sys
.
Reachable
a
c
∧
sys
.
tr
c
t
=
some
b
source
theorem
System
.
reachable_ind_left
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
P
:
(
a
b
:
S
) →
sys
.
Reachable
a
b
→
Prop
}
(
h₁
:
∀ {
a
:
S
},
P
a
a
⋯
)
(
h₂
:
∀ {
a
b
c
:
S
} {
t
:
T
} (
hx
:
sys
.
tr
a
t
=
some
b
) (
hy
:
sys
.
Reachable
b
c
),
P
b
c
hy
→
P
a
c
⋯
)
{
a
b
:
S
}
(
h
:
sys
.
Reachable
a
b
)
:
P
a
b
h
source
@[simp]
theorem
System
.
trs_empty
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
:
sys
.
trs
s
[
]
=
(
s
,
[
]
)
source
@[simp]
theorem
System
.
simulate_zero
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
:
S
}
:
sys
.
simulate
f
s
0
=
(
s
,
0
)
source
theorem
System
.
reachable_of_trs'
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
:
S
}
{
ts
:
List
T
}
{
r
:
S
×
List
T
}
(
h
:
sys
.
trs
a
ts
=
r
)
:
sys
.
Reachable
a
r
.1
source
theorem
System
.
reachable_of_trs
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
b
:
S
}
{
ts
r
:
List
T
}
(
h
:
sys
.
trs
a
ts
=
(
b
,
r
)
)
:
sys
.
Reachable
a
b
source
theorem
System
.
exi_trs_of_reachable
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
b
:
S
}
(
h
:
sys
.
Reachable
a
b
)
:
∃ (
ts
:
List
T
),
sys
.
trs
a
ts
=
(
b
,
[
]
)
source
theorem
System
.
reachable_iff_exi_trs
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
b
:
S
}
:
sys
.
Reachable
a
b
↔
∃ (
ts
:
List
T
),
sys
.
trs
a
ts
=
(
b
,
[
]
)
source
theorem
System
.
trs_append
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
{
xs
ys
:
List
T
}
:
sys
.
trs
s
(
xs
++
ys
)
=
match
sys
.
trs
s
xs
with |
(
s₁
,
xs'
)
=>
match
sys
.
trs
s₁
ys
with |
(
s₂
,
ys'
)
=>
if
xs'
≠
[
]
then
(
s₁
,
xs'
++
ys
)
else
(
s₂
,
xs'
++
ys'
)
source
theorem
System
.
reachable_trs_aux
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
b
:
S
}
{
ts
:
List
T
}
(
h
:
sys
.
Reachable
a
b
)
:
sys
.
Reachable
a
(
sys
.
trs
b
ts
)
.1
source
@[simp]
theorem
System
.
reachable_trs
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
{
ts
:
List
T
}
:
sys
.
Reachable
s
(
sys
.
trs
s
ts
)
.1
source
theorem
System
.
simulate_add
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
:
S
}
{
n
m
:
ℕ
}
:
sys
.
simulate
f
s
(
n
+
m
)
=
match
sys
.
simulate
f
s
n
with |
(
s₁
,
n'
)
=>
match
sys
.
simulate
f
s₁
m
with |
(
s₂
,
m'
)
=>
if
n'
≠
0
then
(
s₁
,
n'
+
m
)
else
(
s₂
,
n'
+
m'
)
source
@[simp]
theorem
System
.
simulate_add_full
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s₂
:
S
}
{
n
m
:
ℕ
}
:
sys
.
simulate
f
s
(
n
+
m
)
=
(
s₂
,
0
)
↔
∃ (
s₁
:
S
),
sys
.
simulate
f
s
n
=
(
s₁
,
0
)
∧
sys
.
simulate
f
s₁
m
=
(
s₂
,
0
)
source
@[simp]
theorem
System
.
trs_append_full
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
s₂
:
S
}
{
ts₁
ts₂
:
List
T
}
:
sys
.
trs
s
(
ts₁
++
ts₂
)
=
(
s₂
,
[
]
)
↔
∃ (
s₁
:
S
),
sys
.
trs
s
ts₁
=
(
s₁
,
[
]
)
∧
sys
.
trs
s₁
ts₂
=
(
s₂
,
[
]
)
source
@[simp]
theorem
System
.
trs_cons_full
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
s₂
:
S
}
{
t
:
T
}
{
ts
:
List
T
}
:
sys
.
trs
s
(
t
::
ts
)
=
(
s₂
,
[
]
)
↔
∃ (
s₁
:
S
),
sys
.
tr
s
t
=
some
s₁
∧
sys
.
trs
s₁
ts
=
(
s₂
,
[
]
)
source
@[simp]
theorem
System
.
trs_snoc_full
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
s₂
:
S
}
{
t
:
T
}
{
ts
:
List
T
}
:
sys
.
trs
s
(
ts
++
[
t
]
)
=
(
s₂
,
[
]
)
↔
∃ (
s₁
:
S
),
sys
.
trs
s
ts
=
(
s₁
,
[
]
)
∧
sys
.
tr
s₁
t
=
some
s₂
source
theorem
System
.
reachable_ind_right
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
P
:
(
a
b
:
S
) →
sys
.
Reachable
a
b
→
Prop
}
(
h₁
:
∀ {
a
:
S
},
P
a
a
⋯
)
(
h₂
:
∀ {
a
b
c
:
S
} {
t
:
T
} (
hx
:
sys
.
Reachable
a
b
) (
hy
:
sys
.
tr
b
t
=
some
c
),
P
a
b
hx
→
P
a
c
⋯
)
{
a
b
:
S
}
(
h
:
sys
.
Reachable
a
b
)
:
P
a
b
h
source
@[simp]
theorem
System
.
simulate_snd_le
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
:
S
}
{
n
:
ℕ
}
:
(
sys
.
simulate
f
s
n
)
.2
≤
n
source
theorem
System
.
simulate_snd_mono
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
:
S
}
{
n
m
:
ℕ
}
(
h
:
n
≤
m
)
:
(
sys
.
simulate
f
s
n
)
.2
≤
(
sys
.
simulate
f
s
m
)
.2
source
@[simp]
theorem
System
.
simulate_sub_simulate_snd_eq
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
:
S
}
{
n
:
ℕ
}
:
sys
.
simulate
f
s
(
n
-
(
sys
.
simulate
f
s
n
)
.2
)
=
(
(
sys
.
simulate
f
s
n
)
.1
,
0
)
source
theorem
System
.
simFn_def
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
:
sys
.
SimFn
f
↔
∀ {
s
:
S
} [
sys
.
WF
s
],
sys
.
hasTr
s
→
sys
.
validTr
s
(
f
s
)
source
theorem
System
.
acyclic_def
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
:
sys
.
Acyclic
s
↔
sys
.
WF
s
∧
∀ {
a
b
:
S
} {
t
:
T
},
sys
.
Reachable
s
a
→
sys
.
tr
a
t
=
some
b
→
¬
sys
.
Reachable
b
a
source
theorem
System
.
tree_def
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
:
sys
.
Tree
s
↔
sys
.
WF
s
∧
∀ {
ts₁
ts₂
:
List
T
},
sys
.
trs
s
ts₁
=
sys
.
trs
s
ts₂
→
ts₁
=
ts₂
source
theorem
System
.
wf_def
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
b
:
S
}
:
sys
.
WF
b
↔
∃ (
a
:
S
),
sys
.
Initial
a
∧
sys
.
Reachable
a
b
source
theorem
System
.
wf_of_initial
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
[
sys
.
Initial
s
]
:
sys
.
WF
s
source
@[simp]
instance
System
.
instWFOfInitial
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
[
sys
.
Initial
s
]
:
sys
.
WF
s
source
theorem
System
.
wf_of_reachable
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
b
:
S
}
[
ha
:
sys
.
WF
a
]
(
hb
:
sys
.
Reachable
a
b
)
:
sys
.
WF
b
source
theorem
System
.
initial_def
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
:
S
}
:
sys
.
Initial
a
↔
a
∈
sys
.
initial
source
theorem
System
.
validTr_iff_isSome
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
{
t
:
T
}
:
sys
.
validTr
s
t
↔
(
sys
.
tr
s
t
)
.
isSome
=
true
source
theorem
System
.
hasTr_iff
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
:
sys
.
hasTr
s
↔
∃ (
t
:
T
) (
s'
:
S
),
sys
.
tr
s
t
=
some
s'
source
@[instance_reducible]
instance
System
.
instDecidableValidTr
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
{
t
:
T
}
:
Decidable
(
sys
.
validTr
s
t
)
Equations
System.instDecidableValidTr
=
match h :
sys
.
tr
s
t
with |
none
=>
isFalse
⋯
|
some
val
=>
isTrue
⋯
source
theorem
System
.
reachable_of_fst_trs
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
:
S
}
{
ts
:
List
T
}
{
b
:
S
}
(
h
:
(
sys
.
trs
a
ts
)
.1
=
b
)
:
sys
.
Reachable
a
b
source
theorem
System
.
wf_of_tr
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
b
:
S
}
{
t
:
T
}
[
ha
:
sys
.
WF
a
]
(
h
:
sys
.
tr
a
t
=
some
b
)
:
sys
.
WF
b
source
theorem
System
.
wf_of_trs
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
b
:
S
}
{
ts
r
:
List
T
}
[
ha
:
sys
.
WF
a
]
(
h
:
sys
.
trs
a
ts
=
(
b
,
r
)
)
:
sys
.
WF
b
source
theorem
System
.
wf_of_acyclic
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
:
S
}
[
ha
:
sys
.
Acyclic
a
]
:
sys
.
WF
a
source
theorem
System
.
wf_of_tree
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
:
S
}
[
ha
:
sys
.
Tree
a
]
:
sys
.
WF
a
source
instance
System
.
instWFOfAcyclic
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
:
S
}
[
ha
:
sys
.
Acyclic
a
]
:
sys
.
WF
a
source
instance
System
.
instWFOfTree
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
a
:
S
}
[
ha
:
sys
.
Tree
a
]
:
sys
.
WF
a
source
theorem
System
.
simulate_eq_of_not_hasTr
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
:
S
}
{
n
:
ℕ
}
(
h
:
¬
sys
.
hasTr
s
)
:
sys
.
simulate
f
s
n
=
(
s
,
n
)
source
class
System
.
WFTrans
{
S
T
:
Type
u}
(
sys
:
System
S
T
)
(
t
:
T
)
:
Prop
h :
∃ (
s
:
S
),
sys
.
WF
s
∧
sys
.
validTr
s
t
Instances
source
theorem
System
.
WFTrans_def
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
t
:
T
}
:
sys
.
WFTrans
t
↔
∃ (
s
:
S
),
sys
.
WF
s
∧
sys
.
validTr
s
t
source
theorem
System
.
wfTrans_of_validTr
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
{
t
:
T
}
[
hs
:
sys
.
WF
s
]
(
h
:
sys
.
validTr
s
t
)
:
sys
.
WFTrans
t
source
theorem
System
.
wfTrans_of_tr
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
s'
:
S
}
{
t
:
T
}
[
hs
:
sys
.
WF
s
]
(
h
:
sys
.
tr
s
t
=
some
s'
)
:
sys
.
WFTrans
t
source
theorem
System
.
simulate_snd_le_of_eq
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s'
:
S
}
{
r
n
:
ℕ
}
(
h
:
sys
.
simulate
f
s
n
=
(
s'
,
r
)
)
:
r
≤
n
source
theorem
System
.
simulate_snd_ne_zero_of
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s'
:
S
}
{
r
n
m
:
ℕ
}
(
h
:
sys
.
simulate
f
s
n
=
(
s'
,
r
)
)
(
hr
:
r
≠
0
)
(
hm
:
n
≤
m
)
:
(
sys
.
simulate
f
s
m
)
.2
≠
0
source
@[simp]
theorem
System
.
snd_simulate_add_eq_zero_iff
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
:
S
}
{
n
m
:
ℕ
}
:
(
sys
.
simulate
f
s
(
n
+
m
))
.2
=
0
↔
∃ (
s₁
:
S
) (
s₂
:
S
),
sys
.
simulate
f
s
n
=
(
s₁
,
0
)
∧
sys
.
simulate
f
s₁
m
=
(
s₂
,
0
)
source
@[simp]
theorem
System
.
snd_trs_append_eq_nil_iff
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
{
ts₁
ts₂
:
List
T
}
:
(
sys
.
trs
s
(
ts₁
++
ts₂
))
.2
=
[
]
↔
∃ (
s₁
:
S
) (
s₂
:
S
),
sys
.
trs
s
ts₁
=
(
s₁
,
[
]
)
∧
sys
.
trs
s₁
ts₂
=
(
s₂
,
[
]
)
source
@[simp]
theorem
System
.
snd_trs_cons_eq_nil_iff
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
{
t
:
T
}
{
ts
:
List
T
}
:
(
sys
.
trs
s
(
t
::
ts
))
.2
=
[
]
↔
∃ (
s₁
:
S
),
sys
.
tr
s
t
=
some
s₁
∧
(
sys
.
trs
s₁
ts
)
.2
=
[
]
source
@[simp]
theorem
System
.
snd_trs_snoc_eq_nil_iff
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
s
:
S
}
{
t
:
T
}
{
ts
:
List
T
}
:
(
sys
.
trs
s
(
ts
++
[
t
]
))
.2
=
[
]
↔
∃ (
s₁
:
S
) (
s₂
:
S
),
sys
.
trs
s
ts
=
(
s₁
,
[
]
)
∧
sys
.
tr
s₁
t
=
some
s₂
source
theorem
System
.
simulate_succ_full'
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s₂
:
S
}
{
n
:
ℕ
}
:
sys
.
simulate
f
s
n
.
succ
=
(
s₂
,
0
)
↔
∃ (
s₁
:
S
),
sys
.
tr
s
(
f
s
)
=
some
s₁
∧
sys
.
simulate
f
s₁
n
=
(
s₂
,
0
)
source
@[simp]
theorem
System
.
simulate_succ_full
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s₂
:
S
}
{
n
:
ℕ
}
:
sys
.
simulate
f
s
n
.
succ
=
(
s₂
,
0
)
↔
∃ (
s₁
:
S
),
sys
.
simulate
f
s
n
=
(
s₁
,
0
)
∧
sys
.
tr
s₁
(
f
s₁
)
=
some
s₂
source
theorem
System
.
simulate_add_one_full'
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s₂
:
S
}
{
n
:
ℕ
}
:
sys
.
simulate
f
s
(
n
+
1
)
=
(
s₂
,
0
)
↔
∃ (
s₁
:
S
),
sys
.
tr
s
(
f
s
)
=
some
s₁
∧
sys
.
simulate
f
s₁
n
=
(
s₂
,
0
)
source
@[simp]
theorem
System
.
simulate_add_one_full
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s₂
:
S
}
{
n
:
ℕ
}
:
sys
.
simulate
f
s
(
n
+
1
)
=
(
s₂
,
0
)
↔
∃ (
s₁
:
S
),
sys
.
simulate
f
s
n
=
(
s₁
,
0
)
∧
sys
.
tr
s₁
(
f
s₁
)
=
some
s₂
source
@[simp]
theorem
System
.
simulate_one_of_snd_succ
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s'
:
S
}
{
r
:
ℕ
}
:
sys
.
simulate
f
s
1
=
(
s'
,
r
.
succ
)
↔
sys
.
tr
s
(
f
s
)
=
none
∧
s
=
s'
∧
r
=
0
source
theorem
System
.
simulate_one_of_snd_add_one
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s'
:
S
}
{
r
:
ℕ
}
:
sys
.
simulate
f
s
1
=
(
s'
,
r
+
1
)
↔
sys
.
tr
s
(
f
s
)
=
none
∧
s
=
s'
∧
r
=
0
source
theorem
System
.
snd_simulate_add_one_eq_zero_iff'
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
:
S
}
{
n
:
ℕ
}
:
(
sys
.
simulate
f
s
(
n
+
1
))
.2
=
0
↔
∃ (
s₁
:
S
),
sys
.
tr
s
(
f
s
)
=
some
s₁
∧
(
sys
.
simulate
f
s₁
n
)
.2
=
0
source
@[simp]
theorem
System
.
simulate_eq_snd_add_right_iff
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s'
:
S
}
{
n
r
:
ℕ
}
:
sys
.
simulate
f
s
n
=
(
s'
,
n
+
r
)
↔
r
=
0
∧
s
=
s'
∧
(
n
=
0
∨
sys
.
tr
s
(
f
s
)
=
none
)
source
@[simp]
theorem
System
.
simulate_eq_snd_add_left_iff
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s'
:
S
}
{
n
r
:
ℕ
}
:
sys
.
simulate
f
s
n
=
(
s'
,
r
+
n
)
↔
r
=
0
∧
s
=
s'
∧
(
n
=
0
∨
sys
.
tr
s
(
f
s
)
=
none
)
source
@[simp]
theorem
System
.
simulate_eq_same_iff
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s'
:
S
}
{
n
:
ℕ
}
:
sys
.
simulate
f
s
n
=
(
s'
,
n
)
↔
s
=
s'
∧
(
n
=
0
∨
sys
.
tr
s
(
f
s
)
=
none
)
source
@[simp]
theorem
System
.
tr_simFn_eq_none_iff
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
:
S
}
[
hs
:
sys
.
WF
s
]
[
hf
:
sys
.
SimFn
f
]
:
sys
.
tr
s
(
f
s
)
=
none
↔
¬
sys
.
hasTr
s
source
theorem
System
.
tr_eq_none_of_simulate_eq
{
S
T
:
Type
u}
{
sys
:
System
S
T
}
{
f
:
S
→
T
}
{
s
s'
:
S
}
{
n
r
:
ℕ
}
(
h
:
sys
.
simulate
f
s
n
=
(
s'
,
r
+
1
)
)
:
sys
.
tr
s'
(
f
s'
)
=
none