Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think I can't correctly infer the general problem that you have, given your description and example.</p> <p>If you already know <code>H : f = g</code>, you can use that to <code>rewrite H</code> wherever you want to show something about <code>f</code> and <code>g</code>, or just <code>elim H</code> to rewrite everything at once. You don't need to <code>assert</code> a helper theorem and if you do, you'll obviously need something like <code>assert</code> or <code>pose proof</code>.</p> <p>If that equality is hidden underneath some eta-expansion, like in your example, remove that layer and then proceed as above. Here are two (out of many) possible ways of doing that:</p> <pre><code>intros A B P Q a H. assert (P = Q) as H0 by apply H. rewrite H0; reflexivity. </code></pre> <p>This solves your example proof by <code>assert</code>ing the equality, then rewriting. Another possibility is to define eta reduction helpers (haven't found predefined ones) and using these. That will be more verbose, but might work in more complex cases.</p> <p>If you define</p> <pre><code>Lemma eta_reduce : forall (A B : Type) (f : A -&gt; B), (fun x =&gt; f x) = f. intros. reflexivity. Defined. Tactic Notation "eta" constr(f) "in" ident(H) := pattern (fun x =&gt; f x) in H; rewrite -&gt; eta_reduce in H. </code></pre> <p>you can do the following:</p> <pre><code>intros A B P Q a H. eta P in H. eta Q in H. rewrite H; reflexivity. </code></pre> <p>(That notation is a bit of a loose cannon and might rewrite in the wrong places. Don't rely on it and in case of anomalies do the <code>pattern</code> and <code>rewrite</code> manually.)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload