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

Deeplim inverses some equalities when sections are involved #621

Open
thomas-lamiaux opened this issue Oct 8, 2024 · 1 comment
Open

Comments

@thomas-lamiaux
Copy link
Contributor

I found a weird behavior with depelim. In the code below, depelim keeps inverting the equality

Section Foo.
  Context (x y : vec nat 2).

Definition foo (H : x = y) : x = y.
  depelim H.
  depelim H.
  depelim H.

but with this code, the equality gets deleted

Definition foo (x y : vec nat 2) (H : x = y) : x = y.
  depelim H.
@thomas-lamiaux
Copy link
Contributor Author

It actually behaves weird for section variables all together.
Compare

Section Foo.
  Context (A : Type).
  Context (a b : A).
  Context (x y : vec A 2).
  Context (z : vec A 3).

Goal (vcons a (vcons a x) = vcons a (vcons b y)) -> a = b /\ x = y.
  intros H. depelim H. now split.
Qed.

Goal (vcons a x = z) -> vtail z = x.
  intros H. depelim H. subst. simp vtail. easy.
Qed.

End Foo.

and

Section Foo.
  Context (A : Type).
  Context (a b : A).

Goal forall (x y : vec A 2), (vcons a (vcons a x) = vcons a (vcons b y)) -> a = b /\ x = y.
  intros x y H. depelim H. now split.
Qed.

Goal forall ( x : vec A 2) z, (vcons a x = z) -> vtail z = x.
  intros x z H. depelim H. simp vtail. reflexivity.
Qed.

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

No branches or pull requests

1 participant