ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
-- Mathlib/Algebra/Free.lean
@[to_additive (attr := simp, nolint simpNF)]
theorem mul_map_seq (x y : FreeMagma α) :
    ((· * ·) <$> x <*> y : Id (FreeMagma α)) = (x * y : FreeMagma α)
-- Mathlib/Analysis/RCLike/Basic.lean
@[simp, rclike_simps]
theorem ofRealCLM_apply : (ofRealCLM : ℝ → K) = ofReal
-- Mathlib/Data/Int/CardIntervalMod.lean
lemma Ico_filter_modEq_cast {v : ℕ} : ((Ico a b).filter (· ≡ v [MOD r])).map castEmbedding =
    (Ico (a : ℤ) (b : ℤ)).filter (· ≡ v [ZMOD r])
-- Mathlib/Data/PNat/Factors.lean
/-- If we start with a multiset of primes, take the product and
 then factor it, we get back the original multiset. -/
theorem factorMultiset_prod (v : PrimeMultiset) : v.prod.factorMultiset = v
-- Mathlib/Combinatorics/SimpleGraph/Regularity/Bound.lean
theorem le_stepBound : id ≤ stepBound
-- Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean
theorem volume_val (s) : volume s = StieltjesFunction.id.measure s
-- Mathlib/MeasureTheory/Measure/VectorMeasure.lean
theorem toENNRealVectorMeasure_apply_measurable {μ : Measure α} {i : Set α} (hi : MeasurableSet i) :
    μ.toENNRealVectorMeasure i = μ i
-- Mathlib/CategoryTheory/Idempotents/Karoubi.lean
@[ext]
theorem hom_ext {P Q : Karoubi C} (f g : P ⟶ Q) (h : f.f = g.f) : f = g
-- Mathlib/Order/Lattice.lean
@[simp]
theorem le_sup_right : b ≤ a ⊔ b
-- Mathlib/Data/Finset/Union.lean
private lemma pairwiseDisjoint_fibers : Set.PairwiseDisjoint ↑t fun a ↦ s.filter (f · = a)
-- Mathlib/Topology/MetricSpace/GromovHausdorffRealized.lean
private theorem HD_bound_aux1 (f : Cb X Y) (C : ℝ) :
    BddAbove (range fun x : X => ⨅ y, f (inl x, inr y) + C)
-- Mathlib/LinearAlgebra/TensorPower.lean
theorem tprod_mul_tprod {na nb} (a : Fin na → M) (b : Fin nb → M) :
    tprod R a ₜ* tprod R b = tprod R (Fin.append a b)
-- Mathlib/Order/SymmDiff.lean
theorem bihimp_right_injective (a : α) : Injective (a ⇔ ·)
-- Mathlib/Analysis/Normed/Group/Basic.lean
@[to_additive]
theorem norm_le_norm_add_norm_div' (u v : E) : ‖u‖ ≤ ‖v‖ + ‖u / v‖
-- Mathlib/Topology/Constructions.lean
theorem nhds_subtype_eq_comap {x : X} {h : p x} : 𝓝 (⟨x, h⟩ : Subtype p) = comap (↑) (𝓝 x)
-- Mathlib/Analysis/Analytic/CPolynomial.lean
theorem CPolynomialOn.congr {s : Set E} (hs : IsOpen s) (hf : CPolynomialOn 𝕜 f s)
    (hg : s.EqOn f g) : CPolynomialOn 𝕜 g s
-- Mathlib/Analysis/Complex/AbsMax.lean
/-- **Maximum modulus principle**. Let `f : E → F` be a function between complex normed spaces.
Suppose that the codomain `F` is a strictly convex space, `f` is complex differentiable on a set
`s`, `f` is continuous on the closure of `s`, the norm of `f` takes it maximum on `s` at `z`, and
`w` is a point such that the closed ball with center `z` and radius `dist w z` is included in `s`,
then `f w = f z`. -/
theorem eq_of_isMaxOn_of_ball_subset {f : E → F} {s : Set E} {z w : E} (hd : DiffContOnCl ℂ f s)
    (hz : IsMaxOn (norm ∘ f) s z) (hsub : ball z (dist w z) ⊆ s) : f w = f z
-- Mathlib/Algebra/BigOperators/Group/Finset.lean
@[to_additive]
lemma prod_fiberwise (s : Finset ι) (g : ι → κ) (f : ι → α) :
    ∏ j, ∏ i ∈ s.filter fun i ↦ g i = j, f i = ∏ i ∈ s, f i
-- Mathlib/Topology/Category/Profinite/Nobeling.lean
/-- The map `Nobeling.ι` is a closed embedding. -/
theorem Nobeling.embedding : ClosedEmbedding (Nobeling.ι S)
-- Mathlib/Algebra/Homology/HomotopyCategory/HomComplex.lean
lemma δ_δ (n₀ n₁ n₂ : ℤ) (z : Cochain F G n₀) : δ n₁ n₂ (δ n₀ n₁ z) = 0
-- Mathlib/Data/NNRat/Defs.lean
@[simp, norm_cast] lemma num_natCast (n : ℕ) : num n = n
-- Mathlib/MeasureTheory/MeasurableSpace/Embedding.lean
@[simp]
lemma preimage_image (e : α ≃ᵐ β) (s : Set α) : e ⁻¹' (e '' s) = s
-- Mathlib/Data/Matroid/Basic.lean
theorem Indep.rkPos_of_nonempty (hI : M.Indep I) (hne : I.Nonempty) : M.RkPos
-- Mathlib/Analysis/Normed/Module/FiniteDimension.lean
/-- The set of injective continuous linear maps `E → F` is open,
  if `E` is finite-dimensional over a complete field. -/
theorem ContinuousLinearMap.isOpen_injective [FiniteDimensional 𝕜 E] :
    IsOpen { L : E →L[𝕜] F | Injective L }
-- Mathlib/Topology/Sheaves/Skyscraper.lean
theorem skyscraperPresheaf_eq_pushforward
    [hd : ∀ U : Opens (TopCat.of PUnit.{u + 1}), Decidable (PUnit.unit ∈ U)] :
    skyscraperPresheaf p₀ A =
      ContinuousMap.const (TopCat.of PUnit) p₀ _*
        skyscraperPresheaf (X := TopCat.of PUnit) PUnit.unit A
-- Mathlib/Topology/Algebra/Monoid.lean
@[to_additive]
theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M]
    (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1))
    (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M
-- Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean
lemma stalkToFiberRingHom_homogeneousLocalizationToStalk (x z) :
    stalkToFiberRingHom 𝒜 x (homogeneousLocalizationToStalk 𝒜 x z) = z
-- Mathlib/Data/Finset/Basic.lean
@[simp]
theorem Finset.union_symm_inr (h : Disjoint s t) (y : t) :
    Equiv.Finset.union s t h (Sum.inr y) = ⟨y, Finset.mem_union.mpr <| Or.inr y.2⟩
-- Mathlib/AlgebraicGeometry/EllipticCurve/Group.lean
lemma XYIdeal_eq₁ (x y L : R) : XYIdeal W x (C y) = XYIdeal W x (linePolynomial x y L)
-- Mathlib/MeasureTheory/Measure/Haar/Basic.lean
@[to_additive addIndex_union_le]
theorem index_union_le (K₁ K₂ : Compacts G) {V : Set G} (hV : (interior V).Nonempty) :
    index (K₁.1 ∪ K₂.1) V ≤ index K₁.1 V + index K₂.1 V
-- Mathlib/Algebra/Homology/ShortComplex/Preadditive.lean
/-- If two maps of short complexes are homotopic, their opposites also are. -/
@[simps]
def neg (h : Homotopy φ₁ φ₂) : Homotopy (-φ₁) (-φ₂)
-- Mathlib/Data/Matrix/Rank.lean
theorem rank_eq_finrank_range_toLin [Finite m] [DecidableEq n] {M₁ M₂ : Type*} [AddCommGroup M₁]
    [AddCommGroup M₂] [Module R M₁] [Module R M₂] (A : Matrix m n R) (v₁ : Basis m R M₁)
    (v₂ : Basis n R M₂) : A.rank = finrank R (LinearMap.range (toLin v₂ v₁ A))
-- Mathlib/Combinatorics/Additive/ETransform.lean
@[to_additive]
theorem mulETransformRight.card :
    (mulETransformLeft e x).2.card + (mulETransformRight e x).2.card = 2 * x.2.card
-- Mathlib/Data/Finset/Sym.lean
theorem isDiag_mk_of_mem_diag {a : α × α} (h : a ∈ s.diag) : (Sym2.mk a).IsDiag
-- Mathlib/Algebra/Homology/Homotopy.lean
/-- Compatibility of `nullHomotopicMap'` with the precomposition by a morphism
of complexes. -/
theorem comp_nullHomotopicMap' (f : C ⟶ D) (hom : ∀ i j, c.Rel j i → (D.X i ⟶ E.X j)) :
    f ≫ nullHomotopicMap' hom = nullHomotopicMap' fun i j hij => f.f i ≫ hom i j hij
-- Mathlib/Data/DFinsupp/Order.lean
lemma coe_strictMono : Monotone ((⇑) : (Π₀ i, α i) → ∀ i, α i)
-- Mathlib/Algebra/Algebra/Hom.lean
protected theorem congr_arg (φ : A →ₐ[R] B) {x y : A} (h : x = y) : φ x = φ y
-- Mathlib/Data/DFinsupp/Basic.lean
@[simp]
theorem comapDomain'_apply [∀ i, Zero (β i)] (h : κ → ι) {h' : ι → κ}
    (hh' : Function.LeftInverse h' h) (f : Π₀ i, β i) (k : κ) : comapDomain' h hh' f k = f (h k)
-- Mathlib/Computability/AkraBazzi/AkraBazzi.lean
lemma growsPolynomially_one_add_smoothingFn : GrowsPolynomially fun x => 1 + ε x
-- Mathlib/Data/Finset/Pointwise.lean
@[to_additive]
theorem univ_mul_of_one_mem [Fintype α] (ht : (1 : α) ∈ t) : univ * t = univ
-- Mathlib/CategoryTheory/Category/Basic.lean
theorem id_of_comp_left_id (f : X ⟶ X) (w : ∀ {Y : C} (g : X ⟶ Y), f ≫ g = g) : f = 𝟙 X
-- Mathlib/LinearAlgebra/Alternating/Basic.lean
@[simp]
theorem add_apply : (f + f') v = f v + f' v
-- Mathlib/Algebra/Group/Ext.lean
@[to_additive]
theorem LeftCancelMonoid.toMonoid_injective {M : Type u} :
    Function.Injective (@LeftCancelMonoid.toMonoid M)
-- Mathlib/Algebra/CharP/Defs.lean
lemma of_eq {p : ℕ} (h : ringChar R = p) : CharP R p
-- Mathlib/Topology/Constructions.lean
theorem isOpenMap_sigma {f : Sigma σ → X} : IsOpenMap f ↔ ∀ i, IsOpenMap fun a => f ⟨i, a⟩
-- Mathlib/Algebra/RingQuot.lean
private irreducible_def zero : RingQuot r
-- Mathlib/Logic/Embedding/Basic.lean
/-- If `f : α ↪ α'` is an embedding and `g : Π a, β α ↪ β' (f α)` is a family
of embeddings, then `Sigma.map f g` is an embedding. -/
@[simps apply]
def sigmaMap (f : α ↪ α') (g : ∀ a, β a ↪ β' (f a)) : (Σa, β a) ↪ Σa', β' a'
-- Mathlib/Analysis/Calculus/IteratedDeriv/Defs.lean
/-- Write the iterated Fréchet derivative as the composition of a continuous linear equiv and the
iterated derivative. -/
theorem iteratedFDerivWithin_eq_equiv_comp :
    iteratedFDerivWithin 𝕜 n f s =
      ContinuousMultilinearMap.piFieldEquiv 𝕜 (Fin n) F ∘ iteratedDerivWithin n f s
-- .lake/packages/batteries/Batteries/Data/List/Lemmas.lean
protected theorem IsInfix.subset (hl : l₁ <:+: l₂) : l₁ ⊆ l₂
-- Mathlib/LinearAlgebra/Dual.lean
@[simp]
theorem dualCoannihilator_bot : (⊥ : Submodule R (Module.Dual R M)).dualCoannihilator = ⊤
-- Mathlib/GroupTheory/Perm/Sign.lean
theorem sign_swap {x y : α} (h : x ≠ y) : sign (swap x y) = -1
-- Mathlib/Order/SuccPred/Basic.lean
@[simp]
theorem succ_le_iff_isMax : succ a ≤ a ↔ IsMax a
-- Mathlib/Topology/UniformSpace/UniformEmbedding.lean
theorem UniformInducing.of_comp_iff {g : β → γ} (hg : UniformInducing g) {f : α → β} :
    UniformInducing (g ∘ f) ↔ UniformInducing f
-- Mathlib/GroupTheory/Coset.lean
@[to_additive]
theorem mk_surjective : Function.Surjective <| @mk _ _ s
-- Mathlib/LinearAlgebra/Finsupp.lean
theorem mulLeftMap_apply {M N : Submodule R S} {ι : Type*} (m : ι → M) (n : ι →₀ N) :
    mulLeftMap N m n = Finsupp.sum n fun (i : ι) (n : N) ↦ (m i).1 * n.1
-- Mathlib/Analysis/Asymptotics/Asymptotics.lean
theorem IsBigOWith.sum (h : ∀ i ∈ s, IsBigOWith (C i) l (A i) g) :
    IsBigOWith (∑ i ∈ s, C i) l (fun x => ∑ i ∈ s, A i x) g
-- Mathlib/LinearAlgebra/Dimension/Basic.lean
theorem cardinal_lift_le_rank {ι : Type w} {v : ι → M}
    (hv : LinearIndependent R v) :
    Cardinal.lift.{v} #ι ≤ Cardinal.lift.{w} (Module.rank R M)
-- Mathlib/Algebra/Order/GroupWithZero/Canonical.lean
theorem div_le_div₀ (a b c d : α) (hb : b ≠ 0) (hd : d ≠ 0) :
    a * b⁻¹ ≤ c * d⁻¹ ↔ a * d ≤ c * b
-- Mathlib/Topology/MetricSpace/Thickening.lean
/-- For the equality, see `thickening_thickening`. -/
@[simp]
theorem thickening_thickening_subset (ε δ : ℝ) (s : Set α) :
    thickening ε (thickening δ s) ⊆ thickening (ε + δ) s
-- Mathlib/Data/Finset/Basic.lean
theorem filter_union_filter_neg_eq [∀ x, Decidable (¬p x)] (s : Finset α) :
    (s.filter p ∪ s.filter fun a => ¬p a) = s
-- Mathlib/RingTheory/Ideal/Basic.lean
/-- An ideal `P` of a ring `R` is prime if `P ≠ R` and `xy ∈ P → x ∈ P ∨ y ∈ P` -/
class IsPrime (I : Ideal α) : Prop where
  /-- The prime ideal is not the entire ring. -/
  ne_top' : I ≠ ⊤
  /-- If a product lies in the prime ideal, then at least one element lies in the prime ideal. -/
  mem_or_mem' : ∀ {x y : α}, x * y ∈ I → x ∈ I ∨ y ∈ I
-- Mathlib/Combinatorics/Colex.lean
@[simp]
lemma mem_initSeg : t ∈ initSeg s ↔ s.card = t.card ∧ toColex t ≤ toColex s
-- Mathlib/Algebra/Homology/HomotopyCategory/HomComplexShift.lean
@[simp]
lemma leftShift_smul (a n' : ℤ) (hn' : n + a = n') (x : R) :
    (x • γ).leftShift a n' hn' = x • γ.leftShift a n' hn'
-- Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean
theorem integral_condexp (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] :
    ∫ x, (μ[f|m]) x ∂μ = ∫ x, f x ∂μ
-- Mathlib/Algebra/GroupWithZero/Units/Basic.lean
lemma div_eq_one_iff_eq (hb : b ≠ 0) : a / b = 1 ↔ a = b
-- Mathlib/CategoryTheory/Opposites.lean
/-- Taking the opposite of a functor is functorial.
-/
@[simps]
def opHom : (C ⥤ D)ᵒᵖ ⥤ Cᵒᵖ ⥤ Dᵒᵖ
-- Mathlib/Topology/Instances/TrivSqZeroExt.lean
theorem hasSum_inl [AddCommMonoid R] [AddCommMonoid M] {f : α → R} {a : R} (h : HasSum f a) :
    HasSum (fun x ↦ inl (f x)) (inl a : tsze R M)
-- .lake/packages/batteries/Batteries/Data/String/Lemmas.lean
theorem prev_of_valid' (cs cs' : List Char) :
    prev ⟨cs ++ cs'⟩ ⟨utf8Len cs⟩ = ⟨utf8Len cs.dropLast⟩
-- Mathlib/Data/Matrix/Kronecker.lean
theorem kronecker_natCast [NonAssocSemiring α] [DecidableEq n] (A : Matrix l m α) (b : ℕ) :
    A ⊗ₖ (b : Matrix n n α) = blockDiagonal fun _ => b • A
-- Mathlib/RingTheory/PrincipalIdealDomain.lean
theorem mem_submonoid_of_factors_subset_of_units_subset (s : Submonoid R) {a : R} (ha : a ≠ 0)
    (hfac : ∀ b ∈ factors a, b ∈ s) (hunit : ∀ c : Rˣ, (c : R) ∈ s) : a ∈ s
-- Mathlib/Data/Set/Function.lean
lemma InjOn.image_ssubset_image_iff (h : s.InjOn f) (h₁ : s₁ ⊆ s) (h₂ : s₂ ⊆ s) :
    f '' s₁ ⊂ f '' s₂ ↔ s₁ ⊂ s₂
-- Mathlib/Order/Interval/Set/Basic.lean
theorem Icc_subset_Ico_right (h₁ : b₁ < b₂) : Icc a b₁ ⊆ Ico a b₂
-- Mathlib/LinearAlgebra/PerfectPairing.lean
lemma trans_dualMap_symm_flip : e.trans e.flip.symm.dualMap = Dual.eval R N
-- Mathlib/Algebra/Order/Monovary.lean
@[simp] lemma antivary_inv_right₀ (hg : StrongLT 0 g) : Antivary f g⁻¹ ↔ Monovary f g
-- Mathlib/Data/Real/Archimedean.lean
theorem iUnion_Iic_rat : ⋃ r : ℚ, Iic (r : ℝ) = univ
-- Mathlib/Algebra/Homology/HomotopyCategory/Pretriangulated.lean
lemma invRotate_distinguished_triangle' (T : Triangle (HomotopyCategory C (ComplexShape.up ℤ)))
    (hT : T ∈ distinguishedTriangles C) : T.invRotate ∈ distinguishedTriangles C
-- Mathlib/Logic/Basic.lean
theorem forall_cond_comm {α} {s : α → Prop} {p : α → α → Prop} :
    (∀ a, s a → ∀ b, s b → p a b) ↔ ∀ a b, s a → s b → p a b
-- Mathlib/Probability/Process/Stopping.lean
theorem stoppedValue_eq {N : ℕ} (hbdd : ∀ ω, τ ω ≤ N) : stoppedValue u τ = fun x =>
    (∑ i ∈ Finset.range (N + 1), Set.indicator {ω | τ ω = i} (u i)) x
-- Mathlib/Order/BooleanAlgebra.lean
theorem sdiff_eq_self_iff_disjoint : x \ y = x ↔ Disjoint y x
-- Mathlib/Algebra/Star/NonUnitalSubalgebra.lean
theorem mul_mem_sup {S T : NonUnitalStarSubalgebra R A} {x y : A} (hx : x ∈ S) (hy : y ∈ T) :
    x * y ∈ S ⊔ T
-- Mathlib/Algebra/Group/Indicator.lean
@[to_additive]
theorem comp_mulIndicator (h : M → β) (f : α → M) {s : Set α} {x : α} [DecidablePred (· ∈ s)] :
    h (s.mulIndicator f x) = s.piecewise (h ∘ f) (const α (h 1)) x
-- Mathlib/Data/ENNReal/Inv.lean
theorem eq_div_iff (ha : a ≠ 0) (ha' : a ≠ ∞) : b = c / a ↔ a * b = c
-- Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean
@[simp]
theorem cos_sub_two_pi (x : ℝ) : cos (x - 2 * π) = cos x
-- Mathlib/AlgebraicGeometry/AffineScheme.lean
theorem self_le_basicOpen_union_iff (s : Set Γ(X, U)) :
    (U ≤ ⨆ f : s, X.basicOpen f.1) ↔ Ideal.span s = ⊤
-- Mathlib/MeasureTheory/Measure/Typeclasses.lean
/-- A measure `μ` is finite on compacts if any compact set `K` satisfies `μ K < ∞`. -/
class IsFiniteMeasureOnCompacts [TopologicalSpace α] (μ : Measure α) : Prop where
  protected lt_top_of_isCompact : ∀ ⦃K : Set α⦄, IsCompact K → μ K < ∞
-- Mathlib/Logic/Equiv/PartialEquiv.lean
/-- Composing two partial equivs if the target of the first coincides with the source of the
second. -/
@[simps]
protected def trans' (e' : PartialEquiv β γ) (h : e.target = e'.source) : PartialEquiv α γ
-- Mathlib/Order/LiminfLimsup.lean
theorem limsInf_le_limsInf_of_le {f g : Filter α} (h : g ≤ f)
    (hf : f.IsBounded (· ≥ ·) := by isBoundedDefault)
    (hg : g.IsCobounded (· ≥ ·) := by isBoundedDefault) :
    limsInf f ≤ limsInf g
-- Mathlib/RingTheory/Nilpotent/Defs.lean
@[simp] lemma isNilpotent_of_subsingleton [Zero R] [Pow R ℕ] [Subsingleton R] : IsNilpotent x
-- Mathlib/CategoryTheory/Subobject/Limits.lean
theorem equalizerSubobject_factors {W : C} (h : W ⟶ X) (w : h ≫ f = h ≫ g) :
    (equalizerSubobject f g).Factors h
-- Mathlib/Data/ZMod/IntUnitsPower.lean
lemma uzpow_mul (s : ℤˣ) (x y : R) : s ^ (x * y) = (s ^ x) ^ y
-- Mathlib/Order/Interval/Multiset.lean
theorem Ico_cons_right (h : a ≤ b) : b ::ₘ Ico a b = Icc a b
-- Mathlib/AlgebraicGeometry/EllipticCurve/Affine.lean
lemma Y_eq_of_Y_ne {x₁ x₂ y₁ y₂ : F} (h₁ : W.Equation x₁ y₁) (h₂ : W.Equation x₂ y₂) (hx : x₁ = x₂)
    (hy : y₁ ≠ W.negY x₂ y₂) : y₁ = y₂
-- Mathlib/Data/Nat/Factorization/Root.lean
@[simp] lemma ceilRoot_one_left (a : ℕ) : ceilRoot 1 a = a
-- Mathlib/GroupTheory/Perm/Basic.lean
theorem inv_def (f : Perm α) : f⁻¹ = f.symm
-- Mathlib/Control/Traversable/Lemmas.lean
theorem map_eq_traverse_id : map (f := t) f = traverse (m := Id) (pure ∘ f)
-- Mathlib/FieldTheory/IsAlgClosed/Basic.lean
/-- If E/L/K is a tower of field extensions with E/L algebraic, and if M is an algebraically
  closed extension of K, then any embedding of L/K into M/K extends to an embedding of E/K.
  Known as the extension lemma in https://math.stackexchange.com/a/687914. -/
theorem surjective_comp_algebraMap_of_isAlgebraic {E : Type*}
    [Field E] [Algebra K E] [Algebra L E] [IsScalarTower K L E] [Algebra.IsAlgebraic L E] :
    Function.Surjective fun φ : E →ₐ[K] M ↦ φ.comp (IsScalarTower.toAlgHom K L E)
-- Mathlib/Algebra/Group/Basic.lean
@[to_additive sub_sub_self]
theorem div_div_self' (a b : G) : a / (a / b) = b
-- Mathlib/Algebra/BigOperators/NatAntidiagonal.lean
theorem prod_antidiagonal_succ {n : ℕ} {f : ℕ × ℕ → M} :
    (∏ p ∈ antidiagonal (n + 1), f p)
      = f (0, n + 1) * ∏ p ∈ antidiagonal n, f (p.1 + 1, p.2)
-- .lake/packages/lean4/src/lean/Init/Data/List/Basic.lean
@[simp 1100] theorem tailD_nil : @tailD α [] l' = l'
-- Mathlib/Algebra/Module/DedekindDomain.lean
/-- Over a Dedekind domain, an `I`-torsion module is the internal direct sum of its `p i ^ e i`-
torsion submodules, where `I = ∏ i, p i ^ e i` is its unique decomposition in prime ideals. -/
theorem isInternal_prime_power_torsion_of_is_torsion_by_ideal {I : Ideal R} (hI : I ≠ ⊥)
    (hM : Module.IsTorsionBySet R M I) :
    DirectSum.IsInternal fun p : (factors I).toFinset =>
      torsionBySet R M (p ^ (factors I).count ↑p : Ideal R)
-- Mathlib/Data/Finset/Sum.lean
@[simp]
theorem inl_mem_disjSum : inl a ∈ s.disjSum t ↔ a ∈ s
-- Mathlib/Analysis/Convex/Gauge.lean
theorem gauge_neg_set_eq_gauge_neg (x : E) : gauge (-s) x = gauge s (-x)
-- Mathlib/NumberTheory/SmoothNumbers.lean
/-- `m` is `n`-smooth if and only if all prime divisors of `m` are less than `n`. -/
lemma mem_smoothNumbers' {n m : ℕ} : m ∈ smoothNumbers n ↔ ∀ p, p.Prime → p ∣ m → p < n
-- Mathlib/Combinatorics/Additive/Energy.lean
@[to_additive] lemma mulEnergy_eq_sum_sq' (s t : Finset α) :
    Eₘ[s, t] = ∑ a ∈ s * t, ((s ×ˢ t).filter fun (x, y) ↦ x * y = a).card ^ 2
-- Mathlib/Combinatorics/SimpleGraph/Trails.lean
theorem isEulerian_iff {u v : V} (p : G.Walk u v) :
    p.IsEulerian ↔ p.IsTrail ∧ ∀ e, e ∈ G.edgeSet → e ∈ p.edges
-- Mathlib/Geometry/Euclidean/Angle/Unoriented/RightAngle.lean
/-- The sine of an angle in a right-angled triangle as a ratio of sides, version subtracting
vectors. -/
theorem sin_angle_sub_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) (h0 : x ≠ 0 ∨ y ≠ 0) :
    Real.sin (angle x (x - y)) = ‖y‖ / ‖x - y‖
-- Mathlib/CategoryTheory/Localization/FiniteProducts.lean
lemma hasFiniteProducts : HasFiniteProducts D
-- Mathlib/MeasureTheory/Decomposition/Lebesgue.lean
lemma absolutelyContinuous_withDensity_rnDeriv [HaveLebesgueDecomposition ν μ] (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ)
-- Mathlib/Order/Filter/CountableSeparatingOn.lean
theorem exists_eventuallyEq_const_of_eventually_mem_of_forall_separating [Nonempty β]
    (p : Set β → Prop) {s : Set β} [HasCountableSeparatingOn β p s] (hs : ∀ᶠ x in l, f x ∈ s)
    (h : ∀ U, p U → (∀ᶠ x in l, f x ∈ U) ∨ (∀ᶠ x in l, f x ∉ U)) :
    ∃ a, f =ᶠ[l] const α a
-- Mathlib/RingTheory/Henselian.lean
theorem isLocalRingHom_of_le_jacobson_bot {R : Type*} [CommRing R] (I : Ideal R)
    (h : I ≤ Ideal.jacobson ⊥) : IsLocalRingHom (Ideal.Quotient.mk I)
-- Mathlib/Algebra/GroupWithZero/Defs.lean
/-- If `α` has no zero divisors, then for elements `a, b : α`, `a * b` is nonzero iff so is
`b * a`. -/
theorem mul_ne_zero_comm : a * b ≠ 0 ↔ b * a ≠ 0
-- Mathlib/LinearAlgebra/QuadraticForm/Dual.lean
/-- `QuadraticForm.dualProd` commutes (isometrically) with `QuadraticForm.prod`. -/
@[simps!]
def dualProdProdIsometry :
    (dualProd R (M × N)).IsometryEquiv ((dualProd R M).prod (dualProd R N))
-- .lake/packages/batteries/Batteries/Data/RBMap/WF.lean
/-- The `balRight` function preserves the ordering invariants. -/
protected theorem Ordered.balRight {l : RBNode α} {v : α} {r : RBNode α}
    (lv : l.All (cmpLT cmp · v)) (vr : r.All (cmpLT cmp v ·))
    (hl : l.Ordered cmp) (hr : r.Ordered cmp) : (balRight l v r).Ordered cmp
-- Mathlib/Analysis/Asymptotics/Theta.lean
theorem isTheta_comm : f =Θ[l] g ↔ g =Θ[l] f
-- Mathlib/Computability/Primrec.lean
theorem list_findIdx₁ {p : α → β → Bool} (hp : Primrec₂ p) :
    ∀ l : List β, Primrec fun a => l.findIdx (p a)
-- Mathlib/Data/List/DropRight.lean
@[simp]
theorem rtake_nil : rtake ([] : List α) n = []
-- Mathlib/Analysis/Convex/Gauge.lean
private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r • s }
-- Mathlib/Topology/Instances/EReal.lean
theorem continuousAt_add_top_top : ContinuousAt (fun p : EReal × EReal => p.1 + p.2) (⊤, ⊤)
-- Mathlib/GroupTheory/Complement.lean
@[to_additive]
theorem mk''_toEquiv (hS : S ∈ Subgroup.rightTransversals (H : Set G))
    (q : Quotient (QuotientGroup.rightRel H)) : Quotient.mk'' (toEquiv hS q : G) = q
-- Mathlib/Data/Set/Basic.lean
theorem union_assoc (a b c : Set α) : a ∪ b ∪ c = a ∪ (b ∪ c)
-- Mathlib/Order/ConditionallyCompleteLattice/Finset.lean
theorem inf'_eq_csInf_image (s : Finset ι) (H : s.Nonempty) (f : ι → α) :
    s.inf' H f = sInf (f '' s)
-- Mathlib/Algebra/Ring/Defs.lean
theorem mul_sub_right_distrib (a b c : α) : (a - b) * c = a * c - b * c
-- Mathlib/Data/Seq/Computation.lean
@[simp]
theorem liftRel_pure_left (R : α → β → Prop) (a : α) (cb : Computation β) :
    LiftRel R (pure a) cb ↔ ∃ b, b ∈ cb ∧ R a b
-- Mathlib/Algebra/Order/CauSeq/Completion.lean
@[simp]
theorem ofRat_intCast (z : ℤ) : (ofRat z : Cauchy abv) = z
-- Mathlib/GroupTheory/Index.lean
@[to_additive]
theorem relindex_inf_le : (H ⊓ K).relindex L ≤ H.relindex L * K.relindex L
-- Mathlib/Topology/Order/OrderClosed.lean
@[simp] lemma bddBelow_closure : BddBelow (closure s) ↔ BddBelow s
-- Mathlib/InformationTheory/Hamming.lean
theorem hammingNorm_le_card_fintype {x : ∀ i, β i} : hammingNorm x ≤ Fintype.card ι
-- Mathlib/Analysis/Convex/Function.lean
theorem ConvexOn.smul {c : 𝕜} (hc : 0 ≤ c) (hf : ConvexOn 𝕜 s f) : ConvexOn 𝕜 s fun x => c • f x
-- Mathlib/Topology/Category/Profinite/Nobeling.lean
theorem projRestricts_eq_comp (hJK : ∀ i, J i → K i) (hKL : ∀ i, K i → L i) :
    ProjRestricts C hJK ∘ ProjRestricts C hKL = ProjRestricts C (fun i ↦ hKL i ∘ hJK i)
-- Mathlib/Topology/PartialHomeomorph.lean
theorem eqOnSource_iff (e e' : PartialHomeomorph X Y) :
    EqOnSource e e' ↔ PartialEquiv.EqOnSource e.toPartialEquiv e'.toPartialEquiv
-- Mathlib/RingTheory/Ideal/QuotientOperations.lean
/-- `H` and `h` are kept as separate hypothesis since H is used in constructing the quotient map. -/
theorem quotientMap_injective' {J : Ideal R} {I : Ideal S} {f : R →+* S} {H : J ≤ I.comap f}
    (h : I.comap f ≤ J) : Function.Injective (quotientMap I f H)
-- Mathlib/Algebra/MonoidAlgebra/Basic.lean
/-- The embedding of a magma into its magma algebra. -/
@[simps]
def ofMagma [Mul G] : G →ₙ* MonoidAlgebra k G
-- Mathlib/RingTheory/DedekindDomain/Dvr.lean
theorem IsLocalization.AtPrime.not_isField {P : Ideal A} (hP : P ≠ ⊥) [pP : P.IsPrime] (Aₘ : Type*)
    [CommRing Aₘ] [Algebra A Aₘ] [IsLocalization.AtPrime Aₘ P] : ¬IsField Aₘ
-- Mathlib/RingTheory/JacobsonIdeal.lean
theorem jacobson_bot_polynomial_of_jacobson_bot (h : jacobson (⊥ : Ideal R) = ⊥) :
    jacobson (⊥ : Ideal R[X]) = ⊥
-- Mathlib/CategoryTheory/Adjunction/Reflective.lean
@[simp]
theorem unitCompPartialBijective_symm_apply [Reflective i] (A : C) {B : C} (hB : B ∈ i.essImage)
    (f) : (unitCompPartialBijective A hB).symm f = (reflectorAdjunction i).unit.app A ≫ f
-- Mathlib/Data/Nat/Cast/Defs.lean
theorem cast_two [AddMonoidWithOne R] : ((2 : ℕ) : R) = (2 : R)
-- .lake/packages/batteries/Batteries/Logic.lean
@[simp]
theorem eqRec_heq_iff_heq {α : Sort _} {a : α} {motive : (a' : α) → a = a' → Sort _}
    (x : motive a (rfl : a = a)) {a' : α} (e : a = a') {β : Sort _} (y : β) :
    HEq (@Eq.rec α a motive x a' e) y ↔ HEq x y
-- Mathlib/Combinatorics/SimpleGraph/Basic.lean
theorem commonNeighbors_top_eq {v w : V} :
    (⊤ : SimpleGraph V).commonNeighbors v w = Set.univ \ {v, w}