Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit eb616cf

Browse files
committed
chore(*): split long lines (#2913)
1 parent b95f165 commit eb616cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+349
-198
lines changed

docs/tutorial/category_theory/Ab.lean

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ open category_theory
1010
open category_theory.limits
1111

1212
/-!
13-
Some small examples of using limits and colimits in `Ab`, the category of additive commutative groups.
13+
Some small examples of using limits and colimits in `Ab`, the category of additive commutative
14+
groups.
1415
-/
1516

1617
example (G H : Ab) (f : G ⟶ H) : Ab := kernel f
17-
example (G H : Ab) (f : G ⟶ H) [epi f] : kernel (cokernel.π f) ≅ H := as_iso (kernel.ι (cokernel.π f))
18+
example (G H : Ab) (f : G ⟶ H) [epi f] : kernel (cokernel.π f) ≅ H :=
19+
as_iso (kernel.ι (cokernel.π f))
1820

1921
-- TODO no images yet...

docs/tutorial/category_theory/intro.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ functor.
136136

137137
section functor
138138

139-
universes v₁ v₂ v₃ u₁ u₂ u₃ -- recall we put morphism universes (`vᵢ`) before object universes (`uᵢ`)
139+
-- recall we put morphism universes (`vᵢ`) before object universes (`uᵢ`)
140+
universes v₁ v₂ v₃ u₁ u₂ u₃
140141

141142
variables (C : Type u₁) [𝒞 : category.{v₁} C]
142143
variables (D : Type u₂) [𝒟 : category.{v₂} D]

roadmap/topology/shrinking_lemma.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ open set
2121

2222
universes u v
2323

24-
/-- A point-finite open cover of a closed subset of a normal space can be "shrunk" to a new open cover
25-
so that the closure of each new open set is contained in the corresponding original open set. -/
24+
/-- A point-finite open cover of a closed subset of a normal space can be "shrunk" to a new open
25+
cover so that the closure of each new open set is contained in the corresponding original open
26+
set. -/
2627
lemma shrinking_lemma {X : Type u} [topological_space X] [normal_space X]
2728
{s : set X} (hs : is_closed s) {α : Type v} (u : α → set X) (uo : ∀ a, is_open (u a))
2829
(uf : ∀ x, finite {a | x ∈ u a}) (su : s ⊆ Union u) :

src/data/equiv/encodable.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,8 @@ Choice function for encodable types and decidable predicates.
305305
We provide the following API
306306
307307
choose {α : Type*} {p : α → Prop} [c : encodable α] [d : decidable_pred p] : (∃ x, p x) → α :=
308-
choose_spec {α : Type*} {p : α → Prop} [c : encodable α] [d : decidable_pred p] (ex : ∃ x, p x) : p (choose ex) :=
308+
choose_spec {α : Type*} {p : α → Prop} [c : encodable α] [d : decidable_pred p] (ex : ∃ x, p x) :
309+
p (choose ex) :=
309310
-/
310311

311312
namespace encodable

src/data/equiv/list.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ finset.univ.sort (encodable.encode' α ⁻¹'o (≤))
123123
theorem mem_sorted_univ {α} [fintype α] [encodable α] (x : α) : x ∈ sorted_univ α :=
124124
(finset.mem_sort _).2 (finset.mem_univ _)
125125

126-
theorem length_sorted_univ {α} [fintype α] [encodable α] : (sorted_univ α).length = fintype.card α :=
126+
theorem length_sorted_univ {α} [fintype α] [encodable α] :
127+
(sorted_univ α).length = fintype.card α :=
127128
finset.length_sort _
128129

129130
theorem sorted_univ_nodup {α} [fintype α] [encodable α] : (sorted_univ α).nodup :=

src/data/equiv/local_equiv.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ structure local_equiv (α : Type*) (β : Type*) :=
7777
(left_inv' : ∀{x}, x ∈ source → inv_fun (to_fun x) = x)
7878
(right_inv' : ∀{x}, x ∈ target → to_fun (inv_fun x) = x)
7979

80-
-- attribute [simp] local_equiv.left_inv local_equiv.right_inv local_equiv.map_source local_equiv.map_target
81-
8280
/-- Associating a local_equiv to an equiv-/
8381
def equiv.to_local_equiv (e : equiv α β) : local_equiv α β :=
8482
{ to_fun := e.to_fun,

src/data/fin_enum.lean

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ def of_equiv (α) {β} [fin_enum α] (h : β ≃ α) : fin_enum β :=
3434
dec_eq := equiv.decidable_eq_of_equiv (h.trans (equiv _)) }
3535

3636
/-- create a `fin_enum` instance from an exhaustive list without duplicates -/
37-
def of_nodup_list [decidable_eq α] (xs : list α) (h : ∀ x : α, x ∈ xs) (h' : list.nodup xs) : fin_enum α :=
37+
def of_nodup_list [decidable_eq α] (xs : list α) (h : ∀ x : α, x ∈ xs) (h' : list.nodup xs) :
38+
fin_enum α :=
3839
{ card := xs.length,
3940
equiv := ⟨λ x, ⟨xs.index_of x,by rw [list.index_of_lt_length]; apply h⟩,
4041
λ ⟨i,h⟩, xs.nth_le _ h,
4142
λ x, by simp [of_nodup_list._match_1],
42-
λ ⟨i,h⟩, by simp [of_nodup_list._match_1,*]; rw list.nth_le_index_of; apply list.nodup_erase_dup ⟩ }
43+
λ ⟨i,h⟩, by simp [of_nodup_list._match_1,*]; rw list.nth_le_index_of;
44+
apply list.nodup_erase_dup ⟩ }
4345

4446
/-- create a `fin_enum` instance from an exhaustive list; duplicates are removed -/
4547
def of_list [decidable_eq α] (xs : list α) (h : ∀ x : α, x ∈ xs) : fin_enum α :=
@@ -62,7 +64,8 @@ def of_surjective {β} (f : β → α) [decidable_eq α] [fin_enum β] (h : surj
6264
of_list ((to_list β).map f) (by intro; simp; exact h _)
6365

6466
/-- create a `fin_enum` instance using an injection -/
65-
noncomputable def of_injective {α β} (f : α → β) [decidable_eq α] [fin_enum β] (h : injective f) : fin_enum α :=
67+
noncomputable def of_injective {α β} (f : α → β) [decidable_eq α] [fin_enum β] (h : injective f) :
68+
fin_enum α :=
6669
of_list ((to_list β).filter_map (partial_inv f))
6770
begin
6871
intro x,
@@ -100,7 +103,8 @@ def finset.enum [decidable_eq α] : list α → list (finset α)
100103
do r ← finset.enum xs,
101104
[r,{x} ∪ r]
102105

103-
@[simp] lemma finset.mem_enum [decidable_eq α] (s : finset α) (xs : list α) : s ∈ finset.enum xs ↔ ∀ x ∈ s, x ∈ xs :=
106+
@[simp]lemma finset.mem_enum [decidable_eq α] (s : finset α) (xs : list α) :
107+
s ∈ finset.enum xs ↔ ∀ x ∈ s, x ∈ xs :=
104108
begin
105109
induction xs generalizing s; simp [*,finset.enum],
106110
{ simp [finset.eq_empty_iff_forall_not_mem,(∉)], refl },
@@ -116,7 +120,8 @@ begin
116120
existsi h,
117121
by_cases xs_hd ∈ s,
118122
{ have : {xs_hd} ⊆ s, simp only [has_subset.subset, *, forall_eq, mem_singleton],
119-
simp only [union_sdiff_of_subset this, or_true, finset.union_sdiff_of_subset, eq_self_iff_true], },
123+
simp only [union_sdiff_of_subset this, or_true, finset.union_sdiff_of_subset,
124+
eq_self_iff_true], },
120125
{ left, symmetry, simp only [sdiff_eq_self],
121126
intro a, simp only [and_imp, mem_inter, mem_singleton, not_mem_empty],
122127
intros h₀ h₁, subst a, apply h h₀, } }
@@ -126,7 +131,8 @@ instance finset.fin_enum [fin_enum α] : fin_enum (finset α) :=
126131
of_list (finset.enum (to_list α)) (by intro; simp)
127132

128133
instance subtype.fin_enum [fin_enum α] (p : α → Prop) [decidable_pred p] : fin_enum {x // p x} :=
129-
of_list ((to_list α).filter_map $ λ x, if h : p x then some ⟨_,h⟩ else none) (by rintro ⟨x,h⟩; simp; existsi x; simp *)
134+
of_list ((to_list α).filter_map $ λ x, if h : p x then some ⟨_,h⟩ else none)
135+
(by rintro ⟨x,h⟩; simp; existsi x; simp *)
130136

131137
instance (β : α → Type*)
132138
[fin_enum α] [∀ a, fin_enum (β a)] : fin_enum (sigma β) :=
@@ -175,12 +181,14 @@ def pi.tail {α : Type*} {β : α → Type*} {x : α} {xs : list α}
175181
| a h := f a (list.mem_cons_of_mem _ h)
176182

177183
/-- `pi xs f` creates the list of functions `g` such that, for `x ∈ xs`, `g x ∈ f x` -/
178-
def pi {α : Type*} {β : α → Type*} [decidable_eq α] : Π xs : list α, (Π a, list (β a)) → list (Π a, a ∈ xs → β a)
184+
def pi {α : Type*} {β : α → Type*} [decidable_eq α] : Π xs : list α, (Π a, list (β a)) →
185+
list (Π a, a ∈ xs → β a)
179186
| [] fs := [λ x h, h.elim]
180187
| (x :: xs) fs :=
181188
fin_enum.pi.cons x xs <$> fs x <*> pi xs fs
182189

183-
lemma mem_pi {α : Type*} {β : α → Type*} [fin_enum α] [∀a, fin_enum (β a)] (xs : list α) (f : Π a, a ∈ xs → β a) :
190+
lemma mem_pi {α : Type*} {β : α → Type*} [fin_enum α] [∀a, fin_enum (β a)] (xs : list α)
191+
(f : Π a, a ∈ xs → β a) :
184192
f ∈ pi xs (λ x, to_list (β x)) :=
185193
begin
186194
induction xs; simp [pi,-list.map_eq_map] with monad_norm functor_norm,
@@ -196,7 +204,8 @@ end
196204
def pi.enum {α : Type*} (β : α → Type*) [fin_enum α] [∀a, fin_enum (β a)] : list (Π a, β a) :=
197205
(pi (to_list α) (λ x, to_list (β x))).map (λ f x, f x (mem_to_list _))
198206

199-
lemma pi.mem_enum {α : Type*} {β : α → Type*} [fin_enum α] [∀a, fin_enum (β a)] (f : Π a, β a) : f ∈ pi.enum β :=
207+
lemma pi.mem_enum {α : Type*} {β : α → Type*} [fin_enum α] [∀a, fin_enum (β a)] (f : Π a, β a) :
208+
f ∈ pi.enum β :=
200209
by simp [pi.enum]; refine ⟨λ a h, f a, mem_pi _ _, rfl⟩
201210

202211
instance pi.fin_enum {α : Type*} {β : α → Type*}

0 commit comments

Comments
 (0)