Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion modules/FunctionTheorems_proofs.tla
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 12 additions & 2 deletions modules/GraphTheorems_proofs.tla
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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. /\ <<p[k], p[k+1]>> \in G.edge
/\ p[k+1] \in S
Expand Down
11 changes: 9 additions & 2 deletions modules/SequencesExtTheorems_proofs.tla
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
Loading