One of the common criticisms of set theory is that it permits "nonsensical" sentences like "2 \in 3".
I would like to know what superficial features Isabelle has that block such things. Maybe one can use locales for this but I'm not yet experienced enough to see how one does this.
By superficial, I mean not at the level of the logic, or with subtyping, but some kind of elementary guard at the user interface level to prevent the user from writing unintended / stupid things; perhaps toggleable.
For example, suppose is a type, is a subset of , and I have a binary relation that is defined on . For technical convenience I have defined but I only regard as meaningful if . I could form a true subtype from using typedef but this cannot be done if is variable rather than a constant closed term, I cannot apply theorems about all subsets of to , and so on. Are there any guards I could use that prevent me from writing unless there is a proof or assumption in the local context that ?
I am interested in developing mathematics in ZFC drawing on the ZFC in HOL AFP article and this becomes particularly important there where you have many diverse mathematical objects inhabiting one type, you would want to overload symbols for different constant terms of that type, and so on. For example if I implement ordered pairs using Kuratowski pairs I can ask whether but I'm looking for a way to stop myself from doing that in terms of rules at the user interface level without adding additional complexity to the underlying logic by working with the type of ordered pairs.
I understand this is the whole point of type theory lol but it seems that (past a certain point?) the use of types tends to add complexity to automation.
That $2 \in 3$ is rather a bad example of a nonsensical statement in set theory. Of course in ZF for a natural number $n>0$ one has $n = \{0,1, ... n-1\}$ , hence instead of writing $k \in \{0,1, ... , n-1\}$ one can always write $k\in n$ which is shorter and does not require special syntax for those three dots. I use that fact quite often in IsarMathLib, for example recently in the statement of the binomial theorem. One person's nonsensical statement can be another person's useful fact.
Yeah that's a stupid example. It's just the one everyone uses.
https://mathoverflow.net/questions/90820/set-theories-without-junk-theorems/90945#90945
how about just apply f x
where f
is a function and we want x
to be in the domain of f
The only related mechanism that comes to my mind is that in Isabelle/Isar definitions can have premises (see this as an example). Using such definition requires the premises to hold in the local context. This feature is orthogonal to the sets vs. types question and is not at the user interface (syntax) level. This answer suggests that the mechanism you ask about is rather difficult to implement, at least in FOL.
Last updated: Dec 21 2024 at 16:20 UTC