Equality of eta-equivalent terms not established by reflexivity in coq

edit: I should probably say how I'm working on the issue here right now. I defined the principle of mapping equality of permutations,

Lemma permInd : βˆ€ (U : Type) (A : Ensemble U) (Ο† ψ : Perm A), Ο† ↓ = ψ ↓ β†’ Ο† ↑ = ψ ↑ β†’ Ο† = ψ 

he applied the lemma in the context of the proof, which gives me the problems below and shows that these equivalent terms are equal. So the problem seems to demonstrate this-equivalence when members are nested inside a record. But I don’t know how to work with records, so maybe something is missing for me.

original:

I'm having problems proving the equality of ethano-equivalent conditions nested in the recording fields. For reference, eta recovery is independently proven by reflexivity:

 Lemma etaEquivalence : βˆ€ (AB : Type) (f : A β†’ B), (Ξ» x : A, fx) = f. Proof. reflexivity. Qed. 

In my current context of evidence, I have two records of which I must prove equality. Completely destroyed and expanded, the context of the proof and the current subgoal is as follows:

 U : Type A : Ensemble U perm0 : U β†’ U pinv0 : U β†’ U permutes0 : IsPerm A perm0 pinv0 ============================ {| perm := Ξ» x : U, perm0 x; pinv := Ξ» x : U, pinv0 x; permutes := permutationComp permutes0 (permutationId A) |} = {| perm := perm0; pinv := pinv0; permutes := permutes0 |} 

Equations to be established,

 perm0 = Ξ» x : U, perm0 x pinv0 = Ξ» x : U, pinv0 x 

Since these equalities can be established by reflexivity, I am not sure what the problem is. However, I suspect that something is wrong, because an attempt to replace Ξ» x : U, perm0 x with perm0 creates a corresponding subgoal, but does not replace the term inside the record. In addition, rewriting using eqa_reduction causes abstraction errors that cause incorrectly typed terms or nested dependent arguments.

I simplified the context as much as possible and inserted it below. Besides the stylistic issues and the fact that I'm still a beginner, I don't see any problems with the current development.

 Require Import Unicode.Utf8 Utf8_core Ensembles Setoid. Class IsPerm {U : Type} (A : Ensemble U) (Ο† ψ : U β†’ U) : Prop := { pinvLeft : βˆ€ x : U, ψ (Ο† x) = x; pinvRight : βˆ€ x : U, Ο† (ψ x) = x; closedPerm : βˆ€ x : U, In UA x β†’ In UA (Ο† x); closedPinv : βˆ€ x : U, In UA x β†’ In UA (ψ x) }. Record Perm {U : Type} (A : Ensemble U) : Type := { perm : U β†’ U; pinv : U β†’ U; permutes :> IsPerm A perm pinv }. Notation "f ∘ g" := (Ξ» x, f (gx)) (at level 45). Notation "P ↓" := (@perm _ _ P) (at level 2, no associativity). Notation "P ↑" := (@pinv _ _ P) (at level 2, no associativity). Instance permutationComp {U : Type} {A : Ensemble U} {fgkh : U β†’ U} (P : IsPerm A fk) (Q : IsPerm A gh) : IsPerm A (f ∘ g) (h ∘ k). Proof. constructor; intros. setoid_rewrite pinvLeft. apply pinvLeft. setoid_rewrite pinvRight. apply pinvRight. apply closedPerm. apply closedPerm. auto. apply closedPinv. apply closedPinv. auto. Defined. Instance permutationId {U : Type} (A : Ensemble U) : IsPerm A (Ξ» x : U, x) (Ξ» x : U, x). Proof. constructor; intros; auto. Defined. Definition permComp {U : Type} (A : Ensemble U) (Ο† : Perm A) (ψ : Perm A) : Perm A := Build_Perm UA (φ↓ ∘ Οˆβ†“) (Οˆβ†‘ ∘ φ↑) (permutationComp (permutes A Ο†) (permutes A ψ)). Definition permId {U : Type} (A : Ensemble U) : Perm A := Build_Perm UA (Ξ» x : U, x) (Ξ» x : U, x) (permutationId A). (* problems occur after the application of the tactic simpl, below: *) Lemma permCompRightIdentity : βˆ€ {U : Type} (A : Ensemble U) (Ο† : Perm A), permComp A Ο† (permId A) = Ο†. Proof. intros. unfold permComp. simpl. admit. Qed. 

Finally, I want to thank everyone here for helping me with Kok and being patient.

+4
source share
1 answer

Lack of evidence is not built into Coq. You can easily prove what you want if you take the evidential axiom of inconsistency:

 Require Import ProofIrrelevance. Lemma permCompRightIdentity : βˆ€ {U : Type} (A : Ensemble U) (Ο† : Perm A), permComp A Ο† (permId A) = Ο†. Proof. intros. unfold permComp. simpl. destruct Ο†. f_equal. apply proof_irrelevance. Qed. 
+6
source

Source: https://habr.com/ru/post/1382491/


All Articles