ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
-- Mathlib/Algebra/Field/Subfield.lean
/-- A subfield contains the field's 0. -/
protected theorem zero_mem : (0 : K) ∈ s
-- Mathlib/Data/List/Chain.lean
/-- Given a chain from `a` to `b`, and a predicate true at `b`, if `r x y → p y → p x` then
the predicate is true at `a`.
That is, we can propagate the predicate all the way up the chain.
-/
@[elab_as_elim]
theorem Chain.induction_head (p : α → Prop) (l : List α) (h : Chain r a l)
    (hb : getLast (a :: l) (cons_ne_nil _ _) = b) (carries : ∀ ⦃x y : α⦄, r x y → p y → p x)
    (final : p b) : p a
-- Mathlib/Data/Set/Card.lean
@[simp] theorem encard_univ_coe (s : Set α) : encard (univ : Set s) = encard s
-- Mathlib/Order/Interval/Set/Basic.lean
theorem mem_Iic_Iio_of_subset_of_subset {s : Set α} (ho : Iio a ⊆ s) (hc : s ⊆ Iic a) :
    s ∈ ({Iic a, Iio a} : Set (Set α))
-- .lake/packages/lean4/src/lean/Init/Data/Array/Lemmas.lean
theorem getElem_set (a : Array α) (i : Fin a.size) (v : α) (j : Nat)
    (h : j < (a.set i v).size) :
    (a.set i v)[j]'h = if i = j then v else a[j]'(size_set a i v ▸ h)
-- Mathlib/Topology/ContinuousFunction/Polynomial.lean
@[simp]
theorem polynomialFunctions_coe (X : Set R) :
    (polynomialFunctions X : Set C(X, R)) = Set.range (Polynomial.toContinuousMapOnAlgHom X)
-- Mathlib/Data/ENNReal/Inv.lean
@[simp] theorem top_div_coe : ∞ / p = ∞
-- Mathlib/GroupTheory/GroupAction/DomAct/Basic.lean
@[to_additive (attr := simp)]
lemma mk_pow [Monoid M] (a : M) (n : ℕ) : mk (a ^ n) = mk a ^ n
-- Mathlib/RingTheory/Ideal/Pointwise.lean
theorem pointwise_smul_def {a : M} (S : Ideal R) :
    a • S = S.map (MulSemiringAction.toRingHom _ _ a)
-- Mathlib/LinearAlgebra/TensorProduct/Basic.lean
@[simp]
theorem rTensor_sub (f g : N →ₗ[R] P) : (f - g).rTensor M = f.rTensor M - g.rTensor M
-- Mathlib/GroupTheory/Sylow.lean
theorem dvd_card_of_dvd_card [Finite G] {p : ℕ} [Fact p.Prime] (P : Sylow p G)
    (hdvd : p ∣ Nat.card G) : p ∣ Nat.card P
