ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
-- Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean
lemma evaluation_naturality_apply {V : Opens Y} (x : (Opens.map f.1.base).obj V)
    (a : Y.presheaf.obj (op V)) :
    residueFieldMap f x.val (Y.evaluation ⟨f.val.base x, x.property⟩ a) =
      X.evaluation x (f.val.c.app (op V) a)
-- Mathlib/Data/List/Basic.lean
theorem bind_congr {l : List α} {f g : α → List β} (h : ∀ x ∈ l, f x = g x) :
    List.bind l f = List.bind l g
-- Mathlib/MeasureTheory/MeasurableSpace/Basic.lean
@[fun_prop, measurability]
theorem measurable_swap : Measurable (Prod.swap : α × β → β × α)
-- Mathlib/RingTheory/Smooth/StandardSmooth.lean
lemma jacobiMatrix_apply (i j : P.rels) :
    P.jacobiMatrix i j = MvPolynomial.pderiv (P.map i) (P.relation j)
-- Mathlib/AlgebraicGeometry/Morphisms/Basic.lean
theorem of_isPullback {UX UY : Scheme.{u}} [IsAffine UY] {iY : UY ⟶ Y} [IsOpenImmersion iY]
    {iX : UX ⟶ X} {f' : UX ⟶ UY} (h : IsPullback iX f' f iY) (hf : P f) :
    Q f'
-- Mathlib/Topology/Algebra/Algebra.lean
@[simp]
theorem coe_mk' (f : A →ₐ[R] B) (h) : (mk f h : A → B) = f
-- Mathlib/AlgebraicGeometry/PrimeSpectrum/Basic.lean
theorem isCompact_basicOpen (f : R) : IsCompact (basicOpen f : Set (PrimeSpectrum R))
-- Mathlib/Data/Matrix/Notation.lean
theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1]
-- Mathlib/Probability/Kernel/Disintegration/Density.lean
lemma measurable_densityProcess_right (κ : Kernel α (γ × β)) (ν : Kernel α γ) (n : ℕ)
    {s : Set β} (a : α) (hs : MeasurableSet s) :
    Measurable (fun x ↦ densityProcess κ ν n a x s)
-- Mathlib/RingTheory/Localization/Basic.lean
theorem mk'_cancel (a : R) (b c : M) :
    mk' S (a * c) (b * c) = mk' S a b
-- Mathlib/CategoryTheory/Sites/Subsheaf.lean
@[reassoc (attr := simp)]
theorem toImagePresheaf_ι (f : F' ⟶ F) : toImagePresheaf f ≫ (imagePresheaf f).ι = f
-- Mathlib/LinearAlgebra/Matrix/Adjugate.lean
theorem adjugate_conjTranspose [StarRing α] (A : Matrix n n α) : A.adjugateᴴ = adjugate Aᴴ
-- Mathlib/Topology/Sets/Closeds.lean
/-- The complement of an open set as a closed set. -/
@[simps]
def Opens.compl (s : Opens α) : Closeds α
-- Mathlib/LinearAlgebra/AffineSpace/AffineMap.lean
@[simp]
theorem coe_homothetyAffine (c : P1) : ⇑(homothetyAffine c : k →ᵃ[k] _) = homothety c
-- Mathlib/NumberTheory/DirichletCharacter/Bounds.lean
/-- The value at a unit of a Dirichlet character with target a normed field has norm `1`. -/
@[simp] lemma unit_norm_eq_one (a : (ZMod n)ˣ) : ‖χ a‖ = 1
-- Mathlib/LinearAlgebra/AffineSpace/Slope.lean
theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF]
    (f : PE →ᵃ[k] PF) (g : k → PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b)
-- Mathlib/GroupTheory/Subgroup/Center.lean
@[to_additive (attr := simp)]
theorem center_toSubmonoid : (center G).toSubmonoid = Submonoid.center G
-- Mathlib/Data/Fin/Basic.lean
@[simp] lemma succAbove_succ_self (j : Fin n) : j.succ.succAbove j = j.castSucc
-- Mathlib/NumberTheory/Divisors.lean
@[simp]
theorem image_div_divisors_eq_divisors (n : ℕ) :
    image (fun x : ℕ => n / x) n.divisors = n.divisors
