ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
-- Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean
/-- To prove something for an arbitrary `Memℒp` function a.e. strongly measurable with respect
to a sub-σ-algebra `m` in a normed space, it suffices to show that
* the property holds for (multiples of) characteristic functions which are measurable w.r.t. `m`;
* is closed under addition;
* the set of functions in the `Lᵖ` space strongly measurable w.r.t. `m` for which the property
  holds is closed.
* the property is closed under the almost-everywhere equal relation.
-/
@[elab_as_elim]
theorem Memℒp.induction_stronglyMeasurable (hm : m ≤ m0) (hp_ne_top : p ≠ ∞) (P : (α → F) → Prop)
    (h_ind : ∀ (c : F) ⦃s⦄, MeasurableSet[m] s → μ s < ∞ → P (s.indicator fun _ => c))
    (h_add : ∀ ⦃f g : α → F⦄, Disjoint (Function.support f) (Function.support g) →
      Memℒp f p μ → Memℒp g p μ → StronglyMeasurable[m] f → StronglyMeasurable[m] g →
        P f → P g → P (f + g))
    (h_closed : IsClosed {f : lpMeas F ℝ m p μ | P f})
    (h_ae : ∀ ⦃f g⦄, f =ᵐ[μ] g → Memℒp f p μ → P f → P g) :
    ∀ ⦃f : α → F⦄, Memℒp f p μ → AEStronglyMeasurable' m f μ → P f
-- Mathlib/Algebra/Order/Sub/Canonical.lean
theorem tsub_tsub_tsub_cancel_left (h : b ≤ a) : a - c - (a - b) = b - c
-- Mathlib/Algebra/Homology/Homotopy.lean
theorem dNext_eq (f : ∀ i j, C.X i ⟶ D.X j) {i i' : ι} (w : c.Rel i i') :
    dNext i f = C.d i i' ≫ f i' i
-- Mathlib/Data/Rat/Cast/CharZero.lean
@[simp, norm_cast]
theorem cast_inj [CharZero α] : ∀ {m n : ℚ}, (m : α) = n ↔ m = n
-- Mathlib/Logic/Equiv/PartialEquiv.lean
/-- Restrict a `PartialEquiv` to a pair of corresponding sets. -/
@[simps (config := .asFn)]
def restr (h : e.IsImage s t) : PartialEquiv α β
-- Mathlib/LinearAlgebra/AffineSpace/Midpoint.lean
@[simp]
theorem midpoint_vsub_left (p₁ p₂ : P) : midpoint R p₁ p₂ -ᵥ p₁ = (⅟ 2 : R) • (p₂ -ᵥ p₁)
-- Mathlib/MeasureTheory/Measure/Lebesgue/EqHaar.lean
theorem addHaar_smul_of_nonneg {r : ℝ} (hr : 0 ≤ r) (s : Set E) :
    μ (r • s) = ENNReal.ofReal (r ^ finrank ℝ E) * μ s
-- Mathlib/Algebra/Order/Module/Defs.lean
@[simp]
lemma smul_le_iff_le_one_left [SMulPosMono α β] [SMulPosReflectLE α β] (hb : 0 < b) :
    a • b ≤ b ↔ a ≤ 1
-- Mathlib/MeasureTheory/Integral/Bochner.lean
theorem integral_mono_ae {f g : α → ℝ} (hf : Integrable f μ) (hg : Integrable g μ) (h : f ≤ᵐ[μ] g) :
    ∫ a, f a ∂μ ≤ ∫ a, g a ∂μ
-- Mathlib/MeasureTheory/Measure/Haar/Basic.lean
@[to_additive]
theorem prehaar_sup_eq {K₀ : PositiveCompacts G} {U : Set G} {K₁ K₂ : Compacts G}
    (hU : (interior U).Nonempty) (h : Disjoint (K₁.1 * U⁻¹) (K₂.1 * U⁻¹)) :
    prehaar (K₀ : Set G) U (K₁ ⊔ K₂) = prehaar (K₀ : Set G) U K₁ + prehaar (K₀ : Set G) U K₂
-- Mathlib/Algebra/Group/Pi/Basic.lean
@[to_additive (attr := simp)]
theorem div_apply [∀ i, Div <| f i] : (x / y) i = x i / y i
-- Mathlib/Algebra/Group/Subgroup/Basic.lean
@[to_additive (attr := simp)]
lemma ker_fst : ker (fst G G') = .prod ⊥ ⊤
-- Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean
theorem eLpNorm'_add_le (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ)
    (hq1 : 1 ≤ q) : eLpNorm' (f + g) q μ ≤ eLpNorm' f q μ + eLpNorm' g q μ
-- Mathlib/Algebra/Algebra/Subalgebra/Unitization.lean
theorem NonUnitalStarSubalgebra.toStarSubalgebra_toNonUnitalStarSubalgebra
    (S : NonUnitalStarSubalgebra R A) (h1 : (1 : A) ∈ S) :
    (S.toStarSubalgebra h1).toNonUnitalStarSubalgebra = S
-- .lake/packages/lean4/src/lean/Init/WF.lean
theorem accessible {a : α} (f : α → β) (ac : Acc r (f a)) : Acc (InvImage r f) a
-- Mathlib/Control/Fold.lean
theorem foldl.unop_ofFreeMonoid (f : β → α → β) (xs : FreeMonoid α) (a : β) :
    unop (Foldl.ofFreeMonoid f xs) a = List.foldl f a (FreeMonoid.toList xs)
-- Mathlib/Logic/Equiv/Defs.lean
theorem trans_assoc {δ} (ab : α ≃ β) (bc : β ≃ γ) (cd : γ ≃ δ) :
    (ab.trans bc).trans cd = ab.trans (bc.trans cd)
-- Mathlib/ModelTheory/FinitelyGenerated.lean
theorem CG.map {N : Type*} [L.Structure N] (f : M →[L] N) {s : L.Substructure M} (hs : s.CG) :
    (s.map f).CG
-- Mathlib/Analysis/Analytic/Basic.lean
theorem analyticAt_congr (h : f =ᶠ[𝓝 x] g) : AnalyticAt 𝕜 f x ↔ AnalyticAt 𝕜 g x
-- Mathlib/Analysis/LocallyConvex/ContinuousOfBounded.lean
/-- If `E` is first countable, then every locally bounded linear map `E →ₛₗ[σ] F` is continuous. -/
theorem LinearMap.continuous_of_locally_bounded [UniformAddGroup F] (f : E →ₛₗ[σ] F)
    (hf : ∀ s, IsVonNBounded 𝕜 s → IsVonNBounded 𝕜' (f '' s)) : Continuous f
-- Mathlib/SetTheory/Surreal/Multiplication.lean
lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :
    P1 x₁ x₂ x₃ y₁ y₂ y₃
-- Mathlib/SetTheory/Ordinal/Arithmetic.lean
@[simp]
theorem sub_zero (a : Ordinal) : a - 0 = a
-- Mathlib/RingTheory/Coalgebra/Hom.lean
theorem coe_linearMap_injective : Function.Injective ((↑) : (A →ₗc[R] B) → A →ₗ[R] B)
-- Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean
theorem vecMul_injective_iff_isUnit {A : Matrix m m K} :
    Function.Injective A.vecMul ↔ IsUnit A
-- Mathlib/Topology/Sets/Opens.lean
@[simp] theorem mk_coe (U : Opens α) : mk (↑U) U.isOpen = U
-- Mathlib/Analysis/Calculus/FDeriv/Mul.lean
@[fun_prop]
theorem DifferentiableAt.clm_comp (hc : DifferentiableAt 𝕜 c x) (hd : DifferentiableAt 𝕜 d x) :
    DifferentiableAt 𝕜 (fun y => (c y).comp (d y)) x
-- Mathlib/Logic/Basic.lean
theorem not_iff_comm : (¬a ↔ b) ↔ (¬b ↔ a)
-- Mathlib/LinearAlgebra/DirectSum/Finsupp.lean
@[simp]
theorem finsuppTensorFinsuppRid_symm_single_smul (i : ι × κ) (m : M) (r : R) :
    (finsuppTensorFinsuppRid R M ι κ).symm (Finsupp.single i (r • m)) =
      Finsupp.single i.1 m ⊗ₜ Finsupp.single i.2 r
-- Mathlib/Order/CompleteBooleanAlgebra.lean
/-- A completely distributive lattice is a complete lattice whose `⨅` and `⨆`
distribute over each other. -/
class CompletelyDistribLattice (α : Type u) extends CompleteLattice α, BiheytingAlgebra α where
  protected iInf_iSup_eq {ι : Type u} {κ : ι → Type u} (f : ∀ a, κ a → α) :
    (⨅ a, ⨆ b, f a b) = ⨆ g : ∀ a, κ a, ⨅ a, f a (g a)
-- Mathlib/Topology/Category/Profinite/Nobeling.lean
/-- The good products span `LocallyConstant C ℤ` if and only all the products do. -/
theorem GoodProducts.span_iff_products : ⊤ ≤ span ℤ (Set.range (eval C)) ↔
    ⊤ ≤ span ℤ (Set.range (Products.eval C))
-- Mathlib/Algebra/Homology/Homotopy.lean
/-- homotopy is closed under composition (on the left) -/
@[simps]
def compLeft {f g : D ⟶ E} (h : Homotopy f g) (e : C ⟶ D) : Homotopy (e ≫ f) (e ≫ g)
-- Mathlib/Data/Finsupp/Basic.lean
@[to_additive]
theorem prod_option_index [AddCommMonoid M] [CommMonoid N] (f : Option α →₀ M)
    (b : Option α → M → N) (h_zero : ∀ o, b o 0 = 1)
    (h_add : ∀ o m₁ m₂, b o (m₁ + m₂) = b o m₁ * b o m₂) :
    f.prod b = b none (f none) * f.some.prod fun a => b (Option.some a)
-- Mathlib/Algebra/AddConstMap/Basic.lean
/-- The map that sends `c` to a translation by `c`
as a monoid homomorphism from `Multiplicative G` to `G →+c[a, a] G`. -/
@[simps! (config := .asFn)]
def addLeftHom : Multiplicative G →* (G →+c[a, a] G)
-- Mathlib/Analysis/NormedSpace/OperatorNorm/Prod.lean
@[simp]
theorem opNNNorm_prod (f : E →L[𝕜] F) (g : E →L[𝕜] G) : ‖f.prod g‖₊ = ‖(f, g)‖₊
-- Mathlib/Order/WellFoundedSet.lean
theorem Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber (hι : s.WellFoundedOn (rι on f))
    (hπ : ∀ i, (s ∩ f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) :
    s.WellFoundedOn (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩)
-- Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean
@[simp, norm_cast]
theorem coe_centralizer (s : Set A) : (centralizer R s : Set A) = s.centralizer
-- Mathlib/Analysis/Normed/Group/Bounded.lean
/-- A helper lemma used to prove that the (scalar or usual) product of a function that tends to one
and a bounded function tends to one. This lemma is formulated for any binary operation
`op : E → F → G` with an estimate `‖op x y‖ ≤ ‖x‖ * ‖y‖` instead of multiplication so that it
can be applied to `(*)`, `flip (*)`, `(•)`, and `flip (•)`. -/
@[to_additive "A helper lemma used to prove that the (scalar or usual) product of a function that
tends to zero and a bounded function tends to zero. This lemma is formulated for any binary
operation `op : E → F → G` with an estimate `‖op x y‖ ≤ ‖x‖ * ‖y‖` instead of multiplication so
that it can be applied to `(*)`, `flip (*)`, `(•)`, and `flip (•)`."]
theorem Filter.Tendsto.op_one_isBoundedUnder_le {f : α → E} {g : α → F} {l : Filter α}
    (hf : Tendsto f l (𝓝 1)) (hg : IsBoundedUnder (· ≤ ·) l (Norm.norm ∘ g)) (op : E → F → G)
    (h_op : ∀ x y, ‖op x y‖ ≤ ‖x‖ * ‖y‖) : Tendsto (fun x => op (f x) (g x)) l (𝓝 1)
-- .lake/packages/lean4/src/lean/Init/Data/Fin/Lemmas.lean
protected theorem mul_assoc (a b c : Fin n) : a * b * c = a * (b * c)
-- Mathlib/MeasureTheory/Measure/VectorMeasure.lean
@[simp]
theorem zero_trim (hle : m ≤ n) : (0 : VectorMeasure α M).trim hle = 0
-- Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean
theorem volume_pi_le_prod_diam (s : Set (ι → ℝ)) :
    volume s ≤ ∏ i : ι, EMetric.diam (Function.eval i '' s)
-- Mathlib/AlgebraicTopology/FundamentalGroupoid/Product.lean
theorem prodToProdTop_map {x₀ x₁ : πₓ A} {y₀ y₁ : πₓ B} (p₀ : x₀ ⟶ x₁) (p₁ : y₀ ⟶ y₁) :
    (prodToProdTop A B).map (X := (x₀, y₀)) (Y := (x₁, y₁)) (p₀, p₁) =
      Path.Homotopic.prod p₀ p₁
-- Mathlib/Algebra/ModEq.lean
protected theorem of_zsmul : a ≡ b [PMOD z • p] → a ≡ b [PMOD p]
-- Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean
@[simp]
theorem coe_toNonUnitalSubring (S : NonUnitalSubalgebra R A) :
    (↑S.toNonUnitalSubring : Set A) = S
-- Mathlib/Data/Multiset/Basic.lean
theorem disjoint_iff_ne {s t : Multiset α} : Disjoint s t ↔ ∀ a ∈ s, ∀ b ∈ t, a ≠ b
-- .lake/packages/batteries/Batteries/Data/List/Count.lean
@[simp] theorem countP_false {l : List α} : (l.countP fun _ => false) = 0
-- Mathlib/Topology/Category/TopCat/Opens.lean
@[simp]
theorem infLELeft_apply_mk (U V : Opens X) (x) (m) :
    (infLELeft U V) ⟨x, m⟩ = ⟨x, (@inf_le_left _ _ U V : _ ≤ _) m⟩
-- Mathlib/RingTheory/Ideal/Basic.lean
@[simp]
theorem mem_nonunits_iff [Monoid α] : a ∈ nonunits α ↔ ¬IsUnit a
-- Mathlib/CategoryTheory/Limits/Shapes/Terminal.lean
theorem hasTerminalChangeUniverse [h : HasLimitsOfShape (Discrete.{w} PEmpty) C] :
    HasLimitsOfShape (Discrete.{w'} PEmpty) C
-- Mathlib/Geometry/Manifold/Algebra/LeftInvariantDerivation.lean
protected theorem map_smul : X (r • f) = r • X f
-- Mathlib/NumberTheory/PellMatiyasevic.lean
theorem isPell_star : ∀ {b : ℤ√d}, IsPell b ↔ IsPell (star b)
-- Mathlib/Topology/Algebra/Order/Group.lean
protected theorem Filter.Tendsto.abs {a : G} (h : Tendsto f l (𝓝 a)) :
    Tendsto (fun x => |f x|) l (𝓝 |a|)
-- Mathlib/Analysis/MeanInequalities.lean
private theorem inner_le_Lp_mul_Lp_of_norm_le_one (f g : ι → ℝ≥0) {p q : ℝ}
    (hpq : p.IsConjExponent q) (hf : ∑ i ∈ s, f i ^ p ≤ 1) (hg : ∑ i ∈ s, g i ^ q ≤ 1) :
    ∑ i ∈ s, f i * g i ≤ 1
-- Mathlib/Algebra/Order/BigOperators/Group/Finset.lean
@[to_additive sum_lt_sum_of_subset]
theorem prod_lt_prod_of_subset' (h : s ⊆ t) {i : ι} (ht : i ∈ t) (hs : i ∉ s) (hlt : 1 < f i)
    (hle : ∀ j ∈ t, j ∉ s → 1 ≤ f j) : ∏ j ∈ s, f j < ∏ j ∈ t, f j
-- Mathlib/Algebra/Homology/DerivedCategory/Ext.lean
protected lemma ext_iff {n : ℕ} {α β : Ext X Y n} : α = β ↔ α.hom = β.hom
-- Mathlib/Analysis/Normed/Group/Basic.lean
@[simp]
theorem nnnorm_abs (r : ℝ) : ‖|r|‖₊ = ‖r‖₊
-- Mathlib/Algebra/MvPolynomial/Basic.lean
theorem monomial_zero {s : σ →₀ ℕ} : monomial s (0 : R) = 0
-- Mathlib/ModelTheory/Semantics.lean
theorem Model.union {T' : L.Theory} (h : M ⊨ T) (h' : M ⊨ T') : M ⊨ T ∪ T'
-- Mathlib/LinearAlgebra/QuadraticForm/Basic.lean
theorem QuadraticMap.toMatrix'_smul (a : R) (Q : QuadraticMap R (n → R) R) :
    (a • Q).toMatrix' = a • Q.toMatrix'
-- Mathlib/Algebra/Order/Interval/Finset.lean
@[simp] lemma image_add_right_Ico (a b c : α) : (Ico a b).image (· + c) = Ico (a + c) (b + c)
-- Mathlib/LinearAlgebra/AffineSpace/Combination.lean
/-- The centroid of a single point. -/
@[simp]
theorem centroid_singleton (p : ι → P) (i : ι) : ({i} : Finset ι).centroid k p = p i
-- Mathlib/Algebra/Order/Interval/Set/Instances.lean
theorem mem_iff_one_sub_mem {t : β} : t ∈ Ioo (0 : β) 1 ↔ 1 - t ∈ Ioo (0 : β) 1
-- Mathlib/Data/Int/Interval.lean
theorem card_fintype_Icc_of_le (h : a ≤ b + 1) : (Fintype.card (Set.Icc a b) : ℤ) = b + 1 - a
-- Mathlib/Data/List/EditDistance/Defs.lean
@[simp]
theorem levenshtein_nil_cons (y) (ys) :
    levenshtein C [] (y :: ys) = C.insert y + levenshtein C [] ys
-- Mathlib/Order/Bounds/Basic.lean
theorem IsGreatest.dual (h : IsGreatest s a) : IsLeast (ofDual ⁻¹' s) (toDual a)
-- Mathlib/Data/List/Cycle.lean
@[simp]
theorem nil_toMultiset : nil.toMultiset = (0 : Multiset α)
-- Mathlib/Data/Fin/Basic.lean
@[simp]
lemma _root_.finCongr_refl (h : n = n := rfl) : finCongr h = Equiv.refl (Fin n)
-- Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean
theorem condexpL1_congr_ae (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (h : f =ᵐ[μ] g) :
    condexpL1 hm μ f = condexpL1 hm μ g
-- Mathlib/RingTheory/Bialgebra/Hom.lean
theorem coe_fn_injective : @Function.Injective (A →ₐc[R] B) (A → B) (↑)
-- Mathlib/Topology/Connected/LocallyConnected.lean
theorem connectedComponentIn_mem_nhds [LocallyConnectedSpace α] {F : Set α} {x : α} (h : F ∈ 𝓝 x) :
    connectedComponentIn F x ∈ 𝓝 x
-- Mathlib/LinearAlgebra/TensorProduct/Basic.lean
@[simp]
theorem rTensorHomToHomRTensor_apply (f : M →ₗ[R] P) (q : Q) (m : M) :
    rTensorHomToHomRTensor R M P Q (f ⊗ₜ q) m = f m ⊗ₜ q
-- Mathlib/Algebra/Group/Fin/Tuple.lean
@[to_additive (attr := simp)]
lemma insertNth_one_right [∀ j, One (α j)] (i : Fin (n + 1)) (x : α i) :
    i.insertNth x 1 = Pi.mulSingle i x
-- Mathlib/Order/Hom/Basic.lean
/-- The composition of two bundled monotone functions, a fully bundled version. -/
@[simps! (config := .asFn)]
def compₘ : (β →o γ) →o (α →o β) →o α →o γ
-- Mathlib/Algebra/Algebra/Hom.lean
theorem coe_ringHom_injective : Function.Injective ((↑) : (A →ₐ[R] B) → A →+* B)
-- Mathlib/Data/Part.lean
theorem inter_def [Inter α] (a b : Part α) : a ∩ b = bind a fun y => map (y ∩ ·) b
-- Mathlib/Data/Complex/Basic.lean
@[simp]
theorem range_im : range im = univ
-- Mathlib/Analysis/Convex/Mul.lean
lemma ConcaveOn.mul_convexOn' (hf : ConcaveOn 𝕜 s f) (hg : ConvexOn 𝕜 s g)
    (hf₀ : ∀ ⦃x⦄, x ∈ s → f x ≤ 0) (hg₀ : ∀ ⦃x⦄, x ∈ s → 0 ≤ g x) (hfg : AntivaryOn f g s) :
    ConcaveOn 𝕜 s (f • g)
-- Mathlib/Order/Filter/Pi.lean
theorem map_pi_map_coprodᵢ_le :
    map (fun k : ∀ i, α i => fun i => m i (k i)) (Filter.coprodᵢ f) ≤
      Filter.coprodᵢ fun i => map (m i) (f i)
-- Mathlib/Algebra/BigOperators/Group/List.lean
@[to_additive] lemma Perm.prod_eq (h : Perm l₁ l₂) : prod l₁ = prod l₂
-- Mathlib/CategoryTheory/Monoidal/Functor.lean
@[simp]
theorem εIso_hom : F.εIso.hom = F.ε
-- Mathlib/Algebra/Polynomial/FieldDivision.lean
theorem modByMonic_eq_mod (p : R[X]) (hq : Monic q) : p %ₘ q = p % q
-- Mathlib/Combinatorics/Colex.lean
lemma ofColex_toColex (s : Finset α) : ofColex (toColex s) = s
-- Mathlib/Data/Nat/Count.lean
theorem count_of_forall {n : ℕ} (hp : ∀ n' < n, p n') : count p n = n
-- Mathlib/CategoryTheory/Sites/Equivalence.lean
/-- A class saying that the equivalence `e` transports the Grothendieck topology `J` to `K`. -/
class TransportsGrothendieckTopology : Prop where
  /-- `K` is equal to the induced topology. -/
  eq_inducedTopology : K = e.inverse.inducedTopology J
-- Mathlib/Topology/Basic.lean
@[simp] theorem isClosed_empty : IsClosed (∅ : Set X)
-- Mathlib/GroupTheory/GroupAction/Blocks.lean
theorem IsBlock.def_one {B : Set X} :
    IsBlock G B ↔ ∀ g : G, g • B = B ∨ Disjoint (g • B) B
-- Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean
lemma hasRightHomology_of_iso {S₁ S₂ : ShortComplex C}
    (e : S₁ ≅ S₂) [HasRightHomology S₁] : HasRightHomology S₂
-- Mathlib/Order/WithBot.lean
theorem coe_strictMono : StrictMono (fun a : α => (a : WithTop α))
-- Mathlib/Combinatorics/Additive/AP/Three/Behrend.lean
theorem sum_lt : (∑ i : Fin n, d * (2 * d + 1) ^ (i : ℕ)) < (2 * d + 1) ^ n
-- Mathlib/Data/Matrix/Basic.lean
theorem conjTranspose_list_sum [AddMonoid α] [StarAddMonoid α] (l : List (Matrix m n α)) :
    l.sumᴴ = (l.map conjTranspose).sum
-- .lake/packages/lean4/src/lean/lake/Lake/Util/Name.lean
theorem eq_of_quickCmp {n n' : Name} : n.quickCmp n' = .eq → n = n'
-- Mathlib/Data/Set/Sigma.lean
theorem sigma_mono (hs : s₁ ⊆ s₂) (ht : ∀ i, t₁ i ⊆ t₂ i) : s₁.sigma t₁ ⊆ s₂.sigma t₂
-- Mathlib/Algebra/DirectSum/LinearMap.lean
/-- The trace of an endomorphism of a direct sum is the sum of the traces on each component.

Note that it is important the statement gives the user definitional control over `p` since the
_type_ of the term `trace R p (f.restrict hp')` depends on `p`. -/
lemma trace_eq_sum_trace_restrict_of_eq_biSup
    [∀ i, Module.Finite R (N i)] [∀ i, Module.Free R (N i)]
    (s : Finset ι) (h : CompleteLattice.Independent <| fun i : s ↦ N i)
    {f : Module.End R M} (hf : ∀ i, MapsTo f (N i) (N i))
    (p : Submodule R M) (hp : p = ⨆ i ∈ s, N i)
    (hp' : MapsTo f p p := hp ▸ mapsTo_biSup_of_mapsTo (s : Set ι) hf) :
    trace R p (f.restrict hp') = ∑ i ∈ s, trace R (N i) (f.restrict (hf i))
-- Mathlib/ModelTheory/Semantics.lean
@[simp]
theorem LHom.setOf_realize_onFormula [L'.Structure M] (φ : L →ᴸ L') [φ.IsExpansionOn M]
    (ψ : L.Formula α) : (setOf (φ.onFormula ψ).Realize : Set (α → M)) = setOf ψ.Realize
-- Mathlib/Data/Finset/Interval.lean
/-- Cardinality of an `Ioc` of finsets. -/
theorem card_Ioc_finset (h : s ⊆ t) : (Ioc s t).card = 2 ^ (t.card - s.card) - 1
-- Mathlib/Data/Real/Hyperreal.lean
@[simp, norm_cast]
theorem coe_add (x y : ℝ) : ↑(x + y) = (x + y : ℝ*)
-- Mathlib/Analysis/RCLike/Basic.lean
theorem normSq_eq_def' (z : K) : normSq z = ‖z‖ ^ 2
-- Mathlib/Topology/Algebra/Constructions/DomMulAct.lean
@[to_additive (attr := simp)]
theorem map_mk_nhds (x : M) : map (mk : M → Mᵈᵐᵃ) (𝓝 x) = 𝓝 (mk x)
-- Mathlib/Data/Finset/Image.lean
theorem image_const {s : Finset α} (h : s.Nonempty) (b : β) : (s.image fun _ => b) = singleton b
-- Mathlib/Order/Filter/Pointwise.lean
@[to_additive (attr := simp)]
theorem map₂_mul : map₂ (· * ·) f g = f * g
-- Mathlib/Algebra/GCDMonoid/Basic.lean
@[simp]
theorem normUnit_mul_normUnit (a : α) : normUnit (a * normUnit a) = 1
-- Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean
@[gcongr] theorem rpow_le_rpow {x y : ℝ≥0} {z : ℝ} (h₁ : x ≤ y) (h₂ : 0 ≤ z) : x ^ z ≤ y ^ z
-- Mathlib/Order/RelSeries.lean
theorem mem_def : x ∈ s ↔ x ∈ Set.range s
-- Mathlib/Algebra/Polynomial/FieldDivision.lean
theorem rootSet_C_mul_X_pow [CommRing S] [IsDomain S] [Algebra R S] {n : ℕ} (hn : n ≠ 0) {a : R}
    (ha : a ≠ 0) : rootSet (C a * X ^ n) S = {0}
-- Mathlib/NumberTheory/Padics/PadicIntegers.lean
theorem p_nonnunit : (p : ℤ_[p]) ∈ nonunits ℤ_[p]
-- Mathlib/Order/Interval/Set/Image.lean
lemma StrictAntiOn.image_Ico_subset (h : StrictAntiOn f (Icc a b)) :
    f '' Ico a b ⊆ Ioc (f b) (f a)
-- Mathlib/Data/Set/List.lean
@[simp]
theorem range_list_get : range l.get = { x | x ∈ l }
-- Mathlib/Order/Disjoint.lean
theorem inf_right_eq_bot_iff (h : IsCompl y z) : x ⊓ z = ⊥ ↔ x ≤ y
-- Mathlib/GroupTheory/GroupAction/Hom.lean
protected theorem map_mul (f : R →ₑ+*[φ] S) (x y : R) : f (x * y) = f x * f y
-- Mathlib/Analysis/Seminorm.lean
theorem finset_sup_apply (p : ι → Seminorm 𝕜 E) (s : Finset ι) (x : E) :
    s.sup p x = ↑(s.sup fun i => ⟨p i x, apply_nonneg (p i) x⟩ : ℝ≥0)
-- Mathlib/Order/Filter/CountableSeparatingOn.lean
theorem of_forall_separating_mem_iff (p : Set β → Prop)
    [HasCountableSeparatingOn β p univ] (h : ∀ U : Set β, p U → ∀ᶠ x in l, f x ∈ U ↔ g x ∈ U) :
    f =ᶠ[l] g
-- Mathlib/CategoryTheory/Limits/Shapes/Pullback/Assoc.lean
@[reassoc (attr := simp)]
theorem inl_pushoutAssoc_inv [HasPushout (g₃ ≫ (pushout.inr _ _ : X₂ ⟶ Y₁)) g₄]
    [HasPushout g₁ (g₂ ≫ (pushout.inl _ _ : X₂ ⟶ Y₂))] :
    pushout.inl _ _ ≫ (pushoutAssoc g₁ g₂ g₃ g₄).inv = pushout.inl _ _ ≫ pushout.inl _ _
-- Mathlib/Topology/SeparatedMap.lean
lemma t2space_iff_isSeparatedMap (y : Y) : T2Space X ↔ IsSeparatedMap fun _ : X ↦ y
-- Mathlib/Topology/Order/Lattice.lean
lemma ContinuousOn.sup' (hf : ContinuousOn f s) (hg : ContinuousOn g s) :
    ContinuousOn (f ⊔ g) s
-- Mathlib/Algebra/Ring/Hom/Defs.lean
@[simp]
theorem coe_mulHom_id : (NonUnitalRingHom.id α : α →ₙ* α) = MulHom.id α
-- Mathlib/Data/List/Sigma.lean
theorem dlookup_eq_none {a : α} {l : List (Sigma β)} : dlookup a l = none ↔ a ∉ l.keys
-- Mathlib/Data/Set/Image.lean
theorem range_subtype_map {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀ x, p x → q (f x)) :
    range (Subtype.map f h) = (↑) ⁻¹' (f '' { x | p x })
-- Mathlib/Data/Ordmap/Ordset.lean
theorem Valid'.merge_aux₁ {o₁ o₂ ls ll lx lr rs rl rx rr t}
    (hl : Valid' o₁ (@Ordnode.node α ls ll lx lr) o₂) (hr : Valid' o₁ (.node rs rl rx rr) o₂)
    (h : delta * ls < rs) (v : Valid' o₁ t rx) (e : size t = ls + size rl) :
    Valid' o₁ (.balanceL t rx rr) o₂ ∧ size (.balanceL t rx rr) = ls + rs
-- Mathlib/Data/Sum/Interval.lean
@[simp]
lemma sumLexLift_inl_inr (a : α₁) (b : β₂) :
    sumLexLift f₁ f₂ g₁ g₂ (inl a) (inr b) = (g₁ a b).disjSum (g₂ a b)
-- Mathlib/Topology/Algebra/InfiniteSum/Basic.lean
@[to_additive]
theorem multipliable_subtype_iff_mulIndicator {s : Set β} :
    Multipliable (f ∘ (↑) : s → α) ↔ Multipliable (s.mulIndicator f)
-- Mathlib/LinearAlgebra/Matrix/Charpoly/Minpoly.lean
theorem minpoly_dvd_charpoly {K : Type*} [Field K] (M : Matrix n n K) : minpoly K M ∣ M.charpoly
-- Mathlib/Algebra/BigOperators/NatAntidiagonal.lean
@[to_additive]
theorem prod_antidiagonal_swap {n : ℕ} {f : ℕ × ℕ → M} :
    ∏ p ∈ antidiagonal n, f p.swap = ∏ p ∈ antidiagonal n, f p
-- Mathlib/MeasureTheory/Function/AEEqOfIntegral.lean
theorem Lp.ae_eq_of_forall_setIntegral_eq (f g : Lp E p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
    (hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
    (hg_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn g s μ)
    (hfg : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ) :
    f =ᵐ[μ] g
-- Mathlib/Topology/Category/Profinite/Nobeling.lean
theorem C0_projOrd {x : I → Bool} (hx : x ∈ C0 C ho) : Proj (ord I · < o) x = x
-- Mathlib/Order/ConditionallyCompleteLattice/Basic.lean
@[simp]
theorem csInf_pair (a b : α) : sInf {a, b} = a ⊓ b
-- Mathlib/Order/PrimeIdeal.lean
theorem IsPrime.of_mem_or_mem [IsProper I] (hI : ∀ {x y : P}, x ⊓ y ∈ I → x ∈ I ∨ y ∈ I) :
    IsPrime I
-- Mathlib/Analysis/Convolution.lean
/-- The convolution `f * g` is `C^n` when `f` is locally integrable and `g` is `C^n` and compactly
supported. Version where `g` depends on an additional parameter in an open subset `s` of a
parameter space `P` (and the compact support `k` is independent of the parameter in `s`),
given in terms of composition with an additional smooth function. -/
theorem contDiffOn_convolution_right_with_param_comp {n : ℕ∞} (L : E →L[𝕜] E' →L[𝕜] F) {s : Set P}
    {v : P → G} (hv : ContDiffOn 𝕜 n v s) {f : G → E} {g : P → G → E'} {k : Set G} (hs : IsOpen s)
    (hk : IsCompact k) (hgs : ∀ p, ∀ x, p ∈ s → x ∉ k → g p x = 0) (hf : LocallyIntegrable f μ)
    (hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ)) : ContDiffOn 𝕜 n (fun x => (f ⋆[L, μ] g x) (v x)) s
-- Mathlib/Combinatorics/Additive/ErdosGinzburgZiv.lean
/-- The **Erdős–Ginzburg–Ziv theorem** for `ℤ/nℤ`.

Any sequence of at least `2 * n - 1` elements of `ZMod n` contains a subsequence of `n` elements
whose sum is zero. -/
theorem ZMod.erdos_ginzburg_ziv (a : ι → ZMod n) (hs : 2 * n - 1 ≤ s.card) :
    ∃ t ⊆ s, t.card = n ∧ ∑ i ∈ t, a i = 0
-- .lake/packages/lean4/src/lean/Init/Data/Int/Lemmas.lean
protected theorem mul_neg_one (a : Int) : a * -1 = -a
-- Mathlib/Logic/Encodable/Basic.lean
theorem mem_decode₂ [Encodable α] {n : ℕ} {a : α} : a ∈ decode₂ α n ↔ encode a = n
-- Mathlib/Order/Atoms.lean
theorem covBy_iff_coatom_Iic (h : a ≤ b) : a ⋖ b ↔ IsCoatom (⟨a, h⟩ : Set.Iic b)
-- Mathlib/Data/Matroid/Basic.lean
theorem basis'_iff_basis (hX : X ⊆ M.E := by aesop_mat) : M.Basis' I X ↔ M.Basis I X
-- Mathlib/CategoryTheory/Galois/GaloisObjects.lean
/-- Given a fiber functor `F` and a connected object `X` of `C`. Then `X` is Galois if and only if
the natural action of `Aut X` on `F.obj X` is transitive. -/
theorem isGalois_iff_pretransitive (X : C) [IsConnected X] :
    IsGalois X ↔ MulAction.IsPretransitive (Aut X) (F.obj X)