Skip to content

Commit a7b020c

Browse files
committed
chore: use the same names as in mathport (#200)
Ideally this would cause mathport to align these definitions, and then we can translate the notation.
1 parent 4b4eb5b commit a7b020c

File tree

6 files changed

+82
-83
lines changed

6 files changed

+82
-83
lines changed

Mathlib/Data/Equiv/Basic.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ variable {α : Sort u} {β : Sort v} {γ : Sort w}
2323
structure Equiv (α : Sort u) (β : Sort v) where
2424
toFun : α → β
2525
invFun : β → α
26-
leftInv : left_inverse invFun toFun
27-
rightInv : right_inverse invFun toFun
26+
left_inv : LeftInverse invFun toFun
27+
right_inv : RightInverse invFun toFun
2828

2929
infix:25 " ≃ " => Equiv
3030

@@ -45,22 +45,22 @@ def refl (α) : α ≃ α := ⟨id, id, λ _ => rfl, λ _ => rfl⟩
4545

4646
instance : Inhabited (α ≃ α) := ⟨Equiv.refl α⟩
4747

48-
def symm (e : α ≃ β) : β ≃ α := ⟨e.invFun, e.toFun, e.rightInv, e.leftInv
48+
def symm (e : α ≃ β) : β ≃ α := ⟨e.invFun, e.toFun, e.right_inv, e.left_inv
4949

5050

5151
def trans (e₁ : α ≃ β) (e₂ : β ≃ γ) : α ≃ γ :=
5252
⟨e₂ ∘ (e₁ : α → β), e₁.symm ∘ (e₂.symm : γ → β),
53-
e₂.leftInv.comp e₁.leftInv, e₂.rightInv.comp e₁.rightInv
53+
e₂.left_inv.comp e₁.left_inv, e₂.right_inv.comp e₁.right_inv
5454

5555
theorem to_fun_as_coe (e : α ≃ β) : e.toFun = e := rfl
5656

5757
@[simp] theorem inv_fun_as_coe (e : α ≃ β) : e.invFun = e.symm := rfl
5858

5959
@[simp] theorem apply_symm_apply (e : α ≃ β) (x : β) : e (e.symm x) = x :=
60-
e.rightInv x
60+
e.right_inv x
6161

6262
@[simp] theorem symm_apply_apply (e : α ≃ β) (x : α) : e.symm (e x) = x :=
63-
e.leftInv x
63+
e.left_inv x
6464

6565
@[simp] theorem symm_comp_self (e : α ≃ β) : e.symm ∘ (e : α → β) = id := funext e.symm_apply_apply
6666

Mathlib/Data/Equiv/Functor.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ theorem map_map (m : α → β) (g : β → γ) (x : f α) :
3131
def map_equiv (h : α ≃ β) : f α ≃ f β where
3232
toFun := map h
3333
invFun := map h.symm
34-
leftInv x := by simp [map_map]
35-
rightInv x := by simp [map_map]
34+
left_inv x := by simp [map_map]
35+
right_inv x := by simp [map_map]
3636

3737
@[simp]
3838
lemma map_equiv_apply (h : α ≃ β) (x : f α) :

Mathlib/Data/Prod.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ def swap : α × β → β × α := λp => (p.2, p.1)
121121
@[simp] lemma swap_swap_eq : swap ∘ swap = @id (α × β) :=
122122
funext swap_swap
123123

124-
lemma swap_left_inverse : Function.left_inverse (@swap α β) swap :=
124+
lemma swap_LeftInverse : Function.LeftInverse (@swap α β) swap :=
125125
swap_swap
126126

127-
lemma swap_right_inverse : Function.right_inverse (@swap α β) swap :=
127+
lemma swap_RightInverse : Function.RightInverse (@swap α β) swap :=
128128
swap_swap
129129

130130
lemma swap_injective : Function.injective (@swap α β) :=
131-
swap_left_inverse.injective
131+
swap_LeftInverse.injective
132132

133133
lemma swap_surjective : Function.surjective (@swap α β) :=
134-
Function.right_inverse.surjective swap_left_inverse
134+
Function.RightInverse.surjective swap_LeftInverse
135135

136136
lemma swap_bijective : Function.bijective (@swap α β) :=
137137
⟨swap_injective, swap_surjective⟩

Mathlib/Init/Function.lean

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -69,37 +69,37 @@ def bijective (f : α → β) := injective f ∧ surjective f
6969
theorem bijective.comp {g : β → φ} {f : α → β} : bijective g → bijective f → bijective (g ∘ f)
7070
| ⟨h_ginj, h_gsurj⟩, ⟨h_finj, h_fsurj⟩ => ⟨h_ginj.comp h_finj, h_gsurj.comp h_fsurj⟩
7171

72-
/-- `left_inverse g f` means that g is a left inverse to f. That is, `g ∘ f = id`. -/
73-
def left_inverse (g : β → α) (f : α → β) : Prop := ∀ x, g (f x) = x
72+
/-- `LeftInverse g f` means that g is a left inverse to f. That is, `g ∘ f = id`. -/
73+
def LeftInverse (g : β → α) (f : α → β) : Prop := ∀ x, g (f x) = x
7474

75-
/-- `has_left_inverse f` means that `f` has an unspecified left inverse. -/
76-
def has_left_inverse (f : α → β) : Prop := ∃ finv : β → α, left_inverse finv f
75+
/-- `has_LeftInverse f` means that `f` has an unspecified left inverse. -/
76+
def has_LeftInverse (f : α → β) : Prop := ∃ finv : β → α, LeftInverse finv f
7777

78-
/-- `right_inverse g f` means that g is a right inverse to f. That is, `f ∘ g = id`. -/
79-
def right_inverse (g : β → α) (f : α → β) : Prop := left_inverse f g
78+
/-- `RightInverse g f` means that g is a right inverse to f. That is, `f ∘ g = id`. -/
79+
def RightInverse (g : β → α) (f : α → β) : Prop := LeftInverse f g
8080

81-
/-- `has_right_inverse f` means that `f` has an unspecified right inverse. -/
82-
def has_right_inverse (f : α → β) : Prop := ∃ finv : β → α, right_inverse finv f
81+
/-- `has_RightInverse f` means that `f` has an unspecified right inverse. -/
82+
def has_RightInverse (f : α → β) : Prop := ∃ finv : β → α, RightInverse finv f
8383

84-
theorem left_inverse.injective {g : β → α} {f : α → β} : left_inverse g f → injective f :=
84+
theorem LeftInverse.injective {g : β → α} {f : α → β} : LeftInverse g f → injective f :=
8585
λ h a b hf => h a ▸ h b ▸ hf ▸ rfl
8686

87-
theorem has_left_inverse.injective {f : α → β} : has_left_inverse f → injective f :=
87+
theorem has_LeftInverse.injective {f : α → β} : has_LeftInverse f → injective f :=
8888
λ h => Exists.elim h (λ finv inv => inv.injective)
8989

90-
theorem right_inverse_of_injective_of_left_inverse {f : α → β} {g : β → α}
91-
(injf : injective f) (lfg : left_inverse f g) :
92-
right_inverse f g :=
90+
theorem RightInverse_of_injective_of_LeftInverse {f : α → β} {g : β → α}
91+
(injf : injective f) (lfg : LeftInverse f g) :
92+
RightInverse f g :=
9393
λ x => injf $ lfg $ f x
9494

95-
theorem right_inverse.surjective {f : α → β} {g : β → α} (h : right_inverse g f) : surjective f :=
95+
theorem RightInverse.surjective {f : α → β} {g : β → α} (h : RightInverse g f) : surjective f :=
9696
λ y => ⟨g y, h y⟩
9797

98-
theorem has_right_inverse.surjective {f : α → β} : has_right_inverse f → surjective f
98+
theorem has_RightInverse.surjective {f : α → β} : has_RightInverse f → surjective f
9999
| ⟨finv, inv⟩ => inv.surjective
100100

101-
theorem left_inverse_of_surjective_of_right_inverse {f : α → β} {g : β → α} (surjf : surjective f)
102-
(rfg : right_inverse f g) : left_inverse f g :=
101+
theorem LeftInverse_of_surjective_of_RightInverse {f : α → β} {g : β → α} (surjf : surjective f)
102+
(rfg : RightInverse f g) : LeftInverse f g :=
103103
λ y =>
104104
let ⟨x, hx⟩ := surjf y
105105
by rw [← hx, rfg]
@@ -130,10 +130,10 @@ rfl
130130
@[simp] theorem uncurry_curry (f : α × β → φ) : uncurry (curry f) = f :=
131131
funext (λ ⟨a, b⟩ => rfl)
132132

133-
protected theorem left_inverse.id {g : β → α} {f : α → β} (h : left_inverse g f) : g ∘ f = id :=
133+
protected theorem LeftInverse.id {g : β → α} {f : α → β} (h : LeftInverse g f) : g ∘ f = id :=
134134
funext h
135135

136-
protected theorem right_inverse.id {g : β → α} {f : α → β} (h : right_inverse g f) : f ∘ g = id :=
136+
protected theorem RightInverse.id {g : β → α} {f : α → β} (h : RightInverse g f) : f ∘ g = id :=
137137
funext h
138138

139139
end Function

Mathlib/Init/Logic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ def commutative := ∀ a b, f a b = f b a
561561
def associative := ∀ a b c, f (f a b) c = f a (f b c)
562562
def left_identity := ∀ a, f one a = a
563563
def right_identity := ∀ a, f a one = a
564-
def right_inverse := ∀ a, f a (inv a) = one
564+
def RightInverse := ∀ a, f a (inv a) = one
565565
def left_cancelative := ∀ a b c, f a b = f a c → b = c
566566
def right_cancelative := ∀ a b c, f a b = f c b → a = c
567567
def left_distributive := ∀ a b c, f a (g b c) = g (f a b) (f a c)

Mathlib/Logic/Function/Basic.lean

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ theorem cantor_surjective {α} (f : α → Set α) : ¬ Function.surjective f
191191
theorem cantor_injective {α : Type _} (f : (Set α) → α) :
192192
¬ Function.injective f
193193
| i => cantor_surjective (λ a b => ∀ U, a = f U → U b) $
194-
right_inverse.surjective
194+
RightInverse.surjective
195195
(λ U => funext $ λ a => propext ⟨λ h => h U rfl, λ h' U' e => i e ▸ h'⟩)
196196

197197
/-- `g` is a partial inverse to `f` (an injective but not necessarily
@@ -211,42 +211,42 @@ theorem injective_of_partial_inv_right {α β} {f : α → β} {g} (H : is_parti
211211
(x y b) (h₁ : g x = some b) (h₂ : g y = some b) : x = y :=
212212
((H _ _).1 h₁).symm.trans ((H _ _).1 h₂)
213213

214-
theorem left_inverse.comp_eq_id {f : α → β} {g : β → α} (h : left_inverse f g) : f ∘ g = id :=
214+
theorem LeftInverse.comp_eq_id {f : α → β} {g : β → α} (h : LeftInverse f g) : f ∘ g = id :=
215215
funext h
216216

217-
theorem left_inverse_iff_comp {f : α → β} {g : β → α} : left_inverse f g ↔ f ∘ g = id :=
218-
left_inverse.comp_eq_id, congr_fun⟩
217+
theorem LeftInverse_iff_comp {f : α → β} {g : β → α} : LeftInverse f g ↔ f ∘ g = id :=
218+
LeftInverse.comp_eq_id, congr_fun⟩
219219

220-
theorem right_inverse.comp_eq_id {f : α → β} {g : β → α} (h : right_inverse f g) : g ∘ f = id :=
220+
theorem RightInverse.comp_eq_id {f : α → β} {g : β → α} (h : RightInverse f g) : g ∘ f = id :=
221221
funext h
222222

223-
theorem right_inverse_iff_comp {f : α → β} {g : β → α} : right_inverse f g ↔ g ∘ f = id :=
224-
right_inverse.comp_eq_id, congr_fun⟩
223+
theorem RightInverse_iff_comp {f : α → β} {g : β → α} : RightInverse f g ↔ g ∘ f = id :=
224+
RightInverse.comp_eq_id, congr_fun⟩
225225

226-
theorem left_inverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : γ → β}
227-
(hf : left_inverse f g) (hh : left_inverse h i) : left_inverse (h ∘ f) (g ∘ i) :=
226+
theorem LeftInverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : γ → β}
227+
(hf : LeftInverse f g) (hh : LeftInverse h i) : LeftInverse (h ∘ f) (g ∘ i) :=
228228
λ a => show h (f (g (i a))) = a by rw [hf (i a), hh a]
229229

230-
theorem right_inverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : γ → β}
231-
(hf : right_inverse f g) (hh : right_inverse h i) : right_inverse (h ∘ f) (g ∘ i) :=
232-
left_inverse.comp hh hf
230+
theorem RightInverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : γ → β}
231+
(hf : RightInverse f g) (hh : RightInverse h i) : RightInverse (h ∘ f) (g ∘ i) :=
232+
LeftInverse.comp hh hf
233233

