Skip to content

Commit 8919646

Browse files
committed
chore(Data/Set/Function): rename some lemmas (#9257)
- `Set.maps_image_to` → `Set.mapsTo_image_iff`; - `Set.maps_univ_to` → `Set.mapsTo_univ_iff`; - `Set.maps_range_to` → `Set.mapsTo_range_iff`. In all cases, use implicit arguments instead of explicit arguments. In the last case, also generalize from `Type*` to `Sort*` and replace the RHS with its `simp`-normal form. Old lemmas stay there but are now deprecated.
1 parent dd0886f commit 8919646

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

Mathlib/Algebra/Module/Zlattice.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ theorem Zlattice.rank : finrank ℤ L = finrank K E := by
480480
-- takes value into the finite set `fundamentalDomain e ∩ L`
481481
have h_mapsto : Set.MapsTo (fun n : ℤ => Zspan.fract e (n • v)) Set.univ
482482
(Metric.closedBall 0 (∑ i, ‖e i‖) ∩ (L : Set E)) := by
483-
rw [Set.mapsTo_inter, Set.maps_univ_to, Set.maps_univ_to]
483+
rw [Set.mapsTo_inter, Set.mapsTo_univ_iff, Set.mapsTo_univ_iff]
484484
refine ⟨fun _ => mem_closedBall_zero_iff.mpr (Zspan.norm_fract_le e _), fun _ => ?_⟩
485485
· change _ ∈ AddSubgroup.toIntSubmodule L
486486
rw [← h_spanL]

Mathlib/Data/Set/Finite.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1497,7 +1497,7 @@ theorem Infinite.exists_lt_map_eq_of_mapsTo [LinearOrder α] {s : Set α} {t : S
14971497

14981498
theorem Finite.exists_lt_map_eq_of_forall_mem [LinearOrder α] [Infinite α] {t : Set β} {f : α → β}
14991499
(hf : ∀ a, f a ∈ t) (ht : t.Finite) : ∃ a b, a < b ∧ f a = f b := by
1500-
rw [← maps_univ_to] at hf
1500+
rw [← mapsTo_univ_iff] at hf
15011501
obtain ⟨a, -, b, -, h⟩ := infinite_univ.exists_lt_map_eq_of_mapsTo hf ht
15021502
exact ⟨a, b, h⟩
15031503
#align set.finite.exists_lt_map_eq_of_forall_mem Set.Finite.exists_lt_map_eq_of_forall_mem

Mathlib/Data/Set/Function.lean

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -538,10 +538,15 @@ theorem mapsTo_range (f : α → β) (s : Set α) : MapsTo f s (range f) :=
538538
#align set.maps_to_range Set.mapsTo_range
539539

540540
@[simp]
541-
theorem maps_image_to (f : α → β) (g : γ → α) (s : Set γ) (t : Set β) :
541+
theorem mapsTo_image_iff {f : α → β} {g : γ → α} {s : Set γ} {t : Set β} :
542542
MapsTo f (g '' s) t ↔ MapsTo (f ∘ g) s t :=
543543
fun h c hc => h ⟨c, hc, rfl⟩, fun h _ ⟨_, hc⟩ => hc.2 ▸ h hc.1
544-
#align set.maps_image_to Set.maps_image_to
544+
#align set.maps_image_to Set.mapsTo_image_iff
545+
546+
@[deprecated]
547+
lemma maps_image_to (f : α → β) (g : γ → α) (s : Set γ) (t : Set β) :
548+
MapsTo f (g '' s) t ↔ MapsTo (f ∘ g) s t :=
549+
mapsTo_image_iff
545550

546551
lemma MapsTo.comp_left (g : β → γ) (hf : MapsTo f s t) : MapsTo (g ∘ f) s (g '' t) :=
547552
fun x hx ↦ ⟨f x, hf hx, rfl⟩
@@ -552,13 +557,21 @@ lemma MapsTo.comp_right {s : Set β} {t : Set γ} (hg : MapsTo g s t) (f : α
552557
#align set.maps_to.comp_right Set.MapsTo.comp_right
553558

554559
@[simp]
555-
theorem maps_univ_to (f : α → β) (s : Set β) : MapsTo f univ s ↔ ∀ a, f as :=
560+
lemma mapsTo_univ_iff : MapsTo f univ t ↔ ∀ x, f xt :=
556561
fun h _ => h (mem_univ _), fun h x _ => h x⟩
562+
563+
@[deprecated]
564+
theorem maps_univ_to (f : α → β) (s : Set β) : MapsTo f univ s ↔ ∀ a, f a ∈ s :=
565+
mapsTo_univ_iff
557566
#align set.maps_univ_to Set.maps_univ_to
558567

559568
@[simp]
569+
lemma mapsTo_range_iff {g : ι → α} : MapsTo f (range g) t ↔ ∀ i, f (g i) ∈ t :=
570+
forall_range_iff
571+
572+
@[deprecated mapsTo_range_iff]
560573
theorem maps_range_to (f : α → β) (g : γ → α) (s : Set β) :
561-
MapsTo f (range g) s ↔ MapsTo (f ∘ g) univ s := by rw [← image_univ, maps_image_to]
574+
MapsTo f (range g) s ↔ MapsTo (f ∘ g) univ s := by rw [← image_univ, mapsTo_image_iff]
562575
#align set.maps_range_to Set.maps_range_to
563576

564577
theorem surjective_mapsTo_image_restrict (f : α → β) (s : Set α) :

0 commit comments

Comments
 (0)