Skip to content

Commit 4d49b1f

Browse files
committed
Decompose Fun_NatBijSingleton singleton case to be backend-portable
The first case of THEOREM Fun_NatBijSingleton was discharged by a single one-liner BY 1..1 = {1} DEF Bijection, Surjection which asks the default SMT pipeline to simultaneously unfold Bijection = Injection \cap Surjection, expand the set comprehension defining Surjection, instantiate the nested \A t \in S : \E s \in 1..1 : f[s] = t and witness the outer \E s : S = {s}. This worked with the bundled provers shipped with the macOS arm64 build of TLAPS 1.6.0-pre but failed with the Linux x86_64 build, which ships different Z3/Zenon/Isabelle binaries and runs on a slower CI runner. The same input file even produced a different obligation count on the two platforms (771 vs. 732), so relying on a single SMT step for this obligation is inherently fragile. Rewrite the case as five small steps that any backend can close: extract the typing and surjection facts from the definitions, derive f[1] \in S, prove \A t \in S : t = f[1] by PICKing the (unique) index in 1..1, then WITNESS f[1]. No backend has to invent the existential witness or reason about set intersection at the same time as a quantified comprehension, so the proof is robust across tlapm builds and timeout budgets. All 795 obligations of FunctionTheorems_proofs continue to check locally with `tlapm --cleanfp`. [Proofs] Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
1 parent 2224142 commit 4d49b1f

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

modules/FunctionTheorems_proofs.tla

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,16 @@ THEOREM Fun_NatBijSingleton ==
879879
ASSUME NEW S
880880
PROVE ExistsBijection(1..1,S) <=> \E s : S = {s}
881881
<1>1. ASSUME NEW f \in Bijection(1..1, S) PROVE \E s : S = {s}
882-
BY 1..1 = {1} DEF Bijection, Surjection
882+
<2>1. f \in [1..1 -> S] /\ \A t \in S : \E i \in 1..1 : f[i] = t
883+
BY DEF Bijection, Injection, Surjection
884+
<2>2. f[1] \in S
885+
BY <2>1
886+
<2>3. \A t \in S : t = f[1]
887+
<3>1. TAKE t \in S
888+
<3>2. PICK i \in 1..1 : f[i] = t BY <2>1
889+
<3>. QED BY <3>2
890+
<2>. WITNESS f[1]
891+
<2>. QED BY <2>2, <2>3
883892
<1>2. ASSUME NEW s, S = {s} PROVE [i \in 1..1 |-> s] \in Bijection(1..1, S)
884893
BY <1>2 DEF Bijection, Injection, IsInjective, Surjection
885894
<1>. QED BY <1>1, <1>2 DEF ExistsBijection

0 commit comments

Comments
 (0)