Zulip Chat Archive

Stream: general

Topic: possible bug of `guard_hyp`


Asei Inoue (Jun 27 2024 at 13:59):

def Set (α : Type) := α  Prop

def Set.inter {α : Type} (s t : Set α) : Set α := fun x => s x  t x

instance (α : Type) : Inter (Set α) where
  inter := Set.inter

variable {α : Type} (s u : Set α)

example (h : s  u = u  s): True := by
  dsimp [Inter.inter] at h
  guard_hyp h : s.inter u = u.inter s
  sorry

example (h : s  u = u  s): True := by
  unfold Inter.inter at h

  /-
  hypothesis h has type
    (instInterSet α).1 s u = (instInterSet α).1 u s
  not
    s ∩ u = u ∩ s
  -/
  guard_hyp h : (instInterSet α).1 s u = (instInterSet α).1 u s
  sorry

Asei Inoue (Jun 27 2024 at 14:00):

I think this is a bug of guard_hyp.

Eric Wieser (Jun 27 2024 at 14:51):

I'm very confused about what (instInterSet α).1 means in the goal view here, and how it is different from @Inter.inter _ (instInterSet α)

Asei Inoue (Jun 27 2024 at 15:02):

@Eric Wieser sorry, I dont understand what do you mean. This is not a bug?

Daniel Weber (Jun 27 2024 at 15:23):

Setting set_option pp.all true the unfold changes
@Eq.{1} (Set α) (@Inter.inter.{0} (Set α) (instInterSet α) s u) (@Inter.inter.{0} (Set α) (instInterSet α) u s) to
@Eq.{1} (Set α) ((instInterSet α).1 s u) ((instInterSet α).1 u s) while the dsimp changes it to
@Eq.{1} (Set α) (@Set.inter α s u) (@Set.inter α u s)

Eric Wieser (Jun 27 2024 at 15:24):

I don't understand what the (instInterSet α).1 is in that second state, and the infotree hovers don't tell me anything about .1

Daniel Weber (Jun 27 2024 at 15:25):

It's the same as (instInterSet α).inter, I believe

Eric Wieser (Jun 27 2024 at 15:26):

But something about it is not the same, otherwise the goal view wouldn't have changed

Daniel Weber (Jun 27 2024 at 15:27):

guard_hyp h : (_ : Set α → Set α → Set α) s u = (_ : Set α → Set α → Set α) u s this works, but I'm really not sure what it's filling the metavariables with


Last updated: May 02 2025 at 03:31 UTC