Skip to content

Conversation

@JasonGross
Copy link

  • Add constantKindName helper to get human-readable names for constant kinds
  • Allow checkAxioms to accept both theorems and defs as targets
  • Include constant kind in error message when target is unsupported

- Add constantKindName helper to get human-readable names for constant kinds
- Allow checkAxioms to accept both theorems and defs as targets
- Include constant kind in error message when target is unsupported
JasonGross added a commit to JasonGross/comparator that referenced this pull request Dec 20, 2025
This PR allows challenges that demand the construction of terms of
non-Prop types.

We remove the error "Challenge and solution constant kind don't match"
in favor of permitting any kind of solution to a challenge that is a
theorem or axiom.

Note that permitted axioms must still be declared as axioms or theorems
in the solution; it would invite inconsistency if we allowed
instantiating informative axioms with definitions.

The optional field "allow_partial" indicates whether or not challenges
may be solved with `partial def` solutions.  We uniformly forbid unsafe
solutions.  We rely on the Lean kernel to mark as unsafe (resp. partial)
any definitions that make use of unsafe (resp. partial) dependencies.

Fixes #3 (mostly)
Fixes #4
Closes leanprover#5
Closes leanprover#6
Closes leanprover#7
JasonGross added a commit to JasonGross/comparator that referenced this pull request Dec 20, 2025
This PR allows challenges that demand the construction of terms of
non-Prop types.

We remove the error "Challenge and solution constant kind don't match"
in favor of permitting any kind of solution to a challenge that is a
theorem or axiom.

Note that permitted axioms must still be declared as axioms or theorems
in the solution; it would invite inconsistency if we allowed
instantiating informative axioms with definitions.

The optional field "allow_partial" indicates whether or not challenges
may be solved with `partial def` solutions.  We uniformly forbid unsafe
solutions.  We rely on the Lean kernel to mark as unsafe (resp. partial)
any definitions that make use of unsafe (resp. partial) dependencies.

Fixes #3 (mostly)
Fixes #4
Closes leanprover#5
Closes leanprover#6
Closes leanprover#7
JasonGross added a commit to JasonGross/comparator that referenced this pull request Dec 20, 2025
This PR allows challenges that demand the construction of terms of
non-Prop types.

We remove the error "Challenge and solution constant kind don't match"
in favor of permitting any kind of solution to a challenge that is a
theorem or axiom.

Note that permitted axioms must still be declared as axioms or theorems
in the solution; it would invite inconsistency if we allowed
instantiating informative axioms with definitions.

The optional field "allow_partial" indicates whether or not challenges
may be solved with `partial def` solutions.  We uniformly forbid unsafe
solutions.  We rely on the Lean kernel to mark as unsafe (resp. partial)
any definitions that make use of unsafe (resp. partial) dependencies.

Fixes #3 (mostly)
Fixes #4
Closes leanprover#5
Closes leanprover#6
Closes leanprover#7
JasonGross added a commit to JasonGross/comparator that referenced this pull request Dec 20, 2025
This PR allows challenges that demand the construction of terms of
non-Prop types.

We remove the error "Challenge and solution constant kind don't match"
in favor of permitting any kind of solution to a challenge that is a
theorem or axiom.

Note that permitted axioms must still be declared as axioms or theorems
in the solution; it would invite inconsistency if we allowed
instantiating informative axioms with definitions.

The optional field "allow_partial" indicates whether or not challenges
may be solved with `partial def` solutions.  We uniformly forbid unsafe
solutions.  We rely on the Lean kernel to mark as unsafe (resp. partial)
any definitions that make use of unsafe (resp. partial) dependencies.

Fixes #3 (mostly)
Fixes #4
Closes leanprover#5
Closes leanprover#6
Closes leanprover#7
JasonGross added a commit to JasonGross/comparator that referenced this pull request Dec 20, 2025
This PR allows challenges that demand the construction of terms of
non-Prop types.

We remove the error "Challenge and solution constant kind don't match"
in favor of permitting any kind of solution to a challenge that is a
theorem or axiom.

Note that permitted axioms must still be declared as axioms or theorems
in the solution; it would invite inconsistency if we allowed
instantiating informative axioms with definitions.

The optional field "allow_partial" indicates whether or not challenges
may be solved with `partial def` solutions.  We uniformly forbid unsafe
solutions.  We rely on the Lean kernel to mark as unsafe (resp. partial)
any definitions that make use of unsafe (resp. partial) dependencies.

Fixes #3 (mostly)
Fixes #4
Closes leanprover#5
Closes leanprover#6
Closes leanprover#7
JasonGross added a commit to JasonGross/comparator that referenced this pull request Dec 20, 2025
This PR allows challenges that demand the construction of terms of
non-Prop types.

We remove the error "Challenge and solution constant kind don't match"
in favor of permitting any kind of solution to a challenge that is a
theorem or axiom.

Note that permitted axioms must still be declared as axioms or theorems
in the solution; it would invite inconsistency if we allowed
instantiating informative axioms with definitions.

The optional field "allow_partial" indicates whether or not challenges
may be solved with `partial def` solutions.  We uniformly forbid unsafe
solutions.  We rely on the Lean kernel to mark as unsafe (resp. partial)
any definitions that make use of unsafe (resp. partial) dependencies.

Fixes #3 (mostly)
Fixes #4
Closes leanprover#5
Closes leanprover#6
Closes leanprover#7
JasonGross added a commit to JasonGross/comparator that referenced this pull request Dec 20, 2025
This PR allows challenges that demand the construction of terms of
non-Prop types.

We remove the error "Challenge and solution constant kind don't match"
in favor of permitting any kind of solution to a challenge that is a
theorem or axiom.

Note that permitted axioms must still be declared as axioms or theorems
in the solution; it would invite inconsistency if we allowed
instantiating informative axioms with definitions.

The optional field "allow_partial" indicates whether or not challenges
may be solved with `partial def` solutions.  We uniformly forbid unsafe
solutions.  We rely on the Lean kernel to mark as unsafe (resp. partial)
any definitions that make use of unsafe (resp. partial) dependencies.

Axioms is now responsible for ensuring that solutions to challenges are
present and have valid kinds (no forbidden axioms recursively; only
partial if permitted; not unsafe)

Compare is is responsible for ensuring that:
- targets are present and are axioms or theorems in the challenge file
- targets have the same type in the challenge and solution
- any dependency of a solution, which is not an explicit target, and
  which occurs in both the challenge and the solution, has the same
  contents in both

Fixes #3 (mostly)
Fixes #4
Closes leanprover#5
Closes leanprover#6
Closes leanprover#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant