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

Commit ffad43d

Browse files
committed
golf(*): λ _, defaultdefault (#14608)
1 parent 60454dd commit ffad43d

File tree

22 files changed

+31
-32
lines changed

22 files changed

+31
-32
lines changed

src/computability/turing_machine.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ structure {u v} pointed_map (Γ : Type u) (Γ' : Type v)
302302
(f : Γ → Γ') (map_pt' : f default = default)
303303

304304
instance {Γ Γ'} [inhabited Γ] [inhabited Γ'] : inhabited (pointed_map Γ Γ') :=
305-
⟨⟨λ _, default, rfl⟩⟩
305+
⟨⟨default, rfl⟩⟩
306306

307307
instance {Γ Γ'} [inhabited Γ] [inhabited Γ'] : has_coe_to_fun (pointed_map Γ Γ') (λ _, Γ → Γ') :=
308308
⟨pointed_map.f⟩

src/data/array/lemmas.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace d_array
1212
variables {n : ℕ} {α : fin n → Type u}
1313

1414
instance [∀ i, inhabited (α i)] : inhabited (d_array n α) :=
15-
⟨⟨λ _, default⟩⟩
15+
⟨⟨default⟩⟩
1616

1717
end d_array
1818

src/data/finset/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2588,7 +2588,7 @@ def sigma_equiv_option_of_inhabited (α : Type u) [inhabited α] [decidable_eq
25882588
Σ (β : Type u), α ≃ option β :=
25892589
⟨{x : α // x ≠ default},
25902590
{ to_fun := λ (x : α), if h : x = default then none else some ⟨x, h⟩,
2591-
inv_fun := λ o, option.elim o (default) coe,
2591+
inv_fun := λ o, option.elim o default coe,
25922592
left_inv := λ x, by { dsimp only, split_ifs; simp [*] },
25932593
right_inv := begin
25942594
rintro (_|⟨x,h⟩),

src/data/holor.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ open_locale big_operators
3838

3939
/-- `holor_index ds` is the type of valid index tuples used to identify an entry of a holor
4040
of dimensions `ds`. -/
41-
def holor_index (ds : list ℕ) : Type := { is : list ℕ // forall₂ (<) is ds}
41+
def holor_index (ds : list ℕ) : Type := {is : list ℕ // forall₂ (<) is ds}
4242

4343
namespace holor_index
4444
variables {ds₁ ds₂ ds₃ : list ℕ}
@@ -80,7 +80,7 @@ lemma drop_drop :
8080
end holor_index
8181

8282
/-- Holor (indexed collections of tensor coefficients) -/
83-
def holor (α : Type u) (ds:list ℕ) := holor_index ds → α
83+
def holor (α : Type u) (ds : list ℕ) := holor_index ds → α
8484

8585
namespace holor
8686

src/data/pfunctor/multivariate/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def map {α β : typevec n} (f : α ⟹ β) : P.obj α → P.obj β :=
3737
λ ⟨a, g⟩, ⟨a, typevec.comp f g⟩
3838

3939
instance : inhabited (mvpfunctor n) :=
40-
⟨default, λ _, default⟩
40+
⟨⟨default, default⟩⟩
4141

4242
instance obj.inhabited {α : typevec n} [inhabited P.A] [Π i, inhabited (α i)] :
4343
inhabited (P.obj α) :=

src/data/pfunctor/univariate/M.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ lemma M.default_consistent [inhabited F.A] :
170170
| (succ n) := agree.intro _ _ $ λ _, M.default_consistent n
171171

172172
instance M.inhabited [inhabited F.A] : inhabited (M F) :=
173-
⟨ { approx := λ n, default,
173+
⟨ { approx := default,
174174
consistent := M.default_consistent _ } ⟩
175175

176176
instance M_intl.inhabited [inhabited F.A] : inhabited (M_intl F) :=

src/data/pfunctor/univariate/basic.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ def obj (α : Type*) := Σ x : P.A, P.B x → α
4141
def map {α β : Type*} (f : α → β) : P.obj α → P.obj β :=
4242
λ ⟨a, g⟩, ⟨a, f ∘ g⟩
4343

44-
instance obj.inhabited [inhabited P.A] [inhabited α] : inhabited (P.obj α) :=
45-
⟨ ⟨ default, λ _, default ⟩ ⟩
44+
instance obj.inhabited [inhabited P.A] [inhabited α] : inhabited (P.obj α) := ⟨⟨default, default⟩⟩
4645
instance : functor P.obj := {map := @map P}
4746

4847
protected theorem map_eq {α β : Type*} (f : α → β) (a : P.A) (g : P.B a → α) :
@@ -99,7 +98,7 @@ one part of `x` or is invalid, if `i.1 ≠ x.1` -/
9998
def Idx := Σ x : P.A, P.B x
10099

101100
instance Idx.inhabited [inhabited P.A] [inhabited (P.B default)] : inhabited P.Idx :=
102-
⟨default, default⟩
101+
⟨⟨default, default⟩⟩
103102

104103
variables {P}
105104

src/data/prod/tprod.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected def mk : ∀ (l : list ι) (f : Π i, α i), tprod α l
5757
| (i :: is) := λ f, (f i, mk is f)
5858

5959
instance [∀ i, inhabited (α i)] : inhabited (tprod α l) :=
60-
⟨tprod.mk l (λ _, default)
60+
⟨tprod.mk l default⟩
6161

6262
@[simp] lemma fst_mk (i : ι) (l : list ι) (f : Π i, α i) : (tprod.mk (i::l) f).1 = f i := rfl
6363

src/data/qpf/multivariate/constructions/sigma.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ def pi (v : typevec.{u} n) : Type.{u} :=
3030
Π α : A, F α v
3131

3232
instance sigma.inhabited {α} [inhabited A] [inhabited (F default α)] : inhabited (sigma F α) :=
33-
⟨default, default⟩
33+
⟨⟨default, default⟩⟩
3434

3535
instance pi.inhabited {α} [Π a, inhabited (F a α)] : inhabited (pi F α) :=
36-
λ a, default
36+
⟨λ a, default⟩
3737

3838
variables [Π α, mvfunctor $ F α]
3939

src/data/setoid/partition.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ variables {ι α : Type*} {s : ι → set α} (hs : indexed_partition s)
291291
instance [unique ι] [inhabited α] :
292292
inhabited (indexed_partition (λ i : ι, (set.univ : set α))) :=
293293
⟨{ eq_of_mem := λ x i j hi hj, subsingleton.elim _ _,
294-
some := λ i, default,
294+
some := default,
295295
some_mem := set.mem_univ,
296-
index := λ a, default,
296+
index := default,
297297
mem_index := set.mem_univ }⟩
298298

299299
attribute [simp] some_mem mem_index

0 commit comments

Comments
 (0)