You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, while we would still like to know which axioms are used in a definition (via uses), it is tiresome to pass them explicitly all the time. To mitigate that, we have several options to adjust Rzk:
Add #assume-globally (aka #define-assumption, see Add #define-assumption command #69) that works like #assume, but adds assumptions globally. This leaves #postulate (a command that exists now) for axioms that do not have to be declared in uses and adds simply allows some variables to leave in a "global" section.
Use #postulate my-axiom : type for axioms, but adjust uses to also require postulated dependencies to be specified (implicit, but also, maybe, explicit ones). This way we would distinguish local assumptions from axioms in Rzk syntax and so can treat them differently:
Local variables only have to appear in uses if they are entirely implicit (do not occur in the type or the body of a definition), whereas axioms should probably always be in uses for clarity.
Error messages and hints may be adjusted to be more elaborate depending on whether we have local variable or an axiom.
Add new commands to reintroduce assumption or instantiate it:
#use section-name.variable would replicate an assumption made previously in section-name and automatically use this assumption when using definitions from section-name AND any section/file that later assumed the same variable; similarly to #assume, the effect of this command would be local to the section;
#let section-name.variable := term would automatically use term for all definitions form section-name where variable argument is expected
Here, #use solves the issue of reusing axioms without extra boilerplate, but also allows to reuse local variables between sections. The suggested version of #let above further allows to partially specialise sections. In fact, this way sections behave like structures, similar to modules. I am not sure this is the correct approach, and, perhaps, a proper module system should be designed and implemented instead. But since this has crossed my mind, I though I'd list it here anyway.
Allow (instance) inference for contractible types:
use _ for holes (unspecified terms) to be inferred by the proof assistant
if the expected type of _ is known, has an inhabitant, and is a proposition, e.g. if the type is FunExt, there is an assumption funext : FunExt and a definition of type is-prop FunExt exists in scope, or if is-contr FunExt exists
then automatically use the inhabitant in place of _
This approach can be useful for many other propositions, not only axioms (e.g. is-segal or is-rezk). But it will not work for axioms that are not propositions (although I can't think of one that would be useful at the moment). This is also a special case of a variant of Agda's instance arguments and could be later extended further.
Building up on (4), allow implicit instance arguments:
use curly braces for implicit arguments/parameters/assumptions { extext : ExtExt}
check that ExtExt is a proposition (as in (4)) to allow it to be implicit
insert _ automatically when the argument would be given explicit otherwise
Note that unlike regular implicit arguments, this one does not actually rely on type inference, so should be much easier to add. It also is mostly orthogonal to regular implicit arguments and has to be implemented separately (although, it may benefit from type inference to work in more contexts).
There are probably more ways to deal with axioms. But for now this is the initial list.
From this list, I personally think it makes sense to implement either (2) or (4). (2) is probably much easier to implement and has minimal effect on the language. (4) is probably a more useful feature that is relatively easy to add.
However, I am open to suggestions and comments regarding this.
The text was updated successfully, but these errors were encountered:
Currently Rzk has
#assume
command (synonymous with#variable
and#variables
), which introduces local assumptions:rzk
and can be silenced byuses (assumption1 ...)
for each definitionCurrently, assumptions are used both
for local parameters in sections (e.g. see
#section homotopy-interchange-law
)for axioms, e.g. in many formalisations we have:
However, while we would still like to know which axioms are used in a definition (via
uses
), it is tiresome to pass them explicitly all the time. To mitigate that, we have several options to adjust Rzk:Add
#assume-globally
(aka#define-assumption
, see Add #define-assumption command #69) that works like#assume
, but adds assumptions globally. This leaves#postulate
(a command that exists now) for axioms that do not have to be declared inuses
and adds simply allows some variables to leave in a "global" section.Use
#postulate my-axiom : type
for axioms, but adjustuses
to also require postulated dependencies to be specified (implicit, but also, maybe, explicit ones). This way we would distinguish local assumptions from axioms in Rzk syntax and so can treat them differently:uses
if they are entirely implicit (do not occur in the type or the body of a definition), whereas axioms should probably always be inuses
for clarity.Add new commands to reintroduce assumption or instantiate it:
#use section-name.variable
would replicate an assumption made previously insection-name
and automatically use this assumption when using definitions fromsection-name
AND any section/file that later assumed the same variable; similarly to#assume
, the effect of this command would be local to the section;#let section-name.variable := term
would automatically useterm
for all definitions formsection-name
wherevariable
argument is expectedHere,
#use
solves the issue of reusing axioms without extra boilerplate, but also allows to reuse local variables between sections. The suggested version of#let
above further allows to partially specialise sections. In fact, this way sections behave like structures, similar to modules. I am not sure this is the correct approach, and, perhaps, a proper module system should be designed and implemented instead. But since this has crossed my mind, I though I'd list it here anyway.Allow (instance) inference for contractible types:
_
for holes (unspecified terms) to be inferred by the proof assistant_
is known, has an inhabitant, and is a proposition, e.g. if the type isFunExt
, there is an assumptionfunext : FunExt
and a definition of typeis-prop FunExt
exists in scope, or ifis-contr FunExt
exists_
This approach can be useful for many other propositions, not only axioms (e.g.
is-segal
oris-rezk
). But it will not work for axioms that are not propositions (although I can't think of one that would be useful at the moment). This is also a special case of a variant of Agda's instance arguments and could be later extended further.Building up on (4), allow implicit instance arguments:
{ extext : ExtExt}
ExtExt
is a proposition (as in (4)) to allow it to be implicit_
automatically when the argument would be given explicit otherwiseNote that unlike regular implicit arguments, this one does not actually rely on type inference, so should be much easier to add. It also is mostly orthogonal to regular implicit arguments and has to be implemented separately (although, it may benefit from type inference to work in more contexts).
There are probably more ways to deal with axioms. But for now this is the initial list.
From this list, I personally think it makes sense to implement either (2) or (4). (2) is probably much easier to implement and has minimal effect on the language. (4) is probably a more useful feature that is relatively easy to add.
However, I am open to suggestions and comments regarding this.
The text was updated successfully, but these errors were encountered: