@@ -15,8 +15,11 @@ This file provides basic definitions and notation instances for Pi types.
15
15
Instances of more sophisticated classes are defined in `pi.lean` files elsewhere.
16
16
-/
17
17
18
+ open function
19
+
18
20
universes u v₁ v₂ v₃
19
21
variable {I : Type u} -- The indexing type
22
+ variables {α β γ : Type *}
20
23
-- The families of types already equipped with instances
21
24
variables {f : I → Type v₁} {g : I → Type v₂} {h : I → Type v₃}
22
25
variables (x y : Π i, f i) (i : I)
@@ -32,6 +35,12 @@ namespace pi
32
35
33
36
@[to_additive] lemma one_def [Π i, has_one $ f i] : (1 : Π i, f i) = λ i, 1 := rfl
34
37
38
+ @[simp, to_additive] lemma const_one [has_one β] : const α (1 : β) = 1 := rfl
39
+
40
+ @[simp, to_additive] lemma one_comp [has_one γ] (x : α → β) : (1 : β → γ) ∘ x = 1 := rfl
41
+
42
+ @[simp, to_additive] lemma comp_one [has_one β] (x : β → γ) : x ∘ 1 = const α (x 1 ) := rfl
43
+
35
44
@[to_additive]
36
45
instance has_mul [∀ i, has_mul $ f i] :
37
46
has_mul (Π i : I, f i) :=
@@ -40,18 +49,34 @@ instance has_mul [∀ i, has_mul $ f i] :
40
49
41
50
@[to_additive] lemma mul_def [Π i, has_mul $ f i] : x * y = λ i, x i * y i := rfl
42
51
52
+ @[simp, to_additive] lemma const_mul [has_mul β] (a b : β) :
53
+ const α a * const α b = const α (a * b) := rfl
54
+
55
+ @[to_additive] lemma mul_comp [has_mul γ] (x y : β → γ) (z : α → β) :
56
+ (x * y) ∘ z = x ∘ z * y ∘ z := rfl
57
+
43
58
@[to_additive] instance has_inv [∀ i, has_inv $ f i] :
44
59
has_inv (Π i : I, f i) :=
45
60
⟨λ f i, (f i)⁻¹⟩
46
61
@[simp, to_additive] lemma inv_apply [∀ i, has_inv $ f i] : x⁻¹ i = (x i)⁻¹ := rfl
47
62
@[to_additive] lemma inv_def [Π i, has_inv $ f i] : x⁻¹ = λ i, (x i)⁻¹ := rfl
48
63
64
+ @[to_additive] lemma const_inv [has_inv β] (a : β) : (const α a)⁻¹ = const α a⁻¹ := rfl
65
+
66
+ @[to_additive] lemma inv_comp [has_inv γ] (x : β → γ) (y : α → β) : x⁻¹ ∘ y = (x ∘ y)⁻¹ := rfl
67
+
49
68
@[to_additive] instance has_div [Π i, has_div $ f i] :
50
69
has_div (Π i : I, f i) :=
51
70
⟨λ f g i, f i / g i⟩
52
71
@[simp, to_additive] lemma div_apply [Π i, has_div $ f i] : (x / y) i = x i / y i := rfl
53
72
@[to_additive] lemma div_def [Π i, has_div $ f i] : x / y = λ i, x i / y i := rfl
54
73
74
+ @[to_additive] lemma div_comp [has_div γ] (x y : β → γ) (z : α → β) :
75
+ (x / y) ∘ z = x ∘ z / y ∘ z := rfl
76
+
77
+ @[simp, to_additive] lemma const_div [has_div β] (a b : β) :
78
+ const α a / const α b = const α (a / b) := rfl
79
+
55
80
section
56
81
57
82
variables [decidable_eq I]
116
141
end pi
117
142
118
143
section extend
119
-
120
144
namespace function
121
145
122
- variables {α β γ : Type *}
123
-
124
146
@[to_additive]
125
147
lemma extend_one [has_one γ] (f : α → β) :
126
148
function.extend f (1 : α → γ) (1 : β → γ) = 1 :=
0 commit comments