Closed pigworker closed 3 years ago
Let me just quickly add in my support for 2. No feedback that my proof was really finished was indeed one thing that made me unsure when briefly playing around earlier today.
Latest update. The given
method is now implemented. I'm working on proven
while rebuilding the prettyprinter with a tighter grip on whitespace. One annoyance is that if someone is silly enough to do
prove a & b by AndI where prove a ?
prove b ?
then solving the subgoals will make the main goal proven
, necessitating a repair in the indentation. Options:
Meanwhile, the question of whether proven-givens (also proven-from-Falses, proven-by-TrueIs) should be automatically inserted in empty prove-wheres but not in nonempty prove-wheres or provens, is really a tension between informative verbosity for beginners and clutter for the more advanced. If we do it, it should only be as an opt-in "beginner mode".
1 & 2 have happened. 3 could still happen, but it seems like its at a priority below the threshold of action. So I'm closing this issue.
I'm writing to suggest two ideas, modulo bikeshedding, and a possible interaction between them.
1 the
given
methodAt the moment, you can say
and leave
ask
to check that the subgoal is given, but there is no successful way to be explicit about it, i.e., if you writeIn fact, we could add the rule
prove p by Assumption where prove p ?
and then users could make an explicitleaving the subgoal to be solved implicitly as before. But that's egregious, because it would lead to
in situations where the goal is not given. For this reason, I propose to create a new method,
given
, which succeeds only if the goal really is given. This would allow the user to choose to documentNote that
ask
checks which subgoals are discharged by subproofs before either declaring unused subproofs to be surplus or checking whether uncovered subgoals are actually obvious. So, as things stand,given p prove p given
would neither be inserted nor removed byask
.2 the
proven
proofAt the cost of a keyword (beloved of the Scots legal system), I propose that we allow
prove
to be replaced byproven
when all subgoals have hereditarily been discharged. I moreover propose thatask
acknowledge completion of goals and subgoals by making this substitution, amounting to a more explicit acknowledgement of achievement than "no comment". If the user writesproven
butask
discovers open subgoals, thenproven
reverts toprove
.So, if we submit
we obtain
but if we submit
we get the corrective reminder
and replacing the first
?
withfrom p & q
then yieldstelling us we've made at least some progress.
3
prove
versusproven
and the insertion ofgiven
sThis is a bit of a subtle idea, and I'm not sure whether I like it. Perhaps, when
ask
gets thisthe response should be
That is, if we start from a
prove
with no subproofs,ask
inserts completed subproofs for thegiven
s (except for the h infrom
h, which we usually expect to be given). However, if the user then deletes thosegiven
s and sendsthen the proof is returned unaltered, because the head was a
proven
, not aprove
.If a
prove
is submitted with some existing subproofs, then missingproven ... given
s are not inserted, as that implies the user has already chosen which subproofs to see. Meanwhile, if the user does not wantproven ... given
s are not inserted in aprove
with no subgoals, they should jolly well writeproven
instead.What to do?
1 and 2 are independent of each other. 3 requires both 1 and 2, but is entirely optional. Open to alternative syntactic choices.