-- Mathlib/AlgebraicGeometry/EllipticCurve/DivisionPolynomial/Degree.lean
@[simp]
lemma coeff_Ψ₃ : W.Ψ₃.coeff 4 = 3
-- Mathlib/MeasureTheory/Constructions/HaarToSphere.lean
theorem toSphere_apply_aux (s : Set (sphere (0 : E) 1)) (r : Ioi (0 : ℝ)) :
    μ ((↑) '' (homeomorphUnitSphereProd E ⁻¹' s ×ˢ Iio r)) = μ (Ioo (0 : ℝ) r • ((↑) '' s))
-- Mathlib/Analysis/Calculus/Deriv/Mul.lean
theorem DifferentiableOn.finset_prod (hd : ∀ i ∈ u, DifferentiableOn 𝕜 (f i) s) :
    DifferentiableOn 𝕜 (∏ i ∈ u, f i ·) s
-- .lake/packages/lean4/src/lean/Init/PropLemmas.lean
theorem not_and_of_not_right (a : Prop) {b : Prop} : ¬b → ¬(a ∧ b)
-- Mathlib/MeasureTheory/Measure/Restrict.lean
@[to_additive]
theorem div_ae_eq_one {β} [Group β] (f g : α → β) : f / g =ᵐ[μ] 1 ↔ f =ᵐ[μ] g
-- Mathlib/Topology/Category/Compactum.lean
@[simp]
theorem str_incl (X : Compactum) (x : X) : X.str (X.incl x) = x
-- Mathlib/LinearAlgebra/Matrix/Hermitian.lean
/-- Note this is more general for matrices than `isSelfAdjoint_one` as it does not
require `Fintype n`, which is necessary for `Monoid (Matrix n n R)`. -/
@[simp]
theorem isHermitian_one [DecidableEq n] : (1 : Matrix n n α).IsHermitian
-- Mathlib/Data/Matrix/Hadamard.lean
theorem hadamard_one : M ⊙ (1 : Matrix n n α) = diagonal fun i => M i i
-- Mathlib/Algebra/Order/Nonneg/Field.lean
@[simp, norm_cast] lemma coe_nnqsmul (q : ℚ≥0) (a : {x : α // 0 ≤ x}) :
    ↑(q • a) = (q • a : α)
-- Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean
theorem single_comp_single {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (r s : R) :
    (single f r ≫ single g s : Free.of R X ⟶ Free.of R Z) = single (f ≫ g) (r * s)
-- Mathlib/Algebra/Polynomial/Laurent.lean
/-- To prove something about Laurent polynomials, it suffices to show that
* the condition is closed under taking sums, and
* it holds for monomials.
-/
@[elab_as_elim]
protected theorem induction_on' {M : R[T;T⁻¹] → Prop} (p : R[T;T⁻¹])
    (h_add : ∀ p q, M p → M q → M (p + q)) (h_C_mul_T : ∀ (n : ℤ) (a : R), M (C a * T n)) :
    M p
-- Mathlib/Data/Finset/Basic.lean
lemma Nontrivial.exists_cons_eq {s : Finset α} (hs : s.Nontrivial) :
    ∃ t a ha b hb hab, (cons b t hb).cons a (mem_cons.not.2 <| not_or_intro hab ha) = s
-- Mathlib/Analysis/Normed/Group/Basic.lean
@[to_additive dist_norm_norm_le]
theorem dist_norm_norm_le' (a b : E) : dist ‖a‖ ‖b‖ ≤ ‖a / b‖
-- Mathlib/Analysis/Calculus/FDeriv/Equiv.lean
theorem HasFDerivWithinAt.eventually_ne (h : HasFDerivWithinAt f f' s x)
    (hf' : ∃ C, ∀ z, ‖z‖ ≤ C * ‖f' z‖) : ∀ᶠ z in 𝓝[s \ {x}] x, f z ≠ f x
-- Mathlib/Algebra/Star/StarAlgHom.lean
@[simp]
theorem coe_id : ⇑(NonUnitalStarAlgHom.id R A) = id
-- Mathlib/Data/Set/Function.lean
theorem mapsTo_image (h : Semiconj f fa fb) (ha : MapsTo fa s t) : MapsTo fb (f '' s) (f '' t)
-- Mathlib/MeasureTheory/Integral/Bochner.lean
theorem posPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (posPart f) =ᵐ[μ] (toSimpleFunc f).posPart
-- Mathlib/CategoryTheory/IsConnected.lean
/-- If `J` and `K` are equivalent, then if `J` is connected then `K` is as well. -/
theorem isConnected_of_equivalent {K : Type u₂} [Category.{v₂} K] (e : J ≌ K) [IsConnected J] :
    IsConnected K
-- Mathlib/Algebra/Order/Floor.lean
@[simp]
theorem preimage_Iio {a : α} : (Nat.cast : ℕ → α) ⁻¹' Set.Iio a = Set.Iio ⌈a⌉₊
-- Mathlib/Algebra/Lie/Weights/Cartan.lean
theorem rootSpaceProduct_tmul
    (χ₁ χ₂ χ₃ : H → R) (hχ : χ₁ + χ₂ = χ₃) (x : rootSpace H χ₁) (y : rootSpace H χ₂) :
    (rootSpaceProduct R L H χ₁ χ₂ χ₃ hχ (x ⊗ₜ y) : L) = ⁅(x : L), (y : L)⁆
-- Mathlib/LinearAlgebra/Span.lean
theorem span_prod_le (s : Set M) (t : Set M') : span R (s ×ˢ t) ≤ prod (span R s) (span R t)
-- Mathlib/Data/Real/EReal.lean
theorem neg_strictAnti : StrictAnti (- · : EReal → EReal)
-- Mathlib/Computability/Ackermann.lean
theorem ack_mono_left (n : ℕ) : Monotone fun m => ack m n
-- Mathlib/Topology/Constructions.lean
theorem closure_subtype {x : { a // p a }} {s : Set { a // p a }} :
    x ∈ closure s ↔ (x : X) ∈ closure (((↑) : _ → X) '' s)
-- Mathlib/Topology/Connected/Basic.lean
theorem isConnected_singleton {x} : IsConnected ({x} : Set α)
-- Mathlib/Order/Filter/Basic.lean
theorem compl_mem_comap : sᶜ ∈ comap f l ↔ (f '' s)ᶜ ∈ l
-- Mathlib/RingTheory/WittVector/Truncated.lean
theorem ext_iff {x y : TruncatedWittVector p n R} : x = y ↔ ∀ i, x.coeff i = y.coeff i
-- Mathlib/MeasureTheory/Constructions/BorelSpace/Metric.lean
@[measurability]
theorem measurable_nnnorm : Measurable (nnnorm : α → ℝ≥0)
-- Mathlib/Combinatorics/SimpleGraph/Walk.lean
@[simp]
theorem toDeleteEdges_cons (s : Set (Sym2 V)) {u v w : V} (h : G.Adj u v) (p : G.Walk v w) (hp) :
    (Walk.cons h p).toDeleteEdges s hp =
      Walk.cons (deleteEdges_adj.mpr ⟨h, hp _ (List.Mem.head _)⟩)
        (p.toDeleteEdges s fun _ he => hp _ <| List.Mem.tail _ he)
-- Mathlib/SetTheory/Cardinal/Cofinality.lean
theorem cof_type (r : α → α → Prop) [IsWellOrder α r] : (type r).cof = StrictOrder.cof r
-- Mathlib/Combinatorics/SimpleGraph/Density.lean
theorem edgeDensity_comm (hr : Symmetric r) (s t : Finset α) :
    edgeDensity r s t = edgeDensity r t s
-- Mathlib/Data/TypeVec.lean
theorem fst_prod_mk {α α' β β' : TypeVec n} (f : α ⟹ β) (g : α' ⟹ β') :
    TypeVec.prod.fst ⊚ (f ⊗' g) = f ⊚ TypeVec.prod.fst
-- Mathlib/FieldTheory/KummerExtension.lean
lemma autAdjoinRootXPowSubCEquiv_symm_smul (σ) :
    ((autAdjoinRootXPowSubCEquiv hζ hn H).symm σ : Kˣ) • (root _ : K[n√a]) = σ (root _)
-- Mathlib/FieldTheory/KummerExtension.lean
theorem X_pow_sub_C_irreducible_iff_of_prime_pow
    {p : ℕ} (hp : p.Prime) (hp' : p ≠ 2) {n} (hn : n ≠ 0) {a : K} :
    Irreducible (X ^ p ^ n - C a) ↔ ∀ b, b ^ p ≠ a
-- Mathlib/Algebra/Ring/Equiv.lean
theorem symm_trans (e₁ : R ≃+* S) (e₂ : S ≃+* S') : (e₁.trans e₂).symm = e₂.symm.trans e₁.symm
-- Mathlib/Algebra/Homology/HomotopyCategory/MappingCone.lean
@[reassoc (attr := simp)]
lemma liftCochain_v_snd_v (p₁ p₂ : ℤ) (h₁₂ : p₁ + n = p₂) :
    (liftCochain φ α β h).v p₁ p₂ h₁₂ ≫ (snd φ).v p₂ p₂ (add_zero p₂) = β.v p₁ p₂ h₁₂
-- Mathlib/NumberTheory/Cyclotomic/Three.lean
/-- We have that `η ^ 2 = -η - 1`. -/
lemma eta_sq : (η ^ 2 : 𝓞 K) = - η - 1
-- Mathlib/Topology/Connected/PathConnected.lean
@[simp]
theorem map_map (γ : Path x y) {Z : Type*} [TopologicalSpace Z]
    {f : X → Y} (hf : Continuous f) {g : Y → Z} (hg : Continuous g) :
    (γ.map hf).map hg = γ.map (hg.comp hf)
-- Mathlib/MeasureTheory/Integral/Gamma.lean
theorem Complex.integral_exp_neg_rpow {p : ℝ} (hp : 1 ≤ p) :
    ∫ x : ℂ, rexp (- ‖x‖ ^ p) = π * Real.Gamma (2 / p + 1)
-- Mathlib/Data/Setoid/Partition.lean
theorem rel_iff_exists_classes (r : Setoid α) {x y} : r.Rel x y ↔ ∃ c ∈ r.classes, x ∈ c ∧ y ∈ c
-- Mathlib/Data/ENNReal/Inv.lean
theorem zpow_pos (ha : a ≠ 0) (h'a : a ≠ ∞) (n : ℤ) : 0 < a ^ n
-- Mathlib/Topology/Algebra/Group/Basic.lean
/-- If a function defined on a topological group has a support contained in a
compact set, then either the function is trivial or the group is locally compact. -/
@[to_additive
      "If a function defined on a topological additive group has a support contained in a compact
      set, then either the function is trivial or the group is locally compact."]
theorem eq_zero_or_locallyCompactSpace_of_support_subset_isCompact_of_group
    [TopologicalSpace α] [Zero α] [T1Space α]
    {f : G → α} {k : Set G} (hk : IsCompact k) (hf : support f ⊆ k) (h'f : Continuous f) :
    f = 0 ∨ LocallyCompactSpace G
-- Mathlib/Combinatorics/SimpleGraph/Finite.lean
theorem neighborFinset_disjoint_singleton : Disjoint (G.neighborFinset v) {v}
-- Mathlib/Topology/Sets/Compacts.lean
@[simp]
theorem coe_mk (s : Compacts α) (h) : (mk s h : Set α) = s
-- Mathlib/Topology/Connected/Basic.lean
theorem Subtype.preconnectedSpace {s : Set α} (h : IsPreconnected s) : PreconnectedSpace s
-- Mathlib/Data/Set/Lattice.lean
theorem preimage_iInter₂ {f : α → β} {s : ∀ i, κ i → Set β} :
    (f ⁻¹' ⋂ (i) (j), s i j) = ⋂ (i) (j), f ⁻¹' s i j
-- Mathlib/CategoryTheory/Functor/Const.lean
/-- These are actually equal, of course, but not definitionally equal
  (the equality requires F.map (𝟙 _) = 𝟙 _). A natural isomorphism is
  more convenient than an equality between functors (compare id_to_iso). -/
@[simps]
def constComp (X : C) (F : C ⥤ D) : (const J).obj X ⋙ F ≅ (const J).obj (F.obj X)
-- Mathlib/Data/Multiset/Bind.lean
@[simp] lemma mem_sigma : ∀ {p : Σa, σ a}, p ∈ @Multiset.sigma α σ s t ↔ p.1 ∈ s ∧ p.2 ∈ t p.1
-- Mathlib/Analysis/Normed/Group/Int.lean
@[to_additive norm_zsmul_le]
theorem norm_zpow_le_mul_norm (n : ℤ) (a : α) : ‖a ^ n‖ ≤ ‖n‖ * ‖a‖
-- Mathlib/RingTheory/Ideal/Maps.lean
theorem comap_bot_of_injective (hf : Function.Injective f) : Ideal.comap f ⊥ = ⊥
-- Mathlib/Analysis/InnerProductSpace/Adjoint.lean
theorem inner_map_map_of_mem_unitary {u : H →L[𝕜] H} (hu : u ∈ unitary (H →L[𝕜] H)) (x y : H) :
    ⟪u x, u y⟫_𝕜 = ⟪x, y⟫_𝕜
-- Mathlib/Order/Compare.lean
@[simp]
theorem cmp_eq_lt_iff : cmp x y = Ordering.lt ↔ x < y
-- Mathlib/CategoryTheory/Comma/StructuredArrow.lean
/-- Given `X : D` and `F : C ⥤ D`, to upgrade a functor `G : E ⥤ C` to a functor
    `E ⥤ StructuredArrow X F`, it suffices to provide maps `X ⟶ F.obj (G.obj Y)` for all `Y` making
    the obvious triangles involving all `F.map (G.map g)` commute.

    This is of course the same as providing a cone over `F ⋙ G` with cone point `X`, see
    `Functor.toStructuredArrowIsoToStructuredArrow`. -/
@[simps]
def toStructuredArrow (G : E ⥤ C) (X : D) (F : C ⥤ D) (f : (Y : E) → X ⟶ F.obj (G.obj Y))
    (h : ∀ {Y Z : E} (g : Y ⟶ Z), f Y ≫ F.map (G.map g) = f Z) : E ⥤ StructuredArrow X F
-- Mathlib/Order/Basic.lean
theorem eq_iff_not_lt_of_le [PartialOrder α] {x y : α} : x ≤ y → y = x ↔ ¬x < y
-- Mathlib/Algebra/Category/ModuleCat/Basic.lean
/-- The scalar multiplication on `ModuleCat R` considered as a morphism of rings
to the endomorphisms of the forgetful functor to `AddCommGrp)`. -/
@[simps]
def smulNatTrans : R →+* End (forget₂ (ModuleCat R) AddCommGrp)
-- Mathlib/Analysis/Asymptotics/Asymptotics.lean
theorem isLittleO_norm_pow_norm_pow {m n : ℕ} (h : m < n) :
    (fun x : E' => ‖x‖ ^ n) =o[𝓝 0] fun x => ‖x‖ ^ m
-- Mathlib/Topology/Algebra/InfiniteSum/Basic.lean
@[to_additive]
theorem HasProd.hasProd_of_prod_eq {g : γ → α}
    (h_eq : ∀ u : Finset γ, ∃ v : Finset β, ∀ v', v ⊆ v' →
      ∃ u', u ⊆ u' ∧ ∏ x ∈ u', g x = ∏ b ∈ v', f b)
    (hf : HasProd g a) : HasProd f a
-- Mathlib/Order/Fin/Tuple.lean
lemma preimage_insertNth_Icc_of_not_mem {i : Fin (n + 1)} {x : α i} {q₁ q₂ : ∀ j, α j}
    (hx : x ∉ Icc (q₁ i) (q₂ i)) : i.insertNth x ⁻¹' Icc q₁ q₂ = ∅
-- Mathlib/GroupTheory/Coprod/Basic.lean
@[to_additive (attr := simp)]
theorem lift_apply_inl (f : M →* P) (g : N →* P) (x : M) : lift f g (inl x) = f x
-- Mathlib/Order/Heyting/Basic.lean
@[simp]
theorem sdiff_le_iff : a \ b ≤ c ↔ a ≤ b ⊔ c
-- Mathlib/CategoryTheory/Monad/Limits.lean
/-- (Impl) This new cocone is used to construct the coalgebra structure -/
@[simps! ι_app]
def newCocone : Cocone (D ⋙ forget T)
-- Mathlib/NumberTheory/NumberField/Embeddings.lean
lemma isConj_one_iff : IsConj φ (1 : K ≃ₐ[k] K) ↔ IsReal φ
-- Mathlib/Data/Num/Bitwise.lean
theorem bit_one (b : Bool) : (b :: zero (Not b)) = msb b
-- Mathlib/CategoryTheory/Monoidal/Category.lean
@[reassoc]
theorem whisker_assoc_symm (X : C) {Y Y' : C} (f : Y ⟶ Y') (Z : C) :
    X ◁ f ▷ Z = (α_ X Y Z).inv ≫ (X ◁ f) ▷ Z ≫ (α_ X Y' Z).hom
-- Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean
lemma opcycles_ext_iff {A : C} (f₁ f₂ : S.opcycles ⟶ A) :
    f₁ = f₂ ↔ S.pOpcycles ≫ f₁ = S.pOpcycles ≫ f₂
-- Mathlib/Analysis/SpecialFunctions/Integrals.lean
theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]]) :
    ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1)
-- Mathlib/Data/Finsupp/Basic.lean
theorem sigma_support : l.support = l.splitSupport.sigma fun i => (l.split i).support
-- Mathlib/RingTheory/FractionalIdeal/Basic.lean
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
    {I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J
-- Mathlib/RingTheory/MvPowerSeries/Basic.lean
protected theorem mul_zero : φ * 0 = 0
-- Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean
/-- `rpow` as a `MonoidHom`-/
@[simps]
def rpowMonoidHom (r : ℝ) : ℝ≥0 →* ℝ≥0
-- Mathlib/LinearAlgebra/AffineSpace/Combination.lean
/-- The linear map corresponding to `affineCombination` is
`weightedVSub`. -/
@[simp]
theorem affineCombination_linear (p : ι → P) :
    (s.affineCombination k p).linear = s.weightedVSub p
-- Mathlib/Data/Real/Cardinality.lean
/-- The cardinality of the interval [a, b]. -/
theorem mk_Icc_real {a b : ℝ} (h : a < b) : #(Icc a b) = 𝔠
-- .lake/packages/lean4/src/lean/Init/Data/Int/Order.lean
protected theorem le_add_of_neg_add_le {a b c : Int} (h : -b + a ≤ c) : a ≤ b + c
-- Mathlib/Topology/Instances/ENNReal.lean
protected theorem continuous_const_mul {a : ℝ≥0∞} (ha : a ≠ ∞) : Continuous (a * ·)
-- Mathlib/Algebra/Category/MonCat/Basic.lean
@[to_additive (attr := simp)]
lemma ofHom_apply {X Y : Type u} [CommMonoid X] [CommMonoid Y] (f : X →* Y) (x : X) :
    (ofHom f) x = f x
-- Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean
/-- The cokernel of `biproduct.fromSubtype f p` is `⨁ Subtype.restrict pᶜ f`. -/
@[simps!]
def cokernelBiproductFromSubtypeIso (p : Set K) :
    cokernel (biproduct.fromSubtype f p) ≅ ⨁ Subtype.restrict pᶜ f
-- Mathlib/Algebra/Lie/Nilpotent.lean
/-- Note that the below inequality can be strict. For example the ideal of strictly-upper-triangular
2x2 matrices inside the Lie algebra of upper-triangular 2x2 matrices with `k = 1`. -/
-- Porting note: added `LieSubmodule.toSubmodule` in the statement
theorem LieModule.coe_lowerCentralSeries_ideal_le {I : LieIdeal R L} (k : ℕ) :
    LieSubmodule.toSubmodule (lowerCentralSeries R I I k) ≤ lowerCentralSeries R L I k
-- Mathlib/MeasureTheory/Measure/Lebesgue/EqHaar.lean
theorem _root_.AlternatingMap.measure_parallelepiped (ω : G [⋀^Fin n]→ₗ[ℝ] ℝ)
    (v : Fin n → G) : ω.measure (parallelepiped v) = ENNReal.ofReal |ω v|
-- Mathlib/Topology/Order.lean
theorem nhds_nhdsAdjoint_of_ne {a b : α} (f : Filter α) (h : b ≠ a) :
    @nhds α (nhdsAdjoint a f) b = pure b
-- Mathlib/Algebra/Group/Subgroup/Basic.lean
/-- The `MonoidHom` from the preimage of a subgroup to itself. -/
@[to_additive (attr := simps!) "the `AddMonoidHom` from the preimage of an
additive subgroup to itself."]
def subgroupComap (f : G →* G') (H' : Subgroup G') : H'.comap f →* H'
-- Mathlib/Algebra/Star/NonUnitalSubalgebra.lean
@[simp]
theorem inf_toNonUnitalSubalgebra (S T : NonUnitalStarSubalgebra R A) :
    (S ⊓ T).toNonUnitalSubalgebra = S.toNonUnitalSubalgebra ⊓ T.toNonUnitalSubalgebra
-- Mathlib/Algebra/BigOperators/Group/List.lean
@[to_additive] lemma prod_reverse (l : List M) : prod l.reverse = prod l
-- .lake/packages/batteries/Batteries/Data/Fin/Lemmas.lean
@[simp] theorem coe_clamp (n m : Nat) : (clamp n m : Nat) = min n m
-- Mathlib/Topology/Algebra/Module/Basic.lean
theorem preimage_closure (e : M₁ ≃SL[σ₁₂] M₂) (s : Set M₂) : e ⁻¹' closure s = closure (e ⁻¹' s)
-- Mathlib/CategoryTheory/Equivalence.lean
@[simp]
theorem cancel_counitInv_right_assoc {W X X' Y : D} (f : W ⟶ X) (g : X ⟶ Y) (f' : W ⟶ X')
    (g' : X' ⟶ Y) : f ≫ g ≫ e.counitInv.app Y = f' ≫ g' ≫ e.counitInv.app Y ↔ f ≫ g = f' ≫ g'
-- Mathlib/Algebra/Polynomial/Degree/Definitions.lean
theorem leadingCoeff_sub_of_degree_lt (h : Polynomial.degree q < Polynomial.degree p) :
    (p - q).leadingCoeff = p.leadingCoeff
-- Mathlib/Algebra/Free.lean
@[to_additive (attr := simp)]
theorem mul_seq {α β : Type u} {f g : FreeMagma (α → β)} {x : FreeMagma α} :
    f * g <*> x = (f <*> x) * (g <*> x)
-- Mathlib/Order/MinMax.lean
@[simp]
theorem max_eq_left_iff : max a b = a ↔ b ≤ a
-- Mathlib/Topology/Instances/Matrix.lean
theorem Summable.matrix_diag {f : X → Matrix n n R} (hf : Summable f) :
    Summable fun x => diag (f x)
-- Mathlib/Analysis/Convex/Basic.lean
theorem Convex.mem_smul_of_zero_mem (h : Convex 𝕜 s) {x : E} (zero_mem : (0 : E) ∈ s) (hx : x ∈ s)
    {t : 𝕜} (ht : 1 ≤ t) : x ∈ t • s
-- Mathlib/Analysis/Calculus/FDeriv/Basic.lean
theorem fderivWithin_eq_fderiv (hs : UniqueDiffWithinAt 𝕜 s x) (h : DifferentiableAt 𝕜 f x) :
    fderivWithin 𝕜 f s x = fderiv 𝕜 f x
-- Mathlib/Algebra/Lie/Nilpotent.lean
@[simp]
theorem isNilpotent_range_toEnd_iff :
    IsNilpotent R (toEnd R L M).range M ↔ IsNilpotent R L M
-- Mathlib/GroupTheory/Schreier.lean
@[to_additive]
theorem card_dvd_exponent_pow_rank' {n : ℕ} (hG : ∀ g : G, g ^ n = 1) :
    Nat.card G ∣ n ^ Group.rank G
-- Mathlib/Order/Filter/Basic.lean
theorem iInf_principal_finite {ι : Type w} {s : Set ι} (hs : s.Finite) (f : ι → Set α) :
    ⨅ i ∈ s, 𝓟 (f i) = 𝓟 (⋂ i ∈ s, f i)
-- Mathlib/Analysis/InnerProductSpace/Basic.lean
theorem orthonormal_span {ι : Type*} {v : ι → E} (hv : Orthonormal 𝕜 v) :
    @Orthonormal 𝕜 (Submodule.span 𝕜 (Set.range v)) _ _ _ ι fun i : ι =>
      ⟨v i, Submodule.subset_span (Set.mem_range_self i)⟩
-- Mathlib/CategoryTheory/Idempotents/Karoubi.lean
@[ext]
theorem ext {P Q : Karoubi C} (h_X : P.X = Q.X) (h_p : P.p ≫ eqToHom h_X = eqToHom h_X ≫ Q.p) :
    P = Q
-- Mathlib/Algebra/Module/LocalizedModule.lean
private theorem nsmul_zero' (x : LocalizedModule S M) : (0 : ℕ) • x = 0
-- Mathlib/Algebra/Order/BigOperators/Group/Finset.lean
theorem card_le_card_biUnion_add_card_fiber {s : Finset ι} {f : ι → Finset α}
    (hs : (s : Set ι).PairwiseDisjoint f) :
    s.card ≤ (s.biUnion f).card + (s.filter fun i ↦ f i = ∅).card
-- Mathlib/Data/Set/Basic.lean
theorem monotone_setOf [Preorder α] {p : α → β → Prop} (hp : ∀ b, Monotone fun a => p a b) :
    Monotone fun a => { b | p a b }
-- Mathlib/Data/Nat/Factorization/Defs.lean
theorem factorization_def (n : ℕ) {p : ℕ} (pp : p.Prime) : n.factorization p = padicValNat p n
-- Mathlib/CategoryTheory/FintypeCat.lean
@[ext]
theorem ext (X Y : Skeleton) : X.len = Y.len → X = Y
-- Mathlib/Order/Filter/Pointwise.lean
theorem NeBot.zero_smul_nonneg (hg : g.NeBot) : 0 ≤ (0 : Filter α) • g
-- Mathlib/Algebra/Lie/Submodule.lean
theorem map_sup_ker_eq_map : LieIdeal.map f (I ⊔ f.ker) = LieIdeal.map f I
-- Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Defs.lean
@[simp]
theorem coeToGL_det (g : SpecialLinearGroup n R) :
    Matrix.GeneralLinearGroup.det (g : GL n R) = 1
-- .lake/packages/lean4/src/lean/Init/Data/Int/Order.lean
protected theorem neg_add_lt_right_of_lt_add {a b c : Int} (h : a < b + c) : -c + a < b
-- Mathlib/Dynamics/Ergodic/Ergodic.lean
/-- For a quasi ergodic map, sets that are almost invariant (rather than strictly invariant) are
still either almost empty or full. -/
theorem ae_mem_or_ae_nmem₀ (hf : QuasiErgodic f μ) (hsm : NullMeasurableSet s μ)
    (hs : f ⁻¹' s =ᵐ[μ] s) :
    (∀ᵐ x ∂μ, x ∈ s) ∨ ∀ᵐ x ∂μ, x ∉ s
-- Mathlib/GroupTheory/SpecificGroups/Cyclic.lean
@[to_additive]
theorem exists_pow_ne_one_of_isCyclic {G : Type*} [Group G] [Fintype G] [G_cyclic : IsCyclic G]
    {k : ℕ} (k_pos : k ≠ 0) (k_lt_card_G : k < Fintype.card G) : ∃ a : G, a ^ k ≠ 1
-- Mathlib/Analysis/Calculus/MeanValue.lean
/-- General fencing theorem for continuous functions with an estimate on the derivative.
Let `f` and `B` be continuous functions on `[a, b]` such that

* `f a ≤ B a`;
* `B` has right derivative `B'` at every point of `[a, b)`;
* for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)`
  is bounded above by `B'`.

Then `f x ≤ B x` everywhere on `[a, b]`. -/
theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ → ℝ} {a b : ℝ}
    (hf : ContinuousOn f (Icc a b)) {B B' : ℝ → ℝ} (ha : f a ≤ B a) (hB : ContinuousOn B (Icc a b))
    (hB' : ∀ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x)
    -- `bound` actually says `liminf (f z - f x) / (z - x) ≤ B' x`
    (bound : ∀ x ∈ Ico a b, ∀ r, B' x < r → ∃ᶠ z in 𝓝[>] x, slope f x z < r) :
    ∀ ⦃x⦄, x ∈ Icc a b → f x ≤ B x
-- Mathlib/Data/ENNReal/Operations.lean
theorem add_left_inj (h : a ≠ ∞) : b + a = c + a ↔ b = c
-- Mathlib/MeasureTheory/OuterMeasure/Operations.lean
@[mono]
theorem map_mono {β} (f : α → β) : Monotone (map f)
-- Mathlib/Order/ConditionallyCompleteLattice/Basic.lean
theorem WithBot.sInf_eq [InfSet α] {s : Set (WithBot α)} (hs : ⊥ ∉ s)
    (hs' : BddBelow ((↑) ⁻¹' s : Set α)) : sInf s = ↑(sInf ((↑) ⁻¹' s) : α)
-- Mathlib/Data/Real/Basic.lean
theorem mk_mul {f g : CauSeq ℚ abs} : mk (f * g) = mk f * mk g
-- Mathlib/Data/Set/Lattice.lean
theorem inter_iInter [Nonempty ι] (s : Set β) (t : ι → Set β) : (s ∩ ⋂ i, t i) = ⋂ i, s ∩ t i
-- Mathlib/Topology/PartialHomeomorph.lean
/-- Two equivalent partial homeomorphisms have the same target. -/
theorem EqOnSource.target_eq {e e' : PartialHomeomorph X Y} (h : e ≈ e') : e.target = e'.target
-- Mathlib/MeasureTheory/Measure/WithDensityFinite.lean
lemma sFiniteSeq_absolutelyContinuous_toFinite (μ : Measure α) [SFinite μ] (n : ℕ) :
    sFiniteSeq μ n ≪ μ.toFinite
-- Mathlib/Analysis/Convex/Basic.lean
protected theorem convex (K : Submodule 𝕜 E) : Convex 𝕜 (↑K : Set E)
-- Mathlib/Geometry/RingedSpace/PresheafedSpace.lean
/-- Sometimes rewriting with `comp_c_app` doesn't work because of dependent type issues.
In that case, `erw comp_c_app_assoc` might make progress.
The lemma `comp_c_app_assoc` is also better suited for rewrites in the opposite direction. -/
@[reassoc, simp]
theorem comp_c_app {X Y Z : PresheafedSpace C} (α : X ⟶ Y) (β : Y ⟶ Z) (U) :
    (α ≫ β).c.app U = β.c.app U ≫ α.c.app (op ((Opens.map β.base).obj (unop U)))
-- Mathlib/Algebra/Algebra/Subalgebra/Unitization.lean
/-- A sufficient condition for injectivity of `NonUnitalSubalgebra.unitization` when the scalars
are a commutative ring. When the scalars are a field, one should use the more natural
`NonUnitalStarSubalgebra.unitization_injective` whose hypothesis is easier to verify. -/
theorem _root_.AlgHomClass.unitization_injective' {F R S A : Type*} [CommRing R] [Ring A]
    [Algebra R A] [SetLike S A] [hSA : NonUnitalSubringClass S A] [hSRA : SMulMemClass S R A]
    (s : S) (h : ∀ r, r ≠ 0 → algebraMap R A r ∉ s)
    [FunLike F (Unitization R s) A] [AlgHomClass F R (Unitization R s) A]
    (f : F) (hf : ∀ x : s, f x = x) : Function.Injective f
-- Mathlib/Analysis/SpecialFunctions/Log/Basic.lean
theorem log_neg_of_lt_zero (h0 : x < 0) (h1 : -1 < x) : log x < 0
-- Mathlib/CategoryTheory/Comma/Presheaf.lean
/-- Intermediate stage of assembling the unit. -/
@[simps!]
def unitAuxAux {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) :
    yonedaCollectionPresheaf A (restrictedYonedaObj η) ≅ F