by practal · 5y ago · 0 comments
As an example, it's very hard for me to judge what it means for equality to not have a type without an underlying system to go along with it. Since it's still featured as part of types (such as your dom f = A ∧ cod f = B example), you still need a typing rule, but what would that look like? It's at the very least non-obvious to me that this doesn't potentially have some issues.
Or, what does extensionality for types cover that isn't done by subtypes? And should this just be a metatheoretic property, or also something that can be stated inside the system?
Besides that, the current items on the list are of course reasonable enough (though nil strikes me as a regression from option types and paraconsistent logic strikes me as totally unusable in the general case as you'd lose A \/ B, ~A |- B, which is absolutely essential.)
Yes, it is not computational for sure. It's a logic, not a programming language.
Nil is the way undefinedness is handled in Practal. It is the most elegant way I can think of. You can still have your option type, just as you can have Kleene logic operators, but these are more suitable for doing program verification work in Practal, not so much for doing general mathematics in Practal. You really want (T ∪ Nil) ∪ Nil = T ∪ Nil here, while in programming you usually don't want Option[Option[T]] to be the same as Option[T].
I am not saying it is easy to make all of this work, and to make it work soundly. But less just doesn't cut it.
With a kernel-based approach, you have a chance to get it right. If you find an inconsistency, fix the kernel, and move on. Automation works just on top of it, and doesn't affect soundness. This is the great thing about automation in kernel-based ITP: If it finds some solution or counter-example, great. Otherwise, no harm done.
Your point that currently it is quite hard to do anything practical in all of the interactive theorem provers is very true, though.
HOL Light allows you to carve out new types of existing types using a predicate filter, and this is baked into the kernel in `fusion.ml`. But this doesn't introduce subtyping relations. Importantly, the kernel rule gives you abstraction and representation functions to move between elements of the new type and the original type, but, unlike in a subtyping system, the terms of the newly defined type are not simultaneously elements of the larger type.
Maybe I missed it in the article, but what does subtyping give you that coercions don't?
In my opinion, subtyping declares a "is" relationship, and coercions declare a "can be viewed as" relationship. You would want both in Practal. Subtyping is more tricky than coercions in the sense that if done wrongly, it can introduce inconsistencies, while coercions cannot (they just may fail to be unique).
For example, ℕ should be a subtype of ℝ. Because a natural number IS a real number. Let's say you have the theorem `∀ x : ℝ. P x` for some predicate `P`. With subtyping, also the theorem `P n` holds for any `n : ℕ`. With coercions, only the theorem `P (c n)` holds, where `c : ℕ → ℝ` is the coercion. Now you have an additional constant `c` in your theorem. It makes things more complicated than they have to be. Sure, some pretty printing and nifty automation can help you a lot here, but why would you want to deal with that added coercion tax in the first place for cases where you don't have to?