Zulip Chat Archive

Stream: Is there code for X?

Topic: explicitly naming components of dependent pair


Arnav Sabharwal (Mar 16 2024 at 03:09):

inductive HeadT where
| first
| second

def dep (a : HeadT) :=
  match a with
  | .first => Nat
  | .second => Bool

def dep_pair := @Sigma.mk HeadT dep HeadT.second true

-- dummy example
example : dep_pair = @Sigma.mk HeadT dep HeadT.second true := by {
  unfold dep_pair
  -- how to access fst and snd from here
  trivial
}

In the above example, is there a way to assign names to fst and snd when unfolding the dependent pair? Thanks!

Arnav Sabharwal (Mar 16 2024 at 03:11):

(deleted)

Notification Bot (Mar 16 2024 at 03:11):

Arnav Sabharwal has marked this topic as resolved.

Notification Bot (Mar 16 2024 at 03:15):

Arnav Sabharwal has marked this topic as unresolved.

Matt Diamond (Mar 16 2024 at 03:53):

cases' dep_pair with a b?


Last updated: May 02 2025 at 03:31 UTC