ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
-- Mathlib/GroupTheory/PushoutI.lean
theorem base_smul_def' (h : H) (w : NormalWord d) :
    h • w = { w with head := h * w.head }
-- .lake/packages/lean4/src/lean/Init/Data/Fin/Lemmas.lean
/-- For rewriting in the reverse direction, see `Fin.cast_addNat_left`. -/
theorem addNat_cast {n n' m : Nat} (i : Fin n') (h : n' = n) :
    addNat (cast h i) m = cast (congrArg (. + m) h) (addNat i m)
-- Mathlib/Combinatorics/Quiver/Path.lean
@[simp]
theorem length_nil {a : V} : (nil : Path a a).length = 0
-- Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean
theorem tanh_half_dist (z w : ℍ) :
    tanh (dist z w / 2) = dist (z : ℂ) w / dist (z : ℂ) (conj ↑w)
-- Mathlib/Combinatorics/Young/SemistandardTableau.lean
@[simp]
theorem highestWeight_apply {μ : YoungDiagram} {i j : ℕ} :
    highestWeight μ i j = if (i, j) ∈ μ then i else 0
-- Mathlib/RingTheory/OreLocalization/Basic.lean
@[to_additive]
theorem smul_oreDiv (r : R) (x : X) (s : S) :
    r • (x /ₒ s) = oreNum (r • 1) s • x /ₒ oreDenom (r • 1) s
-- .lake/packages/lean4/src/lean/Init/Data/Option/Lemmas.lean
theorem bex_ne_none {p : Option α → Prop} : (∃ x, ∃ (_ : x ≠ none), p x) ↔ ∃ x, p (some x)
-- Mathlib/Topology/Constructions.lean
@[simp 1100]
theorem continuous_sigma_map {f₁ : ι → κ} {f₂ : ∀ i, σ i → τ (f₁ i)} :
    Continuous (Sigma.map f₁ f₂) ↔ ∀ i, Continuous (f₂ i)
-- Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean
theorem cokernel_not_mono_of_nonzero (w : f ≠ 0) : ¬Mono (cokernel.π f)
-- Mathlib/Data/Subtype.lean
/-- An alternative version of `Subtype.exists`. This one is useful if Lean cannot figure out `q`
  when using `Subtype.exists` from right to left. -/
protected theorem exists' {q : ∀ x, p x → Prop} : (∃ x h, q x h) ↔ ∃ x : { a // p a }, q x x.2
-- Mathlib/Data/Real/Basic.lean
private theorem le_def' {x y : ℝ} : x ≤ y ↔ x < y ∨ x = y
-- Mathlib/Order/Hom/Lattice.lean
@[simp]
theorem dual_id : SupHom.dual (SupHom.id α) = InfHom.id _
-- Mathlib/NumberTheory/Liouville/LiouvilleWith.lean
theorem rat_mul (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (r * x)
-- Mathlib/Topology/Instances/EReal.lean
theorem closedEmbedding_coe_ennreal : ClosedEmbedding ((↑) : ℝ≥0∞ → EReal)
-- Mathlib/Algebra/Group/Conj.lean
theorem mem_carrier_mk {a : α} : a ∈ carrier (ConjClasses.mk a)
-- Mathlib/LinearAlgebra/Finsupp.lean
@[simp]
theorem total_embDomain (f : α ↪ α') (l : α →₀ R) :
    (Finsupp.total α' M' R v') (embDomain f l) = (Finsupp.total α M' R (v' ∘ f)) l
-- Mathlib/Algebra/Category/CoalgebraCat/Basic.lean
@[simp] theorem toCoalgebraCatIso_refl :
    toCoalgebraCatIso (CoalgEquiv.refl R X) = .refl _
-- Mathlib/CategoryTheory/Triangulated/Opposite.lean
lemma mem_distinguishedTriangles_iff (T : Triangle Cᵒᵖ) :
    T ∈ distinguishedTriangles C ↔
      ((triangleOpEquivalence C).inverse.obj T).unop ∈ distTriang C
-- Mathlib/Data/PEquiv.lean
@[simp]
theorem single_subsingleton_eq_refl [Subsingleton α] (a b : α) : single a b = PEquiv.refl α
-- Mathlib/Algebra/Group/Indicator.lean
theorem indicator_one_preimage [Zero M] (U : Set α) (s : Set M) :
    U.indicator 1 ⁻¹' s ∈ ({Set.univ, U, Uᶜ, ∅} : Set (Set α))
-- .lake/packages/lean4/src/lean/Init/Core.lean
@[simp] theorem imp_false : (a → False) ↔ ¬a
-- Mathlib/Order/WithBot.lean
theorem toDual_le_iff {a : WithBot α} {b : WithTop αᵒᵈ} :
    WithBot.toDual a ≤ b ↔ WithTop.ofDual b ≤ a
-- Mathlib/Algebra/DirectLimit.lean
lemma lift_injective [Nonempty ι] [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift G f P g Hg)
-- Mathlib/Data/List/Perm.lean
theorem forall₂_comp_perm_eq_perm_comp_forall₂ : Forall₂ r ∘r Perm = Perm ∘r Forall₂ r
-- Mathlib/NumberTheory/Cyclotomic/Rat.lean
/-- The algebra isomorphism `adjoin ℤ {ζ} ≃ₐ[ℤ] (𝓞 K)`, where `ζ` is a primitive `p ^ k`-th root of
unity and `K` is a `p ^ k`-th cyclotomic extension of `ℚ`. -/
@[simps!]
noncomputable def _root_.IsPrimitiveRoot.adjoinEquivRingOfIntegers
    [IsCyclotomicExtension {p ^ k} ℚ K] (hζ : IsPrimitiveRoot ζ ↑(p ^ k)) :
    adjoin ℤ ({ζ} : Set K) ≃ₐ[ℤ] 𝓞 K
-- Mathlib/Analysis/SpecialFunctions/Pow/Real.lean
@[simp]
theorem rpow_lt_rpow_left_iff_of_base_lt_one (hx0 : 0 < x) (hx1 : x < 1) :
    x ^ y < x ^ z ↔ z < y
-- Mathlib/Analysis/Calculus/FDeriv/Basic.lean
theorem HasStrictFDerivAt.congr_of_eventuallyEq (h : HasStrictFDerivAt f f' x)
    (h₁ : f =ᶠ[𝓝 x] f₁) : HasStrictFDerivAt f₁ f' x
-- Mathlib/Data/Real/Sqrt.lean
theorem sq_le (h : 0 ≤ y) : x ^ 2 ≤ y ↔ -√y ≤ x ∧ x ≤ √y
-- Mathlib/Analysis/Complex/UpperHalfPlane/Basic.lean
@[simp]
theorem pos_real_im : (x • z).im = x * z.im
-- Mathlib/Analysis/NormedSpace/OperatorNorm/Basic.lean
theorem norm_subtypeL_le (K : Submodule 𝕜 E) : ‖K.subtypeL‖ ≤ 1
-- Mathlib/Algebra/Homology/HomotopyCategory/HomComplexShift.lean
/-- The linear equivalence `Cochain K L n ≃+ Cochain K L⟦a⟧ n'` when `n' + a = n` and
the category is `R`-linear. -/
@[simps!]
def rightShiftLinearEquiv (n a n' : ℤ) (hn' : n' + a = n) :
    Cochain K L n ≃ₗ[R] Cochain K (L⟦a⟧) n'
-- Mathlib/Data/Nat/Defs.lean
@[simp] lemma mod_mul_mod (a b c : ℕ) : (a % c * b) % c = a * b % c
-- Mathlib/CategoryTheory/Iso.lean
theorem hom_comp_eq_id (g : X ⟶ Y) [IsIso g] {f : Y ⟶ X} : g ≫ f = 𝟙 X ↔ f = inv g
-- Mathlib/Geometry/Manifold/SmoothManifoldWithCorners.lean
@[simp, mfld_simps]
protected theorem right_inv {x : E} (hx : x ∈ range I) : I (I.symm x) = x
-- Mathlib/Order/Interval/Finset/Basic.lean
@[simp]
theorem Ioc_insert_left (h : a ≤ b) : insert a (Ioc a b) = Icc a b
-- Mathlib/LinearAlgebra/Dual.lean
theorem dualCopairing_eq (W : Submodule R M) :
    W.dualCopairing = (dualQuotEquivDualAnnihilator W).symm.toLinearMap
-- Mathlib/Data/Nat/PartENat.lean
theorem add_one_le_of_lt {x y : PartENat} (h : x < y) : x + 1 ≤ y
-- .lake/packages/lean4/src/lean/Init/Data/BitVec/Basic.lean
@[simp] theorem cast_ofNat {n m : Nat} (h : n = m) (x : Nat) :
    cast h (BitVec.ofNat n x) = BitVec.ofNat m x
-- Mathlib/Analysis/Calculus/FDeriv/Add.lean
@[fun_prop]
theorem DifferentiableWithinAt.const_sub (hf : DifferentiableWithinAt 𝕜 f s x) (c : F) :
    DifferentiableWithinAt 𝕜 (fun y => c - f y) s x
-- Mathlib/Algebra/MvPolynomial/Basic.lean
/-- Analog of `Polynomial.induction_on'`.
To prove something about mv_polynomials,
it suffices to show the condition is closed under taking sums,
and it holds for monomials. -/
@[elab_as_elim]
theorem induction_on' {P : MvPolynomial σ R → Prop} (p : MvPolynomial σ R)
    (h1 : ∀ (u : σ →₀ ℕ) (a : R), P (monomial u a))
    (h2 : ∀ p q : MvPolynomial σ R, P p → P q → P (p + q)) : P p
-- Mathlib/Data/Matroid/Sum.lean
lemma Base.eq_union_image_of_disjointSum {h B} (hB : (disjointSum M N h).Base B) :
    ∃ BM BN, M.Base BM ∧ N.Base BN ∧ Disjoint BM BN ∧ B = BM ∪ BN
-- Mathlib/Data/ENNReal/Inv.lean
theorem div_le_of_le_mul (h : a ≤ b * c) : a / c ≤ b
-- Mathlib/CategoryTheory/Sites/Sieves.lean
theorem pullback_singleton [HasPullbacks C] (g : Z ⟶ X) :
    pullbackArrows f (singleton g) = singleton (pullback.snd g f)
-- Mathlib/CategoryTheory/Localization/Predicate.lean
/-- Given a localization functor `L : C ⥤ D` for `W : MorphismProperty C`,
if `(F₁' F₂' : D ⥤ E)` are functors which lifts functors `(F₁ F₂ : C ⥤ E)`,
a natural isomorphism `τ : F₁ ⟶ F₂` lifts to a natural isomorphism `F₁' ⟶ F₂'`. -/
@[simps]
def liftNatIso (F₁ F₂ : C ⥤ E) (F₁' F₂' : D ⥤ E) [h₁ : Lifting L W F₁ F₁'] [h₂ : Lifting L W F₂ F₂']
    (e : F₁ ≅ F₂) : F₁' ≅ F₂'
-- Mathlib/GroupTheory/SpecificGroups/Dihedral.lean
/-- If `0 < n`, then `i : ZMod n` has order `n / gcd n i`.
-/
theorem orderOf_r [NeZero n] (i : ZMod n) : orderOf (r i) = n / Nat.gcd n i.val
-- Mathlib/Algebra/Module/Equiv/Defs.lean
@[simp]
theorem refl_apply [Module R M] (x : M) : refl R M x = x
-- Mathlib/Data/Finset/Lattice.lean
@[simp]
theorem sup_cons {b : β} (h : b ∉ s) : (cons b s h).sup f = f b ⊔ s.sup f
-- Mathlib/Data/Part.lean
theorem union_def [Union α] (a b : Part α) : a ∪ b = bind a fun y => map (y ∪ ·) b
-- Mathlib/Computability/Primrec.lean
theorem subtype_val {p : α → Prop} [DecidablePred p] {hp : PrimrecPred p} :
    haveI := Primcodable.subtype hp
    Primrec (@Subtype.val α p)
-- Mathlib/Data/Nat/Factorial/DoubleFactorial.lean
theorem doubleFactorial_two_mul : ∀ n : ℕ, (2 * n)‼ = 2 ^ n * n !
-- Mathlib/MeasureTheory/Integral/SetIntegral.lean
theorem integral_comp_comm (L : E →ₗᵢ[𝕜] F) (φ : X → E) : ∫ x, L (φ x) ∂μ = L (∫ x, φ x ∂μ)
-- Mathlib/Analysis/Complex/Basic.lean
@[simp 1100]
theorem norm_rat (r : ℚ) : ‖(r : ℂ)‖ = |(r : ℝ)|
-- Mathlib/Algebra/Polynomial/EraseLead.lean
theorem card_support_eq_one : f.support.card = 1 ↔
    ∃ (k : ℕ) (x : R) (hx : x ≠ 0), f = C x * X ^ k
-- .lake/packages/lean4/src/lean/Init/Data/Nat/Basic.lean
protected theorem sub_eq_iff_eq_add {c : Nat} (h : b ≤ a) : a - b = c ↔ a = c + b
-- Mathlib/Combinatorics/SimpleGraph/Triangle/Basic.lean
@[simp] lemma locallyLinear_bot : (⊥ : SimpleGraph α).LocallyLinear
-- Mathlib/Geometry/Euclidean/Angle/Oriented/RightAngle.lean
/-- The sine of an angle in a right-angled triangle as a ratio of sides, version subtracting
vectors. -/
theorem sin_oangle_sub_left_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    Real.Angle.sin (o.oangle (x - y) x) = ‖y‖ / ‖x - y‖
-- Mathlib/Probability/Kernel/Disintegration/CdfToKernel.lean
lemma setIntegral_stieltjesOfMeasurableRat_rat (hf : IsRatCondKernelCDF f κ ν) (a : α) (q : ℚ)
    {s : Set β} (hs : MeasurableSet s) :
    ∫ b in s, stieltjesOfMeasurableRat f hf.measurable (a, b) q ∂(ν a)
      = (κ a (s ×ˢ Iic (q : ℝ))).toReal
-- Mathlib/RingTheory/HahnSeries/Summable.lean
@[simp]
theorem embDomain_notin_range (h : b ∉ Set.range f) : s.embDomain f b = 0
-- Mathlib/MeasureTheory/OuterMeasure/AE.lean
theorem ae_le_set_union {s' t' : Set α} (h : s ≤ᵐ[μ] t) (h' : s' ≤ᵐ[μ] t') :
    (s ∪ s' : Set α) ≤ᵐ[μ] (t ∪ t' : Set α)
-- Mathlib/Algebra/Group/Subgroup/Basic.lean
@[to_additive]
theorem Normal.subgroupOf {H : Subgroup G} (hH : H.Normal) (K : Subgroup G) :
    (H.subgroupOf K).Normal
-- Mathlib/Analysis/NormedSpace/Exponential.lean
theorem exp_neg_of_mem_ball [CharZero 𝕂] [CompleteSpace 𝔸] {x : 𝔸}
    (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) : exp 𝕂 (-x) = (exp 𝕂 x)⁻¹
-- .lake/packages/lean4/src/lean/Init/Data/Fin/Lemmas.lean
theorem val_mul {n : Nat} : ∀ a b : Fin n, (a * b).val = a.val * b.val % n
-- Mathlib/Algebra/Module/LinearMap/Defs.lean
@[simp]
theorem restrictScalars_add (f g : M →ₗ[S] N) :
    (f + g).restrictScalars R = f.restrictScalars R + g.restrictScalars R
-- Mathlib/Logic/Equiv/TransferInstance.lean
/-- Transfer `Nontrivial` across an `Equiv` -/
protected theorem nontrivial [Nontrivial β] : Nontrivial α
-- Mathlib/RingTheory/AdicCompletion/Functoriality.lean
@[simp]
theorem sumInv_apply (x : AdicCompletion I (⨁ j, M j)) (j : ι) :
    (sumInv I M x) j = map I (component R ι _ j) x
-- Mathlib/Algebra/Regular/SMul.lean
lemma Equiv.isSMulRegular_congr {R S M M'} [SMul R M] [SMul S M'] {e : M ≃ M'}
    {r : R} {s : S} (h : ∀ x, e (r • x) = s • e x) :
    IsSMulRegular M r ↔ IsSMulRegular M' s
-- Mathlib/ModelTheory/Definability.lean
@[simp]
theorem mem_inf : x ∈ s ⊓ t ↔ x ∈ s ∧ x ∈ t
-- Mathlib/CategoryTheory/Action.lean
@[simp]
protected theorem comp_val {x y z : ActionCategory M X} (f : x ⟶ y) (g : y ⟶ z) :
    (f ≫ g).val = g.val * f.val
-- Mathlib/LinearAlgebra/Dual.lean
@[simp]
lemma dualCoannihilator_range_eq_ker_flip (B : M →ₗ[R] M' →ₗ[R] R) :
    (range B).dualCoannihilator = LinearMap.ker B.flip
-- Mathlib/Data/Set/Pointwise/Interval.lean
@[simp]
theorem preimage_mul_const_Ioi (a : α) {c : α} (h : 0 < c) :
    (fun x => x * c) ⁻¹' Ioi a = Ioi (a / c)
-- Mathlib/Order/Interval/Set/WithBotTop.lean
theorem image_coe_Ioc : (some : α → WithTop α) '' Ioc a b = Ioc (a : WithTop α) b
-- Mathlib/Analysis/SpecificLimits/Normed.lean
theorem summable_of_ratio_test_tendsto_lt_one {α : Type*} [NormedAddCommGroup α] [CompleteSpace α]
    {f : ℕ → α} {l : ℝ} (hl₁ : l < 1) (hf : ∀ᶠ n in atTop, f n ≠ 0)
    (h : Tendsto (fun n ↦ ‖f (n + 1)‖ / ‖f n‖) atTop (𝓝 l)) : Summable f
-- Mathlib/Topology/ContinuousFunction/ZeroAtInfty.lean
theorem isClosed_range_toBCF : IsClosed (range (toBCF : C₀(α, β) → α →ᵇ β))
-- Mathlib/Order/Filter/NAry.lean
theorem map₂_mono (hf : f₁ ≤ f₂) (hg : g₁ ≤ g₂) : map₂ m f₁ g₁ ≤ map₂ m f₂ g₂
-- Mathlib/CategoryTheory/Comma/Arrow.lean
/-- We can also build a morphism in the arrow category out of any commutative square in `T`. -/
@[simps]
def homMk' {X Y : T} {f : X ⟶ Y} {P Q : T} {g : P ⟶ Q} {u : X ⟶ P} {v : Y ⟶ Q} (w : u ≫ g = f ≫ v) :
    Arrow.mk f ⟶ Arrow.mk g
-- Mathlib/Data/Nat/Totient.lean
theorem totient_eq_card_coprime (n : ℕ) : φ n = ((range n).filter n.Coprime).card
-- Mathlib/CategoryTheory/Limits/TypesFiltered.lean
theorem rel_of_quot_rel (x y : Σ j, F.obj j) :
    Quot.Rel F x y → FilteredColimit.Rel.{v, u} F x y
-- Mathlib/Analysis/Convex/Jensen.lean
/-- **Maximum principle** for convex functions on an interval. If a function `f` is convex on the
interval `[x, y]`, then the eventual maximum of `f` on `[x, y]` is at `x` or `y`. -/
lemma ConvexOn.le_max_of_mem_Icc {f : 𝕜 → β} {x y z : 𝕜} (hf : ConvexOn 𝕜 (Icc x y) f)
    (hz : z ∈ Icc x y) : f z ≤ max (f x) (f y)
-- Mathlib/CategoryTheory/Abelian/NonPreadditive.lean
theorem neg_sub {X Y : C} (a b : X ⟶ Y) : -a - b = -b - a
-- Mathlib/CategoryTheory/Subobject/Comma.lean
/-- Projecting and then lifting a quotient recovers the original quotient, because there is at most
    one morphism making the projected quotient into a costructured arrow. -/
theorem lift_projectQuotient [HasColimits C] [PreservesColimits S] {A : CostructuredArrow S T} :
    ∀ (P : Subobject (op A)) {q} (hq : S.map (projectQuotient P).arrow.unop ≫ q = A.hom),
      liftQuotient (projectQuotient P) hq = P
-- Mathlib/Analysis/Convex/Star.lean
theorem StarConvex.neg (hs : StarConvex 𝕜 x s) : StarConvex 𝕜 (-x) (-s)
-- Mathlib/Order/Filter/EventuallyConst.lean
@[simp] protected lemma bot : EventuallyConst f ⊥
-- Mathlib/Topology/MetricSpace/Contracting.lean
theorem edist_efixedPoint_le (hf : ContractingWith K f) {x : α} (hx : edist x (f x) ≠ ∞) :
    edist x (efixedPoint f hf x hx) ≤ edist x (f x) / (1 - K)
-- Mathlib/Algebra/Module/Basic.lean
lemma indicator_smul_apply_left (s : Set α) (r : α → R) (f : α → M) (a : α) :
    indicator s (fun a ↦ r a • f a) a = indicator s r a • f a
-- Mathlib/Algebra/Order/CompleteField.lean
theorem inducedMap_nonneg (ha : 0 ≤ a) : 0 ≤ inducedMap α β a
-- Mathlib/Analysis/BoxIntegral/Basic.lean
theorem integralSum_biUnionTagged (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) (π : Prepartition I)
    (πi : ∀ J, TaggedPrepartition J) :
    integralSum f vol (π.biUnionTagged πi) = ∑ J ∈ π.boxes, integralSum f vol (πi J)
-- Mathlib/Algebra/Algebra/Equiv.lean
@[ext]
theorem ext {f g : A₁ ≃ₐ[R] A₂} (h : ∀ a, f a = g a) : f = g
-- Mathlib/Order/GaloisConnection.lean
theorem upperBounds_l_image (gc : GaloisConnection l u) (s : Set α) :
    upperBounds (l '' s) = u ⁻¹' upperBounds s
-- Mathlib/LinearAlgebra/TensorProduct/Basic.lean
@[simp]
theorem lift.tmul (x y) : lift f (x ⊗ₜ y) = f x y
-- Mathlib/Algebra/Algebra/Spectrum.lean
theorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A)
-- Mathlib/Data/Nat/Defs.lean
/-- A subset of `ℕ` containing `k : ℕ` and closed under `Nat.succ` contains every `n ≥ k`. -/
lemma set_induction_bounded {S : Set ℕ} (hk : k ∈ S) (h_ind : ∀ k : ℕ, k ∈ S → k + 1 ∈ S)
    (hnk : k ≤ n) : n ∈ S
-- Mathlib/RingTheory/Ideal/MinimalPrime.lean
theorem Ideal.minimalPrimes_eq_subsingleton_self [I.IsPrime] : I.minimalPrimes = {I}
-- Mathlib/GroupTheory/Perm/Fin.lean
theorem isCycle_finRotate {n : ℕ} : IsCycle (finRotate (n + 2))
-- Mathlib/Algebra/Module/Submodule/LinearMap.lean
/-- Note the `AddSubmonoid` version of this lemma is called `AddSubmonoid.coe_finset_sum`. -/
-- Porting note: removing the `@[simp]` attribute since it's literally `AddSubmonoid.coe_finset_sum`
theorem coe_sum (x : ι → p) (s : Finset ι) : ↑(∑ i ∈ s, x i) = ∑ i ∈ s, (x i : M)
-- Mathlib/ModelTheory/Semantics.lean
theorem realize_equivSentence_symm (φ : L[[α]].Sentence) (v : α → M) :
    (equivSentence.symm φ).Realize v ↔
      @Sentence.Realize _ M (@Language.withConstantsStructure L M _ α (constantsOn.structure v))
        φ
-- Mathlib/Algebra/Group/Units/Equiv.lean
@[to_additive (attr := simp)]
theorem mulRight_symm (a : G) : (Equiv.mulRight a).symm = Equiv.mulRight a⁻¹
-- Mathlib/Algebra/BigOperators/Group/Finset.lean
@[to_additive]
theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : ∏ x ∈ s, f x ^ n = (∏ x ∈ s, f x) ^ n
-- Mathlib/Data/Bool/Count.lean
@[simp]
theorem count_false_add_count_true (l : List Bool) : count false l + count true l = length l
-- Mathlib/Algebra/Category/AlgebraCat/Basic.lean
@[simp]
lemma forget₂_module_map {X Y : AlgebraCat.{v} R} (f : X ⟶ Y) :
    (forget₂ (AlgebraCat.{v} R) (ModuleCat.{v} R)).map f = ModuleCat.ofHom f.toLinearMap
-- Mathlib/MeasureTheory/Measure/AEDisjoint.lean
theorem of_null_left (h : μ s = 0) : AEDisjoint μ s t
-- Mathlib/CategoryTheory/Linear/Basic.lean
@[simp]
lemma comp_units_smul {X Y Z : C} (f : X ⟶ Y) (r : Rˣ) (g : Y ⟶ Z) :
    f ≫ (r • g) = r • f ≫ g
-- Mathlib/Algebra/Order/Ring/Abs.lean
lemma pow_eq_pow_iff_cases : a ^ n = b ^ n ↔ n = 0 ∨ a = b ∨ a = -b ∧ Even n
-- Mathlib/Data/Int/Defs.lean
protected lemma ge_of_eq (hab : a = b) : b ≤ a
-- Mathlib/Data/TypeVec.lean
theorem eq_nilFun {α β : TypeVec 0} (f : α ⟹ β) : f = nilFun
-- .lake/packages/lean4/src/lean/Init/Data/List/Lemmas.lean
@[simp] theorem unzip_replicate {n : Nat} {a : α} {b : β} :
    unzip (replicate n (a, b)) = (replicate n a, replicate n b)
-- Mathlib/Combinatorics/Additive/AP/Three/Defs.lean
lemma Fin.addRothNumber_le_rothNumberNat (k n : ℕ) (hkn : k ≤ n) :
    addRothNumber (Iio k : Finset (Fin n.succ)) ≤ rothNumberNat k
-- Mathlib/Topology/LocalAtTarget.lean
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isClosedMap (s : Set β) (H : IsClosedMap f) :
    IsClosedMap (s.restrictPreimage f)
-- Mathlib/RingTheory/FractionalIdeal/Operations.lean
theorem eq_one_div_of_mul_eq_one_right (I J : FractionalIdeal R₁⁰ K) (h : I * J = 1) :
    J = 1 / I
-- Mathlib/Geometry/Euclidean/Sphere/Basic.lean
/-- Two points are concyclic. -/
theorem concyclic_pair (p₁ p₂ : P) : Concyclic ({p₁, p₂} : Set P)
-- Mathlib/Computability/TMToPartrec.lean
@[simp]
theorem codeSupp_comp (f g k) :
    codeSupp (Code.comp f g) k =
      trStmts₁ (trNormal (Code.comp f g) k) ∪ codeSupp g (Cont'.comp f k)
-- Mathlib/RingTheory/DedekindDomain/Ideal.lean
theorem Ideal.le_mul_of_no_prime_factors {I J K : Ideal R}
    (coprime : ∀ P, J ≤ P → K ≤ P → ¬IsPrime P) (hJ : I ≤ J) (hK : I ≤ K) : I ≤ J * K
-- Mathlib/CategoryTheory/Monoidal/Internal/FunctorCategory.lean
/-- The unit for the equivalence `Comon_ (C ⥤ D) ≌ C ⥤ Comon_ D`.
-/
@[simps!]
private def unitIso : 𝟭 (Comon_ (C ⥤ D)) ≅ functor ⋙ inverse
-- Mathlib/Algebra/Homology/HomologySequence.lean
@[reassoc (attr := simp)]
lemma pOpcycles_opcyclesToCycles :
    K.pOpcycles i ≫ K.opcyclesToCycles i j = K.toCycles i j
-- Mathlib/Data/List/Basic.lean
theorem insert_neg [DecidableEq α] {x : α} {l : List α} (h : x ∉ l) :
    Insert.insert x l = x :: l
-- Mathlib/Algebra/DirectSum/Module.lean
/-- The map constructed using the universal property gives back the original maps when
restricted to each component. -/
@[simp]
theorem toModule_lof (i) (x : M i) : toModule R ι N φ (lof R ι M i x) = φ i x
-- Mathlib/SetTheory/Cardinal/Basic.lean
theorem mk_subtype_mono {p q : α → Prop} (h : ∀ x, p x → q x) :
    #{ x // p x } ≤ #{ x // q x }
-- Mathlib/Probability/Kernel/Disintegration/Unique.lean
/-- A finite kernel which satisfies the disintegration property is almost everywhere equal to the
disintegration kernel. -/
theorem eq_condKernel_of_measure_eq_compProd (κ : Kernel α Ω) [IsFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) :
    ∀ᵐ x ∂ρ.fst, κ x = ρ.condKernel x
-- Mathlib/Data/NNRat/Defs.lean
@[simp]
theorem coe_eq_zero : (q : ℚ) = 0 ↔ q = 0
-- .lake/packages/batteries/Batteries/Data/Array/Monadic.lean
theorem SatisfiesM_foldlM [Monad m] [LawfulMonad m]
    {as : Array α} (motive : Nat → β → Prop) {init : β} (h0 : motive 0 init) {f : β → α → m β}
    (hf : ∀ i : Fin as.size, ∀ b, motive i.1 b → SatisfiesM (motive (i.1 + 1)) (f b as[i])) :
    SatisfiesM (motive as.size) (as.foldlM f init)
-- Mathlib/Order/ModularLattice.lean
lemma Set.Iic.isCompl_inf_inf_of_isCompl_of_le [Lattice α] [BoundedOrder α] [IsModularLattice α]
    {a b c : α} (h₁ : IsCompl b c) (h₂ : b ≤ a) :
    IsCompl (⟨a ⊓ b, inf_le_left⟩ : Iic a) (⟨a ⊓ c, inf_le_left⟩ : Iic a)
-- Mathlib/FieldTheory/SplittingField/Construction.lean
/-- See note [fact non-instances]. -/
theorem fact_irreducible_factor (f : K[X]) : Fact (Irreducible (factor f))
-- Mathlib/Algebra/Associated/Basic.lean
theorem associated_of_dvd_dvd [CancelMonoidWithZero α] {a b : α} (hab : a ∣ b) (hba : b ∣ a) :
    a ~ᵤ b
-- Mathlib/CategoryTheory/Bicategory/Functor/Prelax.lean
/-- A prelaxfunctor `F` sends 2-isomorphisms `η : f ≅ f` to 2-isomorphisms `F.map f ≅ F.map g`. -/
@[simps!]
abbrev map₂Iso {f g : a ⟶ b} (η : f ≅ g) : F.map f ≅ F.map g
-- Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean
@[simp] lemma rpow_inv_rpow {y : ℝ} (hy : y ≠ 0) (x : ℝ≥0) : (x ^ y⁻¹) ^ y = x
-- Mathlib/CategoryTheory/Subobject/Limits.lean
theorem image_map_comp_imageSubobjectIso_inv {W X Y Z : C} {f : W ⟶ X} [HasImage f] {g : Y ⟶ Z}
    [HasImage g] (sq : Arrow.mk f ⟶ Arrow.mk g) [HasImageMap sq] :
    image.map sq ≫ (imageSubobjectIso _).inv =
      (imageSubobjectIso _).inv ≫ imageSubobjectMap sq
-- Mathlib/CategoryTheory/Linear/Basic.lean
/-- Composition by a fixed right argument as an `R`-linear map. -/
@[simps]
def rightComp (X : C) {Y Z : C} (g : Y ⟶ Z) : (X ⟶ Y) →ₗ[R] X ⟶ Z
-- Mathlib/LinearAlgebra/Matrix/IsDiag.lean
@[simp]
theorem isDiag_conjTranspose_iff [Semiring α] [StarRing α] {A : Matrix n n α} :
    Aᴴ.IsDiag ↔ A.IsDiag
-- Mathlib/Algebra/Group/Subgroup/Basic.lean
@[simp]
theorem _root_.AddSubgroup.toSubgroup_comap {A A₂ : Type*} [AddGroup A] [AddGroup A₂]
    (f : A →+ A₂)  (s : AddSubgroup A₂) :
    s.toSubgroup.comap (AddMonoidHom.toMultiplicative f) = AddSubgroup.toSubgroup (s.comap f)
-- Mathlib/Topology/MetricSpace/PiNat.lean
theorem update_mem_cylinder (x : ∀ n, E n) (n : ℕ) (y : E n) : update x n y ∈ cylinder x n
-- Mathlib/Order/Interval/Set/Basic.lean
theorem Iio_union_right : Iio a ∪ {a} = Iic a
-- Mathlib/Data/List/Destutter.lean
theorem destutter'_is_chain : ∀ l : List α, ∀ {a b}, R a b → (l.destutter' R b).Chain R a
-- Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean
theorem contravariant_lt_of_contravariant_le [PartialOrder N] :
    Contravariant M N μ (· ≤ ·) → Contravariant M N μ (· < ·)
-- Mathlib/Algebra/Module/LocalizedModule.lean
@[simp]
theorem lift_apply (g : M →ₗ[R] M'') (h) (x) :
    lift S f g h (f x) = g x
-- Mathlib/Data/Matroid/Map.lean
@[simp] lemma map_ground (M : Matroid α) (f : α → β) (hf) : (M.map f hf).E = f '' M.E
-- Mathlib/Data/Setoid/Partition.lean
lemma piecewise_apply {β : Type*} {f : ι → α → β} (x : α) : hs.piecewise f x = f (hs.index x) x
-- Mathlib/CategoryTheory/Types.lean
theorem injective_of_mono {X Y : Type u} (f : X ⟶ Y) [hf : Mono f] : Function.Injective f
-- Mathlib/Order/Filter/Prod.lean
theorem eventually_prod_iff {p : α × β → Prop} :
    (∀ᶠ x in f ×ˢ g, p x) ↔
      ∃ pa : α → Prop, (∀ᶠ x in f, pa x) ∧ ∃ pb : β → Prop, (∀ᶠ y in g, pb y) ∧
        ∀ {x}, pa x → ∀ {y}, pb y → p (x, y)
-- Mathlib/Order/Closure.lean
@[simp]
theorem closure_union_closure_right (x y : α) : l (x ∪ l y) = l (x ∪ y)
-- Mathlib/Analysis/Normed/Group/Basic.lean
@[simp]
theorem nnnorm_natCast (n : ℕ) : ‖(n : ℝ)‖₊ = n
-- Mathlib/FieldTheory/KrullTopology.lean
/-- Let `L/E/K` be a tower of fields with `E/K` finite. Then `Gal(L/E)` is an open subgroup of
  `L ≃ₐ[K] L`. -/
theorem IntermediateField.fixingSubgroup_isOpen {K L : Type*} [Field K] [Field L] [Algebra K L]
    (E : IntermediateField K L) [FiniteDimensional K E] :
    IsOpen (E.fixingSubgroup : Set (L ≃ₐ[K] L))
-- Mathlib/Order/Fin/Basic.lean
lemma strictMono_pred_comp (hf : ∀ a, f a ≠ 0) (hf₂ : StrictMono f) :
    StrictMono (fun a => pred (f a) (hf a))
-- Mathlib/Data/Complex/Exponential.lean
theorem cos_sq : cos x ^ 2 = 1 / 2 + cos (2 * x) / 2
-- Mathlib/Analysis/Asymptotics/Asymptotics.lean
theorem isLittleO_const_iff {c : F''} (hc : c ≠ 0) :
    (f'' =o[l] fun _x => c) ↔ Tendsto f'' l (𝓝 0)