-- .lake/packages/lean4/src/lean/Init/Data/String/Basic.lean
theorem _root_.Char.utf8Size_pos (c : Char) : 0 < c.utf8Size
-- Mathlib/RingTheory/Polynomial/GaussLemma.lean
theorem IsPrimitive.isUnit_iff_isUnit_map_of_injective : IsUnit f ↔ IsUnit (map φ f)
-- Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean
theorem RingHom.Finite.to_isIntegral (h : f.Finite) : f.IsIntegral
-- Mathlib/Analysis/Calculus/Deriv/Inv.lean
theorem DifferentiableWithinAt.div (hc : DifferentiableWithinAt 𝕜 c s x)
    (hd : DifferentiableWithinAt 𝕜 d s x) (hx : d x ≠ 0) :
    DifferentiableWithinAt 𝕜 (fun x => c x / d x) s x
-- Mathlib/LinearAlgebra/Matrix/Transvection.lean
/-- Multiplying by all the matrices in `listTransvecCol M` kills all the coefficients in the
last column but the last one. -/
theorem listTransvecCol_mul_last_col (hM : M (inr unit) (inr unit) ≠ 0) (i : Fin r) :
    ((listTransvecCol M).prod * M) (inl i) (inr unit) = 0
-- Mathlib/Algebra/Module/Equiv/Defs.lean
theorem eq_toLinearMap_symm_comp (f : M₃ →ₛₗ[σ₃₁] M₁) (g : M₃ →ₛₗ[σ₃₂] M₂) :
    f = e₁₂.symm.toLinearMap.comp g ↔ e₁₂.toLinearMap.comp f = g
-- Mathlib/Combinatorics/SimpleGraph/Prod.lean
theorem boxProd_neighborFinset (x : α × β)
    [Fintype (G.neighborSet x.1)] [Fintype (H.neighborSet x.2)] [Fintype ((G □ H).neighborSet x)] :
    (G □ H).neighborFinset x =
      (G.neighborFinset x.1 ×ˢ {x.2}).disjUnion ({x.1} ×ˢ H.neighborFinset x.2)
        (Finset.disjoint_product.mpr <| Or.inl <| neighborFinset_disjoint_singleton _ _)
-- Mathlib/CategoryTheory/Limits/HasLimits.lean
@[reassoc (attr := simp)]
theorem ι_colimMap {F G : J ⥤ C} [HasColimit F] [HasColimit G] (α : F ⟶ G) (j : J) :
    colimit.ι F j ≫ colimMap α = α.app j ≫ colimit.ι G j
-- .lake/packages/lean4/src/lean/Init/PropLemmas.lean
@[simp] theorem ite_true_decide_same (p : Prop) [h : Decidable p] (b : Bool) :
  (if p then decide p else b) = (decide p || b)
-- Mathlib/Analysis/Calculus/Deriv/Inv.lean
theorem HasDerivAt.div (hc : HasDerivAt c c' x) (hd : HasDerivAt d d' x) (hx : d x ≠ 0) :
    HasDerivAt (fun y => c y / d y) ((c' * d x - c x * d') / d x ^ 2) x
-- Mathlib/Data/ENNReal/Operations.lean
theorem sub_eq_of_add_eq (hb : b ≠ ∞) (hc : a + b = c) : c - b = a
-- Mathlib/Data/Finset/Sups.lean
theorem subset_infs {s t : Set α} :
    ↑u ⊆ s ⊼ t → ∃ s' t' : Finset α, ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' ⊼ t'
-- Mathlib/Topology/Category/Stonean/Basic.lean
/-- `Projective` implies `Stonean`. -/
@[simps!]
def toStonean (X : CompHaus.{u}) [Projective X] :
    Stonean
-- Mathlib/Topology/ContinuousOn.lean
theorem diff_mem_nhdsWithin_compl {x : α} {s : Set α} (hs : s ∈ 𝓝 x) (t : Set α) :
    s \ t ∈ 𝓝[tᶜ] x
-- Mathlib/Data/Set/Pointwise/Interval.lean
@[simp]
theorem preimage_neg_Ioo : -Ioo a b = Ioo (-b) (-a)
-- Mathlib/Analysis/InnerProductSpace/LaxMilgram.lean
@[simp]
theorem continuousLinearEquivOfBilin_apply (coercive : IsCoercive B) (v w : V) :
    ⟪coercive.continuousLinearEquivOfBilin v, w⟫_ℝ = B v w
-- Mathlib/Analysis/NormedSpace/MazurUlam.lean
/-- If an isometric self-homeomorphism of a normed vector space over `ℝ` fixes `x` and `y`,
then it fixes the midpoint of `[x, y]`. This is a lemma for a more general Mazur-Ulam theorem,
see below. -/
theorem midpoint_fixed {x y : PE} :
    ∀ e : PE ≃ᵢ PE, e x = x → e y = y → e (midpoint ℝ x y) = midpoint ℝ x y
-- Mathlib/Analysis/SpecialFunctions/Log/NegMulLog.lean
lemma mul_log_nonpos {x : ℝ} (hx₀ : 0 ≤ x) (hx₁ : x ≤ 1) : x * log x ≤ 0
-- Mathlib/Tactic/NormNum/GCD.lean
theorem nat_gcd_helper_dvd_left (x y : ℕ) (h : y % x = 0) : Nat.gcd x y = x
-- Mathlib/RingTheory/Ideal/Quotient.lean
/-- If `f : R^n → R^m` is an `R`-linear map and `I ⊆ R` is an ideal, then the image of `I^n` is
    contained in `I^m`. -/
theorem map_pi {ι : Type*} [Finite ι] {ι' : Type w} (x : ι → R) (hi : ∀ i, x i ∈ I)
    (f : (ι → R) →ₗ[R] ι' → R) (i : ι') : f x i ∈ I
-- Mathlib/AlgebraicGeometry/EllipticCurve/Affine.lean
lemma baseChange_polynomial : (W.baseChange B).toAffine.polynomial =
    (W.baseChange A).toAffine.polynomial.map (mapRingHom f)
-- Mathlib/SetTheory/Cardinal/Cofinality.lean
theorem bsup_lt_ord_lift {o : Ordinal} {f : ∀ a < o, Ordinal} {c : Ordinal}
    (ho : Cardinal.lift.{v, u} o.card < c.cof) (hf : ∀ i hi, f i hi < c) : bsup.{u, v} o f < c
-- Mathlib/CategoryTheory/Closed/Functor.lean
/--
If the Frobenius morphism at `A` is an isomorphism, then the exponential comparison transformation
(at `A`) is an isomorphism.
-/
theorem expComparison_iso_of_frobeniusMorphism_iso (h : L ⊣ F) (A : C)
    [i : IsIso (frobeniusMorphism F h A)] : IsIso (expComparison F A)
-- Mathlib/NumberTheory/MulChar/Basic.lean
theorem coe_toUnitHom (χ : MulChar R R') (a : Rˣ) : ↑(χ.toUnitHom a) = χ a
-- Mathlib/Geometry/Manifold/MFDeriv/SpecificFunctions.lean
theorem mdifferentiable_id : MDifferentiable I I (@id M)
-- Mathlib/Data/List/Sort.lean
@[simp]
theorem mergeSort_singleton (a : α) : [a].mergeSort r = [a]
-- Mathlib/Analysis/SpecialFunctions/Pow/Real.lean
theorem ofReal_cpow_of_nonpos {x : ℝ} (hx : x ≤ 0) (y : ℂ) :
    (x : ℂ) ^ y = (-x : ℂ) ^ y * exp (π * I * y)
-- Mathlib/FieldTheory/Perfect.lean
theorem roots_X_pow_char_sub_C_pow {y : R} {m : ℕ} :
    ((X ^ p - C y) ^ m).roots = (m * p) • {(frobeniusEquiv R p).symm y}
-- Mathlib/Algebra/Homology/TotalComplex.lean
lemma d₁_eq' {i₁ i₁' : I₁} (h : c₁.Rel i₁ i₁') (i₂ : I₂) (i₁₂ : I₁₂) :
    K.d₁ c₁₂ i₁ i₂ i₁₂ = ComplexShape.ε₁ c₁ c₂ c₁₂ ⟨i₁, i₂⟩ • ((K.d i₁ i₁').f i₂ ≫
      K.ιTotalOrZero c₁₂ i₁' i₂ i₁₂)
-- Mathlib/Topology/UniformSpace/Cauchy.lean
theorem Cauchy.mono' {f g : Filter α} (h_c : Cauchy f) (_ : NeBot g) (h_le : g ≤ f) : Cauchy g
-- Mathlib/Order/SuccPred/Basic.lean
/-- Induction principle on a type with a `SuccOrder` for all elements above a given element `m`. -/
@[elab_as_elim]
theorem Succ.rec {P : α → Prop} {m : α} (h0 : P m) (h1 : ∀ n, m ≤ n → P n → P (succ n)) ⦃n : α⦄
    (hmn : m ≤ n) : P n
-- Mathlib/Data/Vector/Snoc.lean
@[simp]
theorem reverse_cons : reverse (x ::ᵥ xs) = (reverse xs).snoc x
-- Mathlib/CategoryTheory/HomCongr.lean
@[simp]
theorem homCongr_symm {X₁ Y₁ X₂ Y₂ : C} (α : X₁ ≅ X₂) (β : Y₁ ≅ Y₂) :
    (α.homCongr β).symm = α.symm.homCongr β.symm
-- Mathlib/Data/ZMod/Units.lean
@[simp]
lemma unitsMap_self (n : ℕ) : unitsMap (dvd_refl n) = MonoidHom.id _
-- Mathlib/Topology/UniformSpace/UniformConvergenceTopology.lean
theorem uniformSpace_eq_iInf_precomp_of_cover {δ : ι → Type*} (φ : Π i, δ i → α)
    (h_cover : ∃ I : Set ι, I.Finite ∧ ⋃ i ∈ I, range (φ i) = univ) :
    𝒰(α, β, _) = ⨅ i, .comap (ofFun ∘ (· ∘ φ i) ∘ toFun) 𝒰(δ i, β, _)
-- Mathlib/Computability/Primrec.lean
theorem option_get {f : α → Option β} {h : ∀ a, (f a).isSome} :
    Primrec f → Primrec fun a => (f a).get (h a)
-- Mathlib/RingTheory/PowerSeries/Basic.lean
@[simp]
theorem coeff_mk (n : ℕ) (f : ℕ → R) : coeff R n (mk f) = f n
-- Mathlib/Analysis/SpecialFunctions/NonIntegrable.lean
/-- The function `fun x => (x - c)⁻¹` is integrable on `a..b` if and only if
`a = b` or `c ∉ [a, b]`. -/
@[simp]
theorem intervalIntegrable_sub_inv_iff {a b c : ℝ} :
    IntervalIntegrable (fun x => (x - c)⁻¹) volume a b ↔ a = b ∨ c ∉ [[a, b]]
-- Mathlib/Topology/Constructions.lean
/-- `Prod.fst` maps neighborhood of `x : X × Y` within the section `Prod.snd ⁻¹' {x.2}`
to `𝓝 x.1`. -/
theorem map_fst_nhdsWithin (x : X × Y) : map Prod.fst (𝓝[Prod.snd ⁻¹' {x.2}] x) = 𝓝 x.1
-- Mathlib/Topology/Homeomorph.lean
@[simp]
theorem prodComm_symm : (prodComm X Y).symm = prodComm Y X
-- Mathlib/Tactic/PushNeg.lean
theorem not_exists_eq : (¬ ∃ x, s x) = (∀ x, ¬ s x)
-- Mathlib/Topology/AlexandrovDiscrete.lean
lemma closure_sUnion (S : Set (Set α)) : closure (⋃₀ S) = ⋃ s ∈ S, closure s
-- Mathlib/Order/CompleteLattice.lean
protected lemma Monotone.iInf (hf : ∀ i, Monotone (f i)) : Monotone (⨅ i, f i)
-- Mathlib/Order/Filter/Basic.lean
protected lemma EventuallyLE.iInter [Finite ι] {s t : ι → Set α}
    (h : ∀ i, s i ≤ᶠ[l] t i) : (⋂ i, s i) ≤ᶠ[l] ⋂ i, t i
-- Mathlib/Algebra/Star/StarAlgHom.lean
@[simp]
theorem coe_mk' (f : A →ₐ[R] B) (h) :
    ((⟨f, h⟩ : A →⋆ₐ[R] B) : A → B) = f
-- Mathlib/AlgebraicGeometry/Spec.lean
lemma Spec.locallyRingedSpaceObj_presheaf_map (R : CommRingCat.{u}) {U V} (i : U ⟶ V) :
    (Spec.locallyRingedSpaceObj R).presheaf.map i =
    (structureSheaf R).1.map i
-- Mathlib/Combinatorics/Schnirelmann.lean
/-- The Schnirelmann density of `A` is `1` if and only if `A` contains all the positive naturals. -/
lemma schnirelmannDensity_eq_one_iff : schnirelmannDensity A = 1 ↔ {0}ᶜ ⊆ A
-- Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean
lemma pow_rpow_inv_natCast {n : ℕ} (hn : n ≠ 0) (x : ℝ≥0∞) : (x ^ n) ^ (n⁻¹ : ℝ) = x
-- Mathlib/Analysis/Analytic/CPolynomial.lean
/-- If a function `f` has a finite power series `p` on a ball and `g` is a continuous linear map,
then `g ∘ f` has the finite power series `g ∘ p` on the same ball. -/
theorem ContinuousLinearMap.comp_hasFiniteFPowerSeriesOnBall (g : F →L[𝕜] G)
    (h : HasFiniteFPowerSeriesOnBall f p x n r) :
    HasFiniteFPowerSeriesOnBall (g ∘ f) (g.compFormalMultilinearSeries p) x n r
-- Mathlib/Algebra/Star/Subalgebra.lean
theorem map_sup (f : A →⋆ₐ[R] B) (S T : StarSubalgebra R A) : map f (S ⊔ T) = map f S ⊔ map f T
-- Mathlib/MeasureTheory/Integral/IntegralEqImproper.lean
theorem AECover.integrable_of_integral_norm_tendsto [l.NeBot] [l.IsCountablyGenerated]
    {φ : ι → Set α} (hφ : AECover μ l φ) {f : α → E} (I : ℝ) (hfi : ∀ i, IntegrableOn f (φ i) μ)
    (htendsto : Tendsto (fun i => ∫ x in φ i, ‖f x‖ ∂μ) l (𝓝 I)) : Integrable f μ
-- Mathlib/Algebra/Group/Opposite.lean
@[simp]
theorem opAddEquiv_toEquiv [Add α] : ((opAddEquiv : α ≃+ αᵐᵒᵖ) : α ≃ αᵐᵒᵖ) = opEquiv
-- Mathlib/Order/Heyting/Hom.lean
@[simp]
theorem coe_id : ⇑(CoheytingHom.id α) = id
-- Mathlib/Data/Sum/Order.lean
@[simp]
theorem denselyOrdered_iff [LT α] [LT β] :
    DenselyOrdered (α ⊕ β) ↔ DenselyOrdered α ∧ DenselyOrdered β
-- Mathlib/Topology/Semicontinuous.lean
theorem ContinuousWithinAt.upperSemicontinuousWithinAt {f : α → γ} (h : ContinuousWithinAt f s x) :
    UpperSemicontinuousWithinAt f s x
-- Mathlib/Algebra/Lie/Weights/Basic.lean
theorem coe_weightSpaceOf_zero (x : L) :
    ↑(weightSpaceOf M (0 : R) x) = ⨆ k, LinearMap.ker (toEnd R L M x ^ k)
-- Mathlib/Geometry/Manifold/ContMDiff/Basic.lean
/-- The composition of `C^n` functions is `C^n`. -/
theorem ContMDiff.comp {g : M' → M''} (hg : ContMDiff I' I'' n g) (hf : ContMDiff I I' n f) :
    ContMDiff I I'' n (g ∘ f)
-- Mathlib/Data/Set/Countable.lean
theorem exists_seq_cover_iff_countable {p : Set α → Prop} (h : ∃ s, p s) :
    (∃ s : ℕ → Set α, (∀ n, p (s n)) ∧ ⋃ n, s n = univ) ↔
      ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧ ⋃₀ S = univ
-- Mathlib/CategoryTheory/MorphismProperty/Limits.lean
theorem universally_le (P : MorphismProperty C) : P.universally ≤ P
-- Mathlib/LinearAlgebra/Multilinear/Basic.lean
@[simp]
theorem smulRight_apply (f : MultilinearMap R M₁ R) (z : M₂) (m : ∀ i, M₁ i) :
    f.smulRight z m = f m • z
-- .lake/packages/lean4/src/lean/Init/WF.lean
theorem revLex (ha : WellFounded r) (hb : WellFounded s) : WellFounded (RevLex r s)
-- Mathlib/LinearAlgebra/Quotient.lean
@[simp]
theorem mk'_eq_mk' {p : Submodule R M} (x : M) :
    @Quotient.mk' _ (quotientRel p) x = (mk : M → M ⧸ p) x
-- Mathlib/Data/List/Sigma.lean
@[simp]
theorem mem_keys_kerase_of_ne {a₁ a₂} {l : List (Sigma β)} (h : a₁ ≠ a₂) :
    a₁ ∈ (kerase a₂ l).keys ↔ a₁ ∈ l.keys
-- Mathlib/LinearAlgebra/TensorProduct/Graded/Internal.lean
@[simp]
theorem lift_tmul (f : A →ₐ[R] C) (g : B →ₐ[R] C)
    (h_anti_commutes : ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), f a * g b = (-1 : ℤˣ)^(j * i) • (g b * f a))
    (a : A) (b : B) :
    lift 𝒜 ℬ f g h_anti_commutes (a ᵍ⊗ₜ b) = f a * g b
-- Mathlib/ModelTheory/Basic.lean
/-- In an algebraic language, any injective homomorphism is an embedding. -/
@[simps!]
def ofInjective [L.IsAlgebraic] {f : M →[L] N} (hf : Function.Injective f) : M ↪[L] N
-- Mathlib/Data/List/Destutter.lean
@[simp]
theorem destutter_singleton : destutter R [a] = [a]
-- Mathlib/Data/List/Perm.lean
@[simp]
theorem mem_permutations' {s t : List α} : s ∈ permutations' t ↔ s ~ t
-- .lake/packages/lean4/src/lean/Init/Data/Int/DivModLemmas.lean
@[simp] theorem mod_zero : ∀ a : Int, mod a 0 = a
-- Mathlib/Algebra/Lie/Solvable.lean
theorem center_le_radical : center R L ≤ radical R L
-- Mathlib/Data/Set/Pointwise/Interval.lean
theorem image_const_add_uIcc : (fun x => a + x) '' [[b, c]] = [[a + b, a + c]]
-- Mathlib/Data/DFinsupp/Basic.lean
@[simp, norm_cast]
theorem coe_smul [Monoid γ] [∀ i, AddMonoid (β i)] [∀ i, DistribMulAction γ (β i)] (b : γ)
    (v : Π₀ i, β i) : ⇑(b • v) = b • ⇑v
-- Mathlib/Order/Filter/Archimedean.lean
theorem atBot_hasCountableBasis_of_archimedean [LinearOrderedRing R] [Archimedean R] :
    (atBot : Filter R).HasCountableBasis (fun _ : ℤ => True) fun m => Iic m
-- Mathlib/Topology/Instances/ENNReal.lean
theorem exists_countable_dense_no_zero_top :
    ∃ s : Set ℝ≥0∞, s.Countable ∧ Dense s ∧ 0 ∉ s ∧ ∞ ∉ s
-- Mathlib/Topology/Order/NhdsSet.lean
theorem hasBasis_nhdsSet_Iic_Iic (a : α) [NeBot (𝓝[>] a)] :
    HasBasis (𝓝ˢ (Iic a)) (a < ·) Iic
-- Mathlib/Order/Atoms.lean
@[simp]
theorem isAtomic_dual_iff_isCoatomic [OrderTop α] : IsAtomic αᵒᵈ ↔ IsCoatomic α
-- Mathlib/SetTheory/Cardinal/Finite.lean
lemma card_eq_card_finite_toFinset {s : Set α} (hs : s.Finite) : Nat.card s = hs.toFinset.card
-- Mathlib/Logic/Nontrivial/Defs.lean
protected theorem Decidable.exists_ne [Nontrivial α] [DecidableEq α] (x : α) : ∃ y, y ≠ x
-- Mathlib/Order/Filter/AtTopBot.lean
theorem Tendsto.atTop_of_mul_const {c : α} (hc : 0 < c) (hf : Tendsto (fun x => f x * c) l atTop) :
    Tendsto f l atTop
-- Mathlib/Data/Set/Function.lean
theorem surjOn_iff_exists_map_subtype :
    SurjOn f s t ↔ ∃ (t' : Set β) (g : s → t'), t ⊆ t' ∧ Surjective g ∧ ∀ x : s, f x = g x
-- Mathlib/Analysis/Normed/Operator/Compact.lean
/-- If a compact operator preserves a complete submodule, its restriction to that submodule is
compact.

Note that, following mathlib's convention in linear algebra, `restrict` designates the restriction
of an endomorphism `f : E →ₗ E` to an endomorphism `f' : ↥V →ₗ ↥V`. To prove that the restriction
`f' : ↥U →ₛₗ ↥V` of a compact operator `f : E →ₛₗ F` is compact, apply
`IsCompactOperator.codRestrict` to `f ∘ U.subtypeL`, which is compact by
`IsCompactOperator.comp_clm`. -/
theorem IsCompactOperator.restrict' [T0Space M₂] {f : M₂ →ₗ[R₂] M₂}
    (hf : IsCompactOperator f) {V : Submodule R₂ M₂} (hV : ∀ v ∈ V, f v ∈ V)
    [hcomplete : CompleteSpace V] : IsCompactOperator (f.restrict hV)
-- Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Oplax.lean
/-- Category structure on the oplax natural transformations between OplaxFunctors. -/
@[simps]
instance category (F G : OplaxFunctor B C) : Category (F ⟶ G)
-- .lake/packages/batteries/Batteries/Data/List/Lemmas.lean
theorem forIn_eq_bindList [Monad m] [LawfulMonad m]
    (f : α → β → m (ForInStep β)) (l : List α) (init : β) :
    forIn l init f = ForInStep.run <$> (ForInStep.yield init).bindList f l
-- Mathlib/Data/Matroid/Restrict.lean
theorem restriction_iff_exists : (N ≤r M) ↔ ∃ R, R ⊆ M.E ∧ N = M ↾ R
-- Mathlib/Topology/Separation.lean
@[simp] theorem empty_right (s : Set X) : SeparatedNhds s ∅
-- Mathlib/Topology/Separation.lean
lemma mk_eq {x y : X} : mk x = mk y ↔ ∀ s : Setoid X, T2Space (Quotient s) → s.Rel x y
-- Mathlib/Logic/Basic.lean
protected theorem Decidable.or_not_of_imp [Decidable a] (h : a → b) : b ∨ ¬a
-- Mathlib/Analysis/Complex/Basic.lean
@[simp, norm_cast]
theorem hasSum_ofReal {f : α → ℝ} {x : ℝ} : HasSum (fun x => (f x : ℂ)) x ↔ HasSum f x
-- Mathlib/MeasureTheory/Constructions/BorelSpace/ContinuousLinearMap.lean
@[fun_prop, measurability]
theorem Measurable.apply_continuousLinearMap {φ : α → F →L[𝕜] E} (hφ : Measurable φ) (v : F) :
    Measurable fun a => φ a v
-- Mathlib/Probability/Independence/Kernel.lean
theorem indep_iSup_of_directed_le {Ω} {m : ι → MeasurableSpace Ω} {m' m0 : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} [IsMarkovKernel κ] (h_indep : ∀ i, Indep (m i) m' κ μ)
    (h_le : ∀ i, m i ≤ m0) (h_le' : m' ≤ m0) (hm : Directed (· ≤ ·) m) :
    Indep (⨆ i, m i) m' κ μ
-- Mathlib/Topology/Category/Profinite/Nobeling.lean
theorem coe_πs (o : Ordinal) (f : LocallyConstant (π C (ord I · < o)) ℤ) :
    πs C o f = f ∘ ProjRestrict C (ord I · < o)
-- Mathlib/Algebra/Tropical/Basic.lean
@[simp]
theorem trop_zsmul [AddGroup R] (x : R) (n : ℤ) : trop (n • x) = trop x ^ n
-- Mathlib/Order/WithBot.lean
@[simp]
theorem top_ne_coe : ⊤ ≠ (a : WithTop α)
-- Mathlib/Data/Matrix/Basic.lean
theorem vecMul_smul [Fintype n] [Monoid R] [NonUnitalNonAssocSemiring S] [DistribMulAction R S]
    [IsScalarTower R S S] (M : Matrix n m S) (b : R) (v : n → S) :
    (b • v) ᵥ* M = b • v ᵥ* M
-- Mathlib/Geometry/Euclidean/Angle/Oriented/Affine.lean
/-- If the angle between three points is `-π / 2`, the first two points are not equal. -/
theorem left_ne_of_oangle_eq_neg_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = (-π / 2 : ℝ)) :
    p₁ ≠ p₂
-- Mathlib/RingTheory/PowerSeries/Inverse.lean
theorem inv_eq_iff_mul_eq_one {φ ψ : k⟦X⟧} (h : constantCoeff k ψ ≠ 0) :
    ψ⁻¹ = φ ↔ φ * ψ = 1
-- Mathlib/Order/CompleteLattice.lean
theorem iInf_mono' {g : ι' → α} (h : ∀ i', ∃ i, f i ≤ g i') : iInf f ≤ iInf g
-- .lake/packages/lean4/src/lean/Init/Data/String/Basic.lean
theorem lt_next (s : Substring) (i : String.Pos) (h : i.1 < s.bsize) :
    i.1 < (s.next i).1
-- Mathlib/Topology/EMetricSpace/Lipschitz.lean
/-- Every function is Lipschitz on the empty set (with any Lipschitz constant). -/
@[simp]
theorem lipschitzOnWith_empty (K : ℝ≥0) (f : α → β) : LipschitzOnWith K f ∅
-- Mathlib/Algebra/Order/GroupWithZero/Unbundled.lean
/-- Assumes left covariance. -/
theorem Left.mul_nonneg [PosMulMono α] (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a * b
-- Mathlib/MeasureTheory/Integral/Layercake.lean
/-- An auxiliary version of the layer cake formula (Cavalieri's principle, tail probability
formula), with a measurability assumption that would also essentially follow from the
integrability assumptions.
Compared to `lintegral_comp_eq_lintegral_meas_le_mul_of_measurable_of_sigmaFinite`, we remove
the sigma-finite assumption.

See `MeasureTheory.lintegral_comp_eq_lintegral_meas_le_mul` and
`MeasureTheory.lintegral_comp_eq_lintegral_meas_lt_mul` for the main formulations of the layer
cake formula. -/
theorem lintegral_comp_eq_lintegral_meas_le_mul_of_measurable (μ : Measure α)
    (f_nn : 0 ≤ f) (f_mble : Measurable f)
    (g_intble : ∀ t > 0, IntervalIntegrable g volume 0 t) (g_mble : Measurable g)
    (g_nn : ∀ t > 0, 0 ≤ g t) :
    ∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ =
      ∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t)
-- Mathlib/Geometry/Manifold/MFDeriv/Basic.lean
theorem tangentMapWithin_congr (h : ∀ x ∈ s, f x = f₁ x) (p : TangentBundle I M) (hp : p.1 ∈ s)
    (hs : UniqueMDiffWithinAt I s p.1) :
    tangentMapWithin I I' f s p = tangentMapWithin I I' f₁ s p
-- Mathlib/Data/Fin/Basic.lean
lemma succAbove_succ_of_lt (p i : Fin n) (h : p < i) : succAbove p.succ i = i.succ
-- Mathlib/Algebra/Order/Floor.lean
theorem ceil_sub_self_eq (ha : fract a ≠ 0) : (⌈a⌉ : α) - a = 1 - fract a
-- Mathlib/Order/Bounds/Basic.lean
theorem IsGLB.exists_between' (h : IsGLB s a) (h' : a ∉ s) (hb : a < b) : ∃ c ∈ s, a < c ∧ c < b
-- Mathlib/Order/Atoms.lean
theorem isSimpleOrder_iff_isAtom_top [PartialOrder α] [BoundedOrder α] :
    IsSimpleOrder α ↔ IsAtom (⊤ : α)
-- Mathlib/Algebra/Order/Chebyshev.lean
/-- **Chebyshev's Sum Inequality**: When `f` and `g` antivary together (eg one is monotone, the
other is antitone), the scalar product of their sum is less than the size of the set times their
scalar product. -/
theorem AntivaryOn.card_smul_sum_le_sum_smul_sum (hfg : AntivaryOn f g s) :
    (s.card • ∑ i ∈ s, f i • g i) ≤ (∑ i ∈ s, f i) • ∑ i ∈ s, g i
-- Mathlib/Data/Int/Order/Units.lean
@[simp]
theorem units_sq (u : ℤˣ) : u ^ 2 = 1
-- Mathlib/Data/List/AList.lean
@[simp]
theorem mem_insert {a a'} {b' : β a'} (s : AList β) : a ∈ insert a' b' s ↔ a = a' ∨ a ∈ s
-- Mathlib/NumberTheory/RamificationInertia.lean
theorem Factors.ramificationIdx_ne_zero (P : (factors (map (algebraMap R S) p)).toFinset) :
    ramificationIdx (algebraMap R S) p P ≠ 0
-- Mathlib/Geometry/Manifold/SmoothManifoldWithCorners.lean
theorem extChartAt_target_subset_range (x : M) : (extChartAt I x).target ⊆ range I
-- Mathlib/RingTheory/MvPolynomial/Tower.lean
@[simp]
theorem mvPolynomial_aeval_coe (S : Subalgebra R A) (x : σ → S) (p : MvPolynomial σ R) :
    aeval (fun i => (x i : A)) p = aeval x p
-- Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean
theorem isUnit_det_transpose (h : IsUnit A.det) : IsUnit Aᵀ.det
-- Mathlib/SetTheory/Cardinal/Cofinality.lean
theorem ord_cof_eq (r : α → α → Prop) [IsWellOrder α r] :
    ∃ S, Unbounded r S ∧ type (Subrel r S) = (cof (type r)).ord
-- Mathlib/RingTheory/IsAdjoinRoot.lean
theorem coeff_apply_le (h : IsAdjoinRootMonic S f) (z : S) (i : ℕ) (hi : natDegree f ≤ i) :
    h.coeff z i = 0