Skip to content

Commit 9964d23

Browse files
committed
chore: fixing some naming issues in Data/* (#570)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent a63164b commit 9964d23

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

Mathlib/Data/Option/Basic.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ theorem coe_get {o : Option α} (h : o.isSome) : ((Option.get _ h : α) : Option
5050
theorem eq_of_mem_of_mem {a : α} {o1 o2 : Option α} (h1 : a ∈ o1) (h2 : a ∈ o2) : o1 = o2 :=
5151
h1.trans h2.symm
5252

53-
theorem Mem.left_unique : Relator.LeftUnique ((· ∈ ·) : α → Option α → Prop) :=
53+
theorem Mem.leftUnique : Relator.LeftUnique ((· ∈ ·) : α → Option α → Prop) :=
5454
fun _ _ _=> mem_unique
55+
#align Mem.left_unique Mem.leftUnique
5556

5657
theorem some_injective (α : Type _) : Function.Injective (@some α) := fun _ _ => some_inj.mp
5758

Mathlib/Data/Prod/Basic.lean

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,19 @@ instance {r : α → α → Prop} {s : β → β → Prop} [IsStrictOrder α r]
222222
| (_, _), (_, _), .right _ _, .left _ _ hr₂ => (irrefl _ hr₂).elim
223223
| (_, _), (_, _), .right _ hs₁, .right _ hs₂ => antisymm hs₁ hs₂ ▸ rfl⟩
224224

225-
instance is_total_left {r : α → α → Prop} {s : β → β → Prop} [IsTotal α r] :
225+
instance isTotal_left {r : α → α → Prop} {s : β → β → Prop} [IsTotal α r] :
226226
IsTotal (α × β) (Lex r s) :=
227227
fun ⟨a₁, _⟩ ⟨a₂, _⟩ => (IsTotal.total a₁ a₂).imp (Lex.left _ _) (Lex.left _ _)⟩
228+
#align is_total_left isTotal_left
228229

229-
instance is_total_right {r : α → α → Prop} {s : β → β → Prop} [IsTrichotomous α r] [IsTotal β s] :
230+
instance isTotal_right {r : α → α → Prop} {s : β → β → Prop} [IsTrichotomous α r] [IsTotal β s] :
230231
IsTotal (α × β) (Lex r s) :=
231232
fun ⟨i, a⟩ ⟨j, b⟩ => by
232233
obtain hij | rfl | hji := trichotomous_of r i j
233234
· exact Or.inl (.left _ _ hij)
234235
· exact (total_of s a b).imp (.right _) (.right _)
235236
· exact Or.inr (.left _ _ hji) ⟩
237+
#align is_total_right isTotal_right
236238

237239
end Prod
238240

Mathlib/Data/Quot.lean

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ theorem lift_mk (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a
9090
rfl
9191
#align quot.lift_beta Quot.lift_mk
9292

93-
theorem lift_on_mk (a : α) (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a₂) :
93+
theorem liftOn_mk (a : α) (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a₂) :
9494
Quot.liftOn (Quot.mk r a) f h = f a :=
9595
rfl
96+
#align quot.lift_on_mk Quot.liftOn_mk
9697

9798
/-- Descends a function `f : α → β → γ` to quotients of `α` and `β`. -/
9899
-- porting note: removed `@[elab_as_elim]`, gave "unexpected resulting type γ"
@@ -116,10 +117,11 @@ protected def liftOn₂ (p : Quot r) (q : Quot s) (f : α → β → γ)
116117
Quot.lift₂ f hr hs p q
117118

118119
@[simp]
119-
theorem lift_on₂_mk (a : α) (b : β) (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂)
120+
theorem liftOn₂_mk (a : α) (b : β) (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂)
120121
(hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) :
121122
Quot.liftOn₂ (Quot.mk r a) (Quot.mk s b) f hr hs = f a b :=
122123
rfl
124+
#align quot.lift_on₂_mk Quot.liftOn₂_mk
123125

124126
variable {t : γ → γ → Prop}
125127

@@ -284,15 +286,17 @@ theorem Quotient.lift₂_mk {α : Sort _} {β : Sort _} {γ : Sort _} [Setoid α
284286
Quotient.lift₂ f h (Quotient.mk _ a) (Quotient.mk _ b) = f a b :=
285287
rfl
286288

287-
theorem Quotient.lift_on_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) :
289+
theorem Quotient.liftOn_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) :
288290
Quotient.liftOn (Quotient.mk s x) f h = f x :=
289291
rfl
292+
#align Quotient.lift_on_mk Quotient.liftOn_mk
290293

291294
@[simp]
292-
theorem Quotient.lift_on₂_mk {α : Sort _} {β : Sort _} [Setoid α] (f : α → α → β)
295+
theorem Quotient.liftOn₂_mk {α : Sort _} {β : Sort _} [Setoid α] (f : α → α → β)
293296
(h : ∀ a₁ a₂ b₁ b₂ : α, a₁ ≈ b₁ → a₂ ≈ b₂ → f a₁ a₂ = f b₁ b₂) (x y : α) :
294297
Quotient.liftOn₂ (Quotient.mk _ x) (Quotient.mk _ y) f h = f x y :=
295298
rfl
299+
#align Quotient.lift_on₂_mk Quotient.liftOn₂_mk
296300

297301
/-- `quot.mk r` is a surjective function. -/
298302
theorem surjective_quot_mk (r : α → α → Prop) : Function.Surjective (Quot.mk r) :=
@@ -617,10 +621,11 @@ protected def hrecOn' {φ : Quotient s₁ → Sort _} (qa : Quotient s₁) (f :
617621
Quot.hrecOn qa f c
618622

619623
@[simp]
620-
theorem hrec_on'_mk'' {φ : Quotient s₁ → Sort _} (f : ∀ a, φ (Quotient.mk'' a))
624+
theorem hrecOn'_mk'' {φ : Quotient s₁ → Sort _} (f : ∀ a, φ (Quotient.mk'' a))
621625
(c : ∀ a₁ a₂, a₁ ≈ a₂ → HEq (f a₁) (f a₂))
622626
(x : α) : (Quotient.mk'' x).hrecOn' f c = f x :=
623627
rfl
628+
#align quotient.hrec_on'_mk'' Quotient.hrecOn'_mk''
624629

625630
/-- Recursion on two `Quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`. -/
626631
protected def hrecOn₂' {φ : Quotient s₁ → Quotient s₂ → Sort _} (qa : Quotient s₁)
@@ -630,11 +635,12 @@ protected def hrecOn₂' {φ : Quotient s₁ → Quotient s₂ → Sort _} (qa :
630635
Quotient.hrecOn₂ qa qb f c
631636

632637
@[simp]
633-
theorem hrec_on₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort _}
638+
theorem hrecOn₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort _}
634639
(f : ∀ a b, φ (Quotient.mk'' a) (Quotient.mk'' b))
635640
(c : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) (x : α) (qb : Quotient s₂) :
636641
(Quotient.mk'' x).hrecOn₂' qb f c = qb.hrecOn' (f x) fun _ _ => c _ _ _ _ (Setoid.refl _) :=
637642
rfl
643+
#align quotient.hrec_on₂'_mk'' Quotient.hrecOn₂'_mk''
638644

639645
/-- Map a function `f : α → β` that sends equivalent elements to equivalent elements
640646
to a function `quotient sa → quotient sb`. Useful to define unary operations on quotients. -/
@@ -688,13 +694,15 @@ protected theorem mk''_eq_mk (x : α) : Quotient.mk'' x = Quotient.mk s x :=
688694
rfl
689695

690696
@[simp]
691-
protected theorem lift_on'_mk (x : α) (f : α → β) (h) : (Quotient.mk s x).liftOn' f h = f x :=
697+
protected theorem liftOn'_mk (x : α) (f : α → β) (h) : (Quotient.mk s x).liftOn' f h = f x :=
692698
rfl
699+
#align quotient.lift_on'_mk Quotient.liftOn'_mk
693700

694701
@[simp]
695-
protected theorem lift_on₂'_mk [t : Setoid β] (f : α → β → γ) (h) (a : α) (b : β) :
702+
protected theorem liftOn₂'_mk [t : Setoid β] (f : α → β → γ) (h) (a : α) (b : β) :
696703
Quotient.liftOn₂' (Quotient.mk s a) (Quotient.mk t b) f h = f a b :=
697704
Quotient.liftOn₂'_mk'' _ _ _ _
705+
#align quotient.lift_on₂'_mk Quotient.liftOn₂'_mk
698706

699707
@[simp]
700708
theorem map'_mk [t : Setoid β] (f : α → β) (h) (x : α) :

Mathlib/Data/Sigma/Basic.lean

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,24 @@ def Prod.toSigma {α β} (p : α × β) : Σ_ : α, β :=
144144
⟨p.1, p.2
145145

146146
@[simp]
147-
theorem Prod.fst_comp_to_sigma {α β} : Sigma.fst ∘ @Prod.toSigma α β = Prod.fst :=
147+
theorem Prod.fst_comp_toSigma {α β} : Sigma.fst ∘ @Prod.toSigma α β = Prod.fst :=
148148
rfl
149+
#align prod.fst_comp_to_sigma Prod.fst_comp_toSigma
149150

150151
@[simp]
151-
theorem Prod.fst_to_sigma {α β} (x : α × β) : (Prod.toSigma x).fst = x.fst :=
152+
theorem Prod.fst_toSigma {α β} (x : α × β) : (Prod.toSigma x).fst = x.fst :=
152153
rfl
154+
#align prod.fst_to_sigma Prod.fst_toSigma
153155

154156
@[simp]
155-
theorem Prod.snd_to_sigma {α β} (x : α × β) : (Prod.toSigma x).snd = x.snd :=
157+
theorem Prod.snd_toSigma {α β} (x : α × β) : (Prod.toSigma x).snd = x.snd :=
156158
rfl
159+
#align prod.snd_to_sigma Prod.snd_toSigma
157160

158161
@[simp]
159-
theorem Prod.to_sigma_mk {α β} (x : α) (y : β) : (x, y).toSigma = ⟨x, y⟩ :=
162+
theorem Prod.toSigma_mk {α β} (x : α) (y : β) : (x, y).toSigma = ⟨x, y⟩ :=
160163
rfl
164+
#align prod.to_sigma_mk Prod.toSigma_mk
161165

162166
-- Porting note: the meta instance `has_reflect (Σa, β a)` was removed here.
163167

0 commit comments

Comments
 (0)