Skip to Content.
Sympa Menu

coq-club - [Coq-Club] subst surprise

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] subst surprise


Chronological Thread 
  • From: Jonathan Leivent <jonikelee AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: [Coq-Club] subst surprise
  • Date: Wed, 25 May 2016 23:06:22 -0400
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qg0-f54.google.com
  • Ironport-phdr: 9a23:TWNf2BWHRauwkjk4T5uHOQ8/XSnV8LGtZVwlr6E/grcLSJyIuqrYZhOFt8tkgFKBZ4jH8fUM07OQ6PCxHzBcqsnZ+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8yVP1kD22L1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu3SNp41Rr1ADTkgL3t9pIiy7UGCHkOz4S43VXxeuR5VCUCR5xbjG5z1ryHSt+xn2SDcM9egHp4uXjH3zaBtQQPogSFPEzM47mzRloQkjqVdoRGsoxFy64HRaYCRcvF5e/WOLpshWWNdU5MJBGR6CYSmYt5KVrJZMA==

I thought that the subst tactic just did some rewrites followed by clears.  Not quite:

Variable P : forall {a b:unit}, a = b -> Prop.
Lemma foolish(a b : unit)(x : a = b)(p : P x) : True.
Proof.
  subst a.
  exact I.
Defined.
Definition wtf := Eval cbv in foolish.
Print wtf.

prints (in 8.5pl1):

wtf =
fun (a b : unit) (x : a = b) (p : P x) =>
match
  match
    x as H in (_ = y)
    return
      (match match H in (_ = y0) return (y0 = a) with
             | eq_refl => eq_refl
             end in (_ = y0) return (y0 = y) with
       | eq_refl => eq_refl
       end = H)
  with
  | eq_refl => eq_refl
  end in (_ = H) return (P H -> True)
with
| eq_refl =>
    match
      match x in (_ = y) return (y = a) with
      | eq_refl => eq_refl
      end as H in (_ = y) return (P match H in (_ = y0) return (y0 = b) with
                                    | eq_refl => eq_refl
                                    end -> True)
    with
    | eq_refl => fun _ : P eq_refl => I
    end
end p
     : forall (a b : unit) (x : a = b), P x -> True

Does anyone know what's going on here?

-- Jonathan





Archive powered by MHonArc 2.6.18.

Top of Page