ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
-- Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean
theorem arg_of_re_neg_of_im_neg {x : ℂ} (hx_re : x.re < 0) (hx_im : x.im < 0) :
    arg x = Real.arcsin ((-x).im / abs x) - π
-- Mathlib/Order/Filter/Basic.lean
protected theorem Tendsto.iterate {f : α → α} {l : Filter α} (h : Tendsto f l l) :
    ∀ n, Tendsto (f^[n]) l l
-- Mathlib/Topology/Order/DenselyOrdered.lean
@[simp]
theorem tendsto_Iio_atTop {f : β → Iio a} :
    Tendsto f l atTop ↔ Tendsto (fun x => (f x : α)) l (𝓝[<] a)
-- .lake/packages/lean4/src/lean/Init/Data/Int/DivModLemmas.lean
theorem emod_pos_of_not_dvd {a b : Int} (h : ¬ a ∣ b) : a = 0 ∨ 0 < b % a
-- Mathlib/MeasureTheory/Measure/VectorMeasure.lean
theorem neg_left {M : Type*} [AddCommGroup M] [TopologicalSpace M] [TopologicalAddGroup M]
    {v : VectorMeasure α M} {w : VectorMeasure α N} (h : v ⟂ᵥ w) : -v ⟂ᵥ w
-- Mathlib/CategoryTheory/EqToHom.lean
@[simp]
theorem inv_eqToHom {X Y : C} (h : X = Y) : inv (eqToHom h) = eqToHom h.symm
-- Mathlib/Data/Ordmap/Ordset.lean
theorem dual_balanceL (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balanceL l x r) = balanceR (dual r) x (dual l)
-- Mathlib/RingTheory/Localization/Module.lean
@[simp] lemma LinearMap.extendScalarsOfIsLocalization_apply (f : M →ₗ[A] N) :
    f.extendScalarsOfIsLocalization S A = f
-- Mathlib/Analysis/SpecialFunctions/Trigonometric/Series.lean
lemma cosh_le_exp_half_sq (x : ℝ) : cosh x ≤ exp (x ^ 2 / 2)
-- .lake/packages/lean4/src/lean/Init/Data/List/Lemmas.lean
theorem filter_cons :
    (x :: xs : List α).filter p = if p x then x :: (xs.filter p) else xs.filter p
-- Mathlib/Data/Sym/Sym2.lean
theorem map_comp {g : β → γ} {f : α → β} : Sym2.map (g ∘ f) = Sym2.map g ∘ Sym2.map f
-- Mathlib/FieldTheory/Adjoin.lean
theorem sup_toSubalgebra_of_right [FiniteDimensional K E2] :
    (E1 ⊔ E2).toSubalgebra = E1.toSubalgebra ⊔ E2.toSubalgebra
-- Mathlib/Combinatorics/SimpleGraph/Walk.lean
theorem concat_ne_nil {u v : V} (p : G.Walk u v) (h : G.Adj v u) : p.concat h ≠ nil
-- Mathlib/Combinatorics/Pigeonhole.lean
/-- The pigeonhole principle for finitely many pigeons of different weights, non-strict inequality
version: there is a pigeonhole with the total weight of pigeons in it less than or equal to `b`
provided that the total number of pigeonholes times `b` is greater than or equal to the total weight
of all pigeons. -/
theorem exists_sum_fiber_le_of_sum_le_nsmul [Nonempty β] (hb : ∑ x, w x ≤ card β • b) :
    ∃ y, ∑ x ∈ univ.filter fun x => f x = y, w x ≤ b
-- Mathlib/RingTheory/AdicCompletion/Basic.lean
theorem ext_iff {x y : AdicCompletion I M} : x = y ↔ ∀ n, x.val n = y.val n
-- Mathlib/Algebra/Order/Nonneg/Field.lean
@[simp] lemma mk_nnqsmul (q : ℚ≥0) (a : α) (ha : 0 ≤ a) :
    (⟨q • a, by rw [NNRat.smul_def]; exact mul_nonneg q.cast_nonneg ha⟩ : {x : α // 0 ≤ x}) =
      q • a
-- Mathlib/ModelTheory/Satisfiability.lean
theorem isSatisfiable_of_isSatisfiable_onTheory {L' : Language.{w, w'}} (φ : L →ᴸ L')
    (h : (φ.onTheory T).IsSatisfiable) : T.IsSatisfiable
-- Mathlib/Algebra/Homology/Homotopy.lean
/-- Compatibility of `nullHomotopicMap` with the application of additive functors -/
theorem map_nullHomotopicMap {W : Type*} [Category W] [Preadditive W] (G : V ⥤ W) [G.Additive]
    (hom : ∀ i j, C.X i ⟶ D.X j) :
    (G.mapHomologicalComplex c).map (nullHomotopicMap hom) =
      nullHomotopicMap (fun i j => by exact G.map (hom i j))
-- Mathlib/Order/Interval/Set/OrderIso.lean
@[simp]
theorem image_Ico (e : α ≃o β) (a b : α) : e '' Ico a b = Ico (e a) (e b)
-- Mathlib/ModelTheory/FinitelyGenerated.lean
theorem fg_closure {s : Set M} (hs : s.Finite) : FG (closure L s)
-- Mathlib/Data/Complex/Exponential.lean
@[simp]
theorem exp_conj : exp (conj x) = conj (exp x)
-- Mathlib/MeasureTheory/MeasurableSpace/Invariants.lean
theorem inf_le_invariants_comp (f g : α → α) :
    invariants f ⊓ invariants g ≤ invariants (f ∘ g)
-- Mathlib/Computability/Partrec.lean
theorem cond {c : α → Bool} {f : α → σ} {g : α → σ} (hc : Computable c) (hf : Computable f)
    (hg : Computable g) : Computable fun a => cond (c a) (f a) (g a)
-- Mathlib/Topology/Algebra/Algebra.lean
@[simp]
theorem id_comp (f : A →A[R] B) : (ContinuousAlgHom.id R B).comp f = f
-- Mathlib/Geometry/Manifold/AnalyticManifold.lean
/-- An identity partial homeomorphism belongs to the analytic groupoid. -/
theorem ofSet_mem_analyticGroupoid {s : Set H} (hs : IsOpen s) :
    PartialHomeomorph.ofSet s hs ∈ analyticGroupoid I
-- Mathlib/Probability/Independence/Conditional.lean
theorem CondIndepSets.union {s₁ s₂ s' : Set (Set Ω)}
    (h₁ : CondIndepSets m' hm' s₁ s' μ) (h₂ : CondIndepSets m' hm' s₂ s' μ) :
    CondIndepSets m' hm' (s₁ ∪ s₂) s' μ
-- Mathlib/LinearAlgebra/LinearPMap.lean
theorem le_graph_of_le {f g : E →ₗ.[R] F} (h : f ≤ g) : f.graph ≤ g.graph
-- Mathlib/Algebra/Ring/Parity.lean
lemma Even.odd_add (ha : Even a) (hb : Odd b) : Odd (b + a)
-- Mathlib/Data/Sigma/Basic.lean
theorem fst_injective_iff : Injective (fst : (Σ a, β a) → α) ↔ ∀ a, Subsingleton (β a)
-- Mathlib/Data/Vector3.lean
theorem eq_nil (v : Vector3 α 0) : v = []
-- Mathlib/Probability/Kernel/Basic.lean
/-- A kernel is a Markov kernel if every measure in its image is a probability measure. -/
class IsMarkovKernel (κ : Kernel α β) : Prop where
  isProbabilityMeasure : ∀ a, IsProbabilityMeasure (κ a)
-- Mathlib/Algebra/Homology/HomotopyCategory/HomComplex.lean
@[simp]
lemma comp_assoc_of_second_is_zero_cochain {n₁ n₃ n₁₃ : ℤ}
    (z₁ : Cochain F G n₁) (z₂ : Cochain G K 0) (z₃ : Cochain K L n₃) (h₁₃ : n₁ + n₃ = n₁₃) :
    (z₁.comp z₂ (add_zero n₁)).comp z₃ h₁₃ = z₁.comp (z₂.comp z₃ (zero_add n₃)) h₁₃
-- Mathlib/Algebra/Module/Submodule/Map.lean
theorem map_add_le (f g : M →ₛₗ[σ₁₂] M₂) : map (f + g) p ≤ map f p ⊔ map g p
-- Mathlib/Analysis/Normed/Ring/Units.lean
/-- The function `fun t ↦ inverse (x + t)` is O(1) as `t → 0`. -/
theorem inverse_add_norm (x : Rˣ) : (fun t : R => inverse (↑x + t)) =O[𝓝 0] fun _t => (1 : ℝ)
-- Mathlib/Data/Sign.lean
@[simp]
theorem zero_eq_zero : zero = 0
-- .lake/packages/batteries/Batteries/Data/Sum/Lemmas.lean
@[simp] theorem isRight_swap (x : α ⊕ β) : x.swap.isRight = x.isLeft
-- Mathlib/LinearAlgebra/Contraction.lean
@[simp]
theorem rTensorHomEquivHomRTensor_toLinearMap :
    (rTensorHomEquivHomRTensor R M P Q).toLinearMap = rTensorHomToHomRTensor R M P Q
-- Mathlib/Algebra/Group/AddChar.lean
@[simp] lemma toMonoidHomEquiv_symm_apply (ψ : Multiplicative A →* M) (a : A) :
    toMonoidHomEquiv.symm ψ a = ψ (Multiplicative.ofAdd a)
-- Mathlib/Data/PFunctor/Univariate/Basic.lean
@[simp]
protected theorem map_map (f : α → β) (g : β → γ) :
    ∀ x : P α, P.map g (P.map f x) = P.map (g ∘ f) x
-- Mathlib/Order/Monotone/Basic.lean
/-- If `f` is an antitone function from `ℤ` to a preorder and `x` lies between `f (n + 1)` and
`f n`, then `x` doesn't lie in the range of `f`. -/
theorem Antitone.ne_of_lt_of_lt_int {f : ℤ → α} (hf : Antitone f) (n : ℤ) {x : α}
    (h1 : f (n + 1) < x) (h2 : x < f n) (a : ℤ) : f a ≠ x
-- Mathlib/RingTheory/Ideal/Over.lean
theorem coeff_zero_mem_comap_of_root_mem {r : S} (hr : r ∈ I) {p : R[X]} (hp : p.eval₂ f r = 0) :
    p.coeff 0 ∈ I.comap f
-- Mathlib/Algebra/Quaternion.lean
@[simp, norm_cast]
theorem coe_add : ((x + y : R) : ℍ[R,c₁,c₂]) = x + y
-- .lake/packages/lean4/src/lean/Init/Grind/Norm.lean
@[grind_norm] theorem iff_eq (p q : Prop) : (p ↔ q) = (p = q)
-- Mathlib/Algebra/CubicDiscriminant.lean
@[simp]
theorem leadingCoeff_of_b_ne_zero' (hb : b ≠ 0) : (toPoly ⟨0, b, c, d⟩).leadingCoeff = b
-- Mathlib/Analysis/Normed/Group/Hom.lean
theorem bounds_nonempty {f : NormedAddGroupHom V₁ V₂} :
    ∃ c, c ∈ { c | 0 ≤ c ∧ ∀ x, ‖f x‖ ≤ c * ‖x‖ }
-- Mathlib/NumberTheory/Cyclotomic/PID.lean
/-- If `IsCyclotomicExtension {3} ℚ K` then `𝓞 K` is a principal ideal domain. -/
theorem three_pid [IsCyclotomicExtension {3} ℚ K] : IsPrincipalIdealRing (𝓞 K)
-- .lake/packages/batteries/Batteries/Data/List/Perm.lean
theorem subperm_cons (a : α) {l₁ l₂ : List α} : a :: l₁ <+~ a :: l₂ ↔ l₁ <+~ l₂
-- Mathlib/Algebra/Polynomial/Basic.lean
theorem addHom_ext {M : Type*} [AddMonoid M] {f g : R[X] →+ M}
    (h : ∀ n a, f (monomial n a) = g (monomial n a)) : f = g
-- Mathlib/Algebra/Ring/Subring/MulOpposite.lean
theorem unop_sInf (S : Set (Subring Rᵐᵒᵖ)) : (sInf S).unop = sInf (.op ⁻¹' S)
-- Mathlib/Analysis/Calculus/Deriv/Prod.lean
@[simp]
theorem hasDerivAtFilter_pi :
    HasDerivAtFilter φ φ' x L ↔ ∀ i, HasDerivAtFilter (fun x => φ x i) (φ' i) x L
-- Mathlib/Probability/ProbabilityMassFunction/Basic.lean
theorem apply_ne_top (p : PMF α) (a : α) : p a ≠ ∞
-- Mathlib/Algebra/Polynomial/Monic.lean
theorem leadingCoeff_smul_of_smul_regular {S : Type*} [Monoid S] [DistribMulAction S R] {k : S}
    (p : R[X]) (h : IsSMulRegular R k) : (k • p).leadingCoeff = k • p.leadingCoeff
-- Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean
@[simp] theorem isUnit_ι_iff {m : M} : IsUnit (ι Q m) ↔ IsUnit (Q m)
-- Mathlib/Algebra/Quaternion.lean
theorem normSq_inv : normSq a⁻¹ = (normSq a)⁻¹
-- Mathlib/Analysis/SpecialFunctions/Trigonometric/ArctanDeriv.lean
theorem HasDerivAt.arctan (hf : HasDerivAt f f' x) :
    HasDerivAt (fun x => arctan (f x)) (1 / (1 + f x ^ 2) * f') x
-- Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean
theorem sum_measure [PseudoMetrizableSpace β] {m : MeasurableSpace α} {μ : ι → Measure α}
    (h : ∀ i, AEStronglyMeasurable f (μ i)) : AEStronglyMeasurable f (Measure.sum μ)
-- Mathlib/Algebra/Homology/ShortComplex/HomologicalComplex.lean
@[reassoc (attr := simp)]
lemma homologyIsoSc'_hom_ι :
    (K.homologyIsoSc' i j k hi hk).hom ≫ (K.sc' i j k).homologyι =
      K.homologyι j ≫ (K.opcyclesIsoSc' i j k hi hk).hom
-- Mathlib/FieldTheory/SeparableDegree.lean
@[simp]
theorem finSepDegree_top : finSepDegree F (⊤ : IntermediateField E K) = finSepDegree F K
-- Mathlib/Data/Num/Bitwise.lean
@[simp] lemma lor_eq_or (p q : PosNum) : p.lor q = p ||| q
-- Mathlib/Order/MinMax.lean
theorem min_lt_min (h₁ : a < c) (h₂ : b < d) : min a b < min c d
-- Mathlib/Combinatorics/SimpleGraph/Path.lean
@[simp]
theorem cons_isPath_iff {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    (cons h p).IsPath ↔ p.IsPath ∧ u ∉ p.support
-- Mathlib/Algebra/Ring/Subring/Basic.lean
/-- The subring generated by a set includes the set. -/
@[simp, aesop safe 20 apply (rule_sets := [SetLike])]
theorem subset_closure {s : Set R} : s ⊆ closure s
-- Mathlib/MeasureTheory/Integral/IntervalIntegral.lean
theorem integral_comp_div_sub (hc : c ≠ 0) (d) :
    (∫ x in a..b, f (x / c - d)) = c • ∫ x in a / c - d..b / c - d, f x
-- Mathlib/CategoryTheory/Galois/Prorepresentability.lean
@[simp]
theorem endEquivAutGalois_mul (f g : End F) :
    (endEquivAutGalois F) (g ≫ f) = (endEquivAutGalois F g) * (endEquivAutGalois F f)
-- Mathlib/NumberTheory/FLT/Three.lean
private lemma lambda_not_dvd_Y : ¬ λ ∣ S.Y
-- Mathlib/CategoryTheory/Subobject/FactorThru.lean
@[simp]
theorem factorThru_comp_arrow {X Y : C} {P : Subobject Y} (f : X ⟶ P) (h) :
    P.factorThru (f ≫ P.arrow) h = f
-- Mathlib/ModelTheory/FinitelyGenerated.lean
theorem cg_def {N : L.Substructure M} : N.CG ↔ ∃ S : Set M, S.Countable ∧ closure L S = N
-- Mathlib/Analysis/NormedSpace/Multilinear/Curry.lean
@[simp]
theorem norm_domDomCongr (σ : ι ≃ ι') (f : ContinuousMultilinearMap 𝕜 (fun _ : ι => G) G') :
    ‖domDomCongr σ f‖ = ‖f‖
-- Mathlib/Algebra/Category/ModuleCat/Monoidal/Symmetric.lean
@[simp]
theorem braiding_naturality_left {X Y : ModuleCat R} (f : X ⟶ Y) (Z : ModuleCat R) :
    f ▷ Z ≫ (braiding Y Z).hom = (braiding X Z).hom ≫ Z ◁ f
-- Mathlib/Analysis/SpecialFunctions/Integrals.lean
@[simp]
theorem inv_mul_integral_comp_sub_div :
    (c⁻¹ * ∫ x in a..b, f (d - x / c)) = ∫ x in d - b / c..d - a / c, f x
-- .lake/packages/lean4/src/lean/Init/Prelude.lean
theorem Nat.le_of_ble_eq_true (h : Eq (Nat.ble n m) true) : LE.le n m
-- Mathlib/Data/List/Chain.lean
@[simp]
theorem chain'_cons {x y l} : Chain' R (x :: y :: l) ↔ R x y ∧ Chain' R (y :: l)
-- Mathlib/Analysis/Complex/Basic.lean
@[simp, norm_cast]
theorem summable_ofReal {f : α → ℝ} : (Summable fun x => (f x : 𝕜)) ↔ Summable f
-- Mathlib/Order/SuccPred/LinearLocallyFinite.lean
theorem injective_toZ : Function.Injective (toZ i0)
-- Mathlib/Order/Directed.lean
/-- If `f` is monotone and antitone on a directed order, then `f` is constant. -/
lemma constant_of_monotone_antitone [IsDirected α (· ≤ ·)] (hf : Monotone f) (hf' : Antitone f)
    (a b : α) : f a = f b
-- Mathlib/Algebra/Module/Defs.lean
@[simp]
theorem invOf_two_smul_add_invOf_two_smul [Invertible (2 : R)] (x : M) :
    (⅟ 2 : R) • x + (⅟ 2 : R) • x = x
-- Mathlib/Analysis/Convex/Jensen.lean
/-- Canonical form of the **equality case of Jensen's equality**.

For a strictly convex function `f` and nonnegative weights `w`, we have
`f (∑ i ∈ t, w i • p i) = ∑ i ∈ t, w i • f (p i)` if and only if the points `p` with nonzero
weight are all equal (and in fact all equal to their center of mass wrt `w`). -/
lemma StrictConvexOn.map_sum_eq_iff' (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i)
    (h₁ : ∑ i ∈ t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) :
    f (∑ i ∈ t, w i • p i) = ∑ i ∈ t, w i • f (p i) ↔
      ∀ j ∈ t, w j ≠ 0 → p j = ∑ i ∈ t, w i • p i
-- Mathlib/Geometry/Manifold/LocalInvariantProperties.lean
theorem congr_iff_nhdsWithin {s : Set H} {x : H} {f g : H → H'} (h1 : f =ᶠ[𝓝[s] x] g)
    (h2 : f x = g x) : P f s x ↔ P g s x
-- Mathlib/Data/Real/EReal.lean
@[simp]
theorem bot_lt_coe (x : ℝ) : (⊥ : EReal) < x
-- .lake/packages/lean4/src/lean/Init/Data/Nat/Div.lean
protected theorem mul_div_cancel (m : Nat) {n : Nat} (H : 0 < n) : m * n / n = m
-- Mathlib/Topology/Order/Lattice.lean
/-- Let `L` be a topological space and let `L×L` be equipped with the product topology and let
`⊓:L×L → L` be an infimum. Then `L` is said to have *(jointly) continuous infimum* if the map
`⊓:L×L → L` is continuous.
-/
class ContinuousInf (L : Type*) [TopologicalSpace L] [Inf L] : Prop where
  /-- The infimum is continuous -/
  continuous_inf : Continuous fun p : L × L => p.1 ⊓ p.2
-- Mathlib/Geometry/Manifold/Complex.lean
/-- If a function `f : M → F` from a complex manifold to a complex normed space is holomorphic on a
(pre)connected compact open set, then it is a constant on this set. -/
theorem apply_eq_of_isPreconnected_isCompact_isOpen {f : M → F} {U : Set M} {a b : M}
    (hd : MDifferentiableOn I 𝓘(ℂ, F) f U) (hpc : IsPreconnected U) (hc : IsCompact U)
    (ho : IsOpen U) (ha : a ∈ U) (hb : b ∈ U) : f a = f b
-- Mathlib/RingTheory/Ideal/Over.lean
/-- Let `P` be an ideal in `R[x]`.  The map
`R[x]/P → (R / (P ∩ R))[x] / (P / (P ∩ R))`
is injective.
-/
theorem injective_quotient_le_comap_map (P : Ideal R[X]) :
    Function.Injective <|
      Ideal.quotientMap
        (Ideal.map (Polynomial.mapRingHom (Quotient.mk (P.comap (C : R →+* R[X])))) P)
        (Polynomial.mapRingHom (Ideal.Quotient.mk (P.comap (C : R →+* R[X]))))
        le_comap_map
-- Mathlib/Data/Matrix/Kronecker.lean
theorem kroneckerMap_smul_right [SMul R β] [SMul R γ] (f : α → β → γ) (r : R)
    (hf : ∀ a b, f a (r • b) = r • f a b) (A : Matrix l m α) (B : Matrix n p β) :
    kroneckerMap f A (r • B) = r • kroneckerMap f A B
-- Mathlib/Combinatorics/SimpleGraph/Path.lean
theorem cons_isCycle_iff {u v : V} (p : G.Walk v u) (h : G.Adj u v) :
    (Walk.cons h p).IsCycle ↔ p.IsPath ∧ ¬s(u, v) ∈ p.edges
-- Mathlib/MeasureTheory/Integral/Average.lean
@[simp]
theorem laverage_zero_measure (f : α → ℝ≥0∞) : ⨍⁻ x, f x ∂(0 : Measure α) = 0
-- Mathlib/Data/Finset/Density.lean
lemma le_dens_sdiff (s t : Finset α) : dens t - dens s ≤ dens (t \ s)
-- Mathlib/Algebra/Star/NonUnitalSubalgebra.lean
@[simp]
theorem mem_range (φ : F) {y : B} :
    y ∈ (NonUnitalStarAlgHom.range φ : NonUnitalStarSubalgebra R B) ↔ ∃ x : A, φ x = y
-- Mathlib/Data/Multiset/FinsetOps.lean
@[simp]
theorem mem_ndunion {s t : Multiset α} {a : α} : a ∈ ndunion s t ↔ a ∈ s ∨ a ∈ t
-- Mathlib/Data/Real/Irrational.lean
theorem int_add (h : Irrational x) (m : ℤ) : Irrational (m + x)
-- Mathlib/RingTheory/EssentialFiniteness.lean
lemma essFiniteType_cond_iff (σ : Finset S) :
    IsLocalization ((IsUnit.submonoid S).comap (algebraMap (adjoin R (σ : Set S)) S)) S ↔
    (∀ s : S, ∃ t ∈ Algebra.adjoin R (σ : Set S),
      IsUnit t ∧ s * t ∈ Algebra.adjoin R (σ : Set S))
-- Mathlib/Order/WithBot.lean
@[norm_cast]
theorem coe_inj : (a : WithTop α) = b ↔ a = b
-- Mathlib/LinearAlgebra/PiTensorProduct.lean
private theorem tmul_apply (a : ι → M) (b : ι₂ → M) :
    tmul ((⨂ₜ[R] i, a i) ⊗ₜ[R] ⨂ₜ[R] i, b i) = ⨂ₜ[R] i, Sum.elim a b i
-- Mathlib/Data/List/OfFn.lean
theorem get_ofFn_go {n} (f : Fin n → α) (i j h) (k) (hk) :
    get (ofFn.go f i j h) ⟨k, hk⟩ = f ⟨j + k, by simp at hk; omega⟩
-- .lake/packages/batteries/Batteries/Data/List/Lemmas.lean
@[deprecated getElem?_modifyNth (since := "2024-06-12")]
theorem get?_modifyNth (f : α → α) (n) (l : List α) (m) :
    (modifyNth f n l).get? m = (fun a => if n = m then f a else a) <$> l.get? m
-- Mathlib/Order/Heyting/Basic.lean
/-- `p → q → r ↔ q ∧ p → r` -/
theorem le_himp_iff' : a ≤ b ⇨ c ↔ b ⊓ a ≤ c
-- Mathlib/NumberTheory/LegendreSymbol/AddCharacter.lean
lemma starComp_apply (hR : 0 < ringChar R) {φ : AddChar R ℂ} (a : R) :
    (starRingEnd ℂ) (φ a) = φ⁻¹ a
-- Mathlib/LinearAlgebra/AffineSpace/AffineMap.lean
@[simp]
theorem pi_apply (c : P1) (i : ι) : pi fp c i = fp i c
-- .lake/packages/lean4/src/lean/Init/Data/Array/Lemmas.lean
theorem get?_swap (a : Array α) (i j : Fin a.size) (k : Nat) : (a.swap i j)[k]? =
    if j = k then some a[i.1] else if i = k then some a[j.1] else a[k]?
-- Mathlib/Algebra/Lie/Submodule.lean
theorem incl_isIdealMorphism : I.incl.IsIdealMorphism
-- Mathlib/Analysis/SpecialFunctions/Exp.lean
@[simp]
theorem isLittleO_exp_comp_exp_comp {f g : α → ℝ} :
    ((fun x => exp (f x)) =o[l] fun x => exp (g x)) ↔ Tendsto (fun x => g x - f x) l atTop
-- Mathlib/Algebra/Polynomial/Eval.lean
@[simp]
theorem X_pow_comp {k : ℕ} : (X ^ k).comp p = p ^ k
-- Mathlib/LinearAlgebra/Quotient.lean
@[simp]
theorem Quotient.equiv_trans {N O : Type*} [AddCommGroup N] [Module R N] [AddCommGroup O]
    [Module R O] (P : Submodule R M) (Q : Submodule R N) (S : Submodule R O) (e : M ≃ₗ[R] N)
    (f : N ≃ₗ[R] O) (he : P.map e = Q) (hf : Q.map f = S) (hef : P.map (e.trans f) = S) :
    Quotient.equiv P S (e.trans f) hef =
      (Quotient.equiv P Q e he).trans (Quotient.equiv Q S f hf)
-- Mathlib/Algebra/Category/MonCat/Colimits.lean
@[simp]
theorem quot_mul (x y : Prequotient F) : Quot.mk Setoid.r (mul x y) =
    @HMul.hMul (ColimitType F) (ColimitType F) (ColimitType F) _
      (Quot.mk Setoid.r x) (Quot.mk Setoid.r y)
-- Mathlib/Order/ConditionallyCompleteLattice/Basic.lean
@[simp]
theorem ciInf_unique [Unique ι] {s : ι → α} : ⨅ i, s i = s default
-- Mathlib/Algebra/Vertex/HVertexOperator.lean
/-- Given a coefficient function valued in linear maps satisfying a partially well-ordered support
condition, we produce a heterogeneous vertex operator. -/
@[simps]
def of_coeff (f : Γ → V →ₗ[R] W)
    (hf : ∀(x : V), (Function.support (f · x)).IsPWO) : HVertexOperator Γ R V W
-- Mathlib/Tactic/NormNum/Inv.lean
theorem isRat_inv_one {α} [DivisionRing α] : {a : α} →
    IsNat a (nat_lit 1) → IsNat a⁻¹ (nat_lit 1)
-- Mathlib/Topology/Algebra/Module/Basic.lean
theorem iInf_ker_proj : (⨅ i, ker (proj i : (∀ i, φ i) →L[R] φ i) : Submodule R (∀ i, φ i)) = ⊥
-- Mathlib/Analysis/NormedSpace/AffineIsometry.lean
theorem dist_pointReflection_self_real (x y : P) :
    dist (pointReflection ℝ x y) y = 2 * dist x y
-- Mathlib/Algebra/Order/Ring/Unbundled/Basic.lean
theorem StrictMono.mul_monotone [PosMulMono α] [MulPosStrictMono α]
    (hf : StrictMono f) (hg : Monotone g) (hf₀ : ∀ x, 0 ≤ f x)
    (hg₀ : ∀ x, 0 < g x) : StrictMono (f * g)
-- Mathlib/Order/Filter/CardinalInter.lean
@[simp]
theorem mem_ofCardinalUnion {l : Set (Set α)} (hc : 2 < c) {hunion hmono s} :
    s ∈ ofCardinalUnion l hc hunion hmono ↔ l sᶜ
-- Mathlib/CategoryTheory/MorphismProperty/Limits.lean
/-- The condition that a property of morphisms is stable by finite products. -/
class IsStableUnderFiniteProducts : Prop :=
  isStableUnderProductsOfShape (J : Type) [Finite J] : W.IsStableUnderProductsOfShape J
-- Mathlib/Combinatorics/HalesJewett.lean
@[simp] lemma toSubspaceUnit_apply (l : Line α ι) (a) : ⇑l.toSubspaceUnit a = l (a ())
-- Mathlib/Analysis/SpecialFunctions/Pow/Real.lean
theorem le_rpow_of_log_le (hx : 0 ≤ x) (hy : 0 < y) (h : Real.log x ≤ z * Real.log y) :
    x ≤ y ^ z
-- Mathlib/Order/Interval/Finset/Nat.lean
theorem Icc_succ_left : Icc a.succ b = Ioc a b
-- Mathlib/LinearAlgebra/Dual.lean
/-- A reflexive module is one for which the natural map to its double dual is a bijection.

Any finitely-generated free module (and thus any finite-dimensional vector space) is reflexive.
See `Module.IsReflexive.of_finite_of_free`. -/
class IsReflexive : Prop where
  /-- A reflexive module is one for which the natural map to its double dual is a bijection. -/
  bijective_dual_eval' : Bijective (Dual.eval R M)
-- Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean
@[simp]
theorem ofQuaternion_toQuaternion (c : CliffordAlgebra (Q c₁ c₂)) :
    ofQuaternion (toQuaternion c) = c
-- Mathlib/Data/Bool/Basic.lean
theorem ofNat_toNat (b : Bool) : ofNat (toNat b) = b
-- Mathlib/SetTheory/Game/PGame.lean
theorem neg_add_le {x y : PGame} : -(x + y) ≤ -x + -y
-- Mathlib/RingTheory/Kaehler/Polynomial.lean
@[simp]
lemma KaehlerDifferential.mvPolynomialBasis_repr_D_X (σ) (i) :
    (mvPolynomialBasis R σ).repr (D _ _ (.X i)) = Finsupp.single i 1
-- Mathlib/Algebra/Polynomial/Div.lean
theorem modByMonic_add_div (p : R[X]) {q : R[X]} (hq : Monic q) : p %ₘ q + q * (p /ₘ q) = p
-- Mathlib/Topology/FiberBundle/Basic.lean
theorem totalSpaceMk_embedding (x : B) : Embedding (@TotalSpace.mk B F E x)
-- Mathlib/Analysis/InnerProductSpace/TwoDim.lean
theorem nonneg_inner_and_areaForm_eq_zero_iff_sameRay (x y : E) :
    0 ≤ ⟪x, y⟫ ∧ ω x y = 0 ↔ SameRay ℝ x y
-- Mathlib/Analysis/Calculus/InverseFunctionTheorem/FDeriv.lean
theorem map_nhds_eq_of_equiv (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) :
    map f (𝓝 a) = 𝓝 (f a)
-- Mathlib/CategoryTheory/Bicategory/Basic.lean
theorem whiskerRight_id_symm {f g : a ⟶ b} (η : f ⟶ g) : η = (ρ_ f).inv ≫ η ▷ 𝟙 b ≫ (ρ_ g).hom
-- Mathlib/RingTheory/Binomial.lean
theorem choose_add_smul_choose [NatPowAssoc R] (r : R) (n k : ℕ) :
    (Nat.choose (n + k) k) • choose (r + k) (n + k) = choose (r + k) k * choose r n
-- Mathlib/Algebra/Order/Ring/Pow.lean
/-- **Bernoulli's inequality** for `n : ℕ`, `-2 ≤ a`. -/
lemma one_add_mul_le_pow (H : -2 ≤ a) (n : ℕ) : 1 + n * a ≤ (1 + a) ^ n
-- Mathlib/CategoryTheory/Enriched/Basic.lean
@[simp]
theorem ForgetEnrichment.homOf_homTo {X Y : ForgetEnrichment W C} (f : X ⟶ Y) :
    ForgetEnrichment.homOf W (ForgetEnrichment.homTo W f) = f
-- Mathlib/Algebra/Lie/Weights/RootSystem.lean
lemma rootSpace_neg_nsmul_add_chainTop_of_lt {n : ℕ} (hn : chainLength α β < n) :
    rootSpace H (- (n • α) + chainTop α β) = ⊥
-- Mathlib/Data/Nat/Digits.lean
theorem digits_two_eq_bits (n : ℕ) : digits 2 n = n.bits.map fun b => cond b 1 0
-- Mathlib/Analysis/Seminorm.lean
lemma uniformity_eq_of_hasBasis
    {ι} [UniformSpace E] [UniformAddGroup E] [ContinuousConstSMul 𝕜 E]
    {p' : ι → Prop} {s : ι → Set E} (p : Seminorm 𝕜 E) (hb : (𝓝 0 : Filter E).HasBasis p' s)
    (h₁ : ∃ r, p.closedBall 0 r ∈ 𝓝 0) (h₂ : ∀ i, p' i → ∃ r > 0, p.ball 0 r ⊆ s i) :
    𝓤 E = ⨅ r > 0, 𝓟 {x | p (x.1 - x.2) < r}
-- Mathlib/RingTheory/Localization/Basic.lean
theorem monoidOf_eq_algebraMap (x) : (monoidOf M).toMap x = algebraMap R (Localization M) x
-- Mathlib/CategoryTheory/Whiskering.lean
@[simp]
theorem whiskerRight_id {G : C ⥤ D} (F : D ⥤ E) :
    whiskerRight (NatTrans.id G) F = NatTrans.id (G.comp F)
-- Mathlib/CategoryTheory/Localization/FiniteProducts.lean
lemma adj_counit_app (F : Discrete J ⥤ C) :
    (adj L hW).counit.app (F ⋙ L) =
      (Functor.const (Discrete J)).map ((compLimitFunctorIso L hW).hom.app F) ≫
        (Functor.compConstIso (Discrete J) L).hom.app (lim.obj F) ≫
        whiskerRight (constLimAdj.counit.app F) L
-- Mathlib/Data/NNReal/Basic.lean
@[simp]
theorem inv_le {r p : ℝ≥0} (h : r ≠ 0) : r⁻¹ ≤ p ↔ 1 ≤ r * p
-- Mathlib/Data/Fintype/Basic.lean
theorem not_mem_compl : a ∉ sᶜ ↔ a ∈ s
-- Mathlib/Order/Heyting/Hom.lean
@[simp]
theorem coe_copy (f : HeytingHom α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'