Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit abd6ab5

Browse files
committed
refactor(data/prod): add map_fst, map_snd
1 parent ac4f7b1 commit abd6ab5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

data/prod.lean

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ Extends theory on products
77
-/
88
import tactic.ext
99

10-
universes u v
11-
variables {α : Type u} {β : Type v}
10+
variables {α : Type*} {β : Type*} {γ : Type*} {δ : Type*}
1211

1312
@[simp] theorem prod.forall {p : α × β → Prop} : (∀ x, p x) ↔ (∀ a b, p (a, b)) :=
1413
⟨assume h a b, h (a, b), assume h ⟨a, b⟩, h a b⟩
@@ -20,6 +19,12 @@ namespace prod
2019

2120
attribute [simp] prod.map
2221

22+
@[simp] lemma map_fst (f : α → γ) (g : β → δ) : ∀(p : α × β), (map f g p).1 = f (p.1)
23+
| ⟨a, b⟩ := rfl
24+
25+
@[simp] lemma map_snd (f : α → γ) (g : β → δ) : ∀(p : α × β), (map f g p).2 = g (p.2)
26+
| ⟨a, b⟩ := rfl
27+
2328
@[simp] theorem mk.inj_iff {a₁ a₂ : α} {b₁ b₂ : β} : (a₁, b₁) = (a₂, b₂) ↔ (a₁ = a₂ ∧ b₁ = b₂) :=
2429
⟨prod.mk.inj, by cc⟩
2530

0 commit comments

Comments
 (0)