ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
-- Mathlib/Data/Multiset/Nodup.lean
theorem map_eq_map_of_bij_of_nodup (f : α → γ) (g : β → γ) {s : Multiset α} {t : Multiset β}
    (hs : s.Nodup) (ht : t.Nodup) (i : ∀ a ∈ s, β) (hi : ∀ a ha, i a ha ∈ t)
    (i_inj : ∀ a₁ ha₁ a₂ ha₂, i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)
    (i_surj : ∀ b ∈ t, ∃ a ha, i a ha = b) (h : ∀ a ha, f a = g (i a ha)) : s.map f = t.map g
-- .lake/packages/batteries/Batteries/Data/List/Lemmas.lean
@[simp]
theorem map_add_range' (a) : ∀ s n step, map (a + ·) (range' s n step) = range' (a + s) n step
-- Mathlib/Analysis/NormedSpace/Exponential.lean
/-- Any continuous ring homomorphism commutes with `exp`. -/
theorem map_exp_of_mem_ball {F} [FunLike F 𝔸 𝔹] [RingHomClass F 𝔸 𝔹] (f : F) (hf : Continuous f)
    (x : 𝔸) (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) :
    f (exp 𝕂 x) = exp 𝕂 (f x)
-- Mathlib/CategoryTheory/Preadditive/Opposite.lean
@[simp]
theorem unop_zsmul {X Y : Cᵒᵖ} (k : ℤ) (f : X ⟶ Y) : (k • f).unop = k • f.unop
-- Mathlib/Topology/Separation.lean
theorem SeparatedNhds.of_isCompact_isCompact [T2Space X] {s t : Set X} (hs : IsCompact s)
    (ht : IsCompact t) (hst : Disjoint s t) : SeparatedNhds s t
-- Mathlib/Algebra/CubicDiscriminant.lean
@[simp]
theorem leadingCoeff_of_a_ne_zero' (ha : a ≠ 0) : (toPoly ⟨a, b, c, d⟩).leadingCoeff = a
-- Mathlib/Topology/MetricSpace/Kuratowski.lean
theorem embeddingOfSubset_coe : embeddingOfSubset x a n = dist a (x n) - dist (x 0) (x n)
-- Mathlib/GroupTheory/CosetCover.lean
@[to_additive]
theorem leftCoset_cover_const_iff_surjOn :
    ⋃ i ∈ s, g i • (H : Set G) = Set.univ ↔ Set.SurjOn (g · : ι → G ⧸ H) s Set.univ