234-
theorem left_inverse.right_inverse {f : α → β} {g : β → α} (h : left_inverse g f) :
235-
right_inverse f g := h
234+
theorem LeftInverse.RightInverse {f : α → β} {g : β → α} (h : LeftInverse g f) :
235+
RightInverse f g := h
236236

237-
theorem right_inverse.left_inverse {f : α → β} {g : β → α} (h : right_inverse g f) :
238-
left_inverse f g := h
237+
theorem RightInverse.LeftInverse {f : α → β} {g : β → α} (h : RightInverse g f) :
238+
LeftInverse f g := h
239239

240-
theorem left_inverse.surjective {f : α → β} {g : β → α} (h : left_inverse f g) :
240+
theorem LeftInverse.surjective {f : α → β} {g : β → α} (h : LeftInverse f g) :
241241
surjective f :=
242-
h.right_inverse.surjective
242+
h.RightInverse.surjective
243243

244-
theorem right_inverse.injective {f : α → β} {g : β → α} (h : right_inverse f g) :
244+
theorem RightInverse.injective {f : α → β} {g : β → α} (h : RightInverse f g) :
245245
injective f :=
246-
h.left_inverse.injective
246+
h.LeftInverse.injective
247247

248-
theorem left_inverse.eq_right_inverse {f : α → β} {g₁ g₂ : β → α} (h₁ : left_inverse g₁ f)
249-
(h₂ : Function.right_inverse g₂ f) :
248+
theorem LeftInverse.eq_RightInverse {f : α → β} {g₁ g₂ : β → α} (h₁ : LeftInverse g₁ f)
249+
(h₂ : Function.RightInverse g₂ f) :
250250
g₁ = g₂ := by
251251
have h₃ : g₁ = g₁ ∘ f ∘ g₂ := by rw [h₂.comp_eq_id, comp.right_id]
252252
have h₄ : g₁ ∘ f ∘ g₂ = g₂ := by rw [← comp.assoc, h₁.comp_eq_id, comp.left_id]
@@ -318,33 +318,33 @@ inv_fun_on_eq $ let ⟨a, ha⟩ := h
318318
lemma inv_fun_neg (h : ¬ ∃ a, f a = b) : inv_fun f b = Classical.choice n :=
319319
by refine inv_fun_on_neg (mt ?_ h); exact λ ⟨a, _, ha⟩ => ⟨a, ha⟩
320320

