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.