ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
-- Mathlib/FieldTheory/IsPerfectClosure.lean
/-- If `i : K →+* L` and `j : K →+* M` are ring homomorphisms of characteristic `p` rings, such that
`i` is `p`-radical, and `M` is a perfect ring, then `PerfectRing.liftAux` is well-defined. -/
theorem liftAux_apply (x : L) (n : ℕ) (y : K) (h : i y = x ^ p ^ n) :
    liftAux i j p x = (iterateFrobeniusEquiv M p n).symm (j y)
-- Mathlib/Data/Nat/Hyperoperation.lean
@[simp]
theorem hyperoperation_one : hyperoperation 1 = (· + ·)
-- Mathlib/CategoryTheory/ComposableArrows.lean
lemma ext {F G : ComposableArrows C n} (h : ∀ i, F.obj i = G.obj i)
    (w : ∀ (i : ℕ) (hi : i < n), F.map' i (i + 1) =
      eqToHom (h _) ≫ G.map' i (i + 1) ≫ eqToHom (h _).symm) : F = G
-- Mathlib/RingTheory/Polynomial/Cyclotomic/Eval.lean
/-- Cyclotomic polynomials are always nonnegative on inputs one or more. -/
theorem cyclotomic_nonneg (n : ℕ) {R} [LinearOrderedCommRing R] {x : R} (hx : 1 ≤ x) :
    0 ≤ eval x (cyclotomic n R)
-- Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean
theorem Basis.card_le_card_of_linearIndependent {ι : Type*} [Fintype ι] (b : Basis ι R M)
    {ι' : Type*} [Fintype ι'] {v : ι' → M} (hv : LinearIndependent R v) :
    Fintype.card ι' ≤ Fintype.card ι
-- Mathlib/Order/Filter/Ultrafilter.lean
theorem forall_neBot_le_iff {g : Filter α} {p : Filter α → Prop} (hp : Monotone p) :
    (∀ f : Filter α, NeBot f → f ≤ g → p f) ↔ ∀ f : Ultrafilter α, ↑f ≤ g → p f
-- Mathlib/CategoryTheory/GradedObject/Trifunctor.lean
@[ext]
lemma mapTrifunctorMapObj_ext {X₁ : GradedObject I₁ C₁} {X₂ : GradedObject I₂ C₂}
    {X₃ : GradedObject I₃ C₃} {Y : C₄} (j : J)
    [HasMap ((((mapTrifunctor F I₁ I₂ I₃).obj X₁).obj X₂).obj X₃) p]
    {φ φ' : mapTrifunctorMapObj F p X₁ X₂ X₃ j ⟶ Y}
    (h : ∀ (i₁ : I₁) (i₂ : I₂) (i₃ : I₃) (h : p ⟨i₁, i₂, i₃⟩ = j),
      ιMapTrifunctorMapObj F p X₁ X₂ X₃ i₁ i₂ i₃ j h ≫ φ =
        ιMapTrifunctorMapObj F p X₁ X₂ X₃ i₁ i₂ i₃ j h ≫ φ') : φ = φ'
-- Mathlib/Order/Defs.lean
theorem ne_of_lt {a b : α} (h : a < b) : a ≠ b
-- Mathlib/LinearAlgebra/TensorPower.lean
theorem galgebra_toFun_def (r : R) :
    @DirectSum.GAlgebra.toFun ℕ R (fun i => ⨂[R]^i M) _ _ _ _ _ _ _ r = algebraMap₀ r
-- Mathlib/CategoryTheory/Endomorphism.lean
theorem smul_right {X Y : C} {r : End Y} {f : X ⟶ Y} : r • f = f ≫ r
-- Mathlib/NumberTheory/ModularForms/JacobiTheta/TwoVariable.lean
lemma jacobiTheta₂'_add_left' (z τ : ℂ) :
    jacobiTheta₂' (z + τ) τ =
      cexp (-π * I * (τ + 2 * z)) * (jacobiTheta₂' z τ - 2 * π * I * jacobiTheta₂ z τ)
-- Mathlib/Analysis/Normed/Group/Hom.lean
/-- Given a normed group hom `f : V₁ → V₂` satisfying `g.comp f = 0` for some `g : V₂ → V₃`,
    the corestriction of `f` to the kernel of `g`. -/
@[simps]
def ker.lift (h : g.comp f = 0) : NormedAddGroupHom V₁ g.ker
-- Mathlib/RingTheory/PrimeSpectrum.lean
theorem zeroLocus_anti_mono_ideal {s t : Ideal R} (h : s ≤ t) :
    zeroLocus (t : Set R) ⊆ zeroLocus (s : Set R)
-- Mathlib/Data/Complex/Basic.lean
@[simp, norm_cast] lemma intCast_re (n : ℤ) : (n : ℂ).re = n
-- Mathlib/Algebra/Star/Subalgebra.lean
@[simp]
theorem mem_comap (S : StarSubalgebra R B) (f : A →⋆ₐ[R] B) (x : A) : x ∈ S.comap f ↔ f x ∈ S
-- Mathlib/NumberTheory/Liouville/LiouvilleNumber.lean
theorem liouville_liouvilleNumber {m : ℕ} (hm : 2 ≤ m) : Liouville (liouvilleNumber m)
-- Mathlib/RingTheory/AlgebraTower.lean
theorem Basis.smulTower_repr_mk {ι : Type v₁} {ι' : Type w₁} (b : Basis ι R S) (c : Basis ι' S A)
    (x i j) : (b.smulTower c).repr x (i, j) = b.repr (c.repr x j) i
-- Mathlib/Analysis/NormedSpace/AffineIsometry.lean
@[simp]
theorem coe_toIsometryEquiv : ⇑e.toIsometryEquiv = e
-- .lake/packages/lean4/src/lean/Init/Data/Bool.lean
@[simp] theorem or_iff_left_iff_imp  : ∀(a b : Bool), ((a || b) = a) ↔ (b → a)
-- Mathlib/MeasureTheory/Function/LpSpace.lean
protected theorem antitone [IsFiniteMeasure μ] {p q : ℝ≥0∞} (hpq : p ≤ q) : Lp E q μ ≤ Lp E p μ
-- Mathlib/Topology/UniformSpace/Cauchy.lean
/-- A union of a finite family of sets is totally bounded
if and only if each set of the family is totally bounded. -/
lemma totallyBounded_sUnion {S : Set (Set α)} (hS : S.Finite) :
    TotallyBounded (⋃₀ S) ↔ ∀ s ∈ S, TotallyBounded s
-- Mathlib/RingTheory/JacobsonIdeal.lean
@[simp]
theorem jacobson_idem : jacobson (jacobson I) = jacobson I
-- Mathlib/Algebra/Homology/ShortComplex/Exact.lean
lemma Exact.epi_f_iff (hS : S.Exact) : Epi S.f ↔ S.g = 0
-- Mathlib/Data/Matrix/Block.lean
theorem toBlock_diagonal_self (d : m → α) (p : m → Prop) :
    Matrix.toBlock (diagonal d) p p = diagonal fun i : Subtype p => d ↑i
-- Mathlib/Order/Hom/Lattice.lean
@[simp]
theorem dual_id : InfHom.dual (InfHom.id α) = SupHom.id _
-- Mathlib/RingTheory/Ideal/Operations.lean
theorem radical_inf : radical (I ⊓ J) = radical I ⊓ radical J
-- Mathlib/NumberTheory/RamificationInertia.lean
@[simp]
theorem Quotient.algebraMap_quotient_pow_ramificationIdx (x : R) :
    algebraMap (R ⧸ p) (S ⧸ P ^ e) (Ideal.Quotient.mk p x) = Ideal.Quotient.mk (P ^ e) (f x)
-- .lake/packages/lean4/src/lean/Init/Data/List/Lemmas.lean
@[simp 1100] theorem mem_insert_self (a : α) (l : List α) : a ∈ l.insert a
-- Mathlib/NumberTheory/SiegelsLemma.lean
theorem exists_ne_zero_int_vec_norm_le : ∃ t : β → ℤ, t ≠ 0 ∧
    A *ᵥ t = 0 ∧ ‖t‖ ≤ (n * max 1 ‖A‖) ^ ((m : ℝ) / (n - m))
-- Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean
theorem contDiffAt_rpow_const_of_le {x p : ℝ} {n : ℕ} (h : ↑n ≤ p) :
    ContDiffAt ℝ n (fun x : ℝ => x ^ p) x
-- Mathlib/CategoryTheory/Equivalence.lean
/-- Construct an isomorphism `F ⋙ H.inverse ≅ G` from an isomorphism `F ≅ G ⋙ H.functor`. -/
@[simps!]
def compInverseIso {H : D ≌ E} (i : F ≅ G ⋙ H.functor) : F ⋙ H.inverse ≅ G
-- Mathlib/Data/PFunctor/Univariate/Basic.lean
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : P α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i)
-- Mathlib/Order/RelIso/Basic.lean
@[simp]
theorem default_def (r : α → α → Prop) : default = RelIso.refl r
-- Mathlib/Analysis/Calculus/Deriv/Basic.lean
theorem hasStrictFDerivAt_iff_hasStrictDerivAt {f' : 𝕜 →L[𝕜] F} :
    HasStrictFDerivAt f f' x ↔ HasStrictDerivAt f (f' 1) x
-- Mathlib/Logic/Embedding/Set.lean
@[simp]
theorem codRestrict_apply {α β} (p) (f : α ↪ β) (H a) : codRestrict p f H a = ⟨f a, H a⟩
-- Mathlib/Algebra/Group/Submonoid/Operations.lean
@[to_additive (attr := simp)]
lemma mk_eq_one {a : M} {ha} : (⟨a, ha⟩ : S) = 1 ↔ a = 1
-- Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean
/-- When both maps `S.f` and `S.g` of a short complex `S` are zero, this is the left homology map
data (for the identity of `S`) which relates the left homology data
`LeftHomologyData.ofIsLimitKernelFork` and `ofZeros` . -/
@[simps]
def compatibilityOfZerosOfIsLimitKernelFork (hf : S.f = 0) (hg : S.g = 0)
    (c : KernelFork S.g) (hc : IsLimit c) :
    LeftHomologyMapData (𝟙 S) (LeftHomologyData.ofIsLimitKernelFork S hf c hc)
      (LeftHomologyData.ofZeros S hf hg)
-- Mathlib/Analysis/Complex/ReImTopology.lean
/-- `Complex.im` turns `ℂ` into a trivial topological fiber bundle over `ℝ`. -/
theorem isHomeomorphicTrivialFiberBundle_im : IsHomeomorphicTrivialFiberBundle ℝ im
-- Mathlib/MeasureTheory/Constructions/Prod/Basic.lean
/-- If `s ×ˢ t` is a null measurable set and `ν t ≠ 0`, then `s` is a null measurable set. -/
lemma _root_.MeasureTheory.NullMeasurableSet.left_of_prod {s : Set α} {t : Set β}
    (h : NullMeasurableSet (s ×ˢ t) (μ.prod ν)) (ht : ν t ≠ 0) : NullMeasurableSet s μ
-- Mathlib/Combinatorics/Additive/FreimanHom.lean
@[to_additive]
lemma IsMulFreimanIso.prod (h₁ : IsMulFreimanIso n A₁ B₁ f₁) (h₂ : IsMulFreimanIso n A₂ B₂ f₂) :
    IsMulFreimanIso n (A₁ ×ˢ A₂) (B₁ ×ˢ B₂) (Prod.map f₁ f₂)
-- Mathlib/RingTheory/MvPolynomial/NewtonIdentities.lean
private theorem sum_filter_pairs_eq_sum_powersetCard_mem_filter_antidiagonal_sum (k : ℕ) (a : ℕ × ℕ)
    (ha : a ∈ (antidiagonal k).filter (fun a ↦ a.fst < k)) (f : Finset σ × σ → MvPolynomial σ R) :
    (∑ t ∈ filter (fun t ↦ card t.fst = a.fst) (pairs σ k), f t) =
    ∑ A ∈ powersetCard a.fst univ, (∑ j, f (A, j))
-- Mathlib/LinearAlgebra/QuadraticForm/Basic.lean
theorem map_smul (a : R) (x : M) : Q (a • x) = (a * a) • Q x
-- Mathlib/Algebra/Group/Submonoid/Units.lean
@[to_additive]
lemma isUnit_of_mem_ofUnits (S : Subgroup Mˣ) {x : M} (hx : x ∈ S.ofUnits) : IsUnit x
-- Mathlib/Data/Set/Lattice.lean
theorem mem_iUnion₂ {x : γ} {s : ∀ i, κ i → Set γ} : (x ∈ ⋃ (i) (j), s i j) ↔ ∃ i j, x ∈ s i j
-- Mathlib/NumberTheory/NumberField/Embeddings.lean
lemma not_isUnramified_iff :
    ¬ IsUnramified k w ↔ IsComplex w ∧ IsReal (w.comap (algebraMap k K))
-- Mathlib/Data/Matrix/Basis.lean
@[simp]
theorem mul_right_apply_same (a : n) (M : Matrix n n α) :
    (M * stdBasisMatrix i j c) a j = M a i * c
-- Mathlib/Algebra/Group/Basic.lean
@[to_additive]
theorem mul_div_assoc (a b c : G) : a * b / c = a * (b / c)
-- Mathlib/Topology/Instances/ENNReal.lean
theorem ENNReal.ofReal_tsum_of_nonneg {f : α → ℝ} (hf_nonneg : ∀ n, 0 ≤ f n) (hf : Summable f) :
    ENNReal.ofReal (∑' n, f n) = ∑' n, ENNReal.ofReal (f n)
-- Mathlib/Algebra/Module/LinearMap/Defs.lean
theorem comp_sub (f g : M →ₛₗ[σ₁₂] N₂) (h : N₂ →ₛₗ[σ₂₃] N₃) :
    h.comp (g - f) = h.comp g - h.comp f
-- Mathlib/Data/Set/Pointwise/SMul.lean
@[to_additive (attr := simp)]
theorem iUnion_inv_smul : ⋃ g : α, g⁻¹ • s = ⋃ g : α, g • s
-- .lake/packages/batteries/Batteries/Data/List/Lemmas.lean
theorem Sublist.append_left : l₁ <+ l₂ → ∀ l, l ++ l₁ <+ l ++ l₂
-- Mathlib/Topology/Order/UpperLowerSetTopology.lean
@[simp] lemma map_comp (g : β →o γ) (f : α →o β) : map (g.comp f) = (map g).comp (map f)
-- Mathlib/Algebra/Group/Basic.lean
@[to_additive]
theorem mul_comm_div : a / b * c = a * (c / b)
-- Mathlib/Order/Sublattice.lean
lemma le_comap_sup (L M : Sublattice β) (f : LatticeHom α β) :
    comap f L ⊔ comap f M ≤ comap f (L ⊔ M)
-- Mathlib/AlgebraicGeometry/Gluing.lean
/-- The open cover of the glued space given by the glue data. -/
@[simps (config := .lemmasOnly)]
def openCover (D : Scheme.GlueData) : OpenCover D.glued
-- Mathlib/NumberTheory/ModularForms/Basic.lean
@[simp]
theorem coe_zero : ⇑(0 : CuspForm Γ k) = (0 : ℍ → ℂ)
-- Mathlib/GroupTheory/Perm/Fin.lean
@[simp]
theorem Equiv.Perm.decomposeFin.symm_sign {n : ℕ} (p : Fin (n + 1)) (e : Perm (Fin n)) :
    Perm.sign (Equiv.Perm.decomposeFin.symm (p, e)) = ite (p = 0) 1 (-1) * Perm.sign e
-- Mathlib/MeasureTheory/MeasurableSpace/Embedding.lean
theorem coe_trans (ab : α ≃ᵐ β) (bc : β ≃ᵐ γ) : ⇑(ab.trans bc) = bc ∘ ab
-- Mathlib/Analysis/CstarAlgebra/ContinuousFunctionalCalculus/Instances.lean
lemma spectrum_star_mul_self_nonneg {b : A} : ∀ x ∈ spectrum ℝ (star b * b), 0 ≤ x
-- Mathlib/Analysis/SpecialFunctions/Complex/Log.lean
@[simp, norm_cast]
lemma natCast_log {n : ℕ} : Real.log n = log n
-- Mathlib/MeasureTheory/Measure/WithDensity.lean
/-- The Lebesgue integral of `g` with respect to the measure `μ.withDensity f` coincides with
the integral of `f * g`. This version assumes that `g` is almost everywhere measurable. For a
version without conditions on `g` but requiring that `f` is almost everywhere finite, see
`lintegral_withDensity_eq_lintegral_mul_non_measurable` -/
theorem lintegral_withDensity_eq_lintegral_mul₀' {μ : Measure α} {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) {g : α → ℝ≥0∞} (hg : AEMeasurable g (μ.withDensity f)) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ
-- Mathlib/AlgebraicGeometry/AffineScheme.lean
theorem Scheme.map_PrimeSpectrum_basicOpen_of_affine
    (X : Scheme) [IsAffine X] (f : Scheme.Γ.obj (op X)) :
    X.isoSpec.hom ⁻¹ᵁ PrimeSpectrum.basicOpen f = X.basicOpen f
-- Mathlib/Algebra/Regular/SMul.lean
@[simp]
theorem mul_iff_right [Mul R] [IsScalarTower R R M] (ha : IsSMulRegular M a) :
    IsSMulRegular M (a * b) ↔ IsSMulRegular M b
-- Mathlib/Algebra/Order/Group/Unbundled/Basic.lean
@[to_additive]
theorem Left.self_le_inv (h : a ≤ 1) : a ≤ a⁻¹
-- Mathlib/RingTheory/Polynomial/Chebyshev.lean
@[simp]
theorem U_zero : U R 0 = 1
-- Mathlib/Data/Set/Card.lean
theorem exists_ne_of_one_lt_encard (h : 1 < s.encard) (a : α) : ∃ b ∈ s, b ≠ a
-- Mathlib/Algebra/GCDMonoid/Finset.lean
theorem gcd_eq_zero_iff : s.gcd f = 0 ↔ ∀ x : β, x ∈ s → f x = 0
-- Mathlib/GroupTheory/GroupAction/Basic.lean
@[to_additive]
theorem mem_orbit_smul (g : G) (a : α) : a ∈ orbit G (g • a)
-- Mathlib/MeasureTheory/Measure/OpenPos.lean
theorem measure_Iio_pos [NoMinOrder X] (a : X) : 0 < μ (Iio a)
-- Mathlib/Analysis/Fourier/FourierTransformDeriv.lean
/-- If `‖v‖^n * ‖f v‖` is integrable for all `n ≤ N`, then the Fourier transform of `f` is `C^N`. -/
theorem contDiff_fourierIntegral {N : ℕ∞}
    (hf : ∀ (n : ℕ), n ≤ N → Integrable (fun v ↦ ‖v‖^n * ‖f v‖) μ) :
    ContDiff ℝ N (fourierIntegral 𝐞 μ L.toLinearMap₂ f)
-- Mathlib/FieldTheory/PurelyInseparable.lean
/-- If `F` is a field of exponential characteristic `q`, `F(S) / F` is separable, then
`F(S) = F(S ^ q)`. -/
theorem adjoin_eq_adjoin_pow_expChar_of_isSeparable (S : Set E) [Algebra.IsSeparable F (adjoin F S)]
    (q : ℕ) [ExpChar F q] : adjoin F S = adjoin F ((· ^ q) '' S)
-- Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean
@[simp]
theorem toCone_π_app_left (c : BinaryBicone P Q) : c.toCone.π.app ⟨WalkingPair.left⟩ = c.fst
-- Mathlib/LinearAlgebra/QuadraticForm/Isometry.lean
/-- An isometry between two quadratic spaces `M₁, Q₁` and `M₂, Q₂` over a ring `R`,
is a linear map between `M₁` and `M₂` that commutes with the quadratic forms. -/
structure Isometry (Q₁ : QuadraticMap R M₁ N) (Q₂ : QuadraticMap R M₂ N) extends M₁ →ₗ[R] M₂ where
  /-- The quadratic form agrees across the map. -/
  map_app' : ∀ m, Q₂ (toFun m) = Q₁ m
-- .lake/packages/lean4/src/lean/Init/Data/Nat/Basic.lean
protected theorem lt_le_asymm : ∀{a b : Nat}, a < b → ¬(b ≤ a)
-- Mathlib/Topology/Algebra/Monoid.lean
@[to_additive]
theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b)
-- Mathlib/Data/Finset/Basic.lean
theorem eq_empty_of_ssubset_singleton {s : Finset α} {x : α} (hs : s ⊂ {x}) : s = ∅
-- Mathlib/Data/Finmap.lean
theorem mem_lookup_union {a} {b : β a} {s₁ s₂ : Finmap β} :
    b ∈ lookup a (s₁ ∪ s₂) ↔ b ∈ lookup a s₁ ∨ a ∉ s₁ ∧ b ∈ lookup a s₂
-- Mathlib/Order/Hom/Bounded.lean
theorem copy_eq (f : BoundedOrderHom α β) (f' : α → β) (h : f' = f) : f.copy f' h = f
-- Mathlib/Analysis/Convex/Deriv.lean
lemma lt_slope_of_hasDerivWithinAt (hfc : StrictConcaveOn ℝ S f)
    (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y) (hf' : HasDerivWithinAt f f' S y) :
    f' < slope f x y
-- Mathlib/AlgebraicGeometry/OpenImmersion.lean
theorem range_pullback_to_base_of_left :
    Set.range (pullback.fst f g ≫ f).1.base =
      Set.range f.1.base ∩ Set.range g.1.base
-- Mathlib/Combinatorics/SimpleGraph/Triangle/Tripartite.lean
@[simp] lemma not_in₁₁ : ¬ (graph t).Adj (in₁ b) (in₁ b')
-- Mathlib/Topology/Algebra/Module/Basic.lean
theorem toSpanSingleton_add [ContinuousAdd M₁] (x y : M₁) :
    toSpanSingleton R₁ (x + y) = toSpanSingleton R₁ x + toSpanSingleton R₁ y
-- Mathlib/Data/Finset/Lattice.lean
theorem min_mem_insert_top_image_coe (s : Finset α) :
    s.min ∈ (insert ⊤ (s.image (↑)) : Finset (WithTop α))
-- Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean
theorem _root_.NumberField.canonicalEmbedding_injective [NumberField K] :
    Function.Injective (NumberField.canonicalEmbedding K)
-- Mathlib/CategoryTheory/Limits/Constructions/ZeroObjects.lean
@[simp]
theorem zeroProdIso_inv_snd (X : C) : (zeroProdIso X).inv ≫ prod.snd = 𝟙 X
-- Mathlib/GroupTheory/MonoidLocalization/Basic.lean
/-- Given a MonoidHom `f : M →* N` and Submonoid `S ⊆ M` such that `f(S) ⊆ Nˣ`, for all
`w, z : N` and `y ∈ S`, we have `w * (f y)⁻¹ = z ↔ w = f y * z`. -/
@[to_additive
    "Given an AddMonoidHom `f : M →+ N` and Submonoid `S ⊆ M` such that
`f(S) ⊆ AddUnits N`, for all `w, z : N` and `y ∈ S`, we have `w - f y = z ↔ w = f y + z`."]
theorem mul_inv_left {f : M →* N} (h : ∀ y : S, IsUnit (f y)) (y : S) (w z : N) :
    w * (IsUnit.liftRight (f.restrict S) h y)⁻¹ = z ↔ w = f y * z
-- Mathlib/Topology/Bases.lean
theorem exists_countable_basis [SecondCountableTopology α] :
    ∃ b : Set (Set α), b.Countable ∧ ∅ ∉ b ∧ IsTopologicalBasis b
-- Mathlib/Algebra/Free.lean
@[to_additive (attr := ext 1100)]
theorem hom_ext {β : Type v} [Mul β] {f g : FreeSemigroup α →ₙ* β} (h : f ∘ of = g ∘ of) : f = g
-- Mathlib/Algebra/MonoidAlgebra/Basic.lean
/-- The opposite of a `MonoidAlgebra R I` equivalent as a ring to
the `MonoidAlgebra Rᵐᵒᵖ Iᵐᵒᵖ` over the opposite ring, taking elements to their opposite. -/
@[simps! (config := { simpRhs := true }) apply symm_apply]
protected noncomputable def opRingEquiv [Monoid G] :
    (MonoidAlgebra k G)ᵐᵒᵖ ≃+* MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ
-- Mathlib/Analysis/Normed/Module/FiniteDimension.lean
/-- **Riesz's theorem**: if a closed ball of positive radius is compact in a vector space, then the
space is finite-dimensional. -/
theorem FiniteDimensional.of_isCompact_closedBall {r : ℝ} (rpos : 0 < r) {c : E}
    (h : IsCompact (Metric.closedBall c r)) : FiniteDimensional 𝕜 E
-- Mathlib/RingTheory/LocalProperties.lean
theorem RingHom.HoldsForLocalizationAway.of_bijective
    (H : RingHom.HoldsForLocalizationAway P) (hf : Function.Bijective f) :
    P f
-- Mathlib/MeasureTheory/Function/LpSeminorm/Basic.lean
theorem eLpNorm_one_add_measure (f : α → F) (μ ν : Measure α) :
    eLpNorm f 1 (μ + ν) = eLpNorm f 1 μ + eLpNorm f 1 ν
-- Mathlib/Order/Fin/Basic.lean
/-- The equivalence `Fin n ≃ {i // i < n}` is an order isomorphism. -/
@[simps! apply symm_apply]
def orderIsoSubtype : Fin n ≃o {i // i < n}
-- Mathlib/AlgebraicTopology/SimplicialObject.lean
/-- Functor composition induces a functor on augmented cosimplicial objects. -/
@[simps]
def whiskering (D : Type u') [Category.{v'} D] : (C ⥤ D) ⥤ Augmented C ⥤ Augmented D
-- Mathlib/CategoryTheory/Abelian/Exact.lean
/-- A functor which preserves exactness preserves epimorphisms. -/
theorem preservesEpimorphisms_of_map_exact : L.PreservesEpimorphisms
-- Mathlib/Algebra/Order/Field/Basic.lean
theorem sub_self_div_two (a : α) : a - a / 2 = a / 2
-- Mathlib/Topology/UniformSpace/Separation.lean
theorem lift'_mk [T0Space β] {f : α → β} (h : UniformContinuous f) (a : α) :
    lift' f (mk a) = f a
-- Mathlib/NumberTheory/ArithmeticFunction.lean
theorem map_prod {ι : Type*} [CommMonoidWithZero R] (g : ι → ℕ) {f : ArithmeticFunction R}
    (hf : f.IsMultiplicative) (s : Finset ι) (hs : (s : Set ι).Pairwise (Coprime on g)) :
    f (∏ i ∈ s, g i) = ∏ i ∈ s, f (g i)
-- Mathlib/Topology/Sets/Compacts.lean
@[simp]
theorem coe_top [CompactSpace α] [Nonempty α] : (↑(⊤ : PositiveCompacts α) : Set α) = univ
-- Mathlib/NumberTheory/Harmonic/Bounds.lean
theorem harmonic_le_one_add_log (n : ℕ) :
    harmonic n ≤ 1 + Real.log n
-- .lake/packages/batteries/Batteries/Data/String/Lemmas.lean
theorem revFind_of_valid (p s) :
    revFind s p = (s.1.reverse.dropWhile (!p ·)).tail?.map (⟨utf8Len ·⟩)
-- Mathlib/CategoryTheory/Limits/ConeCategory.lean
/-- Given a cocone `c : Cocone K` and a map `f : F.obj c.X ⟶ X`, we can construct a cocone of
    costructured arrows over `X` with `f` as the cone point. -/
@[simps]
def Cocone.toCostructuredArrowCocone {K : J ⥤ C} (c : Cocone K) (F : C ⥤ D) {X : D}
    (f : F.obj c.pt ⟶ X) : Cocone ((F.mapCocone c).toCostructuredArrow ⋙
      CostructuredArrow.map f ⋙ CostructuredArrow.pre _ _ _)
-- Mathlib/Data/Set/Function.lean
lemma InjOn.prodMap (h₁ : s₁.InjOn f₁) (h₂ : s₂.InjOn f₂) :
    (s₁ ×ˢ s₂).InjOn fun x ↦ (f₁ x.1, f₂ x.2)
-- Mathlib/Algebra/Algebra/Quasispectrum.lean
/-- If `A` is a non-unital `R`-algebra, then the subgroup of units of `Unitization R A` whose
scalar part is `1 : R` (i.e., `Unitization.unitsFstOne`) is isomorphic to the group of units of
`PreQuasiregular A`. -/
@[simps]
def unitsFstOne_mulEquiv_quasiregular : unitsFstOne R A ≃* (PreQuasiregular A)ˣ
-- Mathlib/Analysis/Calculus/MeanValue.lean
/-- Let `f : ℝ → ℝ` be a differentiable function. If `C < f'`, then `f` grows faster than
`C * x`, i.e., `C * (y - x) < f y - f x` whenever `x < y`. -/
theorem mul_sub_lt_image_sub_of_lt_deriv {f : ℝ → ℝ} (hf : Differentiable ℝ f) {C}
    (hf'_gt : ∀ x, C < deriv f x) ⦃x y⦄ (hxy : x < y) : C * (y - x) < f y - f x
-- Mathlib/CategoryTheory/Limits/HasLimits.lean
theorem limit.map_pre' [HasLimitsOfShape K C] (F : J ⥤ C) {E₁ E₂ : K ⥤ J} (α : E₁ ⟶ E₂) :
    limit.pre F E₂ = limit.pre F E₁ ≫ lim.map (whiskerRight α F)
-- Mathlib/Geometry/Euclidean/Angle/Oriented/Affine.lean
/-- An oriented angle is unchanged by replacing the first point with the midpoint of the segment
between the second point and that point. -/
@[simp]
theorem oangle_midpoint_rev_left (p₁ p₂ p₃ : P) : ∡ (midpoint ℝ p₂ p₁) p₂ p₃ = ∡ p₁ p₂ p₃
-- Mathlib/Logic/Equiv/Basic.lean
/-- The equivalence between a product of two dependent functions types and a single dependent
function type. Basically a symmetric version of `Equiv.sumPiEquivProdPi`. -/
@[simps!]
def prodPiEquivSumPi (π : ι → Type u) (π' : ι' → Type u) :
    ((∀ i, π i) × ∀ i', π' i') ≃ ∀ i, Sum.elim π π' i
-- Mathlib/FieldTheory/KrullTopology.lean
/-- An element of `L ≃ₐ[K] L` is in `Gal(L/E)` if and only if it fixes every element of `E`-/
theorem IntermediateField.mem_fixingSubgroup_iff {K L : Type*} [Field K] [Field L] [Algebra K L]
    (E : IntermediateField K L) (σ : L ≃ₐ[K] L) : σ ∈ E.fixingSubgroup ↔ ∀ x : L, x ∈ E → σ x = x
-- Mathlib/LinearAlgebra/AffineSpace/AffineSubspace.lean
/-- Constructing an affine subspace from a point in a subspace and that subspace's direction
yields the original subspace. -/
@[simp]
theorem mk'_eq {s : AffineSubspace k P} {p : P} (hp : p ∈ s) : mk' p s.direction = s
-- Mathlib/Computability/Language.lean
@[simp]
theorem add_self (l : Language α) : l + l = l
-- Mathlib/Data/Matroid/Closure.lean
lemma closure_biUnion_closure_eq_closure_sUnion (M : Matroid α) (Xs : Set (Set α)) :
    M.closure (⋃ X ∈ Xs, M.closure X) = M.closure (⋃₀ Xs)
-- Mathlib/Data/Seq/WSeq.lean
@[simp]
theorem flatten_think (c : Computation (WSeq α)) : flatten c.think = think (flatten c)
-- Mathlib/GroupTheory/MonoidLocalization/Basic.lean
@[to_additive (attr := simp)]
theorem liftOn_mk' {p : Sort u} (f : M → S → p) (H) (a : M) (b : S) :
    liftOn ((monoidOf S).mk' a b) f H = f a b
-- .lake/packages/lean4/src/lean/Init/Data/Int/Order.lean
protected theorem not_le_of_gt {a b : Int} (h : b < a) : ¬a ≤ b
-- Mathlib/Order/Hom/Lattice.lean
lemma toFun_eq_coe (f : LatticeHom α β) : f.toFun = f
-- Mathlib/Topology/MetricSpace/Infsep.lean
theorem einfsep_pair_le_right (hxy : x ≠ y) : ({x, y} : Set α).einfsep ≤ edist y x
-- Mathlib/Algebra/Star/StarRingHom.lean
@[simp]
theorem coe_ofBijective {f : F} (hf : Function.Bijective f) :
    (StarRingEquiv.ofBijective f hf : A → B) = f
-- Mathlib/CategoryTheory/Subobject/Lattice.lean
theorem inf_eq_map_pullback' {A : C} (f₁ : MonoOver A) (f₂ : Subobject A) :
    (Subobject.inf.obj (Quotient.mk'' f₁)).obj f₂ =
      (Subobject.map f₁.arrow).obj ((Subobject.pullback f₁.arrow).obj f₂)
-- Mathlib/Data/List/Rotate.lean
@[simp]
theorem cyclicPermutations_rotate (l : List α) (k : ℕ) :
    (l.rotate k).cyclicPermutations = l.cyclicPermutations.rotate k
-- Mathlib/GroupTheory/MonoidLocalization/Basic.lean
@[to_additive]
theorem lift_eq_iff {x y : M × S} :
    f.lift hg (f.mk' x.1 x.2) = f.lift hg (f.mk' y.1 y.2) ↔ g (x.1 * y.2) = g (y.1 * x.2)
-- Mathlib/MeasureTheory/Integral/PeakFunction.lean
/-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
integrable on `s` and continuous at `x₀`.

Version assuming that `μ` gives positive mass to all open sets.
For a less precise but more usable version, see
`tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`.
-/
theorem tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
    [MetrizableSpace α] [IsLocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s)
    {c : α → ℝ} (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀)
    (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s))
    (hmg : IntegrableOn g s μ) (hcg : ContinuousWithinAt g s x₀) :
    Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop
      (𝓝 (g x₀))