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

Commit 6c23bad

Browse files
kim-emmergify[bot]
andauthored
feat(data/set/lattice): add @[simp] to lemmas (#2091)
* feat(data/set/lattice): add @[simp] to lemmas * fix proof * fix proof * fix proof * oops * fix proofs * typo in doc string Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 4f10d1e commit 6c23bad

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/data/set/finite.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ begin
365365
refine ⟨range f, finite_range f, _⟩,
366366
rintro x hx,
367367
simp,
368-
exact ⟨_, ⟨_, hx, rfl⟩, hf ⟨x, hx⟩⟩
368+
exact ⟨x, ⟨hx, hf _⟩⟩,
369369
end
370370

371371
lemma finite_range_ite {p : α → Prop} [decidable_pred p] {f g : α → β} (hf : finite (range f))

src/data/set/lattice.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -603,18 +603,18 @@ set.ext $ assume a, by simp [@eq_comm α a]
603603
lemma image_eq_Union (f : α → β) (s : set α) : f '' s = (⋃i∈s, {f i}) :=
604604
set.ext $ assume b, by simp [@eq_comm β b]
605605

606-
lemma bUnion_range {f : ι → α} {g : α → set β} : (⋃x ∈ range f, g x) = (⋃y, g (f y)) :=
606+
@[simp] lemma bUnion_range {f : ι → α} {g : α → set β} : (⋃x ∈ range f, g x) = (⋃y, g (f y)) :=
607607
by rw [← sUnion_image, ← range_comp, sUnion_range]
608608

609-
lemma bInter_range {f : ι → α} {g : α → set β} : (⋂x ∈ range f, g x) = (⋂y, g (f y)) :=
609+
@[simp] lemma bInter_range {f : ι → α} {g : α → set β} : (⋂x ∈ range f, g x) = (⋂y, g (f y)) :=
610610
by rw [← sInter_image, ← range_comp, sInter_range]
611611

612612
variables {s : set γ} {f : γ → α} {g : α → set β}
613613

614-
lemma bUnion_image : (⋃x∈ (f '' s), g x) = (⋃y ∈ s, g (f y)) :=
614+
@[simp] lemma bUnion_image : (⋃x∈ (f '' s), g x) = (⋃y ∈ s, g (f y)) :=
615615
by rw [← sUnion_image, ← image_comp, sUnion_image]
616616

617-
lemma bInter_image : (⋂x∈ (f '' s), g x) = (⋂y ∈ s, g (f y)) :=
617+
@[simp] lemma bInter_image : (⋂x∈ (f '' s), g x) = (⋂y ∈ s, g (f y)) :=
618618
by rw [← sInter_image, ← image_comp, sInter_image]
619619

620620
end image

src/measure_theory/integration.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ begin
7474
{ exact is_measurable.bUnion (countable_finite f.finite)
7575
(λ b _, is_measurable.inter (h b) (f.measurable_sn _)) },
7676
ext a, simp,
77-
exact ⟨λ h, ⟨_, ⟨a, rfl⟩, h, rfl⟩, λ ⟨_, ⟨a', rfl⟩, h', e⟩, e.symm ▸ h'⟩
77+
exact ⟨λ h, ⟨a, h, rfl⟩, λ ⟨a', h', e⟩, e.symm ▸ h'⟩
7878
end
7979

8080
theorem preimage_measurable (f : α →ₛ β) (s) : is_measurable (f ⁻¹' s) :=
@@ -103,12 +103,12 @@ def bind (f : α →ₛ β) (g : β → α →ₛ γ) : α →ₛ γ :=
103103
⟨λa, g (f a) a,
104104
λ c, is_measurable_cut (λa b, g b a ∈ ({c} : set γ)) f (λ b, (g b).measurable_sn c),
105105
finite_subset (finite_bUnion f.finite (λ b, (g b).finite)) $
106-
by rintro _ ⟨a, rfl⟩; simp; exact ⟨_, ⟨a, rfl⟩, _, rfl⟩⟩
106+
by rintro _ ⟨a, rfl⟩; simp; exact ⟨a, a, rfl⟩⟩
107107

108108
@[simp] theorem bind_apply (f : α →ₛ β) (g : β → α →ₛ γ) (a) :
109109
f.bind g a = g (f a) a := rfl
110110

111-
/-- Restrict a simple function `f : α →ₛ β`` to a set `s`. If `s` is measurable,
111+
/-- Restrict a simple function `f : α →ₛ β` to a set `s`. If `s` is measurable,
112112
then `f.restrict s a = if a ∈ s then f a else 0`, otherwise `f.restrict s = const α 0`. -/
113113
def restrict [has_zero β] (f : α →ₛ β) (s : set α) : α →ₛ β :=
114114
if hs : is_measurable s then ite hs f (const α 0) else const α 0

src/topology/instances/real.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ metric.totally_bounded_iff.2 $ λ ε ε0, begin
233233
let i : ℕ := ⌊(x - a) / ε⌋.to_nat,
234234
have : (i : ℤ) = ⌊(x - a) / ε⌋ :=
235235
int.to_nat_of_nonneg (floor_nonneg.2 $ le_of_lt (div_pos (sub_pos.2 ax) ε0)),
236-
simp, refine ⟨_, ⟨i, _, rfl⟩, _⟩,
236+
simp, use i, split,
237237
{ rw [← int.coe_nat_lt, this],
238238
refine int.cast_lt.1 (lt_of_le_of_lt (floor_le _) _),
239239
rw [int.cast_coe_nat, div_lt_iff' ε0, sub_lt_iff_lt_add'],

src/topology/uniform_space/cauchy.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ let ⟨c, hfc, hct⟩ := hs _ this in
293293
begin
294294
simp [image_subset_iff],
295295
simp [subset_def] at hct,
296-
intros x hx, simp [-mem_image],
297-
exact let ⟨i, hi, ht⟩ := hct x hx in ⟨f i, mem_image_of_mem f hi, ht⟩
296+
intros x hx, simp,
297+
exact hct x hx
298298
end
299299

300300
lemma cauchy_of_totally_bounded_of_ultrafilter {s : set α} {f : filter α}

0 commit comments

Comments
 (0)