diff --git a/modules/FunctionTheorems_proofs.tla b/modules/FunctionTheorems_proofs.tla index d2c912b..2cb9bbe 100644 --- a/modules/FunctionTheorems_proofs.tla +++ b/modules/FunctionTheorems_proofs.tla @@ -1431,7 +1431,16 @@ BY SumFunctionOnSetZero DEF SumFunction THEOREM SumFunctionConst == ASSUME NEW S, IsFiniteSet(S), NEW c \in Int PROVE SumFunction([s \in S |-> c]) = c * Cardinality(S) -BY SumFunctionOnSetConst DEF SumFunction +<1>. DEFINE f == [s \in S |-> c] +<1>1. DOMAIN f = S + OBVIOUS +<1>2. f \in [S -> Int] + OBVIOUS +<1>3. \A x \in S : f[x] = c + OBVIOUS +<1>4. SumFunctionOnSet(f, S) = c * Cardinality(S) + BY <1>2, <1>3, SumFunctionOnSetConst +<1>. QED BY <1>1, <1>4 DEF SumFunction THEOREM SumFunctionMonotonic == ASSUME NEW f, IsFiniteSet(DOMAIN f), NEW g, DOMAIN g = DOMAIN f, diff --git a/modules/GraphTheorems_proofs.tla b/modules/GraphTheorems_proofs.tla index 9739c85..7c81fe8 100644 --- a/modules/GraphTheorems_proofs.tla +++ b/modules/GraphTheorems_proofs.tla @@ -245,7 +245,15 @@ THEOREM ExistsPathIffExistsSimplePath == <4>7. i \notin Repeats(qq) BY <3>2 <4>8. inj \notin Surjection(Repeats(qq), Repeats(pp)) - BY <3>2, <4>6, <4>7, SMTT(10) DEF Surjection + <5>1. j > i + BY <3>2 + <5>2. ASSUME NEW ii \in Repeats(qq) + PROVE inj[ii] # i + <6>1. ii \in Int + OBVIOUS + <6>. HIDE DEF Repeats, qq + <6>. QED BY <5>1, <6>1, <4>7 + <5>. QED BY <4>6, <5>2, Zenon DEF Surjection <4>9. /\ CR(qq) <= CR(pp) /\ CR(qq) # CR(pp) <5>. HIDE DEF Repeats, inj, qq @@ -368,7 +376,9 @@ THEOREM TreeSimplePath == BY DEF Path <1>. DEFINE S == {p[k] : k \in i .. j} <1>1. PICK k \in i..j : \A e \in G.edge : e[1] = p[k] => e[2] \notin S - BY TreeAcyclic, S \subseteq G.node, S # {} + <2>1. PICK q \in S : \A e \in G.edge : e[1] = q => e[2] \notin S + BY TreeAcyclic, S \subseteq G.node, S # {}, Zenon + <2>. QED BY <2>1, Zenon <1>2. CASE k < j <2>1. /\ <
> \in G.edge /\ p[k+1] \in S diff --git a/modules/SequencesExtTheorems_proofs.tla b/modules/SequencesExtTheorems_proofs.tla index 00bf47f..185b993 100644 --- a/modules/SequencesExtTheorems_proofs.tla +++ b/modules/SequencesExtTheorems_proofs.tla @@ -705,7 +705,14 @@ THEOREM EmptyIsSuffix == /\ IsSuffix(s, <<>>) <=> s = <<>> /\ IsStrictSuffix(<<>>, s) <=> s # <<>> /\ ~ IsStrictSuffix(s, <<>>) -BY IsSuffixProperties, IsStrictSuffixProperties +<1>1. Reverse(s) \in Seq(S) + BY ReverseProperties +<1>2. Reverse(s) = <<>> <=> s = <<>> + BY ReverseEmpty, ReverseEmptyIffEmpty +<1>3. /\ IsPrefix(<<>>, Reverse(s)) + /\ IsPrefix(Reverse(s), <<>>) <=> Reverse(s) = <<>> + BY <1>1, EmptyIsPrefix +<1>. QED BY <1>2, <1>3, ReverseEmpty DEF IsSuffix, IsStrictSuffix THEOREM IsSuffixConcat == ASSUME NEW S, NEW s \in Seq(S), NEW t \in Seq(S) @@ -731,7 +738,7 @@ THEOREM IsSuffixPartialOrder == /\ \A s,t \in Seq(S) : IsSuffix(s,t) /\ IsSuffix(t,s) => s = t /\ \A s,t,u \in Seq(S) : IsSuffix(s,t) /\ IsSuffix(t,u) => IsSuffix(s,u) <1>1. ASSUME NEW s \in Seq(S) PROVE IsSuffix(s,s) - BY s = s \o <<>>, IsSuffixProperties + BY IsPrefixPartialOrder, ReverseProperties DEF IsSuffix <1>2. ASSUME NEW s \in Seq(S), NEW t \in Seq(S), IsSuffix(s,t), IsSuffix(t,s) PROVE s = t BY <1>2, IsPrefixPartialOrder, ReverseProperties, ReverseEqual DEF IsSuffix