lean-ja / lean-ja/lean-by-example
Prod の普遍性を表す簡単な例
Open
Nobody has claimed this yet.
コード例
- Dominant language
- Lean
- Stars
- 188
- Forks
- 15
- Avg merge
- 9h 8m
- Merged PRs (30d)
- 6
Description
variable {A B C : Type}
/-- 積の普遍性から導かれる射 -/
def fork (f : A → B) (g : A → C) : A → B × C :=
fun a => (f a, g a)
/-- 第一成分への射影 -/
abbrev exl := @Prod.fst A B
/-- 第二成分への射影 -/
abbrev exr := @Prod.snd A B
open Prod
/-- ### 積の普遍性
すべての積への関数は、`fork` で書き表すことができる。 -/
example (h : A → B × C) : fork (fst ∘ h) (snd ∘ h) = h := rfl
/-- A × B → A × B は fork -/
example : fork fst snd = @id (A × B) := rfl
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Lean example in the issue and locating the repository section where related code examples are maintained. Check how existing examples are organized and documented. Done means the product universal-property example is included in the appropriate material and remains valid Lean code.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100