ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
-- Mathlib/Analysis/NormedSpace/Pointwise.lean
@[simp]
theorem cthickening_thickening (hε : 0 ≤ ε) (hδ : 0 < δ) (s : Set E) :
    cthickening ε (thickening δ s) = cthickening (ε + δ) s
-- Mathlib/Topology/UniformSpace/Equicontinuity.lean
/-- Given `u : α → γ` a uniform inducing map, a family `𝓕 : ι → β → α` is uniformly equicontinuous
iff the family `𝓕'`, obtained by composing each function of `𝓕` by `u`, is uniformly
equicontinuous. -/
theorem UniformInducing.uniformEquicontinuous_iff {F : ι → β → α} {u : α → γ}
    (hu : UniformInducing u) : UniformEquicontinuous F ↔ UniformEquicontinuous ((u ∘ ·) ∘ F)
-- Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean
theorem adjoin_le_iff {S : NonUnitalSubalgebra R A} {s : Set A} : adjoin R s ≤ S ↔ s ⊆ S
-- Mathlib/Analysis/Normed/Operator/LinearIsometry.lean
@[simp]
theorem coe_prodAssoc [Module R E₂] [Module R E₃] :
    (prodAssoc R E E₂ E₃ : (E × E₂) × E₃ → E × E₂ × E₃) = Equiv.prodAssoc E E₂ E₃
-- Mathlib/Topology/MetricSpace/Pseudo/Constructions.lean
@[simp] lemma dist_up_up (x y : β) : dist (ULift.up x) (ULift.up y) = dist x y
-- Mathlib/MeasureTheory/Measure/Portmanteau.lean
/-- **Portmanteau theorem** -/
theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type*} {L : Filter ι} {μ : Measure Ω}
    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
    (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i E) ≤ μ E) :
    μ Eᶜ ≤ L.liminf fun i => μs i Eᶜ
-- Mathlib/Dynamics/PeriodicPts.lean
private theorem minimalPeriod_iterate_eq_div_gcd_aux (h : 0 < gcd (minimalPeriod f x) n) :
    minimalPeriod f^[n] x = minimalPeriod f x / Nat.gcd (minimalPeriod f x) n
-- Mathlib/CategoryTheory/Sites/Sieves.lean
theorem functorPullback_monotone (X : C) :
    Monotone (Sieve.functorPullback F : Sieve (F.obj X) → Sieve X)
-- Mathlib/Topology/Algebra/InfiniteSum/Basic.lean
@[to_additive]
theorem Function.Surjective.multipliable_iff_of_hasProd_iff {α' : Type*} [CommMonoid α']
    [TopologicalSpace α'] {e : α' → α} (hes : Function.Surjective e) {f : β → α} {g : γ → α'}
    (he : ∀ {a}, HasProd f (e a) ↔ HasProd g a) : Multipliable f ↔ Multipliable g
-- Mathlib/CategoryTheory/Sites/Localization.lean
lemma W_iff_isIso_map_of_adjunction (adj : G ⊣ sheafToPresheaf J A)
    {P₁ P₂ : Cᵒᵖ ⥤ A} (f : P₁ ⟶ P₂) :
    J.W f ↔ IsIso (G.map f)
-- Mathlib/Order/UpperLower/Basic.lean
lemma fibration_iff_image_Ici [Preorder α] [Preorder β] (hf : Monotone f) :
    Fibration (· ≥ ·) (· ≥ ·) f ↔ ∀ x, f '' Ici x = Ici (f x)
-- Mathlib/Data/Real/Irrational.lean
@[simp]
theorem Int.not_irrational (m : ℤ) : ¬Irrational m
-- Mathlib/Computability/PartrecCode.lean
theorem encode_lt_pair (cf cg) :
    encode cf < encode (pair cf cg) ∧ encode cg < encode (pair cf cg)
-- Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean
/-- Shows how the entries of the sequence of the computed continued fraction can be obtained by the
integer parts of the stream of integer and fractional parts.
-/
theorem get?_of_eq_some_of_succ_get?_intFractPair_stream {ifp_succ_n : IntFractPair K}
    (stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp_succ_n) :
    (of v).s.get? n = some ⟨1, ifp_succ_n.b⟩
-- Mathlib/Data/Fin/Basic.lean
lemma predAbove_castSucc_of_le (p i : Fin n) (h : i ≤ p) : p.predAbove (castSucc i) = i
-- Mathlib/Order/Disjoint.lean
theorem right_unique (hxy : IsCompl x y) (hxz : IsCompl x z) : y = z
-- Mathlib/Algebra/Homology/ShortComplex/ShortExact.lean
lemma ShortExact.isIso_f_iff {S : ShortComplex C} (hS : S.ShortExact) [Balanced C] :
    IsIso S.f ↔ IsZero S.X₃
-- Mathlib/Analysis/Complex/PhragmenLindelof.lean
/-- **Phragmen-Lindelöf principle** in a strip `U = {z : ℂ | a < re z < b}`.
Let `f g : ℂ → E` be functions such that

* `f` and `g` are differentiable on `U` and are continuous on its closure;
* `‖f z‖` and `‖g z‖` are bounded from above by `A * exp(B * exp(c * |im z|))` on `U` for some
  `c < π / (b - a)`;
* `f z = g z` on the boundary of `U`.

Then `f` is equal to `g` on the closed strip `{z : ℂ | a ≤ re z ≤ b}`.
-/
theorem eqOn_vertical_strip {g : ℂ → E} (hdf : DiffContOnCl ℂ f (re ⁻¹' Ioo a b))
    (hBf : ∃ c < π / (b - a), ∃ B, f =O[comap (_root_.abs ∘ im) atTop ⊓ 𝓟 (re ⁻¹' Ioo a b)]
      fun z ↦ expR (B * expR (c * |z.im|)))
    (hdg : DiffContOnCl ℂ g (re ⁻¹' Ioo a b))
    (hBg : ∃ c < π / (b - a), ∃ B, g =O[comap (_root_.abs ∘ im) atTop ⊓ 𝓟 (re ⁻¹' Ioo a b)]
      fun z ↦ expR (B * expR (c * |z.im|)))
    (ha : ∀ z : ℂ, re z = a → f z = g z) (hb : ∀ z : ℂ, re z = b → f z = g z) :
    EqOn f g (re ⁻¹' Icc a b)
-- Mathlib/Analysis/Calculus/Deriv/Comp.lean
protected nonrec theorem HasStrictDerivAt.iterate {f : 𝕜 → 𝕜} {f' : 𝕜}
    (hf : HasStrictDerivAt f f' x) (hx : f x = x) (n : ℕ) :
    HasStrictDerivAt f^[n] (f' ^ n) x
-- Mathlib/Topology/Algebra/InfiniteSum/NatInt.lean
@[to_additive]
lemma tprod_nat_mul_neg [T2Space M] {f : ℤ → M} (hf : Multipliable f) :
    ∏' n : ℕ, (f n * f (-n)) = (∏' n : ℤ, f n) * f 0
-- Mathlib/Topology/Algebra/Monoid.lean
@[to_additive]
theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} :
    (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i ∈ s, f i a) t
-- Mathlib/Analysis/Fourier/Inversion.lean
/-- **Fourier inversion formula**: If a function `f` on a finite-dimensional real inner product
space is integrable, and its Fourier transform `𝓕 f` is also integrable, then `𝓕⁻ (𝓕 f) = f` at
continuity points of `f`. -/
theorem MeasureTheory.Integrable.fourier_inversion
    (hf : Integrable f) (h'f : Integrable (𝓕 f)) {v : V}
    (hv : ContinuousAt f v) : 𝓕⁻ (𝓕 f) v = f v
-- Mathlib/CategoryTheory/Comma/Basic.lean
/-- The functor `Comma L R ⥤ Comma L R` induced by the identity natural transformation on `L` is
    naturally isomorphic to the identity functor. -/
@[simps!]
def mapLeftId : mapLeft R (𝟙 L) ≅ 𝟭 _
-- Mathlib/Algebra/Ring/Invertible.lean
@[simp]
theorem invOf_neg [Monoid α] [HasDistribNeg α] (a : α) [Invertible a] [Invertible (-a)] :
    ⅟ (-a) = -⅟ a
-- Mathlib/Algebra/GroupWithZero/Action/Defs.lean
@[simp]
theorem smul_neg (r : M) (x : A) : r • -x = -(r • x)
-- Mathlib/Data/Set/Card.lean
/-- Every set is either empty, infinite, or can have its `encard` reduced by a removal. Intended
  for well-founded induction on the value of `encard`. -/
theorem eq_empty_or_encard_eq_top_or_encard_diff_singleton_lt (s : Set α) :
    s = ∅ ∨ s.encard = ⊤ ∨ ∃ a ∈ s, (s \ {a}).encard < s.encard
-- Mathlib/Data/ENNReal/Real.lean
protected theorem trichotomy₂ {p q : ℝ≥0∞} (hpq : p ≤ q) :
    p = 0 ∧ q = 0 ∨
      p = 0 ∧ q = ∞ ∨
        p = 0 ∧ 0 < q.toReal ∨
          p = ∞ ∧ q = ∞ ∨
            0 < p.toReal ∧ q = ∞ ∨ 0 < p.toReal ∧ 0 < q.toReal ∧ p.toReal ≤ q.toReal
-- Mathlib/Algebra/Polynomial/Smeval.lean
theorem eval_eq_smeval : p.eval r = p.smeval r
-- Mathlib/Topology/MetricSpace/Pseudo/Defs.lean
theorem mem_closure_range_iff_nat {e : β → α} {a : α} :
    a ∈ closure (range e) ↔ ∀ n : ℕ, ∃ k : β, dist a (e k) < 1 / ((n : ℝ) + 1)
-- Mathlib/Data/Real/Archimedean.lean
theorem exists_floor (x : ℝ) : ∃ ub : ℤ, (ub : ℝ) ≤ x ∧ ∀ z : ℤ, (z : ℝ) ≤ x → z ≤ ub
-- Mathlib/Probability/Martingale/BorelCantelli.lean
theorem tendsto_sum_indicator_atTop_iff' [IsFiniteMeasure μ] {s : ℕ → Set Ω}
    (hs : ∀ n, MeasurableSet[ℱ n] (s n)) : ∀ᵐ ω ∂μ,
    Tendsto (fun n => ∑ k ∈ Finset.range n,
      (s (k + 1)).indicator (1 : Ω → ℝ) ω) atTop atTop ↔
    Tendsto (fun n => ∑ k ∈ Finset.range n,
      (μ[(s (k + 1)).indicator (1 : Ω → ℝ)|ℱ k]) ω) atTop atTop
-- Mathlib/Order/CompleteLatticeIntervals.lean
lemma Set.Icc.coe_sInf [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b)
    {S : Set (Set.Icc a b)} (hS : S.Nonempty) : letI := Set.Icc.completeLattice h
    ↑(sInf S) = sInf ((↑) '' S : Set α)
-- Mathlib/NumberTheory/Dioph.lean
theorem IsPoly.neg {f : (α → ℕ) → ℤ} : IsPoly f → IsPoly (-f)
-- Mathlib/RingTheory/Kaehler/CotangentComplex.lean
@[simp]
lemma cotangentSpaceBasis_repr_tmul (r x i) :
    P.cotangentSpaceBasis.repr (r ⊗ₜ .D _ _ x) i = r * aeval P.val (pderiv i x)
-- Mathlib/Order/Partition/Finpartition.lean
theorem mem_bind : b ∈ (P.bind Q).parts ↔ ∃ A hA, b ∈ (Q A hA).parts
-- Mathlib/GroupTheory/QuotientGroup.lean
@[to_additive]
theorem subsingleton_quotient_top : Subsingleton (G ⧸ (⊤ : Subgroup G))
-- Mathlib/Order/Interval/Set/Basic.lean
theorem Ioo_union_Ioo (h₁ : min a b < max c d) (h₂ : min c d < max a b) :
    Ioo a b ∪ Ioo c d = Ioo (min a c) (max b d)
-- Mathlib/Combinatorics/Quiver/Arborescence.lean
/-- The length of a path is at least the length of the shortest path -/
theorem shortest_path_spec {a : V} (p : Path r a) : (shortestPath r a).length ≤ p.length
-- Mathlib/LinearAlgebra/CliffordAlgebra/Contraction.lean
/-- This is [grinberg_clifford_2016][] Theorem 12  -/
theorem contractRight_mul_ι (a : M) (b : CliffordAlgebra Q) :
    b * ι Q a⌊d = d a • b - b⌊d * ι Q a
-- Mathlib/CategoryTheory/Bicategory/Functor/Oplax.lean
/-- A structure on an oplax functor that promotes an oplax functor to a pseudofunctor.
See `Pseudofunctor.mkOfOplax`.
-/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
-- Porting note: removing primes in structure name because
-- my understanding is that they're no longer needed
structure PseudoCore (F : OplaxFunctor B C) where
  mapIdIso (a : B) : F.map (𝟙 a) ≅ 𝟙 (F.obj a)
  mapCompIso {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : F.map (f ≫ g) ≅ F.map f ≫ F.map g
  mapIdIso_hom : ∀ {a : B}, (mapIdIso a).hom = F.mapId a := by aesop_cat
  mapCompIso_hom :
    ∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c), (mapCompIso f g).hom = F.mapComp f g := by aesop_cat
-- Mathlib/GroupTheory/Perm/Support.lean
theorem pow_apply_mem_support {n : ℕ} {x : α} : (f ^ n) x ∈ f.support ↔ x ∈ f.support
-- Mathlib/Data/Finset/Lattice.lean
theorem inf_sup_distrib_right (s : Finset ι) (f : ι → α) (a : α) :
    s.inf f ⊔ a = s.inf fun i => f i ⊔ a
-- Mathlib/Geometry/Manifold/PartitionOfUnity.lean
theorem le_one (i : ι) (x : M) : f i x ≤ 1
-- Mathlib/Order/Minimal.lean
theorem IsAntichain.minimals_upperClosure [PartialOrder α] (hs : IsAntichain (· ≤ ·) s) :
    minimals (· ≤ ·) (upperClosure s : Set α) = s
-- Mathlib/Order/FixedPoints.lean
theorem le_lfp {a : α} (h : ∀ b, f b ≤ b → a ≤ b) : a ≤ lfp f
-- Mathlib/Data/Setoid/Partition.lean
lemma _root_.Set.PairwiseDisjoint.isPartition_of_exists_of_ne_empty {α : Type*} {s : Set (Set α)}
    (h₁ : s.PairwiseDisjoint id) (h₂ : ∀ a : α, ∃ x ∈ s, a ∈ x) (h₃ : ∅ ∉ s) :
    Setoid.IsPartition s
-- Mathlib/RingTheory/GradedAlgebra/Basic.lean
theorem coe_decompose_mul_of_left_mem_of_le (a_mem : a ∈ 𝒜 i) (h : i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = a * decompose 𝒜 b (n - i)
-- Mathlib/MeasureTheory/Function/LpSpace.lean
/-- A family of `indicatorConstLp` functions is continuous in the parameter,
if `μ (s y ∆ s x)` tends to zero as `y` tends to `x` for all `x`. -/
theorem continuous_indicatorConstLp_set [Fact (1 ≤ p)] {X : Type*} [TopologicalSpace X]
    {s : X → Set α} {hs : ∀ x, MeasurableSet (s x)} {hμs : ∀ x, μ (s x) ≠ ∞} (hp : p ≠ ∞)
    (h : ∀ x, Tendsto (fun y ↦ μ (s y ∆ s x)) (𝓝 x) (𝓝 0)) :
    Continuous fun x ↦ indicatorConstLp p (hs x) (hμs x) c
-- Mathlib/Topology/UniformSpace/Basic.lean
lemma uniformContinuous_inl : UniformContinuous (Sum.inl : α → α ⊕ β)
-- Mathlib/Combinatorics/Additive/Corner/Defs.lean
lemma isCornerFree_singleton (x : G × G) : IsCornerFree {x}
-- Mathlib/Topology/FiberBundle/IsHomeomorphicTrivialBundle.lean
/-- The projection from a trivial fiber bundle to its base is open. -/
protected theorem quotientMap_proj [Nonempty F] (h : IsHomeomorphicTrivialFiberBundle F proj) :
    QuotientMap proj
-- .lake/packages/lean4/src/lean/Init/Data/Nat/Basic.lean
theorem add_one_pos (n : Nat) : 0 < n + 1
-- Mathlib/Data/Nat/Choose/Basic.lean
@[simp]
theorem multichoose_zero_right (n : ℕ) : multichoose n 0 = 1
-- Mathlib/Topology/ContinuousFunction/Basic.lean
@[simp]
theorem coe_mk (f : α → β) (h : Continuous f) : ⇑(⟨f, h⟩ : C(α, β)) = f
-- Mathlib/Data/Set/Function.lean
lemma injOn_id (s : Set α) : InjOn id s
-- Mathlib/Data/QPF/Univariate/Basic.lean
theorem supp_eq {α : Type u} (x : F α) :
    supp x = { u | ∀ a f, abs ⟨a, f⟩ = x → u ∈ f '' univ }
-- .lake/packages/batteries/Batteries/Data/List/Basic.lean
@[simp] theorem takeD_zero (l) (a : α) : takeD 0 l a = []
-- Mathlib/Order/Interval/Set/Image.lean
@[simp]
lemma image_subtype_val_Ioi_Iio {a : α} (b : Ioi a) : Subtype.val '' Iio b = Ioo a b
-- Mathlib/Geometry/Manifold/PartitionOfUnity.lean
protected theorem point_finite (x : M) : {i | fs i x ≠ 0}.Finite
-- Mathlib/CategoryTheory/Localization/Construction.lean
/-- The functor `(W.Localization ⥤ D) ⥤ (W.FunctorsInverting D)` induced by the
composition with `W.Q : C ⥤ W.Localization`. -/
@[simps!]
def functor : (W.Localization ⥤ D) ⥤ W.FunctorsInverting D
-- Mathlib/Algebra/Homology/ShortComplex/Exact.lean
lemma exact_iff_mono_fromOpcycles [S.HasHomology] : S.Exact ↔ Mono S.fromOpcycles
-- Mathlib/MeasureTheory/Constructions/BorelSpace/Order.lean
@[measurability]
theorem aemeasurable_iSup {ι} {μ : Measure δ} [Countable ι] {f : ι → δ → α}
    (hf : ∀ i, AEMeasurable (f i) μ) : AEMeasurable (fun b => ⨆ i, f i b) μ
-- Mathlib/CategoryTheory/Monoidal/OfHasFiniteProducts.lean
@[simp]
theorem rightUnitor_inv (X : C) : (ρ_ X).inv = prod.lift (𝟙 _) (terminal.from X)
-- Mathlib/Topology/Semicontinuous.lean
theorem IsOpen.lowerSemicontinuous_indicator (hs : IsOpen s) (hy : 0 ≤ y) :
    LowerSemicontinuous (indicator s fun _x => y)
-- Mathlib/Data/Finset/Prod.lean
@[simp]
theorem mem_product {p : α × β} : p ∈ s ×ˢ t ↔ p.1 ∈ s ∧ p.2 ∈ t
-- Mathlib/Analysis/Calculus/FDeriv/Prod.lean
@[fun_prop]
theorem hasFDerivWithinAt_fst {s : Set (E × F)} :
    HasFDerivWithinAt (@Prod.fst E F) (fst 𝕜 E F) s p
-- Mathlib/Data/DFinsupp/Basic.lean
/-- The `DFinsupp` version of `Finsupp.liftAddHom_singleAddHom`,-/
@[simp, nolint simpNF] -- Porting note: linter claims that simp can prove this, but it can not
theorem liftAddHom_singleAddHom [∀ i, AddCommMonoid (β i)] :
    liftAddHom (β := β) (singleAddHom β) = AddMonoidHom.id (Π₀ i, β i)
-- Mathlib/CategoryTheory/Limits/Indization/IndObject.lean
/-- The recognition theorem for ind-objects: `A : Cᵒᵖ ⥤ Type v` is an ind-object if and only if
    `CostructuredArrow yoneda A` is filtered and finally `v`-small.

    Theorem 6.1.5 of [Kashiwara2006] -/
theorem isIndObject_iff (A : Cᵒᵖ ⥤ Type v) : IsIndObject A ↔
    (IsFiltered (CostructuredArrow yoneda A) ∧ FinallySmall.{v} (CostructuredArrow yoneda A))
-- Mathlib/GroupTheory/MonoidLocalization/Basic.lean
@[to_additive]
theorem mk_left_injective (b : s) : Injective fun a => mk a b
-- Mathlib/Analysis/Calculus/ContDiff/Defs.lean
/-- When a function is `C^n` in a set `s` of unique differentiability, it admits
`ftaylorSeriesWithin 𝕜 f s` as a Taylor series up to order `n` in `s`. -/
theorem contDiff_iff_ftaylorSeries :
    ContDiff 𝕜 n f ↔ HasFTaylorSeriesUpTo n f (ftaylorSeries 𝕜 f)
-- Mathlib/FieldTheory/PurelyInseparable.lean
/-- Transfer `IsPurelyInseparable` across an `AlgEquiv`. -/
theorem AlgEquiv.isPurelyInseparable (e : K ≃ₐ[F] E) [IsPurelyInseparable F K] :
    IsPurelyInseparable F E
-- Mathlib/Topology/Category/LightProfinite/Basic.lean
theorem epi_iff_surjective {X Y : LightProfinite.{u}} (f : X ⟶ Y) :
    Epi f ↔ Function.Surjective f
-- Mathlib/Order/Interval/Finset/Basic.lean
@[simp]
theorem Iic_erase [DecidableEq α] (b : α) : (Iic b).erase b = Iio b
-- Mathlib/Combinatorics/SimpleGraph/Path.lean
@[trans]
protected theorem Reachable.trans {u v w : V} (huv : G.Reachable u v) (hvw : G.Reachable v w) :
    G.Reachable u w
-- Mathlib/Logic/Function/Basic.lean
theorem injective_of_isPartialInv_right {α β} {f : α → β} {g} (H : IsPartialInv f g) (x y b)
    (h₁ : b ∈ g x) (h₂ : b ∈ g y) : x = y
-- Mathlib/Algebra/Module/Zlattice/Covolume.lean
theorem covolume_pos : 0 < covolume L μ
-- Mathlib/Algebra/BigOperators/Group/Finset.lean
@[to_additive]
theorem eq_prod_range_div' {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
    f n = ∏ i ∈ range (n + 1), if i = 0 then f 0 else f i / f (i - 1)
-- Mathlib/Algebra/Lie/BaseChange.lean
@[simp]
lemma LieModule.toEnd_baseChange (x : L) :
    toEnd A (A ⊗[R] L) (A ⊗[R] M) (1 ⊗ₜ x) = (toEnd R L M x).baseChange A
-- Mathlib/Topology/Algebra/InfiniteSum/Nonarchimedean.lean
/-- Let `G` be a complete nonarchimedean multiplicative abelian group. Then a function `f : α → G`
is unconditionally multipliable if and only if it tends to one on the filter of cofinite sets. -/
@[to_additive "Let `G` be a complete nonarchimedean additive abelian group. Then a function
`f : α → G` is unconditionally summable if and only if it tends to zero on the filter of cofinite
sets."]
theorem multipliable_iff_tendsto_cofinite_one [CompleteSpace G] (f : α → G) :
    Multipliable f ↔ Tendsto f cofinite (𝓝 1)
-- Mathlib/Algebra/Polynomial/Degree/Definitions.lean
theorem natDegree_pow_le_of_le (n : ℕ) (hp : natDegree p ≤ m) :
    natDegree (p ^ n) ≤ n * m
-- Mathlib/Data/List/Basic.lean
theorem get?_succ_scanl {i : ℕ} : (scanl f b l).get? (i + 1) =
    ((scanl f b l).get? i).bind fun x => (l.get? i).map fun y => f x y
-- Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean
/-- At `0` the Gamma function is undefined; by convention we assign it the value `0`. -/
@[simp]
theorem Gamma_zero : Gamma 0 = 0
-- Mathlib/Algebra/Module/LocalizedModule.lean
theorem mk'_eq_zero' {m : M} (s : S) : mk' f m s = 0 ↔ ∃ s' : S, s' • m = 0
-- Mathlib/CategoryTheory/Subobject/Basic.lean
theorem map_id (x : Subobject X) : (map (𝟙 X)).obj x = x
-- Mathlib/Topology/Specialization.lean
@[simp] lemma toEquiv_ofEquiv (a : Specialization α) : toEquiv (ofEquiv a) = a
-- .lake/packages/lean4/src/lean/Init/Omega/LinearCombo.lean
@[simp] theorem neg_coeffs {l : LinearCombo} : (-l).coeffs = -l.coeffs
-- Mathlib/Algebra/AddConstMap/Basic.lean
@[scoped simp]
theorem map_zsmul_add [AddCommGroup G] [AddGroup H] [AddConstMapClass F G H a b]
    (f : F) (n : ℤ) (x : G) : f (n • a + x) = f x + n • b
-- Mathlib/Algebra/Ring/BooleanRing.lean
theorem inf_comm (a b : α) : a ⊓ b = b ⊓ a
-- Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean
@[simp]
theorem algebraMap_eq_zero_iff (x : R) : algebraMap R (ExteriorAlgebra R M) x = 0 ↔ x = 0
-- Mathlib/Algebra/Group/Basic.lean
@[to_additive (attr := simp)]
theorem mul_div_cancel_left (a b : G) : a * b / a = b
-- Mathlib/Combinatorics/SetFamily/AhlswedeZhang.lean
private lemma binomial_sum_eq (h : n < m) :
    ∑ i ∈ range (n + 1), (n.choose i * (m - n) / ((m - i) * m.choose i) : ℚ) = 1
-- Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean
theorem sin_lt_sin_of_lt_of_le_pi_div_two {x y : ℝ} (hx₁ : -(π / 2) ≤ x) (hy₂ : y ≤ π / 2)
    (hxy : x < y) : sin x < sin y
-- Mathlib/LinearAlgebra/FiniteDimensional/Defs.lean
theorem _root_.LinearIndependent.lt_aleph0_of_finiteDimensional {ι : Type w} [FiniteDimensional K V]
    {v : ι → V} (h : LinearIndependent K v) : #ι < ℵ₀
-- Mathlib/Dynamics/Minimal.lean
@[to_additive]
theorem IsOpen.exists_smul_mem [IsMinimal M α] (x : α) {U : Set α} (hUo : IsOpen U)
    (hne : U.Nonempty) : ∃ c : M, c • x ∈ U
-- Mathlib/GroupTheory/Exponent.lean
@[to_additive exists_addOrderOf_eq_pow_padic_val_nat_add_exponent]
theorem _root_.Nat.Prime.exists_orderOf_eq_pow_factorization_exponent {p : ℕ} (hp : p.Prime) :
    ∃ g : G, orderOf g = p ^ (exponent G).factorization p
-- Mathlib/Order/Filter/CountableSeparatingOn.lean
theorem of_forall_separating_preimage (p : Set β → Prop) [HasCountableSeparatingOn β p univ]
    (h : ∀ U : Set β, p U → f ⁻¹' U =ᶠ[l] g ⁻¹' U) : f =ᶠ[l] g
-- Mathlib/Order/RelClasses.lean
theorem IsTrans.swap (r) [IsTrans α r] : IsTrans α (swap r)
-- Mathlib/Probability/Kernel/Composition.lean
@[simp]
lemma map_id (κ : Kernel α β) : map κ id measurable_id = κ
-- .lake/packages/lean4/src/lean/Init/Data/Fin/Lemmas.lean
@[simp] theorem castLT_mk (i n m : Nat) (hn : i < n) (hm : i < m) : castLT ⟨i, hn⟩ hm = ⟨i, hm⟩
-- Mathlib/Order/Interval/Set/Monotone.lean
theorem strictAntiOn_Iic_of_succ_lt [SuccOrder α] [IsSuccArchimedean α] {n : α}
    (hψ : ∀ m, m < n → ψ (succ m) < ψ m) : StrictAntiOn ψ (Set.Iic n)
-- Mathlib/Algebra/Order/Hom/Monoid.lean
@[to_additive]
theorem comp_mul (g : β →*o γ) (f₁ f₂ : α →*o β) : g.comp (f₁ * f₂) = g.comp f₁ * g.comp f₂
-- Mathlib/Topology/Category/Profinite/Nobeling.lean
theorem rel_head!_of_mem [Inhabited I] {i : I} {l : Products I} (hi : i ∈ l.val) :
    i ≤ l.val.head!
-- Mathlib/Analysis/Convex/Star.lean
theorem StarConvex.smul_mem (hs : StarConvex 𝕜 0 s) (hx : x ∈ s) {t : 𝕜} (ht₀ : 0 ≤ t)
    (ht₁ : t ≤ 1) : t • x ∈ s
-- .lake/packages/lean4/src/lean/Init/Data/Int/Order.lean
theorem sign_eq_neg_one_iff_neg (a : Int) : sign a = -1 ↔ a < 0
-- Mathlib/Algebra/Order/Interval/Finset.lean
@[simp] lemma map_add_left_Ioo (a b c : α) :
    (Ioo a b).map (addLeftEmbedding c) = Ioo (c + a) (c + b)
-- Mathlib/Logic/Function/Conjugate.lean
/-- Definition of `Function.Semiconj` in terms of functional equality. -/
lemma _root_.Function.semiconj_iff_comp_eq : Semiconj f ga gb ↔ f ∘ ga = gb ∘ f
-- Mathlib/Algebra/Lie/Submodule.lean
@[simp] lemma LieModuleEquiv.range_coe {M' : Type*}
    [AddCommGroup M'] [Module R M'] [LieRingModule L M'] (e : M ≃ₗ⁅R,L⁆ M') :
    LieModuleHom.range (e : M →ₗ⁅R,L⁆ M') = ⊤
-- Mathlib/Algebra/BigOperators/Group/Finset.lean
@[to_additive]
theorem prod_piecewise [DecidableEq α] (s t : Finset α) (f g : α → β) :
    (∏ x ∈ s, (t.piecewise f g) x) = (∏ x ∈ s ∩ t, f x) * ∏ x ∈ s \ t, g x
-- .lake/packages/batteries/Batteries/Data/List/Lemmas.lean
theorem map_sub_range' (a s n : Nat) (h : a ≤ s) :
    map (· - a) (range' s n step) = range' (s - a) n step
-- Mathlib/RingTheory/Ideal/Maps.lean
theorem mem_map_of_mem (f : F) {I : Ideal R} {x : R} (h : x ∈ I) : f x ∈ map f I
-- Mathlib/LinearAlgebra/Matrix/Charpoly/Univ.lean
@[simp]
lemma univ_map_eval₂Hom (M : n × n → S) :
    (univ R n).map (eval₂Hom f M) = charpoly (Matrix.of M.curry)
-- Mathlib/Order/Heyting/Basic.lean
theorem sup_le_of_le_sdiff_left (h : b ≤ c \ a) (hac : a ≤ c) : a ⊔ b ≤ c
-- .lake/packages/batteries/Batteries/Classes/Order.lean
/-- `TransCmp cmp` asserts that `cmp` induces a transitive relation. -/
class TransCmp (cmp : α → α → Ordering) extends OrientedCmp cmp : Prop where
  /-- The comparator operation is transitive. -/
  le_trans : cmp x y ≠ .gt → cmp y z ≠ .gt → cmp x z ≠ .gt
-- Mathlib/Analysis/BoxIntegral/Partition/Basic.lean
@[simp]
theorem biUnion_top : (π.biUnion fun _ => ⊤) = π
-- Mathlib/CategoryTheory/Comma/Presheaf.lean
/-- Intermediate stage of assembling the counit. -/
@[simps]
def counitAuxAux (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) (s : CostructuredArrow yoneda A) :
    F.obj (op s) ≅ OverArrows (yonedaCollectionPresheafToA F) s.hom
-- Mathlib/CategoryTheory/Monoidal/Category.lean
@[reassoc]
theorem tensorHom_def' {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
    f ⊗ g = X₁ ◁ g ≫ f ▷ Y₂
-- Mathlib/Algebra/Category/Ring/Basic.lean
/-- Build an isomorphism in the category `CommRingCat` from a `RingEquiv` between `CommRingCat`s. -/
@[simps]
def toCommRingCatIso [CommRing X] [CommRing Y] (e : X ≃+* Y) :
    CommRingCat.of X ≅ CommRingCat.of Y
-- Mathlib/Algebra/Group/Semiconj/Basic.lean
@[to_additive] lemma eq_one_iff (h : SemiconjBy a x y): x = 1 ↔ y = 1
-- Mathlib/Data/Set/Pointwise/Interval.lean
@[simp]
theorem preimage_const_add_Ioc : (fun x => a + x) ⁻¹' Ioc b c = Ioc (b - a) (c - a)
-- Mathlib/Data/Matrix/ColumnRowPartitioned.lean
/-- A block matrix mulitplied by a row partitioned matrix gives a row partitioned matrix -/
lemma fromBlocks_mul_fromRows (A₁ : Matrix n₁ n R) (A₂ : Matrix n₂ n R)
    (B₁₁ : Matrix m₁ n₁ R) (B₁₂ : Matrix m₁ n₂ R) (B₂₁ : Matrix m₂ n₁ R) (B₂₂ : Matrix m₂ n₂ R) :
    fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ * (fromRows A₁ A₂) =
      fromRows (B₁₁ * A₁ + B₁₂ * A₂) (B₂₁ * A₁ + B₂₂ * A₂)
-- Mathlib/Data/Matrix/Basic.lean
theorem diagonal_apply [Zero α] (d : n → α) (i j) : diagonal d i j = if i = j then d i else 0
-- Mathlib/GroupTheory/Perm/Basic.lean
lemma MapsTo.perm_pow : MapsTo f s s → ∀ n : ℕ, MapsTo (f ^ n) s s
-- Mathlib/Topology/Basic.lean
@[simp]
theorem closure_compl : closure sᶜ = (interior s)ᶜ