ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
-- Mathlib/Combinatorics/SetFamily/LYM.lean
/-- The **Lubell-Yamamoto-Meshalkin inequality**. If `𝒜` is an antichain, then the sum of the
proportion of elements it takes from each layer is less than `1`. -/
theorem sum_card_slice_div_choose_le_one [Fintype α]
    (h𝒜 : IsAntichain (· ⊆ ·) (𝒜 : Set (Finset α))) :
    (∑ r ∈ range (Fintype.card α + 1), ((𝒜 # r).card : 𝕜) / (Fintype.card α).choose r) ≤ 1
-- Mathlib/Algebra/Group/Units.lean
@[to_additive (attr := simp)]
theorem mk_val (u : αˣ) (y h₁ h₂) : mk (u : α) y h₁ h₂ = u
-- Mathlib/Algebra/Order/Hom/Ring.lean
@[simp]
theorem coe_copy (f : α →+*o β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'
-- Mathlib/Data/Finset/NoncommProd.lean
@[to_additive]
theorem map_noncommProd [MonoidHomClass F β γ] (s : Finset α) (f : α → β) (comm) (g : F) :
    g (s.noncommProd f comm) =
      s.noncommProd (fun i => g (f i)) fun x hx y hy _ => (comm.of_refl hx hy).map g
-- Mathlib/Algebra/Module/Submodule/Equiv.lean
theorem ofSubmodule'_toLinearMap [Module R M] [Module R₂ M₂] (f : M ≃ₛₗ[σ₁₂] M₂)
    (U : Submodule R₂ M₂) :
    (f.ofSubmodule' U).toLinearMap = (f.toLinearMap.domRestrict _).codRestrict _ Subtype.prop
-- Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean
theorem rpow_inv_eq_iff {x y : ℝ≥0} {z : ℝ} (hz : z ≠ 0) : x ^ z⁻¹ = y ↔ x = y ^ z
-- Mathlib/Data/Nat/Prime/Basic.lean
theorem dvd_of_forall_prime_mul_dvd {a b : ℕ}
    (hdvd : ∀ p : ℕ, p.Prime → p ∣ a → p * a ∣ b) : a ∣ b
-- Mathlib/CategoryTheory/Monad/Monadicity.lean
@[simp]
theorem unitCofork_π (A : adj.toMonad.Algebra)
    [HasCoequalizer (F.map A.a) (adj.counit.app (F.obj A.A))] :
    (unitCofork A).π = G.map (coequalizer.π (F.map A.a) (adj.counit.app (F.obj A.A)))
-- .lake/packages/batteries/Batteries/Data/String/Lemmas.lean
theorem prevn : ∀ {s}, ValidFor l (m₁.reverse ++ m₂) r s →
    ∀ n, s.prevn n ⟨utf8Len m₁⟩ = ⟨utf8Len (m₁.drop n)⟩
-- Mathlib/Data/PFun.lean
theorem compl_dom_subset_core (s : Set β) : f.Domᶜ ⊆ f.core s
-- Mathlib/RingTheory/Polynomial/Tower.lean
theorem aeval_algebraMap_eq_zero_iff_of_injective {x : A} {p : R[X]}
    (h : Function.Injective (algebraMap A B)) : aeval (algebraMap A B x) p = 0 ↔ aeval x p = 0
-- Mathlib/CategoryTheory/EqToHom.lean
theorem hcongr_hom {F G : C ⥤ D} (h : F = G) {X Y} (f : X ⟶ Y) : HEq (F.map f) (G.map f)
-- Mathlib/Data/Finset/Piecewise.lean
lemma piecewise_singleton [DecidableEq ι] (i : ι) : piecewise {i} f g = update g i (f i)
-- Mathlib/Init/Algebra/Classes.lean
theorem trichotomous [IsTrichotomous α r] : ∀ a b : α, a ≺ b ∨ a = b ∨ b ≺ a
-- Mathlib/Data/Nat/Multiplicity.lean
theorem multiplicity_self {p : ℕ} (hp : p.Prime) : multiplicity p p = 1
-- Mathlib/Algebra/Order/Field/Basic.lean
theorem lt_div_iff' (hc : 0 < c) : a < b / c ↔ c * a < b
-- Mathlib/Combinatorics/SetFamily/Compression/Down.lean
@[simp]
theorem mem_memberSubfamily : s ∈ 𝒜.memberSubfamily a ↔ insert a s ∈ 𝒜 ∧ a ∉ s
-- Mathlib/Data/List/Infix.lean
@[simp]
theorem getElem_inits (l : List α) (n : Nat) (h : n < length (inits l)) :
    (inits l)[n] = l.take n
-- Mathlib/Combinatorics/SetFamily/Compression/Down.lean
/-- Induction principle for finset families. To prove a statement for every finset family,
it suffices to prove it for
* the empty finset family.
* the finset family which only contains the empty finset.
* `ℬ ∪ {s ∪ {a} | s ∈ 𝒞}` assuming the property for `ℬ` and `𝒞`, where `a` is an element of the
  ground type and `𝒜` and `ℬ` are families of finsets not containing `a`.
  Note that instead of giving `ℬ` and `𝒞`, the `subfamily` case gives you
  `𝒜 = ℬ ∪ {s ∪ {a} | s ∈ 𝒞}`, so that `ℬ = 𝒜.nonMemberSubfamily` and `𝒞 = 𝒜.memberSubfamily`.

This is a way of formalising induction on `n` where `𝒜` is a finset family on `n` elements.

See also `Finset.family_induction_on.`-/
@[elab_as_elim]
lemma memberFamily_induction_on {p : Finset (Finset α) → Prop}
    (𝒜 : Finset (Finset α)) (empty : p ∅) (singleton_empty : p {∅})
    (subfamily : ∀ (a : α) ⦃𝒜 : Finset (Finset α)⦄,
      p (𝒜.nonMemberSubfamily a) → p (𝒜.memberSubfamily a) → p 𝒜) : p 𝒜
-- Mathlib/Order/Interval/Finset/Basic.lean
theorem Icc_subset_uIcc' : Icc b a ⊆ [[a, b]]
-- Mathlib/Algebra/Module/Torsion.lean
/-- An `a`-torsion module is a module whose `a`-torsion submodule is the full space. -/
theorem isTorsionBy_iff_torsionBy_eq_top : IsTorsionBy R M a ↔ torsionBy R M a = ⊤
-- Mathlib/Data/Nat/PartENat.lean
theorem eq_natCast_sub_of_add_eq_natCast {x y : PartENat} {n : ℕ} (h : x + y = n) :
    x = ↑(n - y.get (dom_of_le_natCast ((le_add_left le_rfl).trans_eq h)))
-- Mathlib/MeasureTheory/Function/L1Space.lean
theorem Integrable.add {f g : α →ₘ[μ] β} : Integrable f → Integrable g → Integrable (f + g)
-- Mathlib/Analysis/CstarAlgebra/ContinuousFunctionalCalculus/NonUnital.lean
lemma CFC.eq_zero_of_quasispectrum_eq_zero (h_spec : σₙ R a ⊆ {0}) (ha : p a := by cfc_tac) :
    a = 0
-- Mathlib/Analysis/SpecialFunctions/ExpDeriv.lean
@[simp]
theorem DifferentiableAt.exp (hc : DifferentiableAt ℝ f x) :
    DifferentiableAt ℝ (fun x => Real.exp (f x)) x
-- Mathlib/Algebra/Lie/OfAssociative.lean
@[simp]
theorem lieConj_apply (f : Module.End R M₁) : e.lieConj f = e.conj f
-- Mathlib/Data/Real/Basic.lean
theorem lt_cauchy {f g} : (⟨⟦f⟧⟩ : ℝ) < ⟨⟦g⟧⟩ ↔ f < g
-- Mathlib/Data/Complex/Exponential.lean
theorem exp_mul_I : exp (x * I) = cos x + sin x * I
-- Mathlib/Topology/Category/TopCat/Opens.lean
@[simp]
theorem inclusion_map_eq_top {X : TopCat} (U : Opens X) : (Opens.map U.inclusion).obj U = ⊤
-- Mathlib/Probability/Kernel/Basic.lean
theorem deterministic_apply {f : α → β} (hf : Measurable f) (a : α) :
    deterministic f hf a = Measure.dirac (f a)
-- Mathlib/LinearAlgebra/Matrix/Basis.lean
theorem coePiBasisFun.toMatrix_eq_transpose [Finite ι] :
    ((Pi.basisFun R ι).toMatrix : Matrix ι ι R → Matrix ι ι R) = Matrix.transpose
-- Mathlib/NumberTheory/Padics/PadicNumbers.lean
theorem const_equiv {q r : ℚ} : const (padicNorm p) q ≈ const (padicNorm p) r ↔ q = r
-- Mathlib/SetTheory/Cardinal/Basic.lean
@[simp, nolint simpNF]
theorem lift_mk_shrink (α : Type u) [Small.{v} α] :
    Cardinal.lift.{max u w} #(Shrink.{v} α) = Cardinal.lift.{max v w} #α
-- Mathlib/Analysis/Calculus/ContDiff/Defs.lean
/-- If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then
in a neighborhood of `x`, the term of order `1` of this series is a derivative of `f`. -/
theorem HasFTaylorSeriesUpToOn.eventually_hasFDerivAt (h : HasFTaylorSeriesUpToOn n f p s)
    (hn : 1 ≤ n) (hx : s ∈ 𝓝 x) :
    ∀ᶠ y in 𝓝 x, HasFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p y 1)) y
-- Mathlib/Order/Filter/Basic.lean
@[mono]
theorem EventuallyLE.compl {s t : Set α} {l : Filter α} (h : s ≤ᶠ[l] t) :
    (tᶜ : Set α) ≤ᶠ[l] (sᶜ : Set α)
-- .lake/packages/batteries/Batteries/Data/AssocList.lean
@[simp] theorem toList_eraseP (p) (l : AssocList α β) :
    (eraseP p l).toList = l.toList.eraseP fun (a, b) => p a b
-- Mathlib/Algebra/Polynomial/Eval.lean
theorem eval₂_eq_sum_range' (f : R →+* S) {p : R[X]} {n : ℕ} (hn : p.natDegree < n) (x : S) :
    eval₂ f x p = ∑ i ∈ Finset.range n, f (p.coeff i) * x ^ i
-- Mathlib/Data/Num/Lemmas.lean
theorem gcd_to_nat_aux :
    ∀ {n} {a b : Num}, a ≤ b → (a * b).natSize ≤ n → (gcdAux n a b : ℕ) = Nat.gcd a b
-- Mathlib/ModelTheory/Basic.lean
@[simp]
theorem toFun_equiv_empty (f : M ≃ N) : (Equiv.empty f : M → N) = f
-- Mathlib/Analysis/CstarAlgebra/ContinuousFunctionalCalculus/Basic.lean
theorem StarSubalgebra.mem_spectrum_iff {S : StarSubalgebra ℂ A} (hS : IsClosed (S : Set A)) {x : S}
    {z : ℂ} : z ∈ spectrum ℂ x ↔ z ∈ spectrum ℂ (x : A)
-- Mathlib/Data/Real/Sqrt.lean
theorem sqrt_lt' (hy : 0 < y) : √x < y ↔ x < y ^ 2
-- Mathlib/NumberTheory/LegendreSymbol/JacobiSymbol.lean
/-- The **Law of Quadratic Reciprocity for the Jacobi symbol**, version with `qrSign` -/
theorem quadratic_reciprocity' {a b : ℕ} (ha : Odd a) (hb : Odd b) :
    J(a | b) = qrSign b a * J(b | a)
-- Mathlib/Algebra/CharP/Reduced.lean
theorem frobenius_inj : Function.Injective (frobenius R p)
-- Mathlib/Data/List/Range.lean
theorem enum_eq_zip_range (l : List α) : l.enum = (range l.length).zip l
-- Mathlib/Data/Finset/Prod.lean
@[simp]
theorem offDiag_empty : (∅ : Finset α).offDiag = ∅
-- Mathlib/Algebra/Polynomial/Monic.lean
theorem monic_X_add_C (x : R) : Monic (X + C x)
-- Mathlib/Analysis/Distribution/AEEqOfIntegralContDiff.lean
theorem IsOpen.ae_eq_zero_of_integral_smooth_smul_eq_zero {U : Set M} (hU : IsOpen U)
    (hf : LocallyIntegrableOn f U μ)
    (h : ∀ g : M → ℝ,
      Smooth I 𝓘(ℝ) g → HasCompactSupport g → tsupport g ⊆ U → ∫ x, g x • f x ∂μ = 0) :
    ∀ᵐ x ∂μ, x ∈ U → f x = 0
-- Mathlib/CategoryTheory/Monoidal/Preadditive.lean
/-- A faithful additive monoidal functor to a monoidal preadditive category
ensures that the domain is monoidal preadditive. -/
theorem monoidalPreadditive_of_faithful {D} [Category D] [Preadditive D] [MonoidalCategory D]
    (F : MonoidalFunctor D C) [F.Faithful] [F.Additive] :
    MonoidalPreadditive D
-- .lake/packages/lean4/src/lean/Init/Data/List/Lemmas.lean
theorem filterMap_replicate {f : α → Option β} :
    (replicate n a).filterMap f = match f a with | none => [] | .some b => replicate n b
-- Mathlib/RingTheory/Multiplicity.lean
theorem not_unit_of_finite {a b : α} (h : Finite a b) : ¬IsUnit a
-- Mathlib/RingTheory/Finiteness.lean
theorem fg_iSup {ι : Sort*} [Finite ι] (N : ι → Submodule R M) (h : ∀ i, (N i).FG) :
    (iSup N).FG
-- Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean
/-- The equalizer of `(f, g)`, where `f = g`, is an isomorphism. -/
theorem equalizer.ι_of_eq [HasEqualizer f g] (h : f = g) : IsIso (equalizer.ι f g)
-- Mathlib/Algebra/Algebra/Subalgebra/MulOpposite.lean
@[simp]
theorem mem_op {x : Aᵐᵒᵖ} {S : Subalgebra R A} : x ∈ S.op ↔ x.unop ∈ S
-- Mathlib/Analysis/Complex/Circle.lean
@[simp]
theorem coe_div_circle (z w : circle) : ↑(z / w) = (z : ℂ) / w
-- Mathlib/Topology/Instances/NNReal.lean
@[simp]
theorem _root_.Real.comap_toNNReal_atTop : comap Real.toNNReal atTop = atTop
-- Mathlib/CategoryTheory/Monoidal/Preadditive.lean
theorem sum_whiskerRight {Q R : C} {J : Type*} (s : Finset J) (g : J → (Q ⟶ R)) (P : C) :
    (∑ j ∈ s, g j) ▷ P = ∑ j ∈ s, g j ▷ P
-- Mathlib/Order/CompleteLattice.lean
theorem biSup_congr {p : ι → Prop} (h : ∀ i, p i → f i = g i) :
    ⨆ (i) (_ : p i), f i = ⨆ (i) (_ : p i), g i
-- Mathlib/Data/Set/Basic.lean
theorem subset_pair_iff_eq {x y : α} : s ⊆ {x, y} ↔ s = ∅ ∨ s = {x} ∨ s = {y} ∨ s = {x, y}
-- Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean
/-- If `R` is the integral closure of `S` in `A`, then it is integrally closed in `A`. -/
lemma of_isIntegralClosure [Algebra R B] [Algebra A B] [IsScalarTower R A B]
    [IsIntegralClosure A R B] :
    IsIntegrallyClosedIn A B
-- Mathlib/Order/SupClosed.lean
lemma isSublattice_pi {ι : Type*} {α : ι → Type*} [∀ i, Lattice (α i)] {s : Set ι}
    {t : ∀ i, Set (α i)} (ht : ∀ i ∈ s, IsSublattice (t i)) : IsSublattice (s.pi t)
-- Mathlib/Data/Set/Finite.lean
/-- Dependent version of `Finite.biUnion`. -/
theorem Finite.biUnion' {ι} {s : Set ι} (hs : s.Finite) {t : ∀ i ∈ s, Set α}
    (ht : ∀ i (hi : i ∈ s), (t i hi).Finite) : (⋃ i ∈ s, t i ‹_›).Finite
-- Mathlib/Analysis/BoxIntegral/Basic.lean
theorem HasIntegral.unique (h : HasIntegral I l f vol y) (h' : HasIntegral I l f vol y') : y = y'
-- Mathlib/Analysis/SpecialFunctions/ExpDeriv.lean
theorem HasFDerivAt.exp (hf : HasFDerivAt f f' x) :
    HasFDerivAt (fun x => Real.exp (f x)) (Real.exp (f x) • f') x
-- Mathlib/Analysis/CstarAlgebra/Matrix.lean
lemma l2_opNorm_conjTranspose [DecidableEq m] (A : Matrix m n 𝕜) : ‖Aᴴ‖ = ‖A‖
-- Mathlib/SetTheory/Ordinal/Notation.lean
theorem nfBelow_ofNat : ∀ n, NFBelow (ofNat n) 1
-- Mathlib/Order/OrdContinuous.lean
theorem lt_iff (hf : RightOrdContinuous f) (h : Injective f) {x y} : f x < f y ↔ x < y
-- Mathlib/Topology/Algebra/Order/Archimedean.lean
/-- An additive subgroup of an archimedean linear ordered additive commutative group `G` with order
topology either is dense in `G` or is a cyclic subgroup. -/
theorem dense_or_cyclic (S : AddSubgroup G) : Dense (S : Set G) ∨ ∃ a : G, S = closure {a}
-- Mathlib/Data/DFinsupp/Basic.lean
@[simp]
theorem single_neg {β : ι → Type v} [∀ i, AddGroup (β i)] (i : ι) (x : β i) :
    single i (-x) = -single i x
-- Mathlib/Topology/Category/CompactlyGenerated.lean
/-- The type of `u`-compactly generated `w`-small topological spaces. -/
structure CompactlyGenerated where
  /-- The underlying topological space of an object of `CompactlyGenerated`. -/
  toTop : TopCat.{w}
  /-- The underlying topological space is compactly generated. -/
  [is_compactly_generated : UCompactlyGeneratedSpace.{u} toTop]
-- Mathlib/Data/PNat/Basic.lean
/-- We now define a long list of structures on `ℕ+` induced by
 similar structures on `ℕ`. Most of these behave in a completely
 obvious way, but there are a few things to be said about
 subtraction, division and powers.
-/
@[simp, norm_cast]
theorem coe_inj {m n : ℕ+} : (m : ℕ) = n ↔ m = n
-- Mathlib/Topology/MetricSpace/MetricSeparated.lean
@[simp]
theorem empty_left (s : Set X) : IsMetricSeparated ∅ s
-- Mathlib/Analysis/Normed/Module/Dual.lean
@[simp]
theorem dualPairing_apply {v : Dual 𝕜 E} {x : E} : dualPairing 𝕜 E v x = v x
-- Mathlib/MeasureTheory/Function/L2Space.lean
theorem integral_inner_eq_sq_eLpNorm (f : α →₂[μ] E) :
    ∫ a, ⟪f a, f a⟫ ∂μ = ENNReal.toReal (∫⁻ a, (‖f a‖₊ : ℝ≥0∞) ^ (2 : ℝ) ∂μ)
-- Mathlib/RingTheory/Regular/RegularSequence.lean
@[simp] lemma ofList_singleton (r : R) : ofList [r] = span {r}
-- Mathlib/NumberTheory/Rayleigh.lean
/-- **Rayleigh's theorem** on Beatty sequences. Let `r` be an irrational number greater than 1, and
`1/r + 1/s = 1`. Then `B⁺_r` and `B⁺_s` partition the positive integers. -/
theorem Irrational.beattySeq_symmDiff_beattySeq_pos {r s : ℝ}
    (hrs : r.IsConjExponent s) (hr : Irrational r) :
    {beattySeq r k | k > 0} ∆ {beattySeq s k | k > 0} = {n | 0 < n}
-- Mathlib/CategoryTheory/Functor/KanExtension/Adjunction.lean
@[reassoc (attr := simp)]
lemma lanUnit_app_app_lanAdjunction_counit_app_app (G : D ⥤ H) (X : C) :
    (L.lanUnit.app (L ⋙ G)).app X ≫ ((L.lanAdjunction H).counit.app G).app (L.obj X) = 𝟙 _
-- Mathlib/Algebra/GroupWithZero/NonZeroDivisors.lean
@[simp]
theorem mul_right_coe_nonZeroDivisors_eq_zero_iff {x : M} {c : M⁰} : x * c = 0 ↔ x = 0
-- Mathlib/MeasureTheory/Integral/SetIntegral.lean
theorem LpToLpRestrictCLM_coeFn [Fact (1 ≤ p)] (s : Set X) (f : Lp F p μ) :
    LpToLpRestrictCLM X F 𝕜 μ p s f =ᵐ[μ.restrict s] f
-- Mathlib/Topology/Algebra/Module/Star.lean
theorem continuous_skewAdjointPart [ContinuousSub A] [ContinuousStar A] [ContinuousConstSMul R A] :
    Continuous (skewAdjointPart R (A := A))
-- Mathlib/Geometry/Euclidean/Angle/Oriented/Affine.lean
/-- If the sign of the angle between three points is positive, the first two points are not
equal. -/
theorem left_ne_of_oangle_sign_eq_one {p₁ p₂ p₃ : P} (h : (∡ p₁ p₂ p₃).sign = 1) : p₁ ≠ p₂
-- Mathlib/Data/Finset/Lattice.lean
theorem inf'_union [DecidableEq β] {s₁ s₂ : Finset β} (h₁ : s₁.Nonempty) (h₂ : s₂.Nonempty)
    (f : β → α) :
    (s₁ ∪ s₂).inf' (h₁.mono subset_union_left) f = s₁.inf' h₁ f ⊓ s₂.inf' h₂ f
-- Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean
@[simp]
theorem center_re (z r) : (center z r).re = z.re
-- Mathlib/Algebra/Order/CompleteField.lean
theorem coe_lt_inducedMap_iff : (q : β) < inducedMap α β a ↔ (q : α) < a
-- Mathlib/Logic/Equiv/Defs.lean
@[simp] theorem permCongr_refl : e.permCongr (Equiv.refl _) = Equiv.refl _
-- Mathlib/Data/List/Range.lean
@[simp]
theorem nthLe_finRange {n : ℕ} {i : ℕ} (h) :
    (finRange n).nthLe i h = ⟨i, length_finRange n ▸ h⟩
-- Mathlib/LinearAlgebra/PiTensorProduct.lean
@[simp]
theorem reindex_tprod (e : ι ≃ ι₂) (f : Π i, s i) :
    reindex R s e (tprod R f) = tprod R fun i ↦ f (e.symm i)
-- Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean
theorem det_eq_of_forall_row_eq_smul_add_const_aux {A B : Matrix n n R} {s : Finset n} :
    ∀ (c : n → R) (_ : ∀ i, i ∉ s → c i = 0) (k : n) (_ : k ∉ s)
      (_ : ∀ i j, A i j = B i j + c i * B k j), det A = det B
-- Mathlib/Geometry/Euclidean/Triangle.lean
/-- **Pons asinorum**, vector angle form. -/
theorem angle_sub_eq_angle_sub_rev_of_norm_eq {x y : V} (h : ‖x‖ = ‖y‖) :
    angle x (x - y) = angle y (y - x)
-- Mathlib/Computability/Primrec.lean
theorem sub : Nat.Primrec (unpaired (· - ·))
-- Mathlib/Analysis/BoxIntegral/Partition/Split.lean
theorem splitUpper_def [DecidableEq ι] {i x} (h : x ∈ Ioo (I.lower i) (I.upper i))
    (h' : ∀ j, update I.lower i x j < I.upper j :=
      (forall_update_iff I.lower fun j y => y < I.upper j).2
        ⟨h.2, fun j _ => I.lower_lt_upper _⟩) :
    I.splitUpper i x = (⟨update I.lower i x, I.upper, h'⟩ : Box ι)
-- Mathlib/Probability/Independence/Basic.lean
theorem indepSets_of_indepSets_of_le_right {s₁ s₂ s₃ : Set (Set Ω)}
    (h_indep : IndepSets s₁ s₂ μ) (h32 : s₃ ⊆ s₂) :
    IndepSets s₁ s₃ μ
-- .lake/packages/batteries/Batteries/Data/Rat/Lemmas.lean
theorem mkRat_self (a : Rat) : mkRat a.num a.den = a
-- Mathlib/Computability/TMToPartrec.lean
theorem tr_ret_fix (f k) : tr (Λ'.ret (Cont'.fix f k)) = pop' main (goto fun s =>
    cond (natEnd s.iget) (Λ'.ret k) <| Λ'.clear natEnd main <| trNormal f (Cont'.fix f k))
-- Mathlib/MeasureTheory/Measure/GiryMonad.lean
theorem measurable_dirac : Measurable (Measure.dirac : α → Measure α)
-- Mathlib/AlgebraicGeometry/PrimeSpectrum/Basic.lean
theorem isClosed_iff_zeroLocus_radical_ideal (Z : Set (PrimeSpectrum R)) :
    IsClosed Z ↔ ∃ I : Ideal R, I.IsRadical ∧ Z = zeroLocus I
-- Mathlib/Data/Set/Pointwise/Interval.lean
@[simp]
theorem preimage_neg_Iio : -Iio a = Ioi (-a)
-- Mathlib/Data/List/Indexes.lean
theorem findIdx_le_length (p : α → Bool) {xs : List α} : xs.findIdx p ≤ xs.length
-- Mathlib/Analysis/Calculus/Deriv/Basic.lean
theorem Filter.EventuallyEq.hasDerivAt_iff (h : f₀ =ᶠ[𝓝 x] f₁) :
    HasDerivAt f₀ f' x ↔ HasDerivAt f₁ f' x
-- Mathlib/Algebra/BigOperators/RingEquiv.lean
/-- An isomorphism into the opposite ring acts on the product by acting on the reversed elements -/
protected theorem unop_map_list_prod [Semiring R] [Semiring S] (f : R ≃+* Sᵐᵒᵖ) (l : List R) :
    MulOpposite.unop (f l.prod) = (l.map (MulOpposite.unop ∘ f)).reverse.prod
-- Mathlib/Dynamics/Circle/RotationNumber/TranslationNumber.lean
theorem transnumAuxSeq_dist_lt (n : ℕ) :
    dist (f.transnumAuxSeq n) (f.transnumAuxSeq (n + 1)) < 1 / 2 / 2 ^ n
-- Mathlib/Order/Filter/Prod.lean
@[simp]
theorem prod_pure {b : β} : f ×ˢ pure b = map (fun a => (a, b)) f
-- Mathlib/NumberTheory/Liouville/LiouvilleWith.lean
@[simp]
theorem add_rat_iff : LiouvilleWith p (x + r) ↔ LiouvilleWith p x
-- Mathlib/Data/Pi/Interval.lean
theorem card_Ioc : (Ioc a b).card = (∏ i, (Icc (a i) (b i)).card) - 1
-- Mathlib/SetTheory/Cardinal/Cofinality.lean
theorem id_of_le_cof (h : o ≤ o.cof.ord) : IsFundamentalSequence o o fun a _ => a
-- Mathlib/Order/Filter/AtTopBot.lean
theorem Eventually.exists_forall_of_atBot [SemilatticeInf α] [Nonempty α] {p : α → Prop}
    (h : ∀ᶠ x in atBot, p x) : ∃ a, ∀ b ≤ a, p b
-- Mathlib/Topology/Order/LowerUpperTopology.lean
/-- Every set open in the lower topology is a lower set. -/
theorem isLowerSet_of_isOpen (h : IsOpen s) : IsLowerSet s
-- Mathlib/Order/Hom/CompleteLattice.lean
@[simp, norm_cast]
theorem supsSupHom_apply : supsSupHom x = x.1 ⊔ x.2
-- Mathlib/Probability/Martingale/Upcrossing.lean
theorem upcrossingsBefore_pos_eq (hab : a < b) :
    upcrossingsBefore 0 (b - a) (fun n ω => (f n ω - a)⁺) N ω = upcrossingsBefore a b f N ω
-- Mathlib/RingTheory/IsAdjoinRoot.lean
theorem Algebra.adjoin.powerBasis'_minpoly_gen [IsDomain R] [IsDomain S] [NoZeroSMulDivisors R S]
    [IsIntegrallyClosed R] {x : S} (hx' : IsIntegral R x) :
    minpoly R x = minpoly R (Algebra.adjoin.powerBasis' hx').gen
-- Mathlib/FieldTheory/Adjoin.lean
@[simp]
theorem adjoin_le_iff {S : Set E} {T : IntermediateField F E} : adjoin F S ≤ T ↔ S ≤ T
-- Mathlib/Algebra/Algebra/Subalgebra/Directed.lean
@[simp]
theorem iSupLift_inclusion {dir : Directed (· ≤ ·) K} {f : ∀ i, K i →ₐ[R] B}
    {hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (inclusion h)}
    {T : Subalgebra R A} {hT : T = iSup K} {i : ι} (x : K i) (h : K i ≤ T) :
    iSupLift K dir f hf T hT (inclusion h x) = f i x
-- Mathlib/Geometry/Euclidean/Sphere/Basic.lean
theorem Sphere.center_ne_iff_ne_of_mem {s₁ s₂ : Sphere P} {p : P} (hs₁ : p ∈ s₁) (hs₂ : p ∈ s₂) :
    s₁.center ≠ s₂.center ↔ s₁ ≠ s₂
-- Mathlib/LinearAlgebra/AffineSpace/AffineEquiv.lean
@[simp]
theorem toAffineMap_mk (f : P₁ ≃ P₂) (f' : V₁ ≃ₗ[k] V₂) (h) :
    toAffineMap (mk f f' h) = ⟨f, f', h⟩
-- Mathlib/Data/List/OfFn.lean
theorem getElem_ofFn_go {n} (f : Fin n → α) (i j h) (k) (hk : k < (ofFn.go f i j h).length) :
    (ofFn.go f i j h)[k] = f ⟨j + k, by simp at hk; omega⟩
-- Mathlib/MeasureTheory/Measure/MeasureSpace.lean
theorem le_toMeasure_apply (m : OuterMeasure α) (h : ms ≤ m.caratheodory) (s : Set α) :
    m s ≤ m.toMeasure h s
-- Mathlib/Algebra/Order/CauSeq/Basic.lean
theorem inv_mul_cancel {f : CauSeq β abv} (hf) : inv f hf * f ≈ 1
-- Mathlib/Data/Finset/Piecewise.lean
lemma piecewise_compl [DecidableEq ι] (s : Finset ι) [∀ i, Decidable (i ∈ s)]
    [∀ i, Decidable (i ∈ sᶜ)] (f g : ∀ i, π i) :
    sᶜ.piecewise f g = s.piecewise g f
-- Mathlib/Data/Matroid/Map.lean
@[simp] lemma mapEquiv_ground_eq (M : Matroid α) (f : α ≃ β) :
    (M.mapEquiv f).E = f '' M.E
-- .lake/packages/lean4/src/lean/Init/Data/String/Basic.lean
@[simp] theorem data_append (s t : String) : (s ++ t).data = s.data ++ t.data
-- Mathlib/Data/Matrix/ColumnRowPartitioned.lean
/-- A row partitioned matrix multiplied by a column partioned matrix gives a 2 by 2 block matrix -/
lemma fromRows_mul_fromColumns (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R)
    (B₁ : Matrix n n₁ R) (B₂ : Matrix n n₂ R) :
    (fromRows A₁ A₂) * (fromColumns B₁ B₂) =
      fromBlocks (A₁ * B₁) (A₁ * B₂) (A₂ * B₁) (A₂ * B₂)
-- Mathlib/Analysis/SpecialFunctions/Gamma/Deligne.lean
lemma Gammaℂ_add_one {s : ℂ} (hs : s ≠ 0) : Gammaℂ (s + 1) = Gammaℂ s * s / 2 / π
-- Mathlib/Order/Interval/Finset/Nat.lean
theorem card_fintypeIcc : Fintype.card (Set.Icc a b) = b + 1 - a
-- Mathlib/MeasureTheory/Measure/VectorMeasure.lean
@[simp]
theorem neg_le_neg_iff {i : Set α} (hi : MeasurableSet i) : -w ≤[i] -v ↔ v ≤[i] w
-- Mathlib/Algebra/Quandle.lean
@[simp]
theorem op_invAct_op_eq {x y : R} : op x ◃⁻¹ op y = op (x ◃ y)
-- Mathlib/Data/Seq/Seq.lean
@[simp]
theorem get?_cons_succ (a : α) (s : Seq α) (n : ℕ) : (cons a s).get? (n + 1) = s.get? n
-- Mathlib/Algebra/Order/Monoid/Unbundled/WithTop.lean
@[simp] lemma natCast_ne_bot (n : ℕ) : (n : WithBot α) ≠ ⊥
-- Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean
theorem doublingGamma_log_convex_Ioi : ConvexOn ℝ (Ioi (0 : ℝ)) (log ∘ doublingGamma)
-- Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean
@[aesop safe 20 apply (rule_sets := [SetLike])]
theorem subset_adjoin {s : Set A} : s ⊆ adjoin R s
-- Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean
theorem isometry_pos_mul (a : { x : ℝ // 0 < x }) : Isometry (a • · : ℍ → ℍ)
-- Mathlib/Data/Multiset/Sum.lean
@[simp]
theorem inr_mem_disjSum : inr b ∈ s.disjSum t ↔ b ∈ t
-- Mathlib/Analysis/SpecialFunctions/Integrals.lean
@[simp]
theorem integral_sin_sq : ∫ x in a..b, sin x ^ 2 = (sin a * cos a - sin b * cos b + b - a) / 2
-- Mathlib/Data/Fintype/Card.lean
theorem card_le_of_embedding (f : α ↪ β) : card α ≤ card β
-- Mathlib/Data/Matrix/ColumnRowPartitioned.lean
@[simp]
lemma toRows₁_fromRows  (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) :
    toRows₁ (fromRows A₁ A₂) = A₁
-- Mathlib/Analysis/Convex/Radon.lean
/-- **Helly's theorem** for families of compact convex sets.

If `F` is a family of compact convex sets in a vector space of finite dimension `d`, and any
`k ≤ d + 1` sets of `F` intersect nontrivially, then all sets of `F` intersect nontrivially. -/
theorem helly_theorem_compact' [TopologicalSpace E] [T2Space E] {F : ι → Set E}
    (h_convex : ∀ i, Convex 𝕜 (F i)) (h_compact : ∀ i, IsCompact (F i))
    (h_inter : ∀ I : Finset ι, I.card ≤ finrank 𝕜 E + 1 → (⋂ i ∈ I, F i).Nonempty) :
    (⋂ i, F i).Nonempty
-- Mathlib/RingTheory/DedekindDomain/Ideal.lean
theorem inv_nonzero {J : FractionalIdeal R₁⁰ K} (h : J ≠ 0) :
    J⁻¹ = ⟨(1 : FractionalIdeal R₁⁰ K) / J, fractional_div_of_nonzero h⟩
-- Mathlib/Data/Nat/Defs.lean
lemma dvd_iff_dvd_dvd (n d : ℕ) : d ∣ n ↔ ∀ k : ℕ, k ∣ d → k ∣ n