Skip to content

Commit

Permalink
chore: use funext_iff instead of the alias Function.funext_iff (#17847)
Browse files Browse the repository at this point in the history
Not sure why we were using this alias in the first place.
  • Loading branch information
kim-em committed Oct 17, 2024
1 parent 8e52ebf commit 6bcc518
Show file tree
Hide file tree
Showing 70 changed files with 101 additions and 101 deletions.
2 changes: 1 addition & 1 deletion Archive/Wiedijk100Theorems/Partition.lean
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ theorem partialGF_prop (α : Type*) [CommSemiring α] (n : ℕ) (s : Finset ℕ)
intro a; exact Nat.lt_irrefl 0 (hs 0 (hp₂.2 0 a))
intro a; exact Nat.lt_irrefl 0 (hs 0 (hp₁.2 0 a))
· rw [← mul_left_inj' hi]
rw [Function.funext_iff] at h
rw [funext_iff] at h
exact h.2 i
· simp only [φ, mem_filter, mem_finsuppAntidiag, mem_univ, exists_prop, true_and, and_assoc]
rintro f ⟨hf, hf₃, hf₄⟩
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/BigOperators/Ring.lean
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ theorem prod_add (f g : ι → α) (s : Finset ι) :
(fun t _ a _ => a ∈ t)
(by simp)
(by simp [Classical.em])
(by simp_rw [mem_filter, Function.funext_iff, eq_iff_iff, mem_pi, mem_insert]; tauto)
(by simp_rw [mem_filter, funext_iff, eq_iff_iff, mem_pi, mem_insert]; tauto)
(by simp_rw [Finset.ext_iff, @mem_filter _ _ (id _), mem_powerset]; tauto)
(fun a _ ↦ by
simp only [prod_ite, filter_attach', prod_map, Function.Embedding.coeFn_mk,
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Divisibility/Prod.lean
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ instance [DecompositionMonoid G₁] [DecompositionMonoid G₂] : DecompositionMo
exact ⟨(a₁, a₂), (a₁', a₂'), ⟨h₁, h₂⟩, ⟨h₁', h₂'⟩, Prod.ext eq₁ eq₂⟩

theorem pi_dvd_iff {x y : ∀ i, G i} : x ∣ y ↔ ∀ i, x i ∣ y i := by
simp_rw [dvd_def, Function.funext_iff, Classical.skolem]; rfl
simp_rw [dvd_def, funext_iff, Classical.skolem]; rfl

instance [∀ i, DecompositionMonoid (G i)] : DecompositionMonoid (∀ i, G i) where
primal a b c h := by
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Group/Pi/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def Pi.mulHom {γ : Type w} [∀ i, Mul (f i)] [Mul γ] (g : ∀ i, γ →ₙ* f
theorem Pi.mulHom_injective {γ : Type w} [Nonempty I] [∀ i, Mul (f i)] [Mul γ] (g : ∀ i, γ →ₙ* f i)
(hg : ∀ i, Function.Injective (g i)) : Function.Injective (Pi.mulHom g) := fun _ _ h =>
let ⟨i⟩ := ‹Nonempty I›
hg i ((Function.funext_iff.mp h : _) i)
hg i ((funext_iff.mp h : _) i)

/-- A family of monoid homomorphisms `f a : γ →* β a` defines a monoid homomorphism
`Pi.monoidHom f : γ →* Π a, β a` given by `Pi.monoidHom f x b = f b x`. -/
Expand Down Expand Up @@ -337,7 +337,7 @@ theorem SemiconjBy.pi {x y z : ∀ i, f i} (h : ∀ i, SemiconjBy (x i) (y i) (z

@[to_additive]
theorem Pi.semiconjBy_iff {x y z : ∀ i, f i} :
SemiconjBy x y z ↔ ∀ i, SemiconjBy (x i) (y i) (z i) := Function.funext_iff
SemiconjBy x y z ↔ ∀ i, SemiconjBy (x i) (y i) (z i) := funext_iff

@[to_additive]
theorem Commute.pi {x y : ∀ i, f i} (h : ∀ i, Commute (x i) (y i)) : Commute x y := .pi h
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Homology/Functor.lean
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ def asFunctor {T : Type*} [Category T] (C : HomologicalComplex (T ⥤ V) c) :
d := fun i j => (C.d i j).app t
d_comp_d' := fun i j k _ _ => by
have := C.d_comp_d i j k
rw [NatTrans.ext_iff, Function.funext_iff] at this
rw [NatTrans.ext_iff, funext_iff] at this
exact this t
shape := fun i j h => by
have := C.shape _ _ h
rw [NatTrans.ext_iff, Function.funext_iff] at this
rw [NatTrans.ext_iff, funext_iff] at this
exact this t }
map h :=
{ f := fun i => (C.X i).map h
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/LinearRecurrence.lean
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def toInit : E.solSpace ≃ₗ[α] Fin E.order → α where
simp
invFun u := ⟨E.mkSol u, E.is_sol_mkSol u⟩
left_inv u := by ext n; symm; apply E.eq_mk_of_is_sol_of_eq_init u.2; intro k; rfl
right_inv u := Function.funext_iff.mpr fun n ↦ E.mkSol_eq_init u n
right_inv u := funext_iff.mpr fun n ↦ E.mkSol_eq_init u n

/-- Two solutions are equal iff they are equal on `range E.order`. -/
theorem sol_eq_of_eq_init (u v : ℕ → α) (hu : E.IsSolution u) (hv : E.IsSolution v) :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Module/ZLattice/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ theorem discreteTopology_pi_basisFun [Finite ι] :
refine discreteTopology_iff_isOpen_singleton_zero.mpr ⟨Metric.ball 0 1, Metric.isOpen_ball, ?_⟩
ext x
rw [Set.mem_preimage, mem_ball_zero_iff, pi_norm_lt_iff zero_lt_one, Set.mem_singleton_iff]
simp_rw [← coe_eq_zero, Function.funext_iff, Pi.zero_apply, Real.norm_eq_abs]
simp_rw [← coe_eq_zero, funext_iff, Pi.zero_apply, Real.norm_eq_abs]
refine forall_congr' (fun i => ?_)
rsuffices ⟨y, hy⟩ : ∃ (y : ℤ), (y : ℝ) = (x : ι → ℝ) i
· rw [← hy, ← Int.cast_abs, ← Int.cast_one, Int.cast_lt, Int.abs_lt_one_iff, Int.cast_eq_zero]
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Order/BigOperators/Group/Finset.lean
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,11 @@ lemma one_le_prod (hf : 1 ≤ f) : 1 ≤ ∏ i, f i := Finset.one_le_prod' fun _

@[to_additive]
lemma prod_eq_one_iff_of_one_le (hf : 1 ≤ f) : ∏ i, f i = 1 ↔ f = 1 :=
(Finset.prod_eq_one_iff_of_one_le' fun i _ ↦ hf i).trans <| by simp [Function.funext_iff]
(Finset.prod_eq_one_iff_of_one_le' fun i _ ↦ hf i).trans <| by simp [funext_iff]

@[to_additive]
lemma prod_eq_one_iff_of_le_one (hf : f ≤ 1) : ∏ i, f i = 1 ↔ f = 1 :=
(Finset.prod_eq_one_iff_of_le_one' fun i _ ↦ hf i).trans <| by simp [Function.funext_iff]
(Finset.prod_eq_one_iff_of_le_one' fun i _ ↦ hf i).trans <| by simp [funext_iff]

end OrderedCommMonoid

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Polynomial/Smeval.lean
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ theorem smeval.linearMap_apply : smeval.linearMap R x p = p.smeval x := rfl

theorem leval_coe_eq_smeval {R : Type*} [Semiring R] (r : R) :
⇑(leval r) = fun p => p.smeval r := by
rw [Function.funext_iff]
rw [funext_iff]
intro
rw [leval_apply, smeval_def, eval_eq_sum]
rfl
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Analysis/Calculus/LagrangeMultipliers.lean
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ theorem IsLocalExtrOn.exists_multipliers_of_hasStrictFDerivAt {ι : Type*} [Fint
∃ (Λ : ι → ℝ) (Λ₀ : ℝ), (Λ, Λ₀) ≠ 0 ∧ (∑ i, Λ i • f' i) + Λ₀ • φ' = 0 := by
letI := Classical.decEq ι
replace hextr : IsLocalExtrOn φ {x | (fun i => f i x) = fun i => f i x₀} x₀ := by
simpa only [Function.funext_iff] using hextr
simpa only [funext_iff] using hextr
rcases hextr.exists_linear_map_of_hasStrictFDerivAt (hasStrictFDerivAt_pi.2 fun i => hf' i)
hφ' with
⟨Λ, Λ₀, h0, hsum⟩
Expand All @@ -132,5 +132,5 @@ theorem IsLocalExtrOn.linear_dependent_of_hasStrictFDerivAt {ι : Type*} [Finite
rcases hextr.exists_multipliers_of_hasStrictFDerivAt hf' hφ' with ⟨Λ, Λ₀, hΛ, hΛf⟩
refine ⟨Option.elim' Λ₀ Λ, ?_, ?_⟩
· simpa [add_comm] using hΛf
· simpa only [Function.funext_iff, not_and_or, or_comm, Option.exists, Prod.mk_eq_zero, Ne,
· simpa only [funext_iff, not_and_or, or_comm, Option.exists, Prod.mk_eq_zero, Ne,
not_forall] using hΛ
2 changes: 1 addition & 1 deletion Mathlib/Analysis/InnerProductSpace/OfNorm.lean
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private theorem rat_prop (r : ℚ) : innerProp' E (r : 𝕜) := by
private theorem real_prop (r : ℝ) : innerProp' E (r : 𝕜) := by
intro x y
revert r
rw [← Function.funext_iff]
rw [← funext_iff]
refine Rat.isDenseEmbedding_coe_real.dense.equalizer ?_ ?_ (funext fun X => ?_)
· exact (continuous_ofReal.smul continuous_const).inner_ continuous_const
· exact (continuous_conj.comp continuous_ofReal).mul continuous_const
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Normed/Operator/WeakOperatorTopology.lean
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ lemma continuous_of_dual_apply_continuous {α : Type*} [TopologicalSpace α] {g
lemma embedding_inducingFn : Embedding (inducingFn 𝕜 E F) := by
refine Function.Injective.embedding_induced fun A B hAB => ?_
rw [ContinuousLinearMapWOT.ext_dual_iff]
simpa [Function.funext_iff] using hAB
simpa [funext_iff] using hAB

open Filter in
/-- The defining property of the weak operator topology: a function `f` tends to
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ theorem continuousAt_arg_coe_angle (h : x ≠ 0) : ContinuousAt ((↑) ∘ arg :
by_cases hs : x ∈ slitPlane
· exact Real.Angle.continuous_coe.continuousAt.comp (continuousAt_arg hs)
· rw [← Function.comp_id (((↑) : ℝ → Real.Angle) ∘ arg),
(Function.funext_iff.2 fun _ => (neg_neg _).symm : (id : ℂ → ℂ) = Neg.neg ∘ Neg.neg), ←
(funext_iff.2 fun _ => (neg_neg _).symm : (id : ℂ → ℂ) = Neg.neg ∘ Neg.neg), ←
Function.comp_assoc]
refine ContinuousAt.comp ?_ continuous_neg.continuousAt
suffices ContinuousAt (Function.update (((↑) ∘ arg) ∘ Neg.neg : ℂ → Real.Angle) 0 π) (-x) by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/GradedObject.lean
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ abbrev comap {I J : Type*} (h : J → I) : GradedObject I C ⥤ GradedObject J C
-- Porting note: added to ease the port, this is a special case of `Functor.eqToHom_proj`
@[simp]
theorem eqToHom_proj {I : Type*} {x x' : GradedObject I C} (h : x = x') (i : I) :
(eqToHom h : x ⟶ x') i = eqToHom (Function.funext_iff.mp h i) := by
(eqToHom h : x ⟶ x') i = eqToHom (funext_iff.mp h i) := by
subst h
rfl

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Pi/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ section EqToHom

@[simp]
theorem eqToHom_proj {x x' : ∀ i, C i} (h : x = x') (i : I) :
(eqToHom h : x ⟶ x') i = eqToHom (Function.funext_iff.mp h i) := by
(eqToHom h : x ⟶ x') i = eqToHom (funext_iff.mp h i) := by
subst h
rfl

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Sites/LocallySurjective.lean
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ instance {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) [IsLocallySurjective J f] :

theorem isLocallySurjective_iff_imagePresheaf_sheafify_eq_top {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) :
IsLocallySurjective J f ↔ (imagePresheaf (whiskerRight f (forget A))).sheafify J = ⊤ := by
simp only [Subpresheaf.ext_iff, Function.funext_iff, Set.ext_iff, top_subpresheaf_obj,
simp only [Subpresheaf.ext_iff, funext_iff, Set.ext_iff, top_subpresheaf_obj,
Set.top_eq_univ, Set.mem_univ, iff_true]
exact ⟨fun H _ => H.imageSieve_mem, fun H => ⟨H _⟩⟩

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Sites/Types.lean
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,6 @@ theorem typesGrothendieckTopology_eq_canonical :
have : (fun _ => ULift.up true) = fun _ => ULift.up false :=
(hs PUnit fun _ => x).isSeparatedFor.ext
fun β f hf => funext fun y => hsx.elim <| S.2 hf fun _ => y
simp [Function.funext_iff] at this
simp [funext_iff] at this

end CategoryTheory
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Types.lean
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ lemma sections_property {F : J ⥤ Type w} (s : (F.sections : Type _))
s.property f

lemma sections_ext_iff {F : J ⥤ Type w} {x y : F.sections} : x = y ↔ ∀ j, x.val j = y.val j :=
Subtype.ext_iff.trans Function.funext_iff
Subtype.ext_iff.trans funext_iff

variable (J)

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/Additive/AP/Three/Behrend.lean
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ quadrant. -/
def sphere (n d k : ℕ) : Finset (Fin n → ℕ) :=
(box n d).filter fun x => ∑ i, x i ^ 2 = k

theorem sphere_zero_subset : sphere n d 00 := fun x => by simp [sphere, Function.funext_iff]
theorem sphere_zero_subset : sphere n d 00 := fun x => by simp [sphere, funext_iff]

@[simp]
theorem sphere_zero_right (n k : ℕ) : sphere (n + 1) 0 k = ∅ := by simp [sphere]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/HalesJewett.lean
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ variable {η' α' ι' : Type*}
def reindex (l : Subspace η α ι) (eη : η ≃ η') (eα : α ≃ α') (eι : ι ≃ ι') : Subspace η' α' ι' where
idxFun i := (l.idxFun <| eι.symm i).map eα eη
proper e := (eι.exists_congr fun i ↦ by cases h : idxFun l i <;>
simp [*, Function.funext_iff, Equiv.eq_symm_apply]).1 <| l.proper <| eη.symm e
simp [*, funext_iff, Equiv.eq_symm_apply]).1 <| l.proper <| eη.symm e

@[simp] lemma reindex_apply (l : Subspace η α ι) (eη : η ≃ η') (eα : α ≃ α') (eι : ι ≃ ι') (x i) :
l.reindex eη eα eι x i = eα (l (eα.symm ∘ x ∘ eη) <| eι.symm i) := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/Hall/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ instance hallMatchingsOn.finite {ι : Type u} {α : Type v} (t : ι → Finset
apply Finite.of_injective g
intro f f' h
ext a
rw [Function.funext_iff] at h
rw [funext_iff] at h
simpa [g] using h a

/-- This is the version of **Hall's Marriage Theorem** in terms of indexed
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/SimpleGraph/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ instance [Subsingleton V] : Unique (SimpleGraph V) where
uniq G := by ext a b; have := Subsingleton.elim a b; simp [this]

instance [Nontrivial V] : Nontrivial (SimpleGraph V) :=
⟨⟨⊥, ⊤, fun h ↦ not_subsingleton V ⟨by simpa only [← adj_inj, Function.funext_iff, bot_adj,
⟨⟨⊥, ⊤, fun h ↦ not_subsingleton V ⟨by simpa only [← adj_inj, funext_iff, bot_adj,
top_adj, ne_eq, eq_iff_iff, false_iff, not_not] using h⟩⟩⟩

section Decidable
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Combinatorics/SimpleGraph/Circulant.lean
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ theorem cycleGraph_zero_eq_top : cycleGraph 0 = ⊤ := Subsingleton.elim _ _
theorem cycleGraph_one_eq_top : cycleGraph 1 = ⊤ := Subsingleton.elim _ _

theorem cycleGraph_two_eq_top : cycleGraph 2 = ⊤ := by
simp only [SimpleGraph.ext_iff, Function.funext_iff]
simp only [SimpleGraph.ext_iff, funext_iff]
decide

theorem cycleGraph_three_eq_top : cycleGraph 3 = ⊤ := by
simp only [SimpleGraph.ext_iff, Function.funext_iff]
simp only [SimpleGraph.ext_iff, funext_iff]
decide

theorem cycleGraph_one_adj {u v : Fin 1} : ¬(cycleGraph 1).Adj u v := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/SimpleGraph/Turan.lean
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ lemma turanGraph_zero : turanGraph n 0 = ⊤ := by

@[simp]
theorem turanGraph_eq_top : turanGraph n r = ⊤ ↔ r = 0 ∨ n ≤ r := by
simp_rw [SimpleGraph.ext_iff, Function.funext_iff, turanGraph, top_adj, eq_iff_iff, not_iff_not]
simp_rw [SimpleGraph.ext_iff, funext_iff, turanGraph, top_adj, eq_iff_iff, not_iff_not]
refine ⟨fun h ↦ ?_, ?_⟩
· contrapose! h
use ⟨0, (Nat.pos_of_ne_zero h.1).trans h.2⟩, ⟨r, h.2
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Computability/TMToPartrec.lean
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ instance Λ'.instInhabited : Inhabited Λ' :=
instance Λ'.instDecidableEq : DecidableEq Λ' := fun a b => by
induction a generalizing b <;> cases b <;> first
| apply Decidable.isFalse; rintro ⟨⟨⟩⟩; done
| exact decidable_of_iff' _ (by simp [Function.funext_iff]; rfl)
| exact decidable_of_iff' _ (by simp [funext_iff]; rfl)

/-- The type of TM2 statements used by this machine. -/
def Stmt' :=
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Data/Fin/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ then they coincide (in the heq sense). -/
protected theorem heq_fun_iff {α : Sort*} {k l : ℕ} (h : k = l) {f : Fin k → α} {g : Fin l → α} :
HEq f g ↔ ∀ i : Fin k, f i = g ⟨(i : ℕ), h ▸ i.2⟩ := by
subst h
simp [Function.funext_iff]
simp [funext_iff]

/-- Assume `k = l` and `k' = l'`.
If two functions `Fin k → Fin k' → α` and `Fin l → Fin l' → α` are equal on each pair,
Expand All @@ -181,7 +181,7 @@ protected theorem heq_fun₂_iff {α : Sort*} {k l k' l' : ℕ} (h : k = l) (h'
HEq f g ↔ ∀ (i : Fin k) (j : Fin k'), f i j = g ⟨(i : ℕ), h ▸ i.2⟩ ⟨(j : ℕ), h' ▸ j.2⟩ := by
subst h
subst h'
simp [Function.funext_iff]
simp [funext_iff]

/-- Two elements of `Fin k` and `Fin l` are heq iff their values in `ℕ` coincide. This requires
`k = l`. For the left implication without this assumption, see `val_eq_val_of_heq`. -/
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Finset/NAry.lean
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ variable {ι : Type*} {α β γ : ι → Type*} [DecidableEq ι] [Fintype ι] [
lemma piFinset_image₂ (f : ∀ i, α i → β i → γ i) (s : ∀ i, Finset (α i)) (t : ∀ i, Finset (β i)) :
piFinset (fun i ↦ image₂ (f i) (s i) (t i)) =
image₂ (fun a b i ↦ f _ (a i) (b i)) (piFinset s) (piFinset t) := by
ext; simp only [mem_piFinset, mem_image₂, Classical.skolem, forall_and, Function.funext_iff]
ext; simp only [mem_piFinset, mem_image₂, Classical.skolem, forall_and, funext_iff]

end Fintype

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Finset/Sort.lean
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ theorem orderEmbOfFin_unique {s : Finset α} {k : ℕ} (h : s.card = k) {f : Fin
the increasing bijection `orderEmbOfFin s h`. -/
theorem orderEmbOfFin_unique' {s : Finset α} {k : ℕ} (h : s.card = k) {f : Fin k ↪o α}
(hfs : ∀ x, f x ∈ s) : f = s.orderEmbOfFin h :=
RelEmbedding.ext <| Function.funext_iff.1 <| orderEmbOfFin_unique h hfs f.strictMono
RelEmbedding.ext <| funext_iff.1 <| orderEmbOfFin_unique h hfs f.strictMono

/-- Two parametrizations `orderEmbOfFin` of the same set take the same value on `i` and `j` if
and only if `i = j`. Since they can be defined on a priori not defeq types `Fin k` and `Fin l`
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Fintype/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ namespace Fintype
instance decidablePiFintype {α} {β : α → Type*} [∀ a, DecidableEq (β a)] [Fintype α] :
DecidableEq (∀ a, β a) := fun f g =>
decidable_of_iff (∀ a ∈ @Fintype.elems α _, f a = g a)
(by simp [Function.funext_iff, Fintype.complete])
(by simp [funext_iff, Fintype.complete])

instance decidableForallFintype {p : α → Prop} [DecidablePred p] [Fintype α] :
Decidable (∀ a, p a) :=
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Data/Fintype/Pi.lean
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ analogue of `Finset.pi` where the base finset is `univ` (but formally they are n
there is an additional condition `i ∈ Finset.univ` in the `Finset.pi` definition). -/
def piFinset (t : ∀ a, Finset (δ a)) : Finset (∀ a, δ a) :=
(Finset.univ.pi t).map ⟨fun f a => f a (mem_univ a), fun _ _ =>
by simp (config := {contextual := true}) [Function.funext_iff]⟩
by simp (config := {contextual := true}) [funext_iff]⟩

@[simp]
theorem mem_piFinset {t : ∀ a, Finset (δ a)} {f : ∀ a, δ a} : f ∈ piFinset t ↔ ∀ a, f a ∈ t a := by
Expand Down Expand Up @@ -69,7 +69,7 @@ lemma piFinset_of_isEmpty [IsEmpty α] (s : ∀ a, Finset (γ a)) : piFinset s =

@[simp]
theorem piFinset_singleton (f : ∀ i, δ i) : piFinset (fun i => {f i} : ∀ i, Finset (δ i)) = {f} :=
ext fun _ => by simp only [Function.funext_iff, Fintype.mem_piFinset, mem_singleton]
ext fun _ => by simp only [funext_iff, Fintype.mem_piFinset, mem_singleton]

theorem piFinset_subsingleton {f : ∀ i, Finset (δ i)} (hf : ∀ i, (f i : Set (δ i)).Subsingleton) :
(Fintype.piFinset f : Set (∀ i, δ i)).Subsingleton := fun _ ha _ hb =>
Expand All @@ -83,7 +83,7 @@ theorem piFinset_disjoint_of_disjoint (t₁ t₂ : ∀ a, Finset (δ a)) {a : α

lemma piFinset_image [∀ a, DecidableEq (δ a)] (f : ∀ a, γ a → δ a) (s : ∀ a, Finset (γ a)) :
piFinset (fun a ↦ (s a).image (f a)) = (piFinset s).image fun b a ↦ f _ (b a) := by
ext; simp only [mem_piFinset, mem_image, Classical.skolem, forall_and, Function.funext_iff]
ext; simp only [mem_piFinset, mem_image, Classical.skolem, forall_and, funext_iff]

lemma eval_image_piFinset_subset (t : ∀ a, Finset (δ a)) (a : α) [DecidableEq (δ a)] :
((piFinset t).image fun f ↦ f a) ⊆ t a := image_subset_iff.2 fun _x hx ↦ mem_piFinset.1 hx _
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/FunLike/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ theorem ext (f g : F) (h : ∀ x : α, f x = g x) : f = g :=
DFunLike.coe_injective' (funext h)

theorem ext_iff {f g : F} : f = g ↔ ∀ x, f x = g x :=
coe_fn_eq.symm.trans Function.funext_iff
coe_fn_eq.symm.trans funext_iff

protected theorem congr_fun {f g : F} (h₁ : f = g) (x : α) : f x = g x :=
congr_fun (congr_arg _ h₁) x
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Data/Matrix/ColumnRowPartitioned.lean
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ lemma fromRows_toRows (A : Matrix (m₁ ⊕ m₂) n R) : fromRows A.toRows₁ A.

lemma fromRows_inj : Function.Injective2 (@fromRows R m₁ m₂ n) := by
intros x1 x2 y1 y2
simp only [Function.funext_iff, ← Matrix.ext_iff]
simp only [funext_iff, ← Matrix.ext_iff]
aesop

lemma fromColumns_inj : Function.Injective2 (@fromColumns R m n₁ n₂) := by
intros x1 x2 y1 y2
simp only [Function.funext_iff, ← Matrix.ext_iff]
simp only [funext_iff, ← Matrix.ext_iff]
aesop

lemma fromColumns_ext_iff (A₁ : Matrix m n₁ R) (A₂ : Matrix m n₂ R) (B₁ : Matrix m n₁ R)
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Multiset/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,7 @@ instance decidableDforallMultiset {p : ∀ a ∈ m, Prop} [_hp : ∀ (a) (h : a
/-- decidable equality for functions whose domain is bounded by multisets -/
instance decidableEqPiMultiset {β : α → Type*} [∀ a, DecidableEq (β a)] :
DecidableEq (∀ a ∈ m, β a) := fun f g =>
decidable_of_iff (∀ (a) (h : a ∈ m), f a h = g a h) (by simp [Function.funext_iff])
decidable_of_iff (∀ (a) (h : a ∈ m), f a h = g a h) (by simp [funext_iff])

/-- If `p` is a decidable predicate,
so is the existence of an element in a multiset satisfying `p`. -/
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Real/GoldenRatio.lean
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ theorem Real.coe_fib_eq' :

/-- Binet's formula as a dependent equality. -/
theorem Real.coe_fib_eq : ∀ n, (Nat.fib n : ℝ) = (φ ^ n - ψ ^ n) / √5 := by
rw [← Function.funext_iff, Real.coe_fib_eq']
rw [← funext_iff, Real.coe_fib_eq']

/-- Relationship between the Fibonacci Sequence, Golden Ratio and its conjugate's exponents --/
theorem fib_golden_conj_exp (n : ℕ) : Nat.fib (n + 1) - φ * Nat.fib n = ψ ^ n := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Set/Image.lean
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ theorem range_subset_iff : range f ⊆ s ↔ ∀ y, f y ∈ s :=

theorem range_subset_range_iff_exists_comp {f : α → γ} {g : β → γ} :
range f ⊆ range g ↔ ∃ h : α → β, f = g ∘ h := by
simp only [range_subset_iff, mem_range, Classical.skolem, Function.funext_iff, (· ∘ ·), eq_comm]
simp only [range_subset_iff, mem_range, Classical.skolem, funext_iff, (· ∘ ·), eq_comm]

theorem range_eq_iff (f : α → β) (s : Set β) :
range f = s ↔ (∀ a, f a ∈ s) ∧ ∀ b ∈ s, ∃ a, f a = b := by
Expand Down
Loading

0 comments on commit 6bcc518

Please sign in to comment.