Documentation

Mathlib.Data.Set.Restrict

Restrict the domain of a function to a set #

Main definitions #

Domain restriction #

def Set.domRestrict {α : Type u_1} {π : αType u_6} (s : Set α) (f : (a : α) → π a) (a : s) :
π a

Restrict domain of a function f to a set s. Same as Subtype.restrict but this version takes an argument ↥s instead of Subtype s.

Equations
Instances For
    theorem Set.domRestrict_def {α : Type u_1} {π : αType u_6} (s : Set α) :
    s.domRestrict = fun (f : (a : α) → π a) (x : s) => f x
    theorem Set.domRestrict_eq {α : Type u_1} {β : Type u_2} (f : αβ) (s : Set α) :
    @[simp]
    theorem Set.domRestrict_id {α : Type u_1} (s : Set α) :
    @[simp]
    theorem Set.domRestrict_apply {α : Type u_1} {π : αType u_6} (f : (a : α) → π a) (s : Set α) (x : s) :
    s.domRestrict f x = f x
    theorem Set.domRestrict_eq_iff {α : Type u_1} {π : αType u_6} {f : (a : α) → π a} {s : Set α} {g : (a : s) → π a} :
    s.domRestrict f = g ∀ (a : α) (ha : a s), f a = g a, ha
    theorem Set.eq_domRestrict_iff {α : Type u_1} {π : αType u_6} {s : Set α} {f : (a : s) → π a} {g : (a : α) → π a} :
    f = s.domRestrict g ∀ (a : α) (ha : a s), f a, ha = g a
    @[simp]
    theorem Set.range_domRestrict {α : Type u_1} {β : Type u_2} (f : αβ) (s : Set α) :
    range (s.domRestrict f) = f '' s
    theorem Set.image_domRestrict {α : Type u_1} {β : Type u_2} (f : αβ) (s t : Set α) :
    @[simp]
    theorem Set.domRestrict_dite {α : Type u_1} {β : Type u_2} {s : Set α} [(x : α) → Decidable (x s)] (f : (a : α) → a sβ) (g : (a : α) → ¬a sβ) :
    (s.domRestrict fun (a : α) => if h : a s then f a h else g a h) = fun (a : s) => f a
    @[simp]
    theorem Set.domRestrict_dite_compl {α : Type u_1} {β : Type u_2} {s : Set α} [(x : α) → Decidable (x s)] (f : (a : α) → a sβ) (g : (a : α) → ¬a sβ) :
    (s.domRestrict fun (a : α) => if h : a s then f a h else g a h) = fun (a : s) => g a
    @[simp]
    theorem Set.domRestrict_ite {α : Type u_1} {β : Type u_2} (f g : αβ) (s : Set α) [(x : α) → Decidable (x s)] :
    (s.domRestrict fun (a : α) => if a s then f a else g a) = s.domRestrict f
    @[simp]
    theorem Set.domRestrict_ite_compl {α : Type u_1} {β : Type u_2} (f g : αβ) (s : Set α) [(x : α) → Decidable (x s)] :
    (s.domRestrict fun (a : α) => if a s then f a else g a) = s.domRestrict g
    @[simp]
    theorem Set.domRestrict_piecewise {α : Type u_1} {β : Type u_2} (f g : αβ) (s : Set α) [(x : α) → Decidable (x s)] :
    @[simp]
    theorem Set.domRestrict_piecewise_compl {α : Type u_1} {β : Type u_2} (f g : αβ) (s : Set α) [(x : α) → Decidable (x s)] :
    theorem Set.domRestrict_extend_range {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : αβ) (g : αγ) (g' : βγ) :
    (range f).domRestrict (Function.extend f g g') = fun (x : (range f)) => g (Exists.choose )
    @[simp]
    theorem Set.domRestrict_extend_compl_range {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : αβ) (g : αγ) (g' : βγ) :
    def Set.domRestrict₂ {α : Type u_1} {π : αType u_6} {s t : Set α} (hst : st) (f : (a : t) → π a) (a : s) :
    π a

    If a function f is restricted to a set t, and s ⊆ t, this is the restriction to s.

    Equations
    Instances For
      theorem Set.domRestrict₂_def {α : Type u_1} {π : αType u_6} {s t : Set α} (hst : st) :
      domRestrict₂ hst = fun (f : (a : t) → π a) (x : s) => f x,
      theorem Set.domRestrict₂_comp_domRestrict {α : Type u_1} {π : αType u_6} {s t : Set α} (hst : st) :
      theorem Set.domRestrict₂_comp_domRestrict₂ {α : Type u_1} {π : αType u_6} {s t u : Set α} (hst : st) (htu : tu) :
      theorem Set.range_extend_subset {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : αβ) (g : αγ) (g' : βγ) :
      range (Function.extend f g g')range g g' '' (range f)
      theorem Set.range_extend {α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : αβ} (hf : Function.Injective f) (g : αγ) (g' : βγ) :
      theorem Function.FactorsThrough.extend_injOn {α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : αβ} {g : αγ} {j : βγ} (hf : FactorsThrough g f) (hg : Injective g) :

      If g factors through f and g is injective, then extend f g j is injective on the range of f.

      theorem Function.Injective.extend_injOn {α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : αβ} {g : αγ} {j : βγ} (hf : Injective f) (hg : Injective g) :

      If f and g are injective, then extend f g j is injective on the range of f.

      def Set.codRestrict {α : Type u_1} {ι : Sort u_5} (f : ια) (s : Set α) (h : ∀ (x : ι), f x s) :
      ιs

      Restrict codomain of a function f to a set s. Same as Subtype.coind but this version has codomain ↥s instead of Subtype s.

      Equations
      Instances For
        @[simp]
        theorem Set.val_codRestrict_apply {α : Type u_1} {ι : Sort u_5} (f : ια) (s : Set α) (h : ∀ (x : ι), f x s) (x : ι) :
        (codRestrict f s h x) = f x
        @[simp]
        theorem Set.domRestrict_comp_codRestrict {α : Type u_1} {β : Type u_2} {ι : Sort u_5} {f : ια} {g : αβ} {b : Set α} (h : ∀ (x : ι), f x b) :
        @[simp]
        theorem Set.injective_codRestrict {α : Type u_1} {ι : Sort u_5} {f : ια} {s : Set α} (h : ∀ (x : ι), f x s) :
        theorem Function.Injective.codRestrict {α : Type u_1} {ι : Sort u_5} {f : ια} {s : Set α} (h : ∀ (x : ι), f x s) :

        Alias of the reverse direction of Set.injective_codRestrict.

        @[simp]
        theorem Set.range_codRestrict {α : Type u_1} {ι : Sort u_5} {f : ια} {s : Set α} (h : ∀ (x : ι), f x s) :
        theorem Set.surjective_codRestrict {α : Type u_1} {ι : Sort u_5} {f : ια} {s : Set α} (h : ∀ (x : ι), f x s) :
        theorem Set.codRestrict_range_surjective {α : Type u_1} {ι : Sort u_5} (f : ια) :
        @[simp]
        theorem Set.domRestrict_eq_domRestrict_iff {α : Type u_1} {β : Type u_2} {s : Set α} {f₁ f₂ : αβ} :
        s.domRestrict f₁ = s.domRestrict f₂ EqOn f₁ f₂ s
        @[deprecated Set.domRestrict (since := "2026-07-19")]
        def Set.restrict {α : Type u_1} {π : αType u_6} (s : Set α) (f : (a : α) → π a) (a : s) :
        π a

        Alias of Set.domRestrict.


        Restrict domain of a function f to a set s. Same as Subtype.restrict but this version takes an argument ↥s instead of Subtype s.

        Equations
        Instances For
          @[deprecated Set.domRestrict_def (since := "2026-07-19")]
          theorem Set.restrict_def {α : Type u_1} {π : αType u_6} (s : Set α) :
          s.domRestrict = fun (f : (a : α) → π a) (x : s) => f x

          Alias of Set.domRestrict_def.

          @[deprecated Set.domRestrict_eq (since := "2026-07-19")]
          theorem Set.restrict_eq {α : Type u_1} {β : Type u_2} (f : αβ) (s : Set α) :

          Alias of Set.domRestrict_eq.

          @[deprecated Set.domRestrict_id (since := "2026-07-19")]
          theorem Set.restrict_id {α : Type u_1} (s : Set α) :

          Alias of Set.domRestrict_id.

          @[deprecated Set.domRestrict_apply (since := "2026-07-19")]
          theorem Set.restrict_apply {α : Type u_1} {π : αType u_6} (f : (a : α) → π a) (s : Set α) (x : s) :
          s.domRestrict f x = f x

          Alias of Set.domRestrict_apply.

          @[deprecated Set.domRestrict_eq_iff (since := "2026-07-19")]
          theorem Set.restrict_eq_iff {α : Type u_1} {π : αType u_6} {f : (a : α) → π a} {s : Set α} {g : (a : s) → π a} :
          s.domRestrict f = g ∀ (a : α) (ha : a s), f a = g a, ha

          Alias of Set.domRestrict_eq_iff.

          @[deprecated Set.eq_domRestrict_iff (since := "2026-07-19")]
          theorem Set.eq_restrict_iff {α : Type u_1} {π : αType u_6} {s : Set α} {f : (a : s) → π a} {g : (a : α) → π a} :
          f = s.domRestrict g ∀ (a : α) (ha : a s), f a, ha = g a

          Alias of Set.eq_domRestrict_iff.

          @[deprecated Set.range_domRestrict (since := "2026-07-19")]
          theorem Set.range_restrict {α : Type u_1} {β : Type u_2} (f : αβ) (s : Set α) :
          range (s.domRestrict f) = f '' s

          Alias of Set.range_domRestrict.

          @[deprecated Set.image_domRestrict (since := "2026-07-19")]
          theorem Set.image_restrict {α : Type u_1} {β : Type u_2} (f : αβ) (s t : Set α) :

          Alias of Set.image_domRestrict.

          @[deprecated Set.domRestrict_dite (since := "2026-07-19")]
          theorem Set.restrict_dite {α : Type u_1} {β : Type u_2} {s : Set α} [(x : α) → Decidable (x s)] (f : (a : α) → a sβ) (g : (a : α) → ¬a sβ) :
          (s.domRestrict fun (a : α) => if h : a s then f a h else g a h) = fun (a : s) => f a

          Alias of Set.domRestrict_dite.

          @[deprecated Set.domRestrict_dite_compl (since := "2026-07-19")]
          theorem Set.restrict_dite_compl {α : Type u_1} {β : Type u_2} {s : Set α} [(x : α) → Decidable (x s)] (f : (a : α) → a sβ) (g : (a : α) → ¬a sβ) :
          (s.domRestrict fun (a : α) => if h : a s then f a h else g a h) = fun (a : s) => g a

          Alias of Set.domRestrict_dite_compl.

          @[deprecated Set.domRestrict_ite (since := "2026-07-19")]
          theorem Set.restrict_ite {α : Type u_1} {β : Type u_2} (f g : αβ) (s : Set α) [(x : α) → Decidable (x s)] :
          (s.domRestrict fun (a : α) => if a s then f a else g a) = s.domRestrict f

          Alias of Set.domRestrict_ite.

          @[deprecated Set.domRestrict_ite_compl (since := "2026-07-19")]
          theorem Set.restrict_ite_compl {α : Type u_1} {β : Type u_2} (f g : αβ) (s : Set α) [(x : α) → Decidable (x s)] :
          (s.domRestrict fun (a : α) => if a s then f a else g a) = s.domRestrict g

          Alias of Set.domRestrict_ite_compl.

          @[deprecated Set.domRestrict_piecewise (since := "2026-07-19")]
          theorem Set.restrict_piecewise {α : Type u_1} {β : Type u_2} (f g : αβ) (s : Set α) [(x : α) → Decidable (x s)] :

          Alias of Set.domRestrict_piecewise.

          @[deprecated Set.domRestrict_piecewise_compl (since := "2026-07-19")]
          theorem Set.restrict_piecewise_compl {α : Type u_1} {β : Type u_2} (f g : αβ) (s : Set α) [(x : α) → Decidable (x s)] :

          Alias of Set.domRestrict_piecewise_compl.

          @[deprecated Set.domRestrict_extend_range (since := "2026-07-19")]
          theorem Set.restrict_extend_range {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : αβ) (g : αγ) (g' : βγ) :
          (range f).domRestrict (Function.extend f g g') = fun (x : (range f)) => g (Exists.choose )

          Alias of Set.domRestrict_extend_range.

          @[deprecated Set.domRestrict_extend_compl_range (since := "2026-07-19")]
          theorem Set.restrict_extend_compl_range {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : αβ) (g : αγ) (g' : βγ) :

          Alias of Set.domRestrict_extend_compl_range.

          @[deprecated Set.domRestrict₂ (since := "2026-07-19")]
          def Set.restrict₂ {α : Type u_1} {π : αType u_6} {s t : Set α} (hst : st) (f : (a : t) → π a) (a : s) :
          π a

          Alias of Set.domRestrict₂.


          If a function f is restricted to a set t, and s ⊆ t, this is the restriction to s.

          Equations
          Instances For
            @[deprecated Set.domRestrict₂_def (since := "2026-07-19")]
            theorem Set.restrict₂_def {α : Type u_1} {π : αType u_6} {s t : Set α} (hst : st) :
            domRestrict₂ hst = fun (f : (a : t) → π a) (x : s) => f x,

            Alias of Set.domRestrict₂_def.

            @[deprecated Set.domRestrict₂_comp_domRestrict (since := "2026-07-19")]
            theorem Set.restrict₂_comp_restrict {α : Type u_1} {π : αType u_6} {s t : Set α} (hst : st) :

            Alias of Set.domRestrict₂_comp_domRestrict.

            @[deprecated Set.domRestrict₂_comp_domRestrict₂ (since := "2026-07-19")]
            theorem Set.restrict₂_comp_restrict₂ {α : Type u_1} {π : αType u_6} {s t u : Set α} (hst : st) (htu : tu) :

            Alias of Set.domRestrict₂_comp_domRestrict₂.

            @[deprecated Set.domRestrict_comp_codRestrict (since := "2026-07-19")]
            theorem Set.restrict_comp_codRestrict {α : Type u_1} {β : Type u_2} {ι : Sort u_5} {f : ια} {g : αβ} {b : Set α} (h : ∀ (x : ι), f x b) :

            Alias of Set.domRestrict_comp_codRestrict.

            @[deprecated Set.domRestrict_eq_domRestrict_iff (since := "2026-07-19")]
            theorem Set.restrict_eq_restrict_iff {α : Type u_1} {β : Type u_2} {s : Set α} {f₁ f₂ : αβ} :
            s.domRestrict f₁ = s.domRestrict f₂ EqOn f₁ f₂ s

            Alias of Set.domRestrict_eq_domRestrict_iff.

            theorem Set.MapsTo.restrict_commutes {α : Type u_1} {β : Type u_2} (f : αβ) (s : Set α) (t : Set β) (h : MapsTo f s t) :
            @[simp]
            theorem Set.MapsTo.val_restrict_apply {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {f : αβ} (h : MapsTo f s t) (x : s) :
            (restrict f s t h x) = f x
            theorem Set.MapsTo.coe_iterate_restrict {α : Type u_1} {s : Set α} {f : αα} (h : MapsTo f s s) (x : s) (k : ) :
            ((restrict f s s h)^[k] x) = f^[k] x
            @[simp]
            theorem Set.codRestrict_domRestrict {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {f : αβ} (h : ∀ (x : s), f x t) :

            Restricting the domain and then the codomain is the same as MapsTo.restrict.

            @[deprecated Set.codRestrict_domRestrict (since := "2026-07-19")]
            theorem Set.codRestrict_restrict {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {f : αβ} (h : ∀ (x : s), f x t) :

            Alias of Set.codRestrict_domRestrict.


            Restricting the domain and then the codomain is the same as MapsTo.restrict.

            theorem Set.MapsTo.restrict_eq_codRestrict {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {f : αβ} (h : MapsTo f s t) :
            restrict f s t h = codRestrict (s.domRestrict f) t

            Reverse of Set.codRestrict_domRestrict.

            theorem Set.MapsTo.coe_restrict {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {f : αβ} (h : MapsTo f s t) :
            theorem Set.MapsTo.range_restrict {α : Type u_1} {β : Type u_2} (f : αβ) (s : Set α) (t : Set β) (h : MapsTo f s t) :
            theorem Set.mapsTo_iff_exists_map_subtype {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {f : αβ} :
            MapsTo f s t (g : st), ∀ (x : s), f x = (g x)
            theorem Set.surjective_mapsTo_image_restrict {α : Type u_1} {β : Type u_2} (f : αβ) (s : Set α) :

            Restriction onto preimage #

            theorem Set.image_restrictPreimage {α : Type u_1} {β : Type u_2} (s : Set α) (t : Set β) (f : αβ) :
            theorem Set.range_restrictPreimage {α : Type u_1} {β : Type u_2} (t : Set β) (f : αβ) :
            @[simp]
            theorem Set.restrictPreimage_mk {α : Type u_1} {β : Type u_2} (t : Set β) {f : αβ} {a : α} (h : a f ⁻¹' t) :
            theorem Set.image_val_preimage_restrictPreimage {α : Type u_1} {β : Type u_2} (t : Set β) {f : αβ} {u : Set t} :
            theorem Set.preimage_restrictPreimage {α : Type u_1} {β : Type u_2} (t : Set β) {f : αβ} {u : Set t} :
            t.restrictPreimage f ⁻¹' u = (fun (a : ↑(f ⁻¹' t)) => f a) ⁻¹' Subtype.val '' u
            theorem Set.restrictPreimage_injective {α : Type u_1} {β : Type u_2} (t : Set β) {f : αβ} (hf : Function.Injective f) :
            theorem Set.restrictPreimage_surjective {α : Type u_1} {β : Type u_2} (t : Set β) {f : αβ} (hf : Function.Surjective f) :
            theorem Set.restrictPreimage_bijective {α : Type u_1} {β : Type u_2} (t : Set β) {f : αβ} (hf : Function.Bijective f) :
            theorem Function.Injective.restrictPreimage {α : Type u_1} {β : Type u_2} (t : Set β) {f : αβ} (hf : Injective f) :

            Alias of Set.restrictPreimage_injective.

            theorem Function.Surjective.restrictPreimage {α : Type u_1} {β : Type u_2} (t : Set β) {f : αβ} (hf : Surjective f) :

            Alias of Set.restrictPreimage_surjective.

            theorem Function.Bijective.restrictPreimage {α : Type u_1} {β : Type u_2} (t : Set β) {f : αβ} (hf : Bijective f) :

            Alias of Set.restrictPreimage_bijective.

            Injectivity on a set #

            theorem Set.injOn_iff_injective {α : Type u_1} {β : Type u_2} {s : Set α} {f : αβ} :
            theorem Set.InjOn.injective {α : Type u_1} {β : Type u_2} {s : Set α} {f : αβ} :

            Alias of the forward direction of Set.injOn_iff_injective.

            theorem Set.MapsTo.restrict_inj {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {f : αβ} (h : MapsTo f s t) :

            Surjectivity on a set #

            theorem Set.surjOn_iff_surjective {α : Type u_1} {β : Type u_2} {s : Set α} {f : αβ} :
            @[simp]
            theorem Set.MapsTo.restrict_surjective_iff {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {f : αβ} (h : MapsTo f s t) :