ch:univalent-set-mathematics: ch:univalent-set-mathematics
Problem and invariant. Evaluate a finite syntax of cardinal expressions. Maintain the invariant that each syntax constructor is interpreted by the corresponding natural cardinality operation.
Two representations. One can enumerate finite carriers and construct explicit bijections. The companion instead evaluates cardinalities directly. Enumeration retains the witnesses behind the chapter’s equivalences; direct evaluation makes the arithmetic clauses and their mutation tests smaller.
First complete version. Define constructors for
Observable result. The accepted corpus prints four named PASS lines and then All 4 Chapter 195 corpus cases passed.
A failing version. Replace the sum clause by its left operand. This mutation still typechecks, but the named finite-sum oracle changes and the inline test exits nonzero.
Acceptance test. Run the four commands in appendix E. Require a silent check, one passing inline test, the exact five-line run transcript, and an empty audit. Restore the accepted source after replaying the mutation and repeat all four commands.
Mathematical boundary. Natural evaluation decides only the finite syntax and cases represented by the program. Its distributivity and iterated-exponent probes are finite instances of lemma 74.49, and