Skip to content

Commit e393bae

Browse files
chore: tidy various files (#14485)
1 parent 38e09f6 commit e393bae

File tree

33 files changed

+106
-106
lines changed

33 files changed

+106
-106
lines changed

Mathlib/Algebra/Group/Action/Opposite.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ open MulOpposite
154154
See also `Monoid.toOppositeMulAction` and `MonoidWithZero.toOppositeMulActionWithZero`. -/
155155
@[to_additive "Like `Add.toVAdd`, but adds on the right.
156156
157-
See also `AddMonoid.to_OppositeAddAction`."]
157+
See also `AddMonoid.toOppositeAddAction`."]
158158
instance Mul.toHasOppositeSMul [Mul α] : SMul αᵐᵒᵖ α where smul c x := x * c.unop
159159
#align has_mul.to_has_opposite_smul Mul.toHasOppositeSMul
160160
#align has_add.to_has_opposite_vadd Add.toHasOppositeVAdd

Mathlib/Analysis/Convex/Radon.lean

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,11 @@ theorem helly_theorem' {F : ι → Set E} {s : Finset ι}
8989
/- Construct a family of vectors indexed by `ι` such that the vector corresponding to `i : ι`
9090
is an arbitrary element of the intersection of all `F j` except `F i`. -/
9191
let a (i : s) : E := Set.Nonempty.some (s := ⋂ j ∈ (s.erase i), F j) <| by
92-
let s' := s.erase i
93-
apply hk (s := s')
94-
· exact fun i hi ↦h_convex i (mem_of_mem_erase hi)
92+
apply hk (s := s.erase i)
93+
· exact fun i hi ↦ h_convex i (mem_of_mem_erase hi)
9594
· intro J hJ_ss hJ_card
96-
apply h_inter J <| subset_trans hJ_ss (erase_subset i.val s)
97-
assumption
98-
· simp only [coe_mem, card_erase_of_mem, s']; omega
95+
exact h_inter J (subset_trans hJ_ss (erase_subset i.val s)) hJ_card
96+
· simp only [coe_mem, card_erase_of_mem]; omega
9997
/- This family of vectors is not affine independent because the number of them exceeds the
10098
dimension of the space. -/
10199
have h_ind : ¬AffineIndependent 𝕜 a := by
@@ -145,7 +143,7 @@ theorem helly_theorem {F : ι → Set E} {s : Finset ι}
145143
apply helly_theorem' h_convex
146144
intro I hI_ss hI_card
147145
obtain ⟨J, hI_ss_J, hJ_ss, hJ_card⟩ := exists_subsuperset_card_eq hI_ss hI_card h_card
148-
apply Set.Nonempty.mono <| biInter_mono hI_ss_J (by intro _ _; rfl)
146+
apply Set.Nonempty.mono <| biInter_mono hI_ss_J (fun _ _ ↦ Set.Subset.rfl)
149147
exact h_inter J hJ_ss hJ_card
150148

151149
/-- **Helly's theorem** for finite sets of convex sets.
@@ -190,7 +188,7 @@ theorem helly_theorem_compact' [TopologicalSpace E] [T2Space E] {F : ι → Set
190188
(⋂ i, F i).Nonempty := by
191189
/- If `ι` is empty the statement is trivial. -/
192190
cases' isEmpty_or_nonempty ι with _ h_nonempty
193-
simp only [iInter_of_empty, Set.univ_nonempty]
191+
· simp only [iInter_of_empty, Set.univ_nonempty]
194192
/- By the finite version of theorem, every finite subfamily has an intersection. -/
195193
have h_fin (I : Finset ι) : (⋂ i ∈ I, F i).Nonempty := by
196194
apply helly_theorem' (s := I) (𝕜 := 𝕜) (by simp [h_convex])

Mathlib/CategoryTheory/Monad/Coequalizer.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ In `C`, this cofork diagram is a split coequalizer (in particular, it is still a
1919
This split coequalizer is known as the Beck coequalizer (as it features heavily in Beck's
2020
monadicity theorem).
2121
22-
This file has been adapted to `CategoryTheory.Monad.Equalizer`. Please try to keep them in sync.
22+
This file has been adapted to `Mathlib.CategoryTheory.Monad.Equalizer`.
23+
Please try to keep them in sync.
2324
2425
-/
2526

Mathlib/CategoryTheory/Monad/Equalizer.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ In `C`, this fork diagram is a split equalizer (in particular, it is still an eq
1717
This split equalizer is known as the Beck equalizer (as it features heavily in Beck's
1818
comonadicity theorem).
1919
20-
This file is adapted from `CategoryTheory.Monad.Coequalizer`. Please try to keep them in sync.
20+
This file is adapted from `Mathlib.CategoryTheory.Monad.Coequalizer`.
21+
Please try to keep them in sync.
2122
2223
-/
2324

Mathlib/Combinatorics/SimpleGraph/Matching.lean

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ one edge, and the edges of the subgraph represent the paired vertices.
2323
2424
* `SimpleGraph.Subgraph.IsMatching`: `M.IsMatching` means that `M` is a matching of its
2525
underlying graph.
26-
denoted `M.is_matching`.
2726
2827
* `SimpleGraph.Subgraph.IsPerfectMatching` defines when a subgraph `M` of a simple graph is a
2928
perfect matching, denoted `M.IsPerfectMatching`.
@@ -36,7 +35,7 @@ one edge, and the edges of the subgraph represent the paired vertices.
3635
3736
* Tutte's Theorem
3837
39-
* Hall's Marriage Theorem (see Combinatorics.Hall.Basic)
38+
* Hall's Marriage Theorem (see `Mathlib.Combinatorics.Hall.Basic`)
4039
-/
4140

4241
open Function
@@ -156,28 +155,28 @@ lemma even_card_of_isPerfectMatching (c : ConnectedComponent G) (hM : M.IsPerfec
156155
lemma odd_matches_node_outside {u : Set V} {c : ConnectedComponent (Subgraph.deleteVerts ⊤ u).coe}
157156
(hM : M.IsPerfectMatching) (codd : Odd (Nat.card c.supp)) :
158157
∃ᵉ (w ∈ u) (v : ((⊤ : G.Subgraph).deleteVerts u).verts), M.Adj v w ∧ v ∈ c.supp := by
159-
by_contra! h
160-
have hMmatch : (M.induce c.supp).IsMatching := by
161-
intro v hv
162-
obtain ⟨w, hw⟩ := hM.1 (hM.2 v)
163-
obtain ⟨⟨v', hv'⟩, ⟨hv , rfl⟩⟩ := hv
164-
use w
165-
have hwnu : w ∉ u := fun hw' ↦ h w hw' ⟨v', hv'⟩ (hw.1) hv
166-
refine ⟨⟨⟨⟨v', hv'⟩, hv, rfl⟩, ?_, hw.1⟩, fun _ hy ↦ hw.2 _ hy.2.2
167-
apply ConnectedComponent.mem_coe_supp_of_adj ⟨⟨v', hv'⟩, ⟨hv, rfl⟩⟩ ⟨by trivial, hwnu⟩
168-
simp only [Subgraph.induce_verts, Subgraph.verts_top, Set.mem_diff, Set.mem_univ, true_and,
169-
Subgraph.induce_adj, hwnu, not_false_eq_true, and_self, Subgraph.top_adj, M.adj_sub hw.1,
170-
and_true] at hv' ⊢
171-
trivial
172-
173-
apply Nat.odd_iff_not_even.mp codd
174-
haveI : Fintype ↑(Subgraph.induce M (Subtype.val '' supp c)).verts := Fintype.ofFinite _
175-
have hMeven := Subgraph.IsMatching.even_card hMmatch
176-
haveI : Fintype (c.supp) := Fintype.ofFinite _
177-
simp only [Subgraph.induce_verts, Subgraph.verts_top, Set.toFinset_image,
178-
Nat.card_eq_fintype_card, Set.toFinset_image,
179-
Finset.card_image_of_injective _ (Subtype.val_injective), Set.toFinset_card] at hMeven ⊢
180-
exact hMeven
158+
by_contra! h
159+
have hMmatch : (M.induce c.supp).IsMatching := by
160+
intro v hv
161+
obtain ⟨w, hw⟩ := hM.1 (hM.2 v)
162+
obtain ⟨⟨v', hv'⟩, ⟨hv , rfl⟩⟩ := hv
163+
use w
164+
have hwnu : w ∉ u := fun hw' ↦ h w hw' ⟨v', hv'⟩ (hw.1) hv
165+
refine ⟨⟨⟨⟨v', hv'⟩, hv, rfl⟩, ?_, hw.1⟩, fun _ hy ↦ hw.2 _ hy.2.2
166+
apply ConnectedComponent.mem_coe_supp_of_adj ⟨⟨v', hv'⟩, ⟨hv, rfl⟩⟩ ⟨by trivial, hwnu⟩
167+
simp only [Subgraph.induce_verts, Subgraph.verts_top, Set.mem_diff, Set.mem_univ, true_and,
168+
Subgraph.induce_adj, hwnu, not_false_eq_true, and_self, Subgraph.top_adj, M.adj_sub hw.1,
169+
and_true] at hv' ⊢
170+
trivial
171+
172+
apply Nat.odd_iff_not_even.mp codd
173+
haveI : Fintype ↑(Subgraph.induce M (Subtype.val '' supp c)).verts := Fintype.ofFinite _
174+
have hMeven := Subgraph.IsMatching.even_card hMmatch
175+
haveI : Fintype (c.supp) := Fintype.ofFinite _
176+
simp only [Subgraph.induce_verts, Subgraph.verts_top, Set.toFinset_image,
177+
Nat.card_eq_fintype_card, Set.toFinset_image,
178+
Finset.card_image_of_injective _ (Subtype.val_injective), Set.toFinset_card] at hMeven ⊢
179+
exact hMeven
181180

182181
end Finite
183182
end ConnectedComponent

Mathlib/Data/LazyList/Basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ instance : LawfulMonad LazyList := LawfulMonad.mk'
171171
(bind_pure_comp := by
172172
intro _ _ f xs
173173
simp only [bind, Functor.map, pure, singleton]
174-
induction xs using LazyList.traverse.induct (m := @Id) (f := f)
175-
case case1 =>
174+
induction xs using LazyList.traverse.induct (m := @Id) (f := f) with
175+
| case1 =>
176176
simp only [Thunk.pure, LazyList.bind, LazyList.traverse, Id.pure_eq]
177-
case case2 ih =>
177+
| case2 _ _ ih =>
178178
simp only [LazyList.bind, LazyList.traverse, Seq.seq, Id.map_eq, append, Thunk.pure]
179179
rw [← ih]
180180
simp [Thunk.pure, Thunk.get, append])

Mathlib/Data/Matroid/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,8 @@ theorem Indep.exists_insert_of_not_base (hI : M.Indep I) (hI' : ¬M.Base I) (hB
616616
∃ e ∈ B \ I, M.Indep (insert e I) := by
617617
obtain ⟨B', hB', hIB'⟩ := hI.exists_base_superset
618618
obtain ⟨x, hxB', hx⟩ := exists_of_ssubset (hIB'.ssubset_of_ne (by (rintro rfl; exact hI' hB')))
619-
obtain (hxB | hxB) := em (x ∈ B)
620-
· exact ⟨x, ⟨hxB, hx⟩, hB'.indep.subset (insert_subset hxB' hIB')
619+
by_cases hxB : x ∈ B
620+
· exact ⟨x, ⟨hxB, hx⟩, hB'.indep.subset (insert_subset hxB' hIB')⟩
621621
obtain ⟨e,he, hBase⟩ := hB'.exchange hB ⟨hxB',hxB⟩
622622
exact ⟨e, ⟨he.1, not_mem_subset hIB' he.2⟩,
623623
indep_iff.2 ⟨_, hBase, insert_subset_insert (subset_diff_singleton hIB' hx)⟩⟩

Mathlib/Data/Matroid/IndepAxioms.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ namespace IndepMatroid
110110
Base := (· ∈ maximals (· ⊆ ·) {I | M.Indep I})
111111
Indep := M.Indep
112112
indep_iff' := by
113-
refine fun I ↦ ⟨fun h ↦ ?_, fun ⟨B,⟨h,_⟩,hIB'⟩ ↦ M.indep_subset h hIB'⟩
113+
refine fun I ↦ ⟨fun h ↦ ?_, fun ⟨B, ⟨h, _⟩, hIB'⟩ ↦ M.indep_subset h hIB'⟩
114114
obtain ⟨B, hB⟩ := M.indep_maximal M.E Subset.rfl I h (M.subset_ground I h)
115115
simp only [mem_maximals_iff, mem_setOf_eq, and_imp] at hB ⊢
116116
exact ⟨B, ⟨hB.1.1,fun J hJ hBJ ↦ hB.2 hJ (hB.1.2.1.trans hBJ) (M.subset_ground J hJ) hBJ⟩,

Mathlib/Data/Nat/Prime/Defs.lean

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,15 @@ theorem minFac_prime {n : ℕ} (n1 : n ≠ 1) : Prime (minFac n) :=
325325
#align nat.min_fac_prime Nat.minFac_prime
326326

327327
theorem minFac_le_of_dvd {n : ℕ} : ∀ {m : ℕ}, 2 ≤ m → m ∣ n → minFac n ≤ m := by
328-
by_cases n1 : n = 1 <;> [exact fun m2 _ => n1.symm ▸ le_trans (by simp) m2;
329-
apply (minFac_has_prop n1).2.2]
328+
by_cases n1 : n = 1
329+
· exact fun m2 _ => n1.symm ▸ le_trans (by simp) m2
330+
· apply (minFac_has_prop n1).2.2
330331
#align nat.min_fac_le_of_dvd Nat.minFac_le_of_dvd
331332

332333
theorem minFac_pos (n : ℕ) : 0 < minFac n := by
333-
by_cases n1 : n = 1 <;> [exact n1.symm ▸ (by simp); exact (minFac_prime n1).pos]
334+
by_cases n1 : n = 1
335+
· simp [n1]
336+
· exact (minFac_prime n1).pos
334337
#align nat.min_fac_pos Nat.minFac_pos
335338

336339
theorem minFac_le {n : ℕ} (H : 0 < n) : minFac n ≤ n :=

Mathlib/Data/Real/EReal.lean

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,25 +1320,25 @@ lemma le_iff_le_forall_real_gt (x y : EReal) : (∀ z : ℝ, x < z → y ≤ z)
13201320

13211321
lemma ge_iff_le_forall_real_lt (x y : EReal) : (∀ z : ℝ, z < y → z ≤ x) ↔ y ≤ x := by
13221322
refine ⟨fun h ↦ ?_, fun h z z_lt_y ↦ le_trans (le_of_lt z_lt_y) h⟩
1323-
induction x
1324-
case h_bot =>
1323+
induction x with
1324+
| h_bot =>
13251325
refine ((eq_bot_iff_forall_lt y).2 fun z ↦ ?_).le
13261326
refine lt_of_not_le fun z_le_y ↦ (not_le_of_lt (bot_lt_coe (z - 1)) (h (z - 1)
13271327
(lt_of_lt_of_le ?_ z_le_y)))
13281328
exact_mod_cast sub_one_lt z
1329-
case h_real =>
1330-
induction y
1331-
case h_bot => exact bot_le
1332-
case h_real x y =>
1329+
| h_real x =>
1330+
induction y with
1331+
| h_bot => exact bot_le
1332+
| h_real y =>
13331333
norm_cast at h ⊢
13341334
by_contra! x_lt_y
13351335
rcases exists_between x_lt_y with ⟨z, x_lt_z, z_lt_y⟩
13361336
exact not_le_of_lt x_lt_z (h z z_lt_y)
1337-
case h_top x =>
1337+
| h_top =>
13381338
exfalso
13391339
norm_cast at h
13401340
exact not_le_of_lt (lt_add_one x) <| h (x + 1) (coe_lt_top (x + 1))
1341-
case h_top => exact le_top
1341+
| h_top => exact le_top
13421342

13431343
/-! ### Absolute value -/
13441344

0 commit comments

Comments
 (0)