Built with Alectryon, running Coq+SerAPI v8.18.0+0.18.1. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use instead of Ctrl.
[Loading ML file ring_plugin.cmxs (using legacy method) ... done]
[Loading ML file ssrmatching_plugin.cmxs (using legacy method) ... done]
[Loading ML file ssreflect_plugin.cmxs (using legacy method) ... done]
Set Implicit Arguments. Unset Strict Implicit. Import Prenex Implicits.

Utility: Properties of Possibly-Infinite Traces Requiring Classical Logic

Section sec_trace_classical_properties.

Context {A B : Type}.

#[local] Notation trace := (@trace A B).
#[local] Notation propT := (@propT A B).

Relating finiteness and infiniteness

A, B: Type

forall tr : trace, ~ infiniteT tr -> finiteT tr
A, B: Type

forall tr : trace, ~ infiniteT tr -> finiteT tr
A, B: Type
tr: trace
Hnot: ~ infiniteT tr

finiteT tr
A, B: Type
tr: trace
Hnot: ~ infiniteT tr
Hinf: ~ finiteT tr

finiteT tr
A, B: Type
tr: trace
Hinf: ~ finiteT tr

infiniteT tr
exact: not_finiteT_infiniteT. Qed.
A, B: Type

forall tr : trace, finiteT tr \/ infiniteT tr
A, B: Type

forall tr : trace, finiteT tr \/ infiniteT tr
A, B: Type
tr: trace

finiteT tr \/ infiniteT tr
A, B: Type
tr: trace
Hinf: ~ finiteT tr

finiteT tr \/ infiniteT tr
right; exact: not_finiteT_infiniteT. Qed. Definition finiteT_infiniteT_dec (tr : trace) : { finiteT tr }+{ infiniteT tr } := match excluded_middle_informative (finiteT tr) with | left Hfin => left Hfin | right Hfin => right (not_finiteT_infiniteT Hfin) end.

Using midpoints to show the right associativity of the append property

CoFixpoint midp (p0 p1 : trace -> Prop) tr0 tr1 (h : followsT (appendT p0 p1) tr0 tr1) : trace :=
match followsT_dec h with
| inl (existT tr (exist a (conj _ (conj _ H)))) =>
  let: exist x _ := constructive_indefinite_description _ H in x
