ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
-- Mathlib/Data/Nat/Factorization/Defs.lean
/-- Any Finsupp `f : ℕ →₀ ℕ` whose support is in the primes is equal to the factorization of
the product `∏ (a : ℕ) ∈ f.support, a ^ f a`. -/
theorem prod_pow_factorization_eq_self {f : ℕ →₀ ℕ} (hf : ∀ p : ℕ, p ∈ f.support → Prime p) :
    (f.prod (· ^ ·)).factorization = f
-- Mathlib/LinearAlgebra/UnitaryGroup.lean
@[simp] theorem one_val : ↑(1 : unitaryGroup n α) = (1 : Matrix n n α)
-- Mathlib/Order/Filter/Cofinite.lean
theorem eventually_cofinite_ne (x : α) : ∀ᶠ a in cofinite, a ≠ x
-- Mathlib/Order/Filter/Bases.lean
theorem hasBasis_biInf_principal' {ι : Type*} {p : ι → Prop} {s : ι → Set α}
    (h : ∀ i, p i → ∀ j, p j → ∃ k, p k ∧ s k ⊆ s i ∧ s k ⊆ s j) (ne : ∃ i, p i) :
    (⨅ (i) (_ : p i), 𝓟 (s i)).HasBasis p s
-- Mathlib/CategoryTheory/Limits/Shapes/Terminal.lean
/-- Any morphism to an initial object is split epi. -/
theorem IsInitial.isSplitEpi_to {X Y : C} (t : IsInitial X) (f : Y ⟶ X) : IsSplitEpi f
-- Mathlib/Algebra/Lie/Sl2.lean
lemma e_ne_zero (t : IsSl2Triple h e f) : e ≠ 0
-- Mathlib/Geometry/Euclidean/Angle/Oriented/Affine.lean
/-- If the angle between three points is nonzero, the last two points are not equal. -/
theorem right_ne_of_oangle_ne_zero {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ ≠ 0) : p₃ ≠ p₂
-- Mathlib/MeasureTheory/Function/AEEqOfIntegral.lean
theorem ae_nonneg_restrict_of_forall_setIntegral_nonneg_inter {f : α → ℝ} {t : Set α}
    (hf : IntegrableOn f t μ)
    (hf_zero : ∀ s, MeasurableSet s → μ (s ∩ t) < ∞ → 0 ≤ ∫ x in s ∩ t, f x ∂μ) :
    0 ≤ᵐ[μ.restrict t] f
-- Mathlib/Data/Set/Prod.lean
theorem fst_image_prod (s : Set β) {t : Set α} (ht : t.Nonempty) : Prod.fst '' s ×ˢ t = s
-- Mathlib/Topology/MetricSpace/Basic.lean
theorem closedEmbedding_of_pairwise_le_dist {α : Type*} [TopologicalSpace α] [DiscreteTopology α]
    {ε : ℝ} (hε : 0 < ε) {f : α → γ} (hf : Pairwise fun x y => ε ≤ dist (f x) (f y)) :
    ClosedEmbedding f
-- Mathlib/Data/Set/Pointwise/SMul.lean
@[to_additive (attr := simp)]
theorem smul_set_singleton : a • ({b} : Set β) = {a • b}
-- Mathlib/MeasureTheory/Function/SimpleFunc.lean
theorem approx_comp [TopologicalSpace β] [OrderClosedTopology β] [MeasurableSpace β]
    [OpensMeasurableSpace β] [MeasurableSpace γ] {i : ℕ → β} {f : γ → β} {g : α → γ} {n : ℕ} (a : α)
    (hf : Measurable f) (hg : Measurable g) :
    (approx i (f ∘ g) n : α →ₛ β) a = (approx i f n : γ →ₛ β) (g a)
-- Mathlib/Topology/Constructions.lean
theorem ContinuousAt.fin_insertNth {n} {π : Fin (n + 1) → Type*} [∀ i, TopologicalSpace (π i)]
    (i : Fin (n + 1)) {f : X → π i} {x : X} (hf : ContinuousAt f x)
    {g : X → ∀ j : Fin n, π (i.succAbove j)} (hg : ContinuousAt g x) :
    ContinuousAt (fun a => i.insertNth (f a) (g a)) x
-- Mathlib/Topology/Maps/Basic.lean
theorem preimage_frontier_subset_frontier_preimage (hf : IsOpenMap f) {s : Set Y} :
    f ⁻¹' frontier s ⊆ frontier (f ⁻¹' s)
-- Mathlib/Order/SuccPred/Basic.lean
@[simp]
theorem pred_lt_iff : pred a < b ↔ a ≤ b
-- Mathlib/LinearAlgebra/LinearDisjoint.lean
/-- If `M` and `N` are linearly disjoint, if `M` is flat,
if any two elements of `↥(M ⊓ N)` are commutative, then the rank of `↥(M ⊓ N)` is at most one. -/
theorem rank_inf_le_one_of_commute_of_flat_left [Module.Flat R M]
    (hc : ∀ (m n : ↥(M ⊓ N)), Commute m.1 n.1) : Module.rank R ↥(M ⊓ N) ≤ 1
-- Mathlib/Analysis/SpecialFunctions/Complex/LogDeriv.lean
theorem DifferentiableWithinAt.clog {f : E → ℂ} {s : Set E} {x : E}
    (h₁ : DifferentiableWithinAt ℂ f s x) (h₂ : f x ∈ slitPlane) :
    DifferentiableWithinAt ℂ (fun t => log (f t)) s x
-- Mathlib/Analysis/Convex/Basic.lean
theorem Monotone.convex_ge (hf : Monotone f) (r : β) : Convex 𝕜 { x | r ≤ f x }
-- Mathlib/Data/Finset/Pointwise.lean
@[to_additive]
theorem subset_mul_right {s : Finset α} (t : Finset α) (hs : (1 : α) ∈ s) : t ⊆ s * t
-- Mathlib/Analysis/Calculus/FDeriv/Mul.lean
@[fun_prop]
theorem HasFDerivWithinAt.smul_const (hc : HasFDerivWithinAt c c' s x) (f : F) :
    HasFDerivWithinAt (fun y => c y • f) (c'.smulRight f) s x
-- Mathlib/Data/Nat/Cast/Order/Ring.lean
@[simp]
theorem abs_ofNat [LinearOrderedRing α] (n : ℕ) [n.AtLeastTwo] :
    |(no_index (OfNat.ofNat n : α))| = OfNat.ofNat n
-- Mathlib/Data/Rat/Floor.lean
theorem fract_inv_num_lt_num_of_pos {q : ℚ} (q_pos : 0 < q) : (fract q⁻¹).num < q.num
-- Mathlib/MeasureTheory/OuterMeasure/Basic.lean
theorem measure_iUnion_fintype_le [Fintype ι] (μ : F) (s : ι → Set α) :
    μ (⋃ i, s i) ≤ ∑ i, μ (s i)
-- Mathlib/Algebra/AlgebraicCard.lean
@[simp]
theorem cardinal_mk_of_infinite [Infinite R] : #{ x : A // IsAlgebraic R x } = #R
-- Mathlib/Algebra/Homology/ComplexShape.lean
theorem down_mk {α : Type*} [AddRightCancelSemigroup α] [One α] (i j : α) (h : j + 1 = i) :
    (down α).Rel i j
-- Mathlib/MeasureTheory/Measure/Haar/Basic.lean
@[to_additive addIndex_mono]
theorem index_mono {K K' V : Set G} (hK' : IsCompact K') (h : K ⊆ K') (hV : (interior V).Nonempty) :
    index K V ≤ index K' V
-- Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean
theorem ContinuousOn.cpow_const {b : ℂ} (hf : ContinuousOn f s)
    (h : ∀ a : α, a ∈ s → f a ∈ slitPlane) : ContinuousOn (fun x => f x ^ b) s
-- Mathlib/Analysis/Fourier/FourierTransform.lean
@[simp] theorem fourierIntegral_convergent_iff {μ : Measure V} {f : V → E} (w : V) :
    Integrable (fun v : V ↦ 𝐞 (- ⟪v, w⟫) • f v) μ ↔ Integrable f μ
-- Mathlib/Dynamics/BirkhoffSum/NormedSpace.lean
/-- If a function `g` is bounded along the positive orbit of `x` under `f`,
then the difference between Birkhoff averages of `g`
along the orbit of `f x` and along the orbit of `x`
tends to zero.

See also `tendsto_birkhoffAverage_apply_sub_birkhoffAverage'`. -/
theorem tendsto_birkhoffAverage_apply_sub_birkhoffAverage {f : α → α} {g : α → E} {x : α}
    (h : Bornology.IsBounded (range (g <| f^[·] x))) :
    Tendsto (fun n ↦ birkhoffAverage 𝕜 f g n (f x) - birkhoffAverage 𝕜 f g n x) atTop (𝓝 0)
-- .lake/packages/lean4/src/lean/Init/Data/BitVec/Lemmas.lean
theorem msb_eq_true_iff_two_mul_ge (x : BitVec w) : x.msb = true ↔ 2 * x.toNat ≥ 2^w
-- Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean
theorem isQuotient_explicitCokernelπ {X Y : SemiNormedGrp.{u}} (f : X ⟶ Y) :
    NormedAddGroupHom.IsQuotient (explicitCokernelπ f)
-- Mathlib/LinearAlgebra/Finsupp.lean
@[simp] theorem lsum_comp_lsingle (f : α → M →ₗ[R] N) (i : α) :
    Finsupp.lsum S f ∘ₗ lsingle i = f i
-- Mathlib/Probability/Martingale/BorelCantelli.lean
theorem integrable_process (μ : Measure Ω) [IsFiniteMeasure μ] (hs : ∀ n, MeasurableSet[ℱ n] (s n))
    (n : ℕ) : Integrable (process s n) μ
-- Mathlib/Algebra/AddConstMap/Basic.lean
theorem map_ofNat [AddMonoidWithOne G] [AddMonoidWithOne H] [AddConstMapClass F G H 1 1]
    (f : F) (n : ℕ) [n.AtLeastTwo] :
    f (OfNat.ofNat n) = f 0 + OfNat.ofNat n
-- Mathlib/Data/Finset/Image.lean
@[simp]
theorem map_refl : s.map (Embedding.refl _) = s
-- Mathlib/CategoryTheory/MorphismProperty/Limits.lean
theorem StableUnderBaseChange.pullback_map [HasPullbacks C] {P : MorphismProperty C}
    (hP : StableUnderBaseChange P) [P.IsStableUnderComposition] {S X X' Y Y' : C} {f : X ⟶ S}
    {g : Y ⟶ S} {f' : X' ⟶ S} {g' : Y' ⟶ S} {i₁ : X ⟶ X'} {i₂ : Y ⟶ Y'} (h₁ : P i₁) (h₂ : P i₂)
    (e₁ : f = i₁ ≫ f') (e₂ : g = i₂ ≫ g') :
    P (pullback.map f g f' g' i₁ i₂ (𝟙 _) ((Category.comp_id _).trans e₁)
        ((Category.comp_id _).trans e₂))
-- Mathlib/ModelTheory/Syntax.lean
theorem distinctConstantsTheory_mono {s t : Set α} (h : s ⊆ t) :
    L.distinctConstantsTheory s ⊆ L.distinctConstantsTheory t
-- Mathlib/FieldTheory/PolynomialGaloisGroup.lean
lemma galAction_isPretransitive [Fact (p.Splits (algebraMap F E))] (hp : Irreducible p) :
    MulAction.IsPretransitive p.Gal (p.rootSet E)
-- Mathlib/CategoryTheory/Limits/Opposites.lean
theorem hasFiniteCoproducts_of_opposite [HasFiniteProducts Cᵒᵖ] : HasFiniteCoproducts C
-- Mathlib/Data/Set/Sigma.lean
theorem biUnion_sigma (s : Set ι) (t : ∀ i, Set (α i)) (f : Sigma α → Set β) :
    ⋃ ij ∈ s.sigma t, f ij = ⋃ i ∈ s, ⋃ j ∈ t i, f ⟨i, j⟩
-- Mathlib/Order/Interval/Set/Image.lean
lemma Antitone.image_Icc_subset (h : Antitone f) : f '' Icc a b ⊆ Icc (f b) (f a)
-- Mathlib/NumberTheory/LSeries/Basic.lean
/-- If the `LSeries` of `f` is summable at `s`, then `f = O(n^(re s))`. -/
lemma LSeriesSummable.isBigO_rpow {f : ℕ → ℂ} {s : ℂ} (h : LSeriesSummable f s) :
    f =O[atTop] fun n ↦ (n : ℝ) ^ s.re
-- Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean
theorem coe_bot : ((⊥ : NonUnitalSubsemiring R) : Set R) = {0}
-- Mathlib/LinearAlgebra/Finsupp.lean
theorem total_apply (l : α →₀ R) : Finsupp.total α M R v l = l.sum fun i a => a • v i
-- Mathlib/Algebra/Star/NonUnitalSubalgebra.lean
@[simp]
theorem inclusion_self {S : NonUnitalStarSubalgebra R A} :
    inclusion (le_refl S) = NonUnitalAlgHom.id R S
-- Mathlib/Data/Nat/Bitwise.lean
@[simp]
theorem xor_zero (n : ℕ) : n ^^^ 0 = n
-- Mathlib/Topology/UniformSpace/UniformEmbedding.lean
protected theorem UniformInducing.injective [T0Space α] {f : α → β} (h : UniformInducing f) :
    Injective f
-- Mathlib/GroupTheory/OrderOfElement.lean
@[to_additive]
theorem orderOf_dvd_lcm_mul (h : Commute x y):
    orderOf y ∣ Nat.lcm (orderOf x) (orderOf (x * y))
-- Mathlib/Analysis/InnerProductSpace/Basic.lean
/-- Expand the square -/
theorem norm_add_mul_self (x y : E) :
    ‖x + y‖ * ‖x + y‖ = ‖x‖ * ‖x‖ + 2 * re ⟪x, y⟫ + ‖y‖ * ‖y‖
-- Mathlib/Data/Complex/Exponential.lean
nonrec theorem cosh_sq : cosh x ^ 2 = sinh x ^ 2 + 1
-- Mathlib/GroupTheory/MonoidLocalization/Order.lean
/-- An ordered cancellative monoid injects into its localization by sending `a` to `a / b`. -/
@[to_additive (attr := simps!) "An ordered cancellative monoid injects into its localization by
sending `a` to `a - b`."]
def mkOrderEmbedding (b : s) : α ↪o Localization s
-- Mathlib/Algebra/BigOperators/Group/Finset.lean
@[to_additive]
theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∉ s) (f : α → β)
    (b : β) : ∏ x ∈ s, Function.update f i b x = ∏ x ∈ s, f x
-- Mathlib/Algebra/Lie/Derivation/AdjointAction.lean
/-- A derivation `D` belongs to the ideal range of the adjoint action iff it is of the form `ad x`
for some `x` in the Lie algebra `L`. -/
lemma mem_ad_idealRange_iff {D : LieDerivation R L L} :
    D ∈ (ad R L).idealRange ↔ ∃ x : L, ad R L x = D
-- .lake/packages/lean4/src/lean/Init/Data/Nat/Lemmas.lean
theorem add_mod (a b n : Nat) : (a + b) % n = ((a % n) + (b % n)) % n
-- Mathlib/Combinatorics/SimpleGraph/Subgraph.lean
theorem singletonSubgraph_fst_le_subgraphOfAdj {u v : V} {h : G.Adj u v} :
    G.singletonSubgraph u ≤ G.subgraphOfAdj h
-- Mathlib/Algebra/Module/Submodule/Map.lean
theorem range_map_nonempty (N : Submodule R M) :
    (Set.range (fun ϕ => Submodule.map ϕ N : (M →ₛₗ[σ₁₂] M₂) → Submodule R₂ M₂)).Nonempty
-- Mathlib/Analysis/InnerProductSpace/GramSchmidtOrtho.lean
theorem inner_gramSchmidtOrthonormalBasis_eq_zero {f : ι → E} {i : ι}
    (hi : gramSchmidtNormed 𝕜 f i = 0) (j : ι) : ⟪gramSchmidtOrthonormalBasis h f i, f j⟫ = 0
-- Mathlib/Order/Heyting/Hom.lean
theorem copy_eq (f : HeytingHom α β) (f' : α → β) (h : f' = f) : f.copy f' h = f
-- Mathlib/LinearAlgebra/BilinearMap.lean
theorem llcomp_apply' (f : Nₗ →ₗ[R] Pₗ) (g : M →ₗ[R] Nₗ) : llcomp R M Nₗ Pₗ f g = f ∘ₗ g
-- Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean
/-- The algebra isomorphism `AdjoinRoot (minpoly R x) ≃ₐ[R] adjoin R x` -/
@[simps!]
def equivAdjoin (hx : IsIntegral R x) : AdjoinRoot (minpoly R x) ≃ₐ[R] adjoin R ({x} : Set S)
-- Mathlib/Data/ByteArray.lean
theorem Up.next {ub i} (h : i < ub) : Up ub (i+1) i
-- Mathlib/CategoryTheory/Monoidal/Category.lean
theorem whiskerLeft_dite {P : Prop} [Decidable P]
    (X : C) {Y Z : C} (f : P → (Y ⟶ Z)) (f' : ¬P → (Y ⟶ Z)) :
      X ◁ (if h : P then f h else f' h) = if h : P then X ◁ f h else X ◁ f' h
-- Mathlib/MeasureTheory/Group/Measure.lean
@[to_additive]
lemma innerRegularWRT_isCompact_isClosed_measure_ne_top_of_group [h : InnerRegularCompactLTTop μ] :
    InnerRegularWRT μ (fun s ↦ IsCompact s ∧ IsClosed s) (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞)
-- .lake/packages/lean4/src/lean/Init/Data/UInt/Lemmas.lean
declare_uint_theorems UInt16
-- Mathlib/Algebra/Order/Field/Basic.lean
theorem le_div_iff_of_neg' (hc : c < 0) : a ≤ b / c ↔ b ≤ c * a
-- Mathlib/Analysis/Normed/Order/Lattice.lean
/-- Let `α` be an `AddCommGroup` with a `Lattice` structure. A norm on `α` is *solid* if, for `a`
and `b` in `α`, with absolute values `|a|` and `|b|` respectively, `|a| ≤ |b|` implies `‖a‖ ≤ ‖b‖`.
-/
class HasSolidNorm (α : Type*) [NormedAddCommGroup α] [Lattice α] : Prop where
  solid : ∀ ⦃x y : α⦄, |x| ≤ |y| → ‖x‖ ≤ ‖y‖
-- Mathlib/Algebra/Ring/Subring/Basic.lean
@[simp]
theorem centralizer_eq_top_iff_subset {s : Set R} : centralizer s = ⊤ ↔ s ⊆ center R
-- Mathlib/Topology/UniformSpace/UniformConvergenceTopology.lean
protected theorem nhds_eq (f : α →ᵤ[𝔖] β) :
    𝓝 f = ⨅ s ∈ 𝔖, ⨅ V ∈ 𝓤 β, 𝓟 {g | ∀ x ∈ s, (toFun 𝔖 f x, toFun 𝔖 g x) ∈ V}
-- Mathlib/RingTheory/Perfection.lean
theorem valAux_mul (f g : PreTilt K v O hv p) :
    valAux K v O hv p (f * g) = valAux K v O hv p f * valAux K v O hv p g
-- Mathlib/Data/Nat/Defs.lean
protected lemma lt_div_iff_mul_lt (hdn : d ∣ n) (a : ℕ) : a < n / d ↔ d * a < n
-- Mathlib/SetTheory/Ordinal/FixedPoint.lean
theorem fp_iff_derivBFamily (H : ∀ i hi, IsNormal (f i hi)) {a} :
    (∀ i hi, f i hi a = a) ↔ ∃ b, derivBFamily.{u, v} o f b = a
-- Mathlib/Data/List/Basic.lean
theorem reverse_eq_iff {l l' : List α} : l.reverse = l' ↔ l = l'.reverse
-- Mathlib/RingTheory/Valuation/ValuationSubring.lean
theorem nonunits_le_nonunits {A B : ValuationSubring K} : B.nonunits ≤ A.nonunits ↔ A ≤ B
-- Mathlib/Algebra/MvPolynomial/Equiv.lean
@[simp]
theorem mapAlgEquiv_symm (e : A₁ ≃ₐ[R] A₂) : (mapAlgEquiv σ e).symm = mapAlgEquiv σ e.symm
-- Mathlib/GroupTheory/Perm/DomMulAct.lean
lemma stabilizerMulEquiv_apply (g : (stabilizer (Perm α)ᵈᵐᵃ f)ᵐᵒᵖ) {a : α} {i : ι} (h : f a = i) :
    ((stabilizerMulEquiv f)) g i ⟨a, h⟩ = (mk.symm g.unop : Equiv.Perm α) a
-- Mathlib/Logic/Equiv/PartialEquiv.lean
@[simp, mfld_simps]
theorem restr_univ {e : PartialEquiv α β} : e.restr univ = e
-- Mathlib/Algebra/Module/Submodule/Map.lean
theorem map_inf (f : F) {p q : Submodule R M} (hf : Injective f) :
    (p ⊓ q).map f = p.map f ⊓ q.map f
-- Mathlib/MeasureTheory/Group/FundamentalDomain.lean
@[to_additive]
theorem lintegral_eq_tsum_of_ac (h : IsFundamentalDomain G s μ) (hν : ν ≪ μ) (f : α → ℝ≥0∞) :
    ∫⁻ x, f x ∂ν = ∑' g : G, ∫⁻ x in g • s, f x ∂ν
-- Mathlib/GroupTheory/SpecificGroups/Cyclic.lean
@[to_additive isAddCyclic_of_card_nsmul_eq_zero_le]
theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α
-- Mathlib/Order/Interval/Set/Basic.lean
theorem Ioc_inter_Ioo_of_right_le (h : b₂ ≤ b₁) : Ioc a₁ b₁ ∩ Ioo a₂ b₂ = Ioo (max a₁ a₂) b₂
-- Mathlib/Algebra/CharP/Algebra.lean
/-- If `R` has characteristic `0`, then so does Frac(R). -/
theorem charZero_of_isFractionRing [CharZero R] : CharZero K
-- Mathlib/Data/Sym/Basic.lean
theorem eq_replicate_of_subsingleton [Subsingleton α] (a : α) {n : ℕ} (s : Sym α n) :
    s = replicate n a
-- Mathlib/Data/Seq/Seq.lean
@[simp]
theorem ofStream_append (l : List α) (s : Stream' α) :
    ofStream (l ++ₛ s) = append (ofList l) (ofStream s)
-- Mathlib/Algebra/MvPolynomial/Supported.lean
@[simp]
theorem mem_supported_vars (p : MvPolynomial σ R) : p ∈ supported R (↑p.vars : Set σ)
-- Mathlib/Data/Seq/WSeq.lean
theorem cons_congr {s t : WSeq α} (a : α) (h : s ~ʷ t) : cons a s ~ʷ cons a t
-- Mathlib/Algebra/Lie/IdealOperations.lean
/-- Note that the inequality can be strict; e.g., the inclusion of an Abelian subalgebra of a
simple algebra. -/
theorem map_bracket_le {I₁ I₂ : LieIdeal R L} : map f ⁅I₁, I₂⁆ ≤ ⁅map f I₁, map f I₂⁆
-- Mathlib/Order/Interval/Finset/Basic.lean
theorem Ico_union_Ico' {a b c d : α} (hcb : c ≤ b) (had : a ≤ d) :
    Ico a b ∪ Ico c d = Ico (min a c) (max b d)
-- Mathlib/SetTheory/Cardinal/Basic.lean
theorem mk_eq_nat_iff_fintype {n : ℕ} : #α = n ↔ ∃ h : Fintype α, @Fintype.card α h = n
-- Mathlib/LinearAlgebra/TensorProduct/Subalgebra.lean
/-- If `A` and `B` are subalgebras of a commutative `R`-algebra `S`, both of them are
free `R`-algebras, then the rank of `A ⊔ B` is less than or equal to
the product of that of `A` and `B`. -/
theorem rank_sup_le_of_free [Module.Free R A] [Module.Free R B] :
    Module.rank R ↥(A ⊔ B) ≤ Module.rank R A * Module.rank R B
-- Mathlib/Data/Finsupp/Basic.lean
@[to_additive]
theorem prod_mapDomain_index [CommMonoid N] {f : α → β} {s : α →₀ M} {h : β → M → N}
    (h_zero : ∀ b, h b 0 = 1) (h_add : ∀ b m₁ m₂, h b (m₁ + m₂) = h b m₁ * h b m₂) :
    (mapDomain f s).prod h = s.prod fun a m => h (f a) m
-- Mathlib/CategoryTheory/Monad/Basic.lean
/-- An isomorphism of monads gives a natural isomorphism of the underlying functors.
-/
/- Porting note: removed
`@[simps (config := { rhsMd := semireducible })]`
and replaced with `@[simps]` in the two declarations below-/
@[simps!]
def MonadIso.toNatIso {M N : Monad C} (h : M ≅ N) : (M : C ⥤ C) ≅ N
-- Mathlib/Data/Fin/Basic.lean
lemma predAbove_rev_left (p : Fin n) (i : Fin (n + 1)) :
    p.rev.predAbove i = (p.predAbove i.rev).rev
-- .lake/packages/batteries/Batteries/Data/Sum/Lemmas.lean
theorem isRight_iff : x.isRight ↔ ∃ y, x = Sum.inr y
-- Mathlib/Order/MinMax.lean
@[simp]
theorem max_eq_right_iff : max a b = b ↔ a ≤ b
-- Mathlib/CategoryTheory/Elements.lean
/-- The equivalence `(-.Elements)ᵒᵖ ≅ (yoneda, -)` of is actually a natural isomorphism of functors.
-/
theorem costructuredArrow_yoneda_equivalence_naturality {F₁ F₂ : Cᵒᵖ ⥤ Type v} (α : F₁ ⟶ F₂) :
    (map α).op ⋙ toCostructuredArrow F₂ = toCostructuredArrow F₁ ⋙ CostructuredArrow.map α
-- Mathlib/Analysis/Distribution/FourierSchwartz.lean
@[simp] lemma fourierTransformCLM_apply (f : 𝓢(V, E)) :
    fourierTransformCLM 𝕜 f = 𝓕 f
-- Mathlib/Probability/ProbabilityMassFunction/Basic.lean
theorem toPMF_apply (x : α) : μ.toPMF x = μ {x}
-- Mathlib/CategoryTheory/Shift/Basic.lean
theorem shift_neg_shift' (i : A) :
    f⟦-i⟧'⟦i⟧' = (shiftFunctorCompIsoId C (-i) i (neg_add_self i)).hom.app X ≫ f ≫
      (shiftFunctorCompIsoId C (-i) i (neg_add_self i)).inv.app Y
-- Mathlib/Data/Set/Finite.lean
theorem card_lt_card {s t : Set α} [Fintype s] [Fintype t] (h : s ⊂ t) :
    Fintype.card s < Fintype.card t
-- Mathlib/Analysis/Calculus/LocalExtr/LineDeriv.lean
theorem IsMaxOn.hasLineDerivAt_eq_zero (h : IsMaxOn f s a) (hd : HasLineDerivAt ℝ f f' a b)
    (h' : ∀ᶠ t : ℝ in 𝓝 0, a + t • b ∈ s) : f' = 0
-- Mathlib/Algebra/Polynomial/Basic.lean
theorem commute_X_pow (p : R[X]) (n : ℕ) : Commute (X ^ n) p
-- Mathlib/RingTheory/LocalRing/Module.lean
/--
If `M → N → P → 0` is a presentation of `P` over a local ring `(R, 𝔪, k)` with
`M` finite and `N` finite free, then injectivity of `k ⊗ M → k ⊗ N` implies that `P` is free.
-/
theorem free_of_lTensor_residueField_injective
    [Module.Finite R M] [Module.Finite R N] [Module.Free R N]
    (hf : Function.Injective (f.lTensor k)) :
    Module.Free R P
-- Mathlib/Topology/Compactness/Compact.lean
theorem IsCompact.prod {t : Set Y} (hs : IsCompact s) (ht : IsCompact t) :
    IsCompact (s ×ˢ t)
-- Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean
theorem ker_eval {s : S} (hs : IsIntegral R s) :
    RingHom.ker ((Polynomial.aeval s).toRingHom : R[X] →+* S) =
    Ideal.span ({minpoly R s} : Set R[X])
-- .lake/packages/lean4/src/lean/Init/Data/List/Lemmas.lean
theorem getElem?_len_le : ∀ {l : List α} {n}, length l ≤ n → l[n]? = none
-- Mathlib/GroupTheory/Congruence/Basic.lean
@[to_additive (attr := simp, norm_cast)]
theorem coe_iInf {ι : Sort*} (f : ι → Con M) : ⇑(iInf f) = ⨅ i, ⇑(f i)
-- Mathlib/Order/CompleteLattice.lean
theorem iSup_of_empty [IsEmpty ι] (f : ι → α) : iSup f = ⊥
-- Mathlib/Algebra/Algebra/Equiv.lean
@[simp]
theorem autCongr_refl : autCongr AlgEquiv.refl = MulEquiv.refl (A₁ ≃ₐ[R] A₁)
-- .lake/packages/batteries/Batteries/Data/List/Lemmas.lean
theorem foldr_hom (f : β₁ → β₂) (g₁ : α → β₁ → β₁) (g₂ : α → β₂ → β₂) (l : List α) (init : β₁)
    (H : ∀ x y, g₂ x (f y) = f (g₁ x y)) : l.foldr g₂ (f init) = f (l.foldr g₁ init)
-- Mathlib/LinearAlgebra/Dimension/Constructions.lean
/-- The rank of a finite product of free modules is the sum of the ranks. -/
-- this result is not true without the freeness assumption
@[simp]
theorem rank_pi [Finite η] : Module.rank R (∀ i, φ i) =
    Cardinal.sum fun i => Module.rank R (φ i)
-- .lake/packages/lean4/src/lean/Init/Data/Int/DivModLemmas.lean
protected theorem ediv_emod_unique {a b r q : Int} (h : 0 < b) :
  a / b = q ∧ a % b = r ↔ r + b * q = a ∧ 0 ≤ r ∧ r < b
-- Mathlib/MeasureTheory/MeasurableSpace/Basic.lean
lemma map_def {s : Set β} : MeasurableSet[m.map f] s ↔ MeasurableSet[m] (f ⁻¹' s)
-- Mathlib/Data/Multiset/Basic.lean
@[mono]
theorem card_mono : Monotone (@card α)
-- .lake/packages/batteries/Batteries/Data/Nat/Gcd.lean
theorem Coprime.gcd_mul_left_cancel (m : Nat) (H : Coprime k n) : gcd (k * m) n = gcd m n
-- Mathlib/Algebra/Group/Action/Basic.lean
@[to_additive]
protected lemma MulAction.bijective (g : α) : Function.Bijective (g • · : β → β)
-- Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean
/-- The Weierstrass curve over `R` induced by an admissible linear change of variables
$(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$. -/
@[simps]
def variableChange : WeierstrassCurve R
-- Mathlib/Topology/UniformSpace/CompactConvergence.lean
theorem hasBasis_compactConvergenceUniformity :
    HasBasis (𝓤 C(α, β)) (fun p : Set α × Set (β × β) => IsCompact p.1 ∧ p.2 ∈ 𝓤 β) fun p =>
      { fg : C(α, β) × C(α, β) | ∀ x ∈ p.1, (fg.1 x, fg.2 x) ∈ p.2 }
-- Mathlib/Analysis/Calculus/InverseFunctionTheorem/ApproximatesLinearOn.lean
/-- The inverse function is approximated linearly on `f '' s` by `f'.symm`. -/
theorem to_inv (hf : ApproximatesLinearOn f (f' : E →L[𝕜] F) s c) (hc : Subsingleton E ∨ c < N⁻¹) :
    ApproximatesLinearOn (hf.toPartialEquiv hc).symm (f'.symm : F →L[𝕜] E) (f '' s)
      (N * (N⁻¹ - c)⁻¹ * c)
-- Mathlib/CategoryTheory/Preadditive/AdditiveFunctor.lean
theorem map_nsmul {X Y : C} {f : X ⟶ Y} {n : ℕ} : F.map (n • f) = n • F.map f
-- Mathlib/Analysis/Calculus/Deriv/Basic.lean
theorem DifferentiableAt.hasDerivAt (h : DifferentiableAt 𝕜 f x) : HasDerivAt f (deriv f x) x
-- Mathlib/Algebra/Ring/Subring/Basic.lean
@[simp]
theorem mem_mk' {s : Set R} {sm : Submonoid R} (hm : ↑sm = s) {sa : AddSubgroup R} (ha : ↑sa = s)
    {x : R} : x ∈ Subring.mk' s sm sa hm ha ↔ x ∈ s
-- Mathlib/Analysis/NormedSpace/AffineIsometry.lean
/-- An affine isometric equivalence between two normed vector spaces. -/
structure AffineIsometryEquiv extends P ≃ᵃ[𝕜] P₂ where
  norm_map : ∀ x, ‖linear x‖ = ‖x‖
-- Mathlib/Geometry/Euclidean/Angle/Unoriented/RightAngle.lean
/-- A side of a right-angled triangle divided by the cosine of the adjacent angle equals the
hypotenuse. -/
theorem norm_div_cos_angle_add_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) (h0 : x ≠ 0 ∨ y = 0) :
    ‖x‖ / Real.cos (angle x (x + y)) = ‖x + y‖
-- Mathlib/Topology/PartialHomeomorph.lean
theorem inv_image_trans_target : e'.symm '' (e.trans e').target = e'.source ∩ e.target
-- Mathlib/CategoryTheory/EqToHom.lean
@[simp]
theorem eqToHom_op {X Y : C} (h : X = Y) : (eqToHom h).op = eqToHom (congr_arg op h.symm)
-- Mathlib/CategoryTheory/Sites/CoverLifting.lean
@[simp]
lemma pushforwardContinuousSheafificationCompatibility_hom_app_val (F : Dᵒᵖ ⥤ A) :
    ((G.pushforwardContinuousSheafificationCompatibility A J K).hom.app F).val =
    sheafifyLift J (whiskerLeft G.op <| toSheafify K F)
      ((presheafToSheaf K A ⋙ G.sheafPushforwardContinuous A J K).obj F).cond
-- Mathlib/MeasureTheory/Function/AEEqOfIntegral.lean
theorem ae_le_of_forall_setLIntegral_le_of_sigmaFinite [SigmaFinite μ] {f g : α → ℝ≥0∞}
    (hf : Measurable f)
    (h : ∀ s, MeasurableSet s → μ s < ∞ → (∫⁻ x in s, f x ∂μ) ≤ ∫⁻ x in s, g x ∂μ) : f ≤ᵐ[μ] g
-- Mathlib/Algebra/Lie/TraceForm.lean
@[simp] lemma toSubmodule_killingCompl :
    LieSubmodule.toSubmodule I.killingCompl = (killingForm R L).orthogonal I.toSubmodule
-- Mathlib/Topology/UniformSpace/Equicontinuity.lean
/-- Each function of a family uniformly equicontinuous on `S` is uniformly continuous on `S`. -/
theorem UniformEquicontinuousOn.uniformContinuousOn {F : ι → β → α} {S : Set β}
    (h : UniformEquicontinuousOn F S) (i : ι) :
    UniformContinuousOn (F i) S