321-
theorem inv_fun_eq_of_injective_of_right_inverse {g : β → α}
322-
(hf : injective f) (hg : right_inverse g f) : inv_fun f = g :=
321+
theorem inv_fun_eq_of_injective_of_RightInverse {g : β → α}
322+
(hf : injective f) (hg : RightInverse g f) : inv_fun f = g :=
323323
funext $ λ b => hf (by rw [hg b]
324324
exact inv_fun_eq ⟨g b, hg b⟩)
325325

326-
lemma right_inverse_inv_fun (hf : surjective f) : right_inverse (inv_fun f) f :=
326+
lemma RightInverse_inv_fun (hf : surjective f) : RightInverse (inv_fun f) f :=
327327
λ b => inv_fun_eq $ hf b
328328

329-
lemma left_inverse_inv_fun (hf : injective f) : left_inverse (inv_fun f) f :=
329+
lemma LeftInverse_inv_fun (hf : injective f) : LeftInverse (inv_fun f) f :=
330330
λ b => have : f (inv_fun f (f b)) = f b := inv_fun_eq ⟨b, rfl⟩
331331
hf this
332332

333333
lemma inv_fun_surjective (hf : injective f) : surjective (inv_fun f) :=
334-
(left_inverse_inv_fun hf).surjective
334+
(LeftInverse_inv_fun hf).surjective
335335

336-
lemma inv_fun_comp (hf : injective f) : inv_fun f ∘ f = id := funext $ left_inverse_inv_fun hf
336+
lemma inv_fun_comp (hf : injective f) : inv_fun f ∘ f = id := funext $ LeftInverse_inv_fun hf
337337

338338
end inv_fun
339339

340340
section inv_fun
341341
variable {α : Type u} [i : Nonempty α] {β : Sort v} {f : α → β}
342342

343-
lemma injective.has_left_inverse (hf : injective f) : has_left_inverse f :=
344-
⟨inv_fun f, left_inverse_inv_fun hf⟩
343+
lemma injective.has_LeftInverse (hf : injective f) : has_LeftInverse f :=
344+
⟨inv_fun f, LeftInverse_inv_fun hf⟩
345345

346-
lemma injective_iff_has_left_inverse : injective f ↔ has_left_inverse f :=
347-
⟨injective.has_left_inverse, has_left_inverse.injective⟩
346+
lemma injective_iff_has_LeftInverse : injective f ↔ has_LeftInverse f :=
347+
⟨injective.has_LeftInverse, has_LeftInverse.injective⟩
348348

349349
end inv_fun
350350

@@ -357,24 +357,24 @@ noncomputable def surj_inv {f : α → β} (h : surjective f) (b : β) : α := C
357357

358358
lemma surj_inv_eq (h : surjective f) (b) : f (surj_inv h b) = b := Classical.choose_spec (h b)
359359

360-
lemma right_inverse_surj_inv (hf : surjective f) : right_inverse (surj_inv hf) f :=
360+
lemma RightInverse_surj_inv (hf : surjective f) : RightInverse (surj_inv hf) f :=
361361
surj_inv_eq hf
362362

363-
lemma left_inverse_surj_inv (hf : bijective f) : left_inverse (surj_inv hf.2) f :=
364-
right_inverse_of_injective_of_left_inverse hf.1 (right_inverse_surj_inv hf.2)
363+
lemma LeftInverse_surj_inv (hf : bijective f) : LeftInverse (surj_inv hf.2) f :=
364+
RightInverse_of_injective_of_LeftInverse hf.1 (RightInverse_surj_inv hf.2)
365365

366-
lemma surjective.has_right_inverse (hf : surjective f) : has_right_inverse f :=
367-
⟨_, right_inverse_surj_inv hf⟩
366+
lemma surjective.has_RightInverse (hf : surjective f) : has_RightInverse f :=
367+
⟨_, RightInverse_surj_inv hf⟩
368368

369-
lemma surjective_iff_has_right_inverse : surjective f ↔ has_right_inverse f :=
370-
⟨surjective.has_right_inverse, has_right_inverse.surjective⟩
369+
lemma surjective_iff_has_RightInverse : surjective f ↔ has_RightInverse f :=
370+
⟨surjective.has_RightInverse, has_RightInverse.surjective⟩
371371

372-
lemma bijective_iff_has_inverse : bijective f ↔ ∃ g, left_inverse g f ∧ right_inverse g f :=
373-
⟨λ hf => ⟨_, left_inverse_surj_inv hf, right_inverse_surj_inv hf.2⟩,
372+
lemma bijective_iff_has_inverse : bijective f ↔ ∃ g, LeftInverse g f ∧ RightInverse g f :=
373+
⟨λ hf => ⟨_, LeftInverse_surj_inv hf, RightInverse_surj_inv hf.2⟩,
374374
λ ⟨g, gl, gr⟩ => ⟨gl.injective, gr.surjective⟩⟩
375375

376376
lemma injective_surj_inv (h : surjective f) : injective (surj_inv h) :=
377-
(right_inverse_surj_inv h).injective
377+
(RightInverse_surj_inv h).injective
378378

379379
lemma surjective_to_subsingleton [na : Nonempty α] [Subsingleton β] (f : α → β) :
380380
surjective f :=
@@ -564,21 +564,20 @@ end bicomp
564564

565565
section uncurry
566566

567-
variable {α β γ δ : Type _}
568-
569567
/-- Records a way to turn an element of `α` into a function from `β` to `γ`. The most generic use
570568
is to recursively uncurry. For instance `f : α → β → γ → δ` will be turned into
571569
`↿f : α × β × γ → δ`. One can also add instances for bundled maps. -/
572-
class has_uncurry (α : Type _) (β : outParam (Type _)) (γ : outParam (Type _)) := (uncurry : α → (β → γ))
570+
class HasUncurry (α : Type u) (β : outParam (Type v)) (γ : outParam (Type w)) where
571+
uncurry : α → (β → γ)
573572

574573
/- Uncurrying operator. The most generic use is to recursively uncurry. For instance
575574
`f : α → β → γ → δ` will be turned into `↿f : α × β × γ → δ`. One can also add instances
576575
for bundled maps. -/
577-
notation:max "↿" x:max => has_uncurry.uncurry x
576+
notation:max "↿" x:max => HasUncurry.uncurry x
578577

579-
instance has_uncurry_base : has_uncurry (α → β) α β := ⟨id⟩
578+
instance HasUncurry_base : HasUncurry (α → β) α β := ⟨id⟩
580579

581-
instance has_uncurry_induction [has_uncurry β γ δ] : has_uncurry (α → β) (α × γ) δ :=
580+
instance HasUncurry_induction [HasUncurry β γ δ] : HasUncurry (α → β) (α × γ) δ :=
582581
⟨λ f p => ↿(f p.1) p.2
583582

584583
end uncurry
@@ -595,10 +594,10 @@ variable {α : Sort u} {f : α → α} (h : involutive f)
595594
@[simp]
596595
lemma comp_self : f ∘ f = id := funext h
597596

598-
protected lemma left_inverse : left_inverse f f := h
599-
protected lemma right_inverse : right_inverse f f := h
597+
protected lemma LeftInverse : LeftInverse f f := h
598+
protected lemma RightInverse : RightInverse f f := h
600599

601-
protected lemma injective : injective f := h.left_inverse.injective
600+
protected lemma injective : injective f := h.LeftInverse.injective
602601
protected lemma surjective : surjective f := λ x => ⟨f x, h x⟩
603602
protected lemma bijective : bijective f := ⟨h.injective, h.surjective⟩
604603

0 commit comments

Comments
 (0)