-- Mathlib/Data/Finsupp/Defs.lean
@[simp]
theorem support_update_zero [DecidableEq α] : support (f.update a 0) = f.support.erase a
-- .lake/packages/batteries/Batteries/Data/Fin/Lemmas.lean
@[simp] theorem enum_zero : (enum 0) = #[]
-- Mathlib/Algebra/Lie/DirectSum.lean
/-- Given a family of Lie algebras `L i`, together with a family of morphisms of Lie algebras
`f i : L i →ₗ⁅R⁆ L'` into a fixed Lie algebra `L'`, we have a natural linear map:
`(⨁ i, L i) →ₗ[R] L'`. If in addition `⁅f i x, f j y⁆ = 0` for any `x ∈ L i` and `y ∈ L j` (`i ≠ j`)
then this map is a morphism of Lie algebras. -/
@[simps]
def toLieAlgebra [DecidableEq ι] (L' : Type w₁) [LieRing L'] [LieAlgebra R L']
    (f : ∀ i, L i →ₗ⁅R⁆ L') (hf : Pairwise fun i j => ∀ (x : L i) (y : L j), ⁅f i x, f j y⁆ = 0) :
    (⨁ i, L i) →ₗ⁅R⁆ L'
-- Mathlib/Order/Filter/Basic.lean
@[trans]
theorem EventuallyLE.trans_eq (H₁ : f ≤ᶠ[l] g) (H₂ : g =ᶠ[l] h) : f ≤ᶠ[l] h
-- Mathlib/Algebra/GroupWithZero/InjSurj.lean
protected theorem Function.Injective.isRightCancelMulZero
    [IsRightCancelMulZero M₀'] : IsRightCancelMulZero M₀
-- Mathlib/RepresentationTheory/Basic.lean
/-- A predicate for representations that fix every element. -/
class IsTrivial (ρ : Representation k G V) : Prop where
  out : ∀ g x, ρ g x = x := by aesop
-- Mathlib/Analysis/Calculus/DiffContOnCl.lean
protected theorem mono (h : DiffContOnCl 𝕜 f s) (ht : t ⊆ s) : DiffContOnCl 𝕜 f t
-- Mathlib/RingTheory/Adjoin/FG.lean
theorem fg_of_noetherian [IsNoetherian R A] (S : Subalgebra R A) : S.FG
-- .lake/packages/lean4/src/lean/Init/Data/Int/Order.lean
theorem NonNeg.elim {a : Int} : NonNeg a → ∃ n : Nat, a = n
-- Mathlib/RingTheory/FinitePresentation.lean
/-- An algebra over a Noetherian ring is finitely generated if and only if it is finitely
presented. -/
theorem of_finiteType [IsNoetherianRing R] : FiniteType R A ↔ FinitePresentation R A
-- Mathlib/Control/Traversable/Basic.lean
@[functor_norm]
theorem preserves_pure {α} : ∀ x : α, η (pure x) = pure x
-- Mathlib/Order/Minimal.lean
theorem Set.Subsingleton.maximals_eq (h : s.Subsingleton) : maximals r s = s
-- Mathlib/Order/CompleteLattice.lean
/-- A version of `iSup_option` useful for rewriting right-to-left. -/
theorem iSup_option_elim (a : α) (f : β → α) : ⨆ o : Option β, o.elim a f = a ⊔ ⨆ b, f b
-- Mathlib/Algebra/Lie/Subalgebra.lean
theorem mem_map_submodule (e : L ≃ₗ⁅R⁆ L₂) (x : L₂) :
    x ∈ K.map (e : L →ₗ⁅R⁆ L₂) ↔ x ∈ (K : Submodule R L).map (e : L →ₗ[R] L₂)
-- Mathlib/Algebra/Module/Submodule/Equiv.lean
@[simp]
theorem coe_ofTop_symm_apply {h} (x : M) : ((ofTop p h).symm x : M) = x
-- Mathlib/Algebra/Order/Ring/Rat.lean
@[simp] lemma num_neg {a : ℚ} : a.num < 0 ↔ a < 0
-- Mathlib/Topology/Order/Lattice.lean
lemma finset_sup'_nhds [SemilatticeSup L] [ContinuousSup L]
    (hne : s.Nonempty) (hs : ∀ i ∈ s, Tendsto (f i) l (𝓝 (g i))) :
    Tendsto (s.sup' hne f) l (𝓝 (s.sup' hne g))
-- Mathlib/Algebra/ContinuedFractions/Translations.lean
theorem partDen_none_iff_s_none : g.partDens.get? n = none ↔ g.s.get? n = none
-- Mathlib/Algebra/Star/Basic.lean
@[simp, norm_cast]
theorem star_natCast [NonAssocSemiring R] [StarRing R] (n : ℕ) : star (n : R) = n
-- Mathlib/Data/Int/Bitwise.lean
@[simp]
theorem shiftLeft_neg (m n : ℤ) : m <<< (-n) = m >>> n
-- Mathlib/Data/ZMod/Basic.lean
theorem val_add_of_le {n : ℕ} [NeZero n] {a b : ZMod n} (h : n ≤ a.val + b.val) :
    (a + b).val = a.val + b.val - n
-- Mathlib/Analysis/InnerProductSpace/Basic.lean
lemma norm_innerSL_le : ‖innerSL 𝕜 (E := E)‖ ≤ 1
-- Mathlib/CategoryTheory/Monoidal/Opposite.lean
@[simp] lemma unmop_rightUnitor (X : Cᴹᵒᵖ) : (ρ_ X).unmop = λ_ (unmop X)
-- Mathlib/Analysis/Calculus/FDeriv/Prod.lean
theorem HasFDerivAtFilter.prod (hf₁ : HasFDerivAtFilter f₁ f₁' x L)
    (hf₂ : HasFDerivAtFilter f₂ f₂' x L) :
    HasFDerivAtFilter (fun x => (f₁ x, f₂ x)) (f₁'.prod f₂') x L
-- Mathlib/Data/Part.lean
@[simp]
theorem some_toOption (a : α) [Decidable (some a).Dom] : (some a).toOption = Option.some a
-- Mathlib/Analysis/SpecificLimits/Basic.lean
theorem NNReal.summable_geometric {r : ℝ≥0} (hr : r < 1) : Summable fun n : ℕ ↦ r ^ n
-- Mathlib/Analysis/SpecialFunctions/Log/NegMulLog.lean
lemma differentiableOn_mul_log : DifferentiableOn ℝ (fun x ↦ x * log x) {0}ᶜ
-- .lake/packages/batteries/Batteries/Data/RBMap/WF.lean
theorem cmpEq.lt_congr_right (H : cmpEq cmp y z) : cmpLT cmp x y ↔ cmpLT cmp x z
-- Mathlib/Analysis/Convex/SpecificFunctions/Deriv.lean
theorem strictConcaveOn_sin_Icc : StrictConcaveOn ℝ (Icc 0 π) sin
-- Mathlib/FieldTheory/Finite/Basic.lean
/-- If `p` is a prime natural number and `x` is an integer number, then there exist natural numbers
`a ≤ p / 2` and `b ≤ p / 2` such that `a ^ 2 + b ^ 2 ≡ x [ZMOD p]`. This is a version of
`ZMod.sq_add_sq` with estimates on `a` and `b`. -/
theorem Nat.sq_add_sq_zmodEq (p : ℕ) [Fact p.Prime] (x : ℤ) :
    ∃ a b : ℕ, a ≤ p / 2 ∧ b ≤ p / 2 ∧ (a : ℤ) ^ 2 + (b : ℤ) ^ 2 ≡ x [ZMOD p]
-- Mathlib/Data/Matroid/Basic.lean
theorem basis_iff (hX : X ⊆ M.E := by aesop_mat) :
    M.Basis I X ↔ (M.Indep I ∧ I ⊆ X ∧ ∀ J, M.Indep J → I ⊆ J → J ⊆ X → I = J)
-- Mathlib/CategoryTheory/Monoidal/Comon_.lean
@[simp] theorem forgetMonoidal_ε : (forgetMonoidal C).ε = 𝟙 (𝟙_ C)
-- .lake/packages/lean4/src/lean/Init/Data/Nat/Basic.lean
protected theorem sub_ne_zero_iff_lt : n - m ≠ 0 ↔ m < n
-- Mathlib/Analysis/ODE/PicardLindelof.lean
theorem tDist_nonneg : 0 ≤ v.tDist
-- Mathlib/MeasureTheory/OuterMeasure/Induced.lean
/-- To test whether `s` is Carathéodory-measurable we only need to check the sets `t` for which
  `P t` holds. See `ofFunction_caratheodory` for another way to show the Carathéodory-measurability
  of `s`.
-/
theorem inducedOuterMeasure_caratheodory (s : Set α) :
    MeasurableSet[(inducedOuterMeasure m P0 m0).caratheodory] s ↔
      ∀ t : Set α,
        P t →
          inducedOuterMeasure m P0 m0 (t ∩ s) + inducedOuterMeasure m P0 m0 (t \ s) ≤
            inducedOuterMeasure m P0 m0 t
-- Mathlib/Algebra/Order/AbsoluteValue.lean
protected theorem map_sub (a b : R) : abv (a - b) = abv (b - a)
-- Mathlib/Data/List/Zip.lean
theorem lt_length_right_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
    (h : i < (zipWith f l l').length) : i < l'.length
-- Mathlib/Analysis/NormedSpace/Multilinear/Basic.lean
/-- Controlling the norm of `f.iteratedFDeriv` when `f` is continuous multilinear. For the same
bound on the iterated derivative of `f` in the calculus sense,
see `ContinuousMultilinearMap.norm_iteratedFDeriv_le`. -/
lemma norm_iteratedFDeriv_le' (f : ContinuousMultilinearMap 𝕜 E₁ G) (k : ℕ) (x : (i : ι) → E₁ i) :
    ‖f.iteratedFDeriv k x‖
      ≤ Nat.descFactorial (Fintype.card ι) k * ‖f‖ * ‖x‖ ^ (Fintype.card ι - k)
-- Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean
theorem rpow_inv_le_iff {x y : ℝ≥0∞} {z : ℝ} (hz : 0 < z) : x ^ z⁻¹ ≤ y ↔ x ≤ y ^ z
-- Mathlib/Data/Finset/Sups.lean
lemma compls_subset_iff : sᶜˢ ⊆ t ↔ s ⊆ tᶜˢ
-- Mathlib/Order/Bounds/Basic.lean
/-- When there is a global maximum, every set is bounded above. -/
@[simp]
protected theorem OrderTop.bddAbove [OrderTop α] (s : Set α) : BddAbove s
-- Mathlib/Algebra/Star/Unitary.lean
@[simp]
theorem star_mul_self_of_mem {U : R} (hU : U ∈ unitary R) : star U * U = 1
-- Mathlib/Algebra/Homology/ComplexShapeSigns.lean
lemma ε₁_ε₂ {i₁ i₁' : I₁} {i₂ i₂' : I₂} (h₁ : c₁.Rel i₁ i₁') (h₂ : c₂.Rel i₂ i₂') :
    ε₁ c₁ c₂ c₁₂ ⟨i₁, i₂⟩ * ε₂ c₁ c₂ c₁₂ ⟨i₁, i₂⟩ =
      - ε₂ c₁ c₂ c₁₂ ⟨i₁', i₂⟩ * ε₁ c₁ c₂ c₁₂ ⟨i₁, i₂'⟩
-- Mathlib/GroupTheory/OrderOfElement.lean
/-- If each prime factor of `orderOf x` has higher multiplicity in `orderOf y`, and `x` commutes
  with `y`, then `x * y` has the same order as `y`. -/
@[to_additive addOrderOf_add_eq_right_of_forall_prime_mul_dvd
  "If each prime factor of
  `addOrderOf x` has higher multiplicity in `addOrderOf y`, and `x` commutes with `y`,
  then `x + y` has the same order as `y`."]
theorem orderOf_mul_eq_right_of_forall_prime_mul_dvd (h : Commute x y) (hy : IsOfFinOrder y)
    (hdvd : ∀ p : ℕ, p.Prime → p ∣ orderOf x → p * orderOf x ∣ orderOf y) :
    orderOf (x * y) = orderOf y
-- Mathlib/Logic/Relator.lean
protected lemma trans (hr : ∀ (a : α) (b : β) (c : γ), r₁₂ a b → r₂₃ b c → r₁₃ a c) :
    BiTotal r₁₂ → BiTotal r₂₃ → BiTotal r₁₃
-- .lake/packages/batteries/Batteries/Data/Nat/Lemmas.lean
@[simp] theorem recDiagOn_zero_zero {motive : Nat → Nat → Sort _} (zero_zero : motive 0 0)
    (zero_succ : ∀ n, motive 0 n → motive 0 (n+1)) (succ_zero : ∀ m, motive m 0 → motive (m+1) 0)
    (succ_succ : ∀ m n, motive m n → motive (m+1) (n+1)) :
    Nat.recDiagOn (motive:=motive) 0 0 zero_zero zero_succ succ_zero succ_succ = zero_zero
-- Mathlib/Data/Finset/Basic.lean
theorem inter_eq_inter_iff_left : s ∩ t = s ∩ u ↔ s ∩ u ⊆ t ∧ s ∩ t ⊆ u
-- Mathlib/SetTheory/Cardinal/Basic.lean
protected theorem lt_wf : @WellFounded Cardinal.{u} (· < ·)
-- Mathlib/Data/Finset/Image.lean
theorem _root_.Function.Injective.mem_finset_image (hf : Injective f) :
    f a ∈ s.image f ↔ a ∈ s
-- Mathlib/Data/Matroid/Closure.lean
lemma Indep.mem_closure_iff_of_not_mem (hI : M.Indep I) (heI : e ∉ I) :
    e ∈ M.closure I ↔ M.Dep (insert e I)
-- Mathlib/Analysis/Calculus/LHopital.lean
theorem lhopital_zero_left_on_Ioo (hdf : DifferentiableOn ℝ f (Ioo a b))
    (hg' : ∀ x ∈ Ioo a b, (deriv g) x ≠ 0) (hfb : Tendsto f (𝓝[<] b) (𝓝 0))
    (hgb : Tendsto g (𝓝[<] b) (𝓝 0))
    (hdiv : Tendsto (fun x => (deriv f) x / (deriv g) x) (𝓝[<] b) l) :
    Tendsto (fun x => f x / g x) (𝓝[<] b) l
-- Mathlib/Topology/Algebra/ContinuousAffineMap.lean
@[norm_cast, simp]
theorem coe_neg (f : P →ᴬ[R] W) : ⇑(-f) = -f
-- Mathlib/RingTheory/MvPolynomial/Homogeneous.lean
/-- See `MvPolynomial.IsHomogeneous.funext_of_le_card`
for a version that assumes `n ≤ #R`. -/
lemma funext [Infinite R] {F G : MvPolynomial σ R} {n : ℕ}
    (hF : F.IsHomogeneous n) (hG : G.IsHomogeneous n)
    (h : ∀ r : σ → R, eval r F = eval r G) : F = G
-- Mathlib/CategoryTheory/Limits/Shapes/Pullback/Iso.lean
@[simp]
theorem pushoutCoconeOfLeftIso_inl : (pushoutCoconeOfLeftIso f g).inl = inv f ≫ g
-- Mathlib/Algebra/Star/StarAlgHom.lean
@[simp]
theorem coe_inl : (inl R A B : A → A × B) = fun x => (x, 0)
-- Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean
@[reassoc (attr := simp)]
theorem biprodComparison_fst : biprodComparison F X Y ≫ biprod.fst = F.map biprod.fst
-- Mathlib/CategoryTheory/Subobject/Lattice.lean
theorem inf_eq_map_pullback {A : C} (f₁ : MonoOver A) (f₂ : Subobject A) :
    (Quotient.mk'' f₁ ⊓ f₂ : Subobject A) = (map f₁.arrow).obj ((pullback f₁.arrow).obj f₂)
-- Mathlib/Data/Finsupp/Defs.lean
@[simp]
theorem embDomain_apply (f : α ↪ β) (v : α →₀ M) (a : α) : embDomain f v (f a) = v a
-- Mathlib/Order/Heyting/Basic.lean
theorem himp_le_himp_right (h : a ≤ b) : b ⇨ c ≤ a ⇨ c
-- Mathlib/Analysis/SpecificLimits/Basic.lean
/-- If `edist (f n) (f (n+1))` is bounded by `C * r^n`, then the distance from
`f 0` to the limit of `f` is bounded above by `C / (1 - r)`. -/
theorem edist_le_of_edist_le_geometric_of_tendsto₀ {a : α} (ha : Tendsto f atTop (𝓝 a)) :
    edist (f 0) a ≤ C / (1 - r)
-- Mathlib/RingTheory/Ideal/Maps.lean
theorem comap_isMaximal_of_surjective (hf : Function.Surjective f) {K : Ideal S} [H : IsMaximal K]:
    IsMaximal (comap f K)
-- Mathlib/CategoryTheory/Bicategory/Kan/HasKan.lean
theorem LanLift.existsUnique [HasLeftKanLift f g] (s : LeftLift f g) :
    ∃! τ, lanLiftUnit f g ≫ τ ▷ f = s.unit
-- Mathlib/Data/Finset/Pointwise.lean
@[to_additive]
theorem image_smul_product : ((s ×ˢ t).image fun x : α × β => x.fst • x.snd) = s • t
-- Mathlib/Algebra/Module/CharacterModule.lean
protected lemma int.divByNat_self (n : ℕ) :
    int.divByNat n n = 0
-- Mathlib/Algebra/Algebra/Subalgebra/Basic.lean
theorem map_toSubsemiring {S : Subalgebra R A} {f : A →ₐ[R] B} :
    (S.map f).toSubsemiring = S.toSubsemiring.map f.toRingHom
-- Mathlib/Algebra/Polynomial/Degree/Definitions.lean
@[simp]
theorem coeff_natDegree_succ_eq_zero {p : R[X]} : p.coeff (p.natDegree + 1) = 0
-- Mathlib/Order/Filter/Basic.lean
theorem EventuallyLE.sup_le [SemilatticeSup β] {l : Filter α} {f g h : α → β} (hf : f ≤ᶠ[l] h)
    (hg : g ≤ᶠ[l] h) : f ⊔ g ≤ᶠ[l] h
-- Mathlib/Analysis/SpecialFunctions/Pow/Asymptotics.lean
/-- `exp (-a * x) = o(x ^ s)` as `x → ∞`, for any positive `a` and real `s`. -/
theorem isLittleO_exp_neg_mul_rpow_atTop {a : ℝ} (ha : 0 < a) (b : ℝ) :
    IsLittleO atTop (fun x : ℝ => exp (-a * x)) fun x : ℝ => x ^ b
-- Mathlib/Data/List/Basic.lean
theorem map₂Right_nil_cons : map₂Right f [] (b :: bs) = f none b :: bs.map (f none)
-- Mathlib/ModelTheory/Satisfiability.lean
theorem models_not_iff (h : T.IsComplete) (φ : L.Sentence) : T ⊨ᵇ φ.not ↔ ¬T ⊨ᵇ φ
-- Mathlib/SetTheory/ZFC/Basic.lean
@[simp]
theorem eval_mk {n f x} :
    (@Resp.eval (n + 1) f : ZFSet → OfArity ZFSet ZFSet n) (mk x) = Resp.eval n (Resp.f f x)
-- Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean
/-- Assumes left covariance.
The lemma assuming right covariance is `Right.mul_le_one`. -/
@[to_additive "Assumes left covariance.
The lemma assuming right covariance is `Right.add_nonpos`."]
theorem Left.mul_le_one [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} (ha : a ≤ 1) (hb : b ≤ 1) :
    a * b ≤ 1
-- Mathlib/RingTheory/Ideal/Operations.lean
theorem sup_pow_eq_top {n : ℕ} (h : I ⊔ J = ⊤) : I ⊔ J ^ n = ⊤
-- Mathlib/Analysis/Normed/Group/HomCompletion.lean
theorem NormedAddGroupHom.completion_def (f : NormedAddGroupHom G H) (x : Completion G) :
    f.completion x = Completion.map f x
-- Mathlib/CategoryTheory/Comma/Presheaf.lean
lemma unitBackward_unitForward {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X : C) :
    unitBackward η X ∘ unitForward η X = id
-- Mathlib/FieldTheory/KummerExtension.lean
theorem X_pow_sub_C_irreducible_of_prime {p : ℕ} (hp : p.Prime) {a : K} (ha : ∀ b : K, b ^ p ≠ a) :
    Irreducible (X ^ p - C a)
-- Mathlib/Data/Finset/Sups.lean
@[simp] lemma compls_infs_eq_diffs (s t : Finset α) : sᶜˢ ⊼ t = t \\ s
-- Mathlib/Data/Ordmap/Ordset.lean
theorem balanceL_eq_balance' {l x r} (hl : Balanced l) (hr : Balanced r) (sl : Sized l)
    (sr : Sized r)
    (H :
      (∃ l', Raised l' (size l) ∧ BalancedSz l' (size r)) ∨
        ∃ r', Raised (size r) r' ∧ BalancedSz (size l) r') :
    @balanceL α l x r = balance' l x r
-- Mathlib/Order/Zorn.lean
/-- Every chain is contained in a maximal chain. This generalizes Hausdorff's maximality principle.
-/
theorem IsChain.exists_maxChain (hc : IsChain r c) : ∃ M, @IsMaxChain _ r M ∧ c ⊆ M
-- Mathlib/NumberTheory/Zsqrtd/Basic.lean
theorem nonnegg_neg_pos {c d} : ∀ {a b : ℕ}, Nonnegg c d (-a) b ↔ SqLe a d b c
-- Mathlib/Topology/Bases.lean
/-- Let `s` be a dense set in a topological space `α` with partial order structure. If `s` is a
separable space (e.g., if `α` has a second countable topology), then there exists a countable
dense subset `t ⊆ s` such that `t` contains bottom/top element of `α` when they exist and belong
to `s`. For a dense subset containing neither bot nor top elements, see
`Dense.exists_countable_dense_subset_no_bot_top`. -/
theorem Dense.exists_countable_dense_subset_bot_top {α : Type*} [TopologicalSpace α]
    [PartialOrder α] {s : Set α} [SeparableSpace s] (hs : Dense s) :
    ∃ t ⊆ s, t.Countable ∧ Dense t ∧ (∀ x, IsBot x → x ∈ s → x ∈ t) ∧
      ∀ x, IsTop x → x ∈ s → x ∈ t
-- Mathlib/Algebra/BigOperators/Ring.lean
lemma mul_sum (s : Finset ι) (f : ι → α) (a : α) :
    a * ∑ i ∈ s, f i = ∑ i ∈ s, a * f i
-- Mathlib/Data/Complex/Module.lean
nonrec lemma IsSelfAdjoint.imaginaryPart {x : A} (hx : IsSelfAdjoint x) :
    ℑ x = 0
-- Mathlib/Algebra/Homology/ShortComplex/Preadditive.lean
@[simp]
lemma opcyclesMap'_neg :
    opcyclesMap' (-φ) h₁ h₂ = -opcyclesMap' φ h₁ h₂
-- Mathlib/Topology/Order/ScottTopology.lean
@[simp] lemma scottContinuous_iff_continuous : ScottContinuous f ↔ Continuous f
-- Mathlib/Combinatorics/Additive/FreimanHom.lean
@[to_additive] lemma MulEquivClass.isMulFreimanIso [EquivLike F α β] [MulEquivClass F α β] (f : F)
    (hfAB : BijOn f A B) : IsMulFreimanIso n A B f
-- Mathlib/Geometry/Euclidean/Inversion/Basic.lean
@[simp]
theorem inversion_self (c : P) (R : ℝ) : inversion c R c = c
-- Mathlib/Algebra/GroupWithZero/NonZeroDivisors.lean
theorem mem_nonZeroDivisors_of_ne_zero [NoZeroDivisors M] {x : M} (hx : x ≠ 0) : x ∈ M⁰
-- Mathlib/Algebra/CubicDiscriminant.lean
private theorem ne_zero (h0 : P.a ≠ 0 ∨ P.b ≠ 0 ∨ P.c ≠ 0 ∨ P.d ≠ 0) : P.toPoly ≠ 0
-- Mathlib/Data/Nat/Cast/Order/Field.lean
theorem inv_pos_of_nat {n : ℕ} : 0 < ((n : α) + 1)⁻¹
-- Mathlib/Computability/ContextFreeGrammar.lean
lemma ContextFreeGrammar.reverse_involutive :
    Function.Involutive (@ContextFreeGrammar.reverse T)
-- Mathlib/CategoryTheory/Abelian/Pseudoelements.lean
theorem apply_eq_zero_of_comp_eq_zero {P Q R : C} (f : Q ⟶ R) (a : P ⟶ Q) : a ≫ f = 0 → f a = 0
-- Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean
theorem volume_le_diam (s : Set ℝ) : volume s ≤ EMetric.diam s
-- Mathlib/Data/Set/Basic.lean
@[simp] lemma right_eq_inter : t = s ∩ t ↔ t ⊆ s
-- Mathlib/ModelTheory/Semantics.lean
theorem infinite [Mi : Infinite M] (h : M ≅[L] N) : Infinite N
-- Mathlib/Data/Finsupp/Weight.lean
theorem le_weight_of_ne_zero' {s : σ} {f : σ →₀ ℕ} (hs : f s ≠ 0) :
    w s ≤ weight w f
-- .lake/packages/lean4/src/lean/Init/Data/List/Lemmas.lean
@[simp] theorem join_replicate_replicate : (replicate n (replicate m a)).join = replicate (n * m) a
-- Mathlib/Algebra/Homology/HomologicalComplex.lean
@[simp]
theorem next (α : Type*) [AddGroup α] [One α] (i : α) : (ComplexShape.down α).next i = i - 1
-- Mathlib/Data/PFunctor/Univariate/M.lean
theorem head'_eq_head : ∀ (x : M F) (n : ℕ), head' (x.approx <| n + 1) = head x
-- Mathlib/FieldTheory/SeparableDegree.lean
@[simp]
theorem finSepDegree_self : finSepDegree F F = 1
-- Mathlib/MeasureTheory/Measure/MeasureSpace.lean
lemma measure_preimage_eq_zero_iff_of_countable {s : Set β} {f : α → β} (hs : s.Countable) :
    μ (f ⁻¹' s) = 0 ↔ ∀ x ∈ s, μ (f ⁻¹' {x}) = 0
-- Mathlib/MeasureTheory/Integral/SetToL1.lean
theorem setToFun_congr_measure_of_add_left {μ' : Measure α}
    (hT_add : DominatedFinMeasAdditive (μ + μ') T C') (hT : DominatedFinMeasAdditive μ' T C)
    (f : α → E) (hf : Integrable f (μ + μ')) :
    setToFun (μ + μ') T hT_add f = setToFun μ' T hT f
-- Mathlib/Algebra/Group/Prod.lean
@[to_additive (attr := simp) prod_unique]
theorem prod_unique (f : M →* N × P) : ((fst N P).comp f).prod ((snd N P).comp f) = f
-- Mathlib/Data/PFun.lean
theorem dom_iff_graph (f : α →. β) (x : α) : x ∈ f.Dom ↔ ∃ y, (x, y) ∈ f.graph
-- Mathlib/MeasureTheory/OuterMeasure/Induced.lean
theorem le_extend {s : α} (h : P s) : m s h ≤ extend m s
-- Mathlib/Algebra/Order/Module/Defs.lean
/-- Typeclass for reverse monotonicity of scalar multiplication by positive elements on the left,
namely `a • b₁ ≤ a • b₂ → b₁ ≤ b₂` if `0 < a`.

You should usually not use this very granular typeclass directly, but rather a typeclass like
`OrderedSMul`. -/
class PosSMulReflectLE : Prop where
  /-- Do not use this. Use `le_of_smul_lt_smul_left` instead. -/
  protected elim ⦃a : α⦄ (ha : 0 < a) ⦃b₁ b₂ : β⦄ (hb : a • b₁ ≤ a • b₂) : b₁ ≤ b₂
-- Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean
/--
The family of elements given by `x : FirstObj P S` is compatible iff `firstMap` and `secondMap`
map it to the same point.
-/
theorem compatible_iff (x : FirstObj P X) : (Arrows.Compatible P π ((Types.productIso _).hom x)) ↔
    firstMap P X π x = secondMap P X π x
-- Mathlib/Algebra/Group/Equiv/Basic.lean
@[to_additive (attr := simp)]
theorem ofBijective_apply_symm_apply {n : N} (f : M →* N) (hf : Bijective f) :
    f ((ofBijective f hf).symm n) = n
-- Mathlib/MeasureTheory/Integral/CircleIntegral.lean
theorem circleMap_ne_center {c : ℂ} {R : ℝ} (hR : R ≠ 0) {θ : ℝ} : circleMap c R θ ≠ c
-- Mathlib/Algebra/Category/HopfAlgebraCat/Basic.lean
@[simp] theorem toBialgHom_comp {X Y Z : HopfAlgebraCat.{v} R} (f : X ⟶ Y) (g : Y ⟶ Z) :
    (f ≫ g).toBialgHom = g.toBialgHom.comp f.toBialgHom
-- .lake/packages/lean4/src/lean/Init/Data/Option/Lemmas.lean
@[simp] theorem map_id'' {x : Option α} : (x.map fun a => a) = x
-- Mathlib/NumberTheory/ModularForms/JacobiTheta/OneVariable.lean
theorem jacobiTheta_eq_tsum_nat {τ : ℂ} (hτ : 0 < im τ) :
    jacobiTheta τ = ↑1 + ↑2 * ∑' n : ℕ, cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ)
-- Mathlib/CategoryTheory/Limits/Shapes/Types.lean
/-- The converse of `type_equalizer_of_unique`. -/
theorem unique_of_type_equalizer (t : IsLimit (Fork.ofι _ w)) (y : Y) (hy : g y = h y) :
    ∃! x : X, f x = y
-- Mathlib/Topology/Instances/ENNReal.lean
theorem _root_.Continuous.ennreal_mul [TopologicalSpace α] {f g : α → ℝ≥0∞} (hf : Continuous f)
    (hg : Continuous g) (h₁ : ∀ x, f x ≠ 0 ∨ g x ≠ ∞) (h₂ : ∀ x, g x ≠ 0 ∨ f x ≠ ∞) :
    Continuous fun x => f x * g x
-- .lake/packages/lean4/src/lean/Init/Data/BitVec/Lemmas.lean
@[simp] theorem getLsb_cast (h : w = v) (x : BitVec w) : (cast h x).getLsb i = x.getLsb i
-- Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
@[measurability, fun_prop]
theorem Measurable.real_toNNReal {f : α → ℝ} (hf : Measurable f) :
    Measurable fun x => Real.toNNReal (f x)
-- Mathlib/Data/List/Basic.lean
theorem surjective_head! [Inhabited α] : Surjective (@head! α _)
-- Mathlib/Topology/DerivedSet.lean
lemma derivedSet_subset_closure (A : Set X) : derivedSet A ⊆ closure A
-- Mathlib/Order/Interval/Set/Disjoint.lean
theorem iUnion_Ici_eq_Ici_iInf {R : Type*} [CompleteLinearOrder R] {f : ι → R}
    (has_least_elem : (⨅ i, f i) ∈ range f) : ⋃ i : ι, Ici (f i) = Ici (⨅ i, f i)
-- Mathlib/Data/List/Basic.lean
theorem getLastI_eq_getLast? [Inhabited α] : ∀ l : List α, l.getLastI = l.getLast?.iget
-- Mathlib/MeasureTheory/Measure/Portmanteau.lean
theorem le_measure_liminf_of_limsup_measure_compl_le {ι : Type*} {L : Filter ι} {μ : Measure Ω}
    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
    (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i Eᶜ) ≤ μ Eᶜ) :
    μ E ≤ L.liminf fun i => μs i E
-- Mathlib/Algebra/Homology/Homotopy.lean
@[simp]
theorem nullHomotopicMap'_f_of_not_rel_left {k₁ k₀ : ι} (r₁₀ : c.Rel k₁ k₀)
    (hk₀ : ∀ l : ι, ¬c.Rel k₀ l) (h : ∀ i j, c.Rel j i → (C.X i ⟶ D.X j)) :
    (nullHomotopicMap' h).f k₀ = h k₀ k₁ r₁₀ ≫ D.d k₁ k₀
-- Mathlib/Data/Set/Image.lean
@[simp, mfld_simps]
theorem preimage_id' {s : Set α} : (fun x => x) ⁻¹' s = s
-- Mathlib/Topology/MetricSpace/Pseudo/Defs.lean
theorem closedBall_subset_closedBall' (h : ε₁ + dist x y ≤ ε₂) :
    closedBall x ε₁ ⊆ closedBall y ε₂
-- Mathlib/RepresentationTheory/Maschke.lean
theorem exists_isCompl (p : Submodule (MonoidAlgebra k G) V) :
    ∃ q : Submodule (MonoidAlgebra k G) V, IsCompl p q