| inr (existT tr (existT tr' (existT a (exist b (conj _ (conj _ H)))))) =>
  Tcons a b (@midp _ _ _ _ H)
end.

A, B: Type

forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
A, B: Type

forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
A, B: Type
CIH: forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)

forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
A, B: Type
CIH: forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
p0, p1: trace -> Prop
tr1: trace
h: followsT (p0 *+* p1) (Tnil (hd tr1)) tr1
a0: (p0 *+* p1) tr1

midpointT (followsT_nil eq_refl a0) (midp (followsT_nil eq_refl a0))
A, B: Type
CIH: forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
p0, p1: trace -> Prop
a: A
b: B
tr, tr': trace
h: followsT (p0 *+* p1) (Tcons a b tr) (Tcons a b tr')
f: followsT (p0 *+* p1) tr tr'
midpointT (followsT_delay a b f) (midp (followsT_delay a b f))
A, B: Type
CIH: forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
p0, p1: trace -> Prop
tr1: trace
h: followsT (p0 *+* p1) (Tnil (hd tr1)) tr1
a0: (p0 *+* p1) tr1

midpointT (followsT_nil eq_refl a0) (midp (followsT_nil eq_refl a0))
A, B: Type
CIH: forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
p0, p1: trace -> Prop
a: A
b: B
tr, tr': trace
h: followsT (p0 *+* p1) (Tcons a b tr) (Tcons a b tr')
f: followsT (p0 *+* p1) tr tr'
midpointT (followsT_delay a b f) (midp (followsT_delay a b f))
A, B: Type
CIH: forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
p0, p1: trace -> Prop
tr1: trace
h: followsT (p0 *+* p1) (Tnil (hd tr1)) tr1
a0: (p0 *+* p1) tr1

midpointT (followsT_nil eq_refl a0) match (let '@exist _ _ x _ := constructive_indefinite_description (fun tr' : trace => p0 tr' /\ followsT p1 tr' tr1) a0 in x) with | Tnil a => Tnil a | Tcons a b tr' => Tcons a b tr' end
A, B: Type
CIH: forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
p0, p1: trace -> Prop
a: A
b: B
tr, tr': trace
h: followsT (p0 *+* p1) (Tcons a b tr) (Tcons a b tr')
f: followsT (p0 *+* p1) tr tr'
midpointT (followsT_delay a b f) (midp (followsT_delay a b f))
A, B: Type
CIH: forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
p0, p1: trace -> Prop
tr1: trace
h: followsT (p0 *+* p1) (Tnil (hd tr1)) tr1
a0: (p0 *+* p1) tr1
x: trace
a1: p0 x
hm: followsT p1 x tr1

midpointT (followsT_nil eq_refl a0) match x with | Tnil a => Tnil a | Tcons a b tr' => Tcons a b tr' end
A, B: Type
CIH: forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
p0, p1: trace -> Prop
a: A
b: B
tr, tr': trace
h: followsT (p0 *+* p1) (Tcons a b tr) (Tcons a b tr')
f: followsT (p0 *+* p1) tr tr'
midpointT (followsT_delay a b f) (midp (followsT_delay a b f))
A, B: Type
CIH: forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
p0, p1: trace -> Prop
a: A
b: B
tr, tr': trace
h: followsT (p0 *+* p1) (Tcons a b tr) (Tcons a b tr')
f: followsT (p0 *+* p1) tr tr'

midpointT (followsT_delay a b f) (midp (followsT_delay a b f))
A, B: Type
CIH: forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
p0, p1: trace -> Prop
a: A
b: B
tr, tr': trace
h: followsT (p0 *+* p1) (Tcons a b tr) (Tcons a b tr')
f: followsT (p0 *+* p1) tr tr'

midpointT (followsT_delay a b f) (midp (followsT_delay a b f))
A, B: Type
CIH: forall (p0 p1 : trace -> Prop) (tr0 tr1 : trace) (h : followsT (p0 *+* p1) tr0 tr1), midpointT h (midp h)
p0, p1: trace -> Prop
a: A
b: B
tr, tr': trace
h: followsT (p0 *+* p1) (Tcons a b tr) (Tcons a b tr')
f: followsT (p0 *+* p1) tr tr'

midpointT (followsT_delay a b f) (Tcons a b (midp f))
exact: (@midpointT_delay _ _ p0 p1 (Tcons a b tr) (Tcons a b tr') (followsT_delay a b f) tr tr' f a b (midp f)). Qed.
A, B: Type

forall (p1 p2 p3 : trace -> Prop) (tr : trace), (p1 *+* p2 *+* p3) tr -> ((p1 *+* p2) *+* p3) tr
A, B: Type

forall (p1 p2 p3 : trace -> Prop) (tr : trace), (p1 *+* p2 *+* p3) tr -> ((p1 *+* p2) *+* p3) tr
A, B: Type
p1, p2, p3: trace -> Prop
tr0, tr1: trace
h1: p1 tr1
h2: followsT (p2 *+* p3) tr1 tr0

((p1 *+* p2) *+* p3) tr0
A, B: Type
p1, p2, p3: trace -> Prop
tr0, tr1: trace
h1: p1 tr1
h2: followsT (p2 *+* p3) tr1 tr0

(p1 *+* p2) (midp h2)
A, B: Type
p1, p2, p3: trace -> Prop
tr0, tr1: trace
h1: p1 tr1
h2: followsT (p2 *+* p3) tr1 tr0
followsT p3 (midp h2) tr0
A, B: Type
p1, p2, p3: trace -> Prop
tr0, tr1: trace
h1: p1 tr1
h2: followsT (p2 *+* p3) tr1 tr0

(p1 *+* p2) (midp h2)
A, B: Type
p1, p2, p3: trace -> Prop
tr0, tr1: trace
h1: p1 tr1
h2: followsT (p2 *+* p3) tr1 tr0
followsT p3 (midp h2) tr0
A, B: Type
p1, p2, p3: trace -> Prop
tr0, tr1: trace
h1: p1 tr1
h2: followsT (p2 *+* p3) tr1 tr0

followsT p2 tr1 (midp h2)
A, B: Type
p1, p2, p3: trace -> Prop
tr0, tr1: trace
h1: p1 tr1
h2: followsT (p2 *+* p3) tr1 tr0
followsT p3 (midp h2) tr0
A, B: Type
p1, p2, p3: trace -> Prop
tr0, tr1: trace
h1: p1 tr1
h2: followsT (p2 *+* p3) tr1 tr0

followsT p3 (midp h2) tr0
A, B: Type
p1, p2, p3: trace -> Prop
tr0, tr1: trace
h1: p1 tr1
h2: followsT (p2 *+* p3) tr1 tr0

followsT p3 (midp h2) tr0
exact: (midpointT_after (midpointT_midp h2)). Qed.
A, B: Type

forall p1 p2 p3 : propT, (p1 *** p2 *** p3) =>> (p1 *** p2) *** p3
A, B: Type

forall p1 p2 p3 : propT, (p1 *** p2 *** p3) =>> (p1 *** p2) *** p3
A, B: Type
f1: trace -> Prop
hf1: setoidT f1
f2: trace -> Prop
hf2: setoidT f2
f3: trace -> Prop
hf3: setoidT f3
tr0: trace
h1: (f1 *+* f2 *+* f3) tr0

((f1 *+* f2) *+* f3) tr0
exact: appendT_assoc_R. Qed. End sec_trace_classical_properties.