Zulip Chat Archive

Stream: new members

Topic: patterns with coerced var


Ralf Stephan (Apr 28 2024 at 17:27):

Can you please help? How to find out what is wrong?

import Mathlib

set_option autoImplicit false
open Finset PNat BigOperators Function

lemma prod_Icc_succ_div {n x : +} :  n : +,
    ( x in Icc 1 n, ((1 + x) : ) / (x : )) = n + 1 := by
  rw [prod_div_distrib (s := Icc 1 n)
    (f := fun x : +  ((1 + x) : ))
    (g := fun x : +  (x : ))]
tactic 'rewrite' failed, did not find instance of the pattern in the target expression
   x in Icc 1 n, (1 + ↑↑x) / ↑↑x
n x : +
  (n : +),  x in Icc 1 n, (1 + ↑↑x) / ↑↑x = ↑↑n + 1

The pattern seems identical, but it's not? Would it be possible to give information what doesn't match in the error message? This is so frustrating. Thanks for any hint.

Ruben Van de Velde (Apr 28 2024 at 17:46):

You're confusing yourself by having two ns

Ralf Stephan (Apr 28 2024 at 17:50):

But when I remove the second \N+ so that it reads ∀ n, I get

failed to synthesize instance
  LocallyFiniteOrder 

Ralf Stephan (Apr 28 2024 at 17:55):

Ah, you mean competely without \forall. That works. Thanks!

Ralf Stephan (Apr 28 2024 at 18:04):

Can't different variables with same name be labelled on error output? Should I open an issue?


Last updated: May 02 2025 at 03:31 UTC