@@ -152,9 +152,9 @@ structure NonScalar where
152152inductive PNonScalar : Type u where
153153 | mk (v : Nat) : PNonScalar
154154
155- theorem natAddZero (n : Nat) : n + 0 = n := rfl
155+ @[simp] theorem Nat.add_zero (n : Nat) : n + 0 = n := rfl
156156
157- theorem optParamEq (α : Sort u) (default : α) : optParam α default = α := rfl
157+ theorem optParam_eq (α : Sort u) (default : α) : optParam α default = α := rfl
158158
159159/- Boolean operators -/
160160
@@ -178,7 +178,7 @@ def trivial : True := ⟨⟩
178178theorem mt {a b : Prop } (h₁ : a → b) (h₂ : ¬b) : ¬a :=
179179 fun ha => h₂ (h₁ ha)
180180
181- theorem notFalse : ¬False := id
181+ theorem not_false : ¬False := id
182182
183183-- proof irrelevance is built in
184184theorem proofIrrel {a : Prop } (h₁ h₂ : a) : h₁ = h₂ := rfl
@@ -194,7 +194,7 @@ theorem id.def {α : Sort u} (a : α) : id a = a := rfl
194194theorem Eq.substr {α : Sort u} {p : α → Prop } {a b : α} (h₁ : b = a) (h₂ : p a) : p b :=
195195 h₁ ▸ h₂
196196
197- theorem castEq {α : Sort u} (h : α = α) (a : α) : cast h a = a :=
197+ theorem cast_eq {α : Sort u} (h : α = α) (a : α) : cast h a = a :=
198198 rfl
199199
200200@[reducible] def Ne {α : Sort u} (a b : α) :=
@@ -215,18 +215,18 @@ theorem Ne.irrefl (h : a ≠ a) : False := h rfl
215215theorem Ne.symm (h : a ≠ b) : b ≠ a :=
216216 fun h₁ => h (h₁.symm)
217217
218- theorem falseOfNe : a ≠ a → False := Ne.irrefl
218+ theorem false_of_ne : a ≠ a → False := Ne.irrefl
219219
220- theorem neFalseOfSelf : p → p ≠ False :=
220+ theorem ne_false_of_self : p → p ≠ False :=
221221 fun (hp : p) (h : p = False) => h ▸ hp
222222
223- theorem neTrueOfNot : ¬p → p ≠ True :=
223+ theorem ne_true_of_not : ¬p → p ≠ True :=
224224 fun (hnp : ¬p) (h : p = True) =>
225225 have : ¬True := h ▸ hnp
226226 this trivial
227227
228- theorem trueNeFalse : ¬True = False :=
229- neFalseOfSelf trivial
228+ theorem true_ne_false : ¬True = False :=
229+ ne_false_of_self trivial
230230
231231end Ne
232232
@@ -248,37 +248,37 @@ theorem HEq.subst {p : (T : Sort u) → T → Prop} (h₁ : a ≅ b) (h₂ : p
248248theorem HEq.symm (h : a ≅ b) : b ≅ a :=
249249 HEq.ndrecOn (motive := fun x => x ≅ a) h (HEq.refl a)
250250
251- theorem heqOfEq (h : a = a') : a ≅ a' :=
251+ theorem heq_of_eq (h : a = a') : a ≅ a' :=
252252 Eq.subst h (HEq.refl a)
253253
254254theorem HEq.trans (h₁ : a ≅ b) (h₂ : b ≅ c) : a ≅ c :=
255255 HEq.subst h₂ h₁
256256
257- theorem heqOfHEqOfEq (h₁ : a ≅ b) (h₂ : b = b') : a ≅ b' :=
258- HEq.trans h₁ (heqOfEq h₂)
257+ theorem heq_of_heq_of_eq (h₁ : a ≅ b) (h₂ : b = b') : a ≅ b' :=
258+ HEq.trans h₁ (heq_of_eq h₂)
259259
260- theorem heqOfEqOfHEq (h₁ : a = a') (h₂ : a' ≅ b) : a ≅ b :=
261- HEq.trans (heqOfEq h₁) h₂
260+ theorem heq_of_eq_of_heq (h₁ : a = a') (h₂ : a' ≅ b) : a ≅ b :=
261+ HEq.trans (heq_of_eq h₁) h₂
262262
263- def typeEqOfHEq (h : a ≅ b) : α = β :=
263+ def type_eq_of_heq (h : a ≅ b) : α = β :=
264264 HEq.ndrecOn (motive := @fun (x : Sort u) _ => α = x) h (Eq.refl α)
265265
266266end
267267
268- theorem eqRecHEq {α : Sort u} {φ : α → Sort v} {a a' : α} : (h : a = a') → (p : φ a) → (Eq.recOn (motive := fun x _ => φ x) h p) ≅ p
268+ theorem eqRec_heq {α : Sort u} {φ : α → Sort v} {a a' : α} : (h : a = a') → (p : φ a) → (Eq.recOn (motive := fun x _ => φ x) h p) ≅ p
269269 | rfl, p => HEq.refl p
270270
271- theorem heqOfEqRecEq {α β : Sort u} {a : α} {b : β} (h₁ : α = β) (h₂ : Eq.rec (motive := fun α _ => α) a h₁ = b) : a ≅ b := by
271+ theorem heq_of_eqRec_eq {α β : Sort u} {a : α} {b : β} (h₁ : α = β) (h₂ : Eq.rec (motive := fun α _ => α) a h₁ = b) : a ≅ b := by
272272 subst h₁
273- apply heqOfEq
273+ apply heq_of_eq
274274 exact h₂
275275
276- theorem castHEq {α β : Sort u} : (h : α = β) → (a : α) → cast h a ≅ a
276+ theorem cast_heq {α β : Sort u} : (h : α = β) → (a : α) → cast h a ≅ a
277277 | rfl, a => HEq.refl a
278278
279279variable {a b c d : Prop }
280280
281- theorem iffIffImpliesAndImplies (a b : Prop ) : (a ↔ b) ↔ (a → b) ∧ (b → a) :=
281+ theorem iff_iff_implies_and_implies (a b : Prop ) : (a ↔ b) ↔ (a → b) ∧ (b → a) :=
282282 Iff.intro (fun h => And.intro h.mp h.mpr) (fun h => Iff.intro h.left h.right)
283283
284284theorem Iff.refl (a : Prop ) : a ↔ a :=
@@ -306,12 +306,12 @@ theorem Exists.elim {α : Sort u} {p : α → Prop} {b : Prop}
306306
307307/- Decidable -/
308308
309- theorem decideTrueEqTrue (h : Decidable True) : @decide True h = true :=
309+ theorem decide_true_eq_true (h : Decidable True) : @decide True h = true :=
310310 match h with
311311 | isTrue h => rfl
312312 | isFalse h => False.elim <| h ⟨⟩
313313
314- theorem decideFalseEqFalse (h : Decidable False) : @decide False h = false :=
314+ theorem decide_false_eq_false (h : Decidable False) : @decide False h = false :=
315315 match h with
316316 | isFalse h => rfl
317317 | isTrue h => False.elim h
@@ -320,20 +320,20 @@ theorem decideFalseEqFalse (h : Decidable False) : @decide False h = false :=
320320@[inline] def toBoolUsing {p : Prop } (d : Decidable p) : Bool :=
321321 decide p (h := d)
322322
323- theorem toBoolUsingEqTrue {p : Prop } (d : Decidable p) (h : p) : toBoolUsing d = true :=
324- decideEqTrue (s := d) h
323+ theorem toBoolUsing_eq_true {p : Prop } (d : Decidable p) (h : p) : toBoolUsing d = true :=
324+ decide_eq_true (s := d) h
325325
326- theorem ofBoolUsingEqTrue {p : Prop } {d : Decidable p} (h : toBoolUsing d = true ) : p :=
327- ofDecideEqTrue (s := d) h
326+ theorem ofBoolUsing_eq_true {p : Prop } {d : Decidable p} (h : toBoolUsing d = true ) : p :=
327+ of_decide_eq_true (s := d) h
328328
329- theorem ofBoolUsingEqFalse {p : Prop } {d : Decidable p} (h : toBoolUsing d = false ) : ¬ p :=
330- ofDecideEqFalse (s := d) h
329+ theorem ofBoolUsing_eq_false {p : Prop } {d : Decidable p} (h : toBoolUsing d = false ) : ¬ p :=
330+ of_decide_eq_false (s := d) h
331331
332332instance : Decidable True :=
333333 isTrue trivial
334334
335335instance : Decidable False :=
336- isFalse notFalse
336+ isFalse not_false
337337
338338namespace Decidable
339339variable {p q : Prop }
@@ -349,10 +349,10 @@ theorem em (p : Prop) [Decidable p] : p ∨ ¬p :=
349349theorem byContradiction [dec : Decidable p] (h : ¬p → False) : p :=
350350 byCases id (fun np => False.elim (h np))
351351
352- theorem ofNotNot [Decidable p] : ¬ ¬ p → p :=
352+ theorem of_not_not [Decidable p] : ¬ ¬ p → p :=
353353 fun hnn => byContradiction (fun hn => absurd hn hnn)
354354
355- theorem notAndIffOrNot (p q : Prop ) [d₁ : Decidable p] [d₂ : Decidable q] : ¬ (p ∧ q) ↔ ¬ p ∨ ¬ q :=
355+ theorem not_and_iff_or_not (p q : Prop ) [d₁ : Decidable p] [d₂ : Decidable q] : ¬ (p ∧ q) ↔ ¬ p ∨ ¬ q :=
356356 Iff.intro
357357 (fun h => match d₁, d₂ with
358358 | isTrue h₁, isTrue h₂ => absurd (And.intro h₁ h₂) h
@@ -396,28 +396,36 @@ instance {p q} [Decidable p] [Decidable q] : Decidable (p ↔ q) :=
396396
397397/- if-then-else expression theorems -/
398398
399- theorem ifPos {c : Prop } [h : Decidable c] (hc : c) {α : Sort u} {t e : α} : (ite c t e) = t :=
399+ theorem if_pos {c : Prop } [h : Decidable c] (hc : c) {α : Sort u} {t e : α} : (ite c t e) = t :=
400400 match h with
401401 | isTrue hc => rfl
402402 | isFalse hnc => absurd hc hnc
403403
404- theorem ifNeg {c : Prop } [h : Decidable c] (hnc : ¬c) {α : Sort u} {t e : α} : (ite c t e) = e :=
404+ -- TODO: delete
405+ theorem ifPos {c : Prop } [h : Decidable c] (hc : c) {α : Sort u} {t e : α} : (ite c t e) = t :=
406+ if_pos hc
407+
408+ theorem if_neg {c : Prop } [h : Decidable c] (hnc : ¬c) {α : Sort u} {t e : α} : (ite c t e) = e :=
405409 match h with
406410 | isTrue hc => absurd hc hnc
407411 | isFalse hnc => rfl
408412
409- theorem difPos {c : Prop } [h : Decidable c] (hc : c) {α : Sort u} {t : c → α} {e : ¬ c → α} : (dite c t e) = t hc :=
413+ -- TODO: delete
414+ theorem ifNeg {c : Prop } [h : Decidable c] (hnc : ¬c) {α : Sort u} {t e : α} : (ite c t e) = e :=
415+ if_neg hnc
416+
417+ theorem dif_pos {c : Prop } [h : Decidable c] (hc : c) {α : Sort u} {t : c → α} {e : ¬ c → α} : (dite c t e) = t hc :=
410418 match h with
411419 | isTrue hc => rfl
412420 | isFalse hnc => absurd hc hnc
413421
414- theorem difNeg {c : Prop } [h : Decidable c] (hnc : ¬c) {α : Sort u} {t : c → α} {e : ¬ c → α} : (dite c t e) = e hnc :=
422+ theorem dif_neg {c : Prop } [h : Decidable c] (hnc : ¬c) {α : Sort u} {t : c → α} {e : ¬ c → α} : (dite c t e) = e hnc :=
415423 match h with
416424 | isTrue hc => absurd hc hnc
417425 | isFalse hnc => rfl
418426
419427-- Remark: dite and ite are "defally equal" when we ignore the proofs.
420- theorem difEqIf (c : Prop ) [h : Decidable c] {α : Sort u} (t : α) (e : α) : dite c (fun h => t) (fun h => e) = ite c t e :=
428+ theorem dif_eq_if (c : Prop ) [h : Decidable c] {α : Sort u} (t : α) (e : α) : dite c (fun h => t) (fun h => e) = ite c t e :=
421429 match h with
422430 | isTrue hc => rfl
423431 | isFalse hnc => rfl
@@ -448,7 +456,7 @@ protected def Nonempty.elim {α : Sort u} {p : Prop} (h₁ : Nonempty α) (h₂
448456instance {α : Sort u} [Inhabited α] : Nonempty α :=
449457 ⟨arbitrary⟩
450458
451- theorem nonemptyOfExists {α : Sort u} {p : α → Prop } : Exists (fun x => p x) → Nonempty α
459+ theorem nonempty_of_exists {α : Sort u} {p : α → Prop } : Exists (fun x => p x) → Nonempty α
452460 | ⟨w, h⟩ => ⟨w⟩
453461
454462/- Subsingleton -/
@@ -461,7 +469,7 @@ protected def Subsingleton.elim {α : Sort u} [h : Subsingleton α] : (a b : α)
461469
462470protected def Subsingleton.helim {α β : Sort u} [h₁ : Subsingleton α] (h₂ : α = β) (a : α) (b : β) : a ≅ b := by
463471 subst h₂
464- apply heqOfEq
472+ apply heq_of_eq
465473 apply Subsingleton.elim
466474
467475instance (p : Prop ) : Subsingleton p :=
@@ -580,7 +588,7 @@ instance prodHasDecidableLt
580588 : (s t : α × β) → Decidable (s < t) :=
581589 fun t s => inferInstanceAs (Decidable (_ ∨ _))
582590
583- theorem Prod.ltDef [LT α] [LT β] (s t : α × β) : (s < t) = (s.1 < t.1 ∨ (s.1 = t.1 ∧ s.2 < t.2 )) :=
591+ theorem Prod.lt_def [LT α] [LT β] (s t : α × β) : (s < t) = (s.1 < t.1 ∨ (s.1 = t.1 ∧ s.2 < t.2 )) :=
584592 rfl
585593
586594theorem Prod.ext (p : α × β) : (p.1 , p.2 ) = p := by
@@ -592,7 +600,7 @@ def Prod.map {α₁ : Type u₁} {α₂ : Type u₂} {β₁ : Type v₁} {β₂
592600
593601/- Dependent products -/
594602
595- theorem exOfPsig {α : Type u} {p : α → Prop } : (PSigma (fun x => p x)) → Exists (fun x => p x)
603+ theorem ex_of_PSigma {α : Type u} {p : α → Prop } : (PSigma (fun x => p x)) → Exists (fun x => p x)
596604 | ⟨x, hx⟩ => ⟨x, hx⟩
597605
598606protected theorem PSigma.eta {α : Sort u} {β : α → Sort v} {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂}
@@ -669,7 +677,7 @@ gen_injective_theorems% Lean.Syntax
669677/- Quotients -/
670678
671679-- Iff can now be used to do substitutions in a calculation
672- theorem iffSubst {a b : Prop } {p : Prop → Prop } (h₁ : a ↔ b) (h₂ : p a) : p b :=
680+ theorem Iff.subst {a b : Prop } {p : Prop → Prop } (h₁ : a ↔ b) (h₂ : p a) : p b :=
673681 Eq.subst (propext h₁) h₂
674682
675683namespace Quot
@@ -697,7 +705,7 @@ protected theorem inductionOn {α : Sort u} {r : α → α → Prop} {motive : Q
697705 : motive q :=
698706 ind h q
699707
700- theorem existsRep {α : Sort u} {r : α → α → Prop } (q : Quot r) : Exists (fun a => (Quot.mk r a) = q) :=
708+ theorem exists_rep {α : Sort u} {r : α → α → Prop } (q : Quot r) : Exists (fun a => (Quot.mk r a) = q) :=
701709 Quot.inductionOn (motive := fun q => Exists (fun a => (Quot.mk r a) = q)) q (fun a => ⟨a, rfl⟩)
702710
703711section
@@ -751,7 +759,7 @@ protected abbrev hrecOn
751759 (c : (a b : α) → (p : r a b) → f a ≅ f b)
752760 : motive q :=
753761 Quot.recOn q f fun a b p => eqOfHEq <|
754- have p₁ : Eq.ndrec (f a) (sound p) ≅ f a := eqRecHEq (sound p) (f a)
762+ have p₁ : Eq.ndrec (f a) (sound p) ≅ f a := eqRec_heq (sound p) (f a)
755763 HEq.trans p₁ (c a b p)
756764
757765end
@@ -784,8 +792,8 @@ protected theorem inductionOn {α : Sort u} [s : Setoid α] {motive : Quotient s
784792 : motive q :=
785793 Quot.inductionOn q h
786794
787- theorem existsRep {α : Sort u} [s : Setoid α] (q : Quotient s) : Exists (fun (a : α) => Quotient.mk a = q) :=
788- Quot.existsRep q
795+ theorem exists_rep {α : Sort u} [s : Setoid α] (q : Quotient s) : Exists (fun (a : α) => Quotient.mk a = q) :=
796+ Quot.exists_rep q
789797
790798section
791799variable {α : Sort u}
@@ -895,11 +903,11 @@ private def rel [s : Setoid α] (q₁ q₂ : Quotient s) : Prop :=
895903private theorem rel.refl [s : Setoid α] (q : Quotient s) : rel q q :=
896904 Quot.inductionOn (motive := fun q => rel q q) q (fun a => Setoid.refl a)
897905
898- private theorem eqImpRel [s : Setoid α] {q₁ q₂ : Quotient s} : q₁ = q₂ → rel q₁ q₂ :=
906+ private theorem rel_of_eq [s : Setoid α] {q₁ q₂ : Quotient s} : q₁ = q₂ → rel q₁ q₂ :=
899907 fun h => Eq.ndrecOn h (rel.refl q₁)
900908
901909theorem exact [s : Setoid α] {a b : α} : Quotient.mk a = Quotient.mk b → a ≈ b :=
902- fun h => eqImpRel h
910+ fun h => rel_of_eq h
903911
904912end Exact
905913
0 commit comments