Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pair が関手(functor)であることを示す例 #1154

Open
Seasawher opened this issue Nov 23, 2024 · 0 comments
Open

Pair が関手(functor)であることを示す例 #1154

Seasawher opened this issue Nov 23, 2024 · 0 comments

Comments

@Seasawher
Copy link
Member

/-- 与えられた型の対を作る -/
def Pair (α : Type) : Type := α × α

/-- `Pair` を関手にする -/
instance : Functor Pair where
  map f := fun a => (f a.fst, f a.snd)

macro "functor" : tactic => `(tactic| constructor <;> aesop)

instance : LawfulFunctor Pair := by 
  functor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant