Skip to Content.
Sympa Menu

ssreflect - [ssreflect] Why is _this_ not first order?

Subject: Ssreflect Users Discussion List

List archive

[ssreflect] Why is _this_ not first order?


Chronological Thread 
  • From: Ian Zimmerman <>
  • To: Ssreflect Mailinglist <>
  • Subject: [ssreflect] Why is _this_ not first order?
  • Date: Sun, 22 Sep 2019 23:49:54 -0700
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=Pass
  • Ironport-phdr: 9a23:BHUz2xL4VeQ5xUtlL9mcpTZWNBhigK39O0sv0rFitYgfK/vxwZ3uMQTl6Ol3ixeRBMOHsqkC0bWd6vm8ESxYuNDd6SpEKMQNHzY+yuwu1zQ6B8CEDUCpZNXLVAcdWPp4aVl+4nugOlJUEsutL3fbo3m18CJAUk6nbVk9Kev6AJPdgNqq3O6u5ZLTfx9IhD2gar9uMRm6twrcutQYjId4NKo8yBTFrmZVd+lZ2GhkIU6fkwvm6sq/4ZJv7T5ct+49+8JFTK73Y7k2QbtEATo8Lms7/tfrtR7NTQuO4nsTTGAbmQdWDgbG8R/3QI7/vjP1ueRh1iaaO9b2Ta0vVjS586hrUh7ohzwZODM/7Wral9Z/jKNfoBKmuhx/34vZa5ybOfZiYq/Qe84RSHFfVchNSSNOHoK8b5MOD+UfO+ZYs5L9rEYKoRenGAWgGP/jxjpOi3DxwKM6zv8hERnY0wM8A9IAvnPUrNDvO6cTV+C+0a3EwDrHYv9T3zr29YrGfQ07ofyUU7x+cdTfx1QsGQzKklqftIPrMD2O2+QRsGWW9fZsWf61hmMlrQx6vzihxt0rionMno8byUrL9SNky4k2JN24TUt7bsC+EJtVrS6aMZZ9T8QjQ2F0uSc30aMGtoChfCkK0pgnwxnfa/ucc4eW5hLiVPydITBihHJqYb+ygQu5/0anyu35TMa00VBKozJAktnLsXAN0Abf5dSASvt4+EqqxDWB1xjL5+1ZI005m7DXJ4Ahz7MwjJYfr1nPEy/slEj3iKKabkQp9+qy5+j6YLjrqYWQO5F6hwzwKKgihNGzDOY+PwMTRWaU4/6826fm/UDhQLVFkPk2kq7BvZDEO8sbvK64DxVR0oYk7Ba/FCmp0NAYnHUdK1JFYh2Hg5DoO1HIPv/4Ee+yj0munTpl3fzKIL3sD5XXInTdjbvsfaxx5k9YxQYryNBQ/ZNUCrUPIPLpXU/xscTVDh4lMw212OvnFsty1pkeWG6VBq+ZN6TSsUSW6eIrI+iAfogVuCzyK/Q9/f7hkWc5mUMBfamuxZYXc2u4Hu54LEWXZXrjnMsOEXsRswolTO3qjUWCXiRJa3azWaI8/DA7B5i8AYfNXID+yICGiRygBJBYYm1NFhipGHbsdoOLX/YXdGrGOdR7nzIAWLO9Y4o6z1SvshX7wvxmKPDV82sWr8Sw+sJy4rjynBd6xz1xCsmH1miLBzV1gnEgWTIszeZ7pktmx1OSl69ijKoLRpRo+/pVX1JiZtbnxOtgBoW3B1uYL4W5DW2+S9DjOgkfC9c4wtsAeUF4QoXwkB3ZzmyuBLgOmriaQpsu/fCFhiWjF4NG03/DkZIZoRwmT89IbD30mKNl5k7XAInSnkGI0aGwevZFhXKfxCK41WOL+XpgfktoS6ycDSIBa1HH69D+4VjPS67oDq4oYFNM

Ok, here's my next stumbling block. My entire file until now:

>> begin quote

From mathcomp Require Import ssreflect ssrfun ssrbool.
Require Import FunctionalExtensionality.
Require Import ClassicalEpsilon.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Require Import Utf8.

Section Transformations.

Variable T: Type.

Let I := @id T.

Lemma id_cancel: cancel I I.
Proof.
exact.
Qed.

Let bij_id_witness := Bijective id_cancel id_cancel: bijective I.

Lemma bij_id: bijective I.
Proof.
exact: bij_id_witness.
Qed.

Let has_invimg (f: T → T) (y: T) := ∃ x: T, f x = y.

Lemma img_has_invimg: ∀ f: T → T, ∀ x: T, has_invimg f (f x).
Proof.
rewrite /has_invimg => f x; exists x; reflexivity.
Qed.

Let is_preimg (f: T → T) (y: T) := λ x: T, has_invimg f y → f x = y.

Let eps_preimg (f: T → T) (y: T) := epsilon (inhabits y) (is_preimg f y).

Lemma has_preimg: ∀ f: T → T, ∀ y: T, ∃ x: T, is_preimg f y x.
Proof.
move => f y; set INVfy := has_invimg f y.
have: {INVfy} + {¬ INVfy} by apply: excluded_middle_informative.
case; [firstorder ..].
Qed.

Lemma inj_eps_is_preimg: ∀ f: T → T, ∀ y: T, injective f → is_preimg f y
(eps_preimg f y).
Proof.
move => f y INJf; apply: epsilon_spec; exact: has_preimg.
Qed.

Lemma inj_preimg_cancels: ∀ f: T → T, injective f → cancel f (eps_preimg f).
Proof.
move => f INJf x; set y := f x; set x' := eps_preimg f y.
have: is_preimg f y x' by apply: inj_eps_is_preimg.
rewrite /is_preimg.
have: has_invimg f y by apply: img_has_invimg.
firstorder.
Qed.

Lemma inj_r_inv: ∀ f: T → T, injective f → ∃ f', cancel f f'.
Proof.
move => f INJf; exists (eps_preimg f); apply: inj_preimg_cancels INJf.
Qed.

Lemma bij_r_inv: ∀ f: T → T, bijective f → ∃ f', cancel f f'.
Proof.
move => f BJf; have: injective f by [apply: bij_inj BJf]; apply inj_r_inv.
Qed.

Lemma bij_r_inv_unique: ∀ f f' f'': T → T, bijective f → cancel f f' →
cancel f f'' → f' = f''.
Proof.
move => f f' f'' BJf Cf' Cf''; extensionality y; move: BJf f' f'' Cf' Cf''
y.
exact: bij_can_eq.
Qed.

Proposition bij_r_inv_l_inv: ∀ f f': T → T, bijective f → cancel f f' →
cancel f' f.
Proof.
move => f f' BJf.
have: ∀ g, cancel f f' → cancel f g → f' = g.
- move => g CANff' CANfg; apply: bij_r_inv_unique BJf CANff' CANfg.
case: BJf => g CANfg CANgf UNIQf' CANff'.
have: f' = g by apply: UNIQf' g CANff' CANfg.
move => EQgf'. move: EQgf' CANgf.

>> end quote

And here I am left with this goalstack:

f, f', g : T → T
CANfg : cancel f g
UNIQf' : ∀ g : T → T, cancel f f' → cancel f g → f' = g
CANff' : cancel f f'
______________________________________(1/1)
f' = g → cancel g f → cancel f' f

Sure seems like first order to me ... but not to Coq:

Ltac call to "firstorder (tactic_opt) (firstorder_using)" failed.
Tactic failure: reversible in 1st order mode.

So what's going on here, and how can I proceed?

Another question: I wish the last apply step would remove the hypotheses
is uses from the context, but it doesn't, and something like the
following which _should_ have that effect according to the doc, doesn't
work either:

have: f' = g by apply: UNIQf' g CANff' CANfg => {UNIQf' CANff' CANfg}

In general, the doc is tough to read because information on most tactics
is not in one place :-(

--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet and on broken lists
which rewrite From, fetch the TXT record for no-use.mooo.com.


  • [ssreflect] Why is _this_ not first order?, Ian Zimmerman, 09/23/2019

Archive powered by MHonArc 2.6.18.

Top of Page