Skip to content
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

Problem is here... #76

Closed
wants to merge 3 commits into from
Closed

Problem is here... #76

wants to merge 3 commits into from

Conversation

Ailrun
Copy link
Member

@Ailrun Ailrun commented May 10, 2024

No description provided.

per_univ_elem_irrel_rewrite.
exists (per_univ i).
split; [> econstructor; only 1-2: repeat econstructor; eauto ..].
exists (* There's no way to give the correct R here!!!! *)
Copy link
Member Author

@Ailrun Ailrun May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current rel_exp_under_ctx, it is not possible to give the correct R here.
However, with

Definition rel_exp_under_ctx Γ M M' A :=
  exists env_rel (_ : {{ EF Γ ≈ Γ ∈ per_ctx_env ↘ env_rel }}) i
     (elem_rel : forall p p' (equiv_p_p' : {{ Dom p ≈ p' ∈ env_rel }}), relation domain),
  forall p p' (equiv_p_p' : {{ Dom p ≈ p' ∈ env_rel }}),
     rel_typ i A p A p' (elem_rel _ _ equiv_p_p') /\ rel_exp (elem_rel _ _ equiv_p_p') M p M' p'.

now the problem is in rel_exp_sub_cong... its last eexists requires equiv_p_p' : {{ Dom p ≈ p' ∈ env_rel }} to destruct some Props.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's discuss next week. there might just be an easy way out.

Copy link
Member Author

@Ailrun Ailrun May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HuStmpHrrr with

instantiate (1 := fun c c' (equiv_c_c' : head_rel p p' equiv_p_p' c c') b b' =>
  forall a a' R,
    {{ ⟦ B ⟧ p ↦ c ↘ a }} ->
    {{ ⟦ B' ⟧ p' ↦ c' ↘ a' }} ->
    per_univ_elem i a a' R ->
    R b b').

Now the problem is that we need to show

per_univ_elem i m m'0
    (fun b b' : domain =>
     forall (a0 a'0 : domain) (R : relation domain),
     {{ ⟦ B ⟧ p ↦ c ↘ a0 }} -> {{ ⟦ B' ⟧ p' ↦ c' ↘ a'0 }} -> per_univ_elem i a0 a'0 R -> R b b')

under

H : per_univ_elem i m m'0 R'

Here the main problem is that even when we know R that satisfies per_univ_elem i a0 a'0 R, this R is not equal to per_univ_elem i a0 a'0 R -> R b b' (or any similar variant).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other words, this approach looks like requiring propositional extensionality to work.

Copy link
Member Author

@Ailrun Ailrun May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically it goes back to the dependence issue of ?out_rel. It can be solved by either

  1. your way with propositional extensionality
  2. a more "naive" way with dep. choice (or indef. descr.)

But would there be a better way (that requires weaker/no axioms)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the change to the PER model is more substantial. It should use <-> to relate the returning relation in all cases. let's merge the other PR first, and then try to see how this fix complicates the proofs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that approach requires some "congruence-like" lemmas like the one you suggested, and that makes all other cases also contain R <-> per_nat or so.

Copy link
Member Author

@Ailrun Ailrun May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we need to understand the structure of per_elems better first. By that I mean equivalence relation we want to use between those (previously: equality, suggestion: biconditional), or in general, what kind of "morphisms" (and isomorphisms) we have between those.

Then per_univ_elem i - a a' should respect that (iso-)morphisms.

Copy link
Member Author

@Ailrun Ailrun May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the new equivalence is in fact not just biconditional, but a biconditional under some universal quantification and applications. Under this, do we need fun. ext.? I mean, the arguments we need to add here would be something like forall a b, R a b <-> per_nat a b or so, which already has all arguments. Hm... let's see after changing the PER type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we need to understand the structure of per_elems better first. By that I mean equivalence relation we want to use between those (previously: equality, suggestion: biconditional), or in general, what kind of "morphisms" (and isomorphisms) we have between those.

Then per_univ_elem i - a a' should respect that (iso-)morphisms.

same thought.

Actually, the new equivalence is in fact not just biconditional, but a biconditional under some universal quantification and applications. Under this, do we need fun. ext.? I mean, the arguments we need to add here would be something like forall a b, R a b <-> per_nat a b or so, which already has all arguments. Hm... let's see after changing the PER type.

yeah, I meant an equivalence between relations. There should be something already defined in the standard library, at least that's what I hope.

Ltac destruct_rel_mod_app :=
repeat
match goal with
| H : (forall c c' (equiv_c_c' : {{ Dom c ≈ c' ∈ ?in_rel }}), rel_mod_app _ _ _ _ _) |- _ =>
destruct_rel_by_assumption in_rel H; mark H
destruct_rel_by_assumption in_rel H; mark_with H uconstr:("destruct_rel_mod_eval"%string)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I frankly don't understand what is this for. can we avoid this? it's not making the script nice looking. when is mark and unmark useful? most of the time, we should be able to match the exact assumption we want to play with. usually, mark and unmark can be avoided by, for example, failing when detecting repeated hypotheses in the proof context.

Copy link
Member Author

@Ailrun Ailrun May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that would work as well. Marking/unmarking is really an "easy" way to implement something based on traversal, not a "nice" way. Once the PER things are solved, let check what would make tactics better-looking.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for your information, this change is to allow the use of this tactic within another tactic depending marking.

Copy link
Member Author

@Ailrun Ailrun May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, BTW, there are some cases where marking/unmarking is really meaningful

  1. when we apply a tactic to assumptions but that only changes the goal.
  2. when we apply an idempotent/self-invertible tactic on hypotheses
  3. Although this is not about "applying on all hypotheses" procedures, marking/unmarking can be used to block applications of some (automation-based) tactics to a hypothesis.

Copy link
Member

@HuStmpHrrr HuStmpHrrr May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I guess it's an Ltac issue. The usually way I would implement a "saturation" tactic is to do the following:

  1. remember the current number of assumptions = n,
  2. saturate,
  3. remove duplicates,
  4. if the current number of assumptions == n, then fail, effectively, this step makes sure some useful saturation is done,
  5. repeat step 1-4 until failure.

this way, you don't care about marking or need to use any "difficult" Ltac programming tricks, and it's easier to understand IMO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That approach requires the change of the number of assumptions, but there are cases where we don't have such, like inversion_clear, so that approach is not so general IMO.

@Ailrun Ailrun closed this May 17, 2024
@Ailrun Ailrun deleted the pr-completeness-cases branch May 24, 2024 16:49
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.

2 participants