-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inversion lemma for formulas #222
Comments
This known limitation of |
The type of first-order formulas is a dependent type. Inversion of identity equations over dependent types is not trivial. If the type of parameters is not discrete (ie with decidable equality, or unicity of identity proofs see below), then constructors may not even be provably injective. In general, as @yforster suggests, it is a good idea to be able to write inversions of identity equations by hand. Typically, I suggest you try this one as a minimal exercise: Section term_eq_inv.
Variables (I : Type) (f : I -> Type).
Inductive term : Type :=
| term_in i : f i -> term.
Implicit Type t : term.
Fact term_eq_inv i j a b : term_in i a = term_in j b -> exists e : i = j, eq_rect _ _ a _ e = b.
Proof.
Admitted. Try a direct approach and see what happens with It is important to know that Definition term_idx t :=
match t with
| term_in i _ => i
end.
Definition term_val t : f (term_idx t) :=
match t with
| term_in _ a => a
end.
Fact term_form_inv t j b : t = term_in j b -> exists e : term_idx t = j, eq_rect _ _ (term_val t) _ e = b.
Proof.
Admitted. which gives the solution for Fact term_eq_inv' n a b : term_in n a = term_in n b -> a = b. then you won't be able to get it unless the type index |
In the current version of the library, inversion on formulas is not working as expected. In some cases, for instance,
congruence
falls short of closing a goals = t
given the assumptionq → s = q → t
withs,t,q: form
.@yforster suggested to fix this by adding the following lemma to the library (formulation and proof are due to him):
The text was updated successfully, but these errors were encountered: