lemma eq_image_iff_symm_image_eq (e : α ≃ᵐ β) (s : Set β) (t : Set α) :
    s = e '' t ↔ e.symm '' s = t

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(e : α ≃ᵐ β)
(s : Set β)
(t : Set α)


theorem IsSymmetric.coe_toSelfAdjoint (hT : IsSymmetric T) : (hT.toSelfAdjoint : E →ₗ[𝕜] E) = T

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
{T : E →ₗ[𝕜] E}
(hT : T.IsSymmetric)


theorem max_mul : max a b * c = max (a * c) (b * c)


theorem hasDerivAt_exp_smul_const (x : 𝔸) (t : 𝕂) :
    HasDerivAt (fun u : 𝕂 => exp 𝕂 (u • x)) (exp 𝕂 (t • x) * x) t

{𝕂 : Type u_1}
{𝔸 : Type u_3}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
(x : 𝔸)
(t : 𝕂)

HasDerivAt (fun u => NormedSpace.exp 𝕂 (u • x)) (NormedSpace.exp 𝕂 (t • x) * x) t


/--
If a series ``a₀ -r→ a₁ -r→ ... -r→ aₙ``, then `a₀ -r→ a₁ -r→ ... -r→ aₙ₋₁` is
another series -/
@[simps]
def eraseLast (p : RelSeries r) : RelSeries r

{α : Type u_1}
{r : Rel α α}
(p : RelSeries r)
(i : Fin (p.length - 1 + 1))


/-- If `M` and `M'` are each other's inverse matrices, they provide an equivalence between `m → A`
and `n → A` corresponding to `M.mulVec` and `M'.mulVec`. -/
@[simps]
def Matrix.toLin'OfInv [Fintype m] [DecidableEq m] {M : Matrix m n R} {M' : Matrix n m R}
    (hMM' : M * M' = 1) (hM'M : M' * M = 1) : (m → R) ≃ₗ[R] n → R

{R : Type u_1}
[CommSemiring R]
{m : Type u_4}
{n : Type u_5}
[DecidableEq n]
[Fintype n]
[Fintype m]
[DecidableEq m]
{M : Matrix m n R}
{M' : Matrix n m R}
(hMM' : M * M' = 1)
(hM'M : M' * M = 1)
(a : m → R)

∀ (a_1 : n), (Matrix.toLin'OfInv hMM' hM'M) a a_1 = (Matrix.toLin' M') a a_1


/-- A variant of `colimit_iso_flip_comp_colim` where the arguments of `F` are flipped. -/
@[simps!]
def colimitFlipIsoCompColim [HasColimitsOfShape J C] (F : K ⥤ J ⥤ C) : colimit F.flip ≅ F ⋙ colim

(CategoryTheory.Limits.colimitFlipIsoCompColim F).inv.app X =
  (CategoryTheory.Limits.HasColimit.isoOfNatIso (CategoryTheory.flipCompEvaluation F X)).inv ≫
    (CategoryTheory.Limits.colimitObjIsoColimitCompEvaluation F.flip X).inv


@[simp]
theorem sInter_empty : ⋂₀ (∅ : Class.{u}) = univ


theorem inr_of_isLimit {X Y : C} {t : BinaryBicone X Y} (ht : IsLimit t.toCone) :
    t.inr = ht.lift (BinaryFan.mk 0 (𝟙 Y))

{t : CategoryTheory.Limits.BinaryBicone X Y}

(ht : CategoryTheory.Limits.IsLimit t.toCone)

t.inr = ht.lift (CategoryTheory.Limits.BinaryFan.mk 0 (𝟙 Y))


lemma mk' (h : S.LeftHomologyData) : HasLeftHomology S


theorem cantor' (a) {b : Cardinal} (hb : 1 < b) : a < b ^ a

(a : Cardinal.{u_1})
{b : Cardinal.{u_1}}
(hb : 1 < b)


theorem decompose_of_mem_ne {x : M} {i j : ι} (hx : x ∈ ℳ i) (hij : i ≠ j) :
    (decompose ℳ x j : M) = 0

{ι : Type u_1}
{M : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddCommMonoid M]
[SetLike σ M]
[AddSubmonoidClass σ M]
(ℳ : ι → σ)
[DirectSum.Decomposition ℳ]
{x : M}
{i j : ι}
(hx : x ∈ ℳ i)
(hij : i ≠ j)


theorem toList_nonempty : ∀ {s : String}, s ≠ "" → s.toList = s.head :: (s.drop 1).toList


theorem exp_sum {α : Type*} (s : Finset α) (f : α → ℝ) :
    exp (∑ x ∈ s, f x) = ∏ x ∈ s, exp (f x)

{α : Type u_1}
(s : Finset α)
(f : α → ℝ)

Real.exp (∑ x ∈ s, f x) = ∏ x ∈ s, Real.exp (f x)


@[simp]
lemma comap_cobounded : Filter.comap f (cobounded β) = cobounded α

{α : Type u_1}
{β : Type u_2}
{F : Type u_4}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
[FunLike F α β]
[DilationClass F α β]
(f : F)

Filter.comap (⇑f) (Bornology.cobounded β) = Bornology.cobounded α


lemma isRatCondKernelCDF_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
    IsRatCondKernelCDF (fun p r ↦ (preCDF ρ r p.2).toReal)
      (Kernel.const Unit ρ) (Kernel.const Unit ρ.fst)

{α : Type u_1}
{mα : MeasurableSpace α}
(ρ : MeasureTheory.Measure (α × ℝ))
[MeasureTheory.IsFiniteMeasure ρ]

ProbabilityTheory.IsRatCondKernelCDF (fun p r => (ProbabilityTheory.preCDF ρ r p.2).toReal)
  (ProbabilityTheory.Kernel.const Unit ρ) (ProbabilityTheory.Kernel.const Unit ρ.fst)


@[to_additive (attr := simp) neg_add_rev]
theorem mul_inv_rev (a b : G) : (a * b)⁻¹ = b⁻¹ * a⁻¹

{G : Type u_1}
[DivisionMonoid G]
(a b : G)


/-- Assumes left covariance.
The lemma assuming right covariance is `Right.mul_lt_one_of_le_of_lt`. -/
@[to_additive Left.add_neg_of_nonpos_of_neg
      "Assumes left covariance.
      The lemma assuming right covariance is `Right.add_neg_of_nonpos_of_neg`."]
theorem Left.mul_lt_one_of_le_of_lt [CovariantClass α α (· * ·) (· < ·)] {a b : α} (ha : a ≤ 1)
    (hb : b < 1) :
    a * b < 1

[CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1]


@[to_additive]
theorem inf_subgroupOf_inf_normal_of_right (A B' B : Subgroup G) (hB : B' ≤ B)
    [hN : (B'.subgroupOf B).Normal] : ((A ⊓ B').subgroupOf (A ⊓ B)).Normal

{G : Type u_1}
[AddGroup G]
(A B' B : AddSubgroup G)
(hB : B' ≤ B)
[hN : (B'.addSubgroupOf B).Normal]


theorem exp_smul {G} [Monoid G] [MulSemiringAction G 𝔸] [ContinuousConstSMul G 𝔸] (g : G) (x : 𝔸) :
    exp 𝕂 (g • x) = g • exp 𝕂 x

(𝕂 : Type u_1)
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
{G : Type u_4}
[Monoid G]
[MulSemiringAction G 𝔸]
[ContinuousConstSMul G 𝔸]
(g : G)
(x : 𝔸)

NormedSpace.exp 𝕂 (g • x) = g • NormedSpace.exp 𝕂 x


theorem truncateFun_zsmul (m : ℤ) (x : 𝕎 R) : truncateFun n (m • x) = m • truncateFun n x

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(n : ℕ)
{R : Type u_1}
[CommRing R]
(m : ℤ)
(x : 𝕎 R)

WittVector.truncateFun n (m • x) = m • WittVector.truncateFun n x


theorem Int.rel_of_forall_rel_succ_of_lt (r : β → β → Prop) [IsTrans β r] {f : ℤ → β}
    (h : ∀ n, r (f n) (f (n + 1))) ⦃a b : ℤ⦄ (hab : a < b) : r (f a) (f b)

{β : Type v}
(r : β → β → Prop)
[IsTrans β r]
{f : ℤ → β}
(h : ∀ (n : ℤ), r (f n) (f (n + 1)))
⦃a b : ℤ⦄
(hab : a < b)


lemma eq_midpoint_of_dist_eq_half (hx : dist x y = dist x z / 2) (hy : dist y z = dist x z / 2) :
    y = midpoint ℝ x z

{E : Type u_3}
{PE : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[StrictConvexSpace ℝ E]
[MetricSpace PE]
[NormedAddTorsor E PE]
{x y z : PE}
(hx : dist x y = dist x z / 2)
(hy : dist y z = dist x z / 2)


@[simp]
theorem nodup_toList [FinEnum α] : List.Nodup (toList α)


/-- The type of lattice homomorphisms from `α` to `β`. -/
structure LatticeHom (α β : Type*) [Lattice α] [Lattice β] extends SupHom α β where
  /-- A `LatticeHom` preserves infima. -/
  map_inf' (a b : α) : toFun (a ⊓ b) = toFun a ⊓ toFun b

{α : Type u_7}
{β : Type u_8}
[Lattice α]
[Lattice β]
(self : LatticeHom α β)
(a b : α)

self.toFun (a ⊓ b) = self.toFun a ⊓ self.toFun b


theorem GradedAlgebra.ι_apply (m : M) :
    GradedAlgebra.ι R M m =
      DirectSum.of (fun (i : ℕ) => ↥(LinearMap.range (TensorAlgebra.ι R : M →ₗ[_] _) ^ i)) 1
        ⟨TensorAlgebra.ι R m, by simpa only [pow_one] using LinearMap.mem_range_self _ m⟩

(R : Type u_1)
(M : Type u_2)
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(m : M)

(TensorAlgebra.GradedAlgebra.ι R M) m =
  (DirectSum.of (fun i => ↥(LinearMap.range (TensorAlgebra.ι R) ^ i)) 1) ⟨(TensorAlgebra.ι R) m, ⋯⟩


@[to_additive nsmul_nonneg_iff]
theorem one_le_pow_iff {x : M} {n : ℕ} (hn : n ≠ 0) : 1 ≤ x ^ n ↔ 1 ≤ x

[CovariantClass M M (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


@[simp]
theorem trans_apply (e₁ : M ≃ₗ⁅R,L⁆ N) (e₂ : N ≃ₗ⁅R,L⁆ P) (m : M) : (e₁.trans e₂) m = e₂ (e₁ m)

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
{P : Type w₂}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
[LieRingModule L M]
[LieRingModule L N]
[LieRingModule L P]
(e₁ : M ≃ₗ⁅R,L⁆ N)
(e₂ : N ≃ₗ⁅R,L⁆ P)
(m : M)


@[to_additive]
protected theorem mul [Mul β] [ContinuousMul β] (hu : Adapted f u) (hv : Adapted f v) :
    Adapted f (u * v)

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[TopologicalSpace β]
[Preorder ι]
{u v : ι → Ω → β}
{f : MeasureTheory.Filtration ι m}
[Add β]
[ContinuousAdd β]
(hu : MeasureTheory.Adapted f u)
(hv : MeasureTheory.Adapted f v)


@[to_additive]
theorem ContinuousWithinAt.smul (hf : ContinuousWithinAt f s b) (hg : ContinuousWithinAt g s b) :
    ContinuousWithinAt (fun x => f x • g x) s b

{M : Type u_1}
{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace M]
[TopologicalSpace X]
[TopologicalSpace Y]
[VAdd M X]
[ContinuousVAdd M X]
{f : Y → M}
{g : Y → X}
{b : Y}
{s : Set Y}
(hf : ContinuousWithinAt f s b)
(hg : ContinuousWithinAt g s b)

ContinuousWithinAt (fun x => f x +ᵥ g x) s b


theorem edgeDensity_le_one (s t : Finset α) : G.edgeDensity s t ≤ 1

{α : Type u_4}
(G : SimpleGraph α)
[DecidableRel G.Adj]
(s t : Finset α)


theorem mem_support_cycleOf_iff [DecidableEq α] [Fintype α] :
    y ∈ support (f.cycleOf x) ↔ SameCycle f x y ∧ x ∈ support f

{α : Type u_2}
{f : Equiv.Perm α}
{x y : α}
[DecidableRel f.SameCycle]
[DecidableEq α]
[Fintype α]

y ∈ (f.cycleOf x).support ↔ f.SameCycle x y ∧ x ∈ f.support


/-- A `SemilatticeSup` is a join-semilattice, that is, a partial order
  with a join (a.k.a. lub / least upper bound, sup / supremum) operation
  `⊔` which is the least element larger than both factors. -/
class SemilatticeSup (α : Type u) extends Sup α, PartialOrder α where
  /-- The supremum is an upper bound on the first argument -/
  protected le_sup_left : ∀ a b : α, a ≤ a ⊔ b
  /-- The supremum is an upper bound on the second argument -/
  protected le_sup_right : ∀ a b : α, b ≤ a ⊔ b
  /-- The supremum is the *least* upper bound -/
  protected sup_le : ∀ a b c : α, a ≤ c → b ≤ c → a ⊔ b ≤ c

{α : Type u}
[self : SemilatticeSup α]
(a b : α)


/-- A `R`-module linearly equivalent to a flat `R`-module is flat. -/
lemma of_linearEquiv [f : Flat R M] (e : N ≃ₗ[R] M) : Flat R N

(R : Type u)
(M : Type v)
[CommRing R]
[AddCommGroup M]
[Module R M]
(N : Type w)
[AddCommGroup N]
[Module R N]
[f : Module.Flat R M]
(e : N ≃ₗ[R] M)


@[simp]
theorem spanExt_hom_app_right : (spanExt iX iY iZ wf wg).hom.app WalkingSpan.right = iZ.hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z X' Y' Z' : C}
(iX : X ≅ X')
(iY : Y ≅ Y')
(iZ : Z ≅ Z')
{f : X ⟶ Y}
{g : X ⟶ Z}
{f' : X' ⟶ Y'}
{g' : X' ⟶ Z'}
(wf : iX.hom ≫ f' = f ≫ iY.hom)
(wg : iX.hom ≫ g' = g ≫ iZ.hom)

(CategoryTheory.Limits.spanExt iX iY iZ wf wg).hom.app CategoryTheory.Limits.WalkingSpan.right = iZ.hom


lemma zero_def [Nontrivial R] : (0 : W'.Point) = ⟨nonsingularLift_zero⟩

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
[Nontrivial R]

0 = WeierstrassCurve.Jacobian.Point.mk ⋯


/-- The set of `k`-rough numbers `≤ N` can be written as the union of the sets of multiples `≤ N`
of primes `k ≤ p ≤ N`. -/
lemma roughNumbersUpTo_eq_biUnion (N k) :
    roughNumbersUpTo N k =
      (N.succ.primesBelow \ k.primesBelow).biUnion
        fun p ↦ (Finset.range N.succ).filter (fun m ↦ m ≠ 0 ∧ p ∣ m)

N.roughNumbersUpTo k =
  (N.succ.primesBelow \ k.primesBelow).biUnion fun p => Finset.filter (fun m => m ≠ 0 ∧ p ∣ m) (Finset.range N.succ)


lemma unitization_nnnorm_def (x : WithLp 1 (Unitization 𝕜 A)) :
    ‖x‖₊ = ‖(WithLp.equiv 1 _ x).fst‖₊ + ‖(WithLp.equiv 1 _ x).snd‖₊

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
(x : WithLp 1 (Unitization 𝕜 A))

‖x‖₊ = ‖((WithLp.equiv 1 (Unitization 𝕜 A)) x).fst‖₊ + ‖((WithLp.equiv 1 (Unitization 𝕜 A)) x).snd‖₊


theorem derivWithin_smul (hxs : UniqueDiffWithinAt 𝕜 s x) (hc : DifferentiableWithinAt 𝕜 c s x)
    (hf : DifferentiableWithinAt 𝕜 f s x) :
    derivWithin (fun y => c y • f y) s x = c x • derivWithin f s x + derivWithin c s x • f x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : 𝕜 → 𝕜'}
(hxs : UniqueDiffWithinAt 𝕜 s x)
(hc : DifferentiableWithinAt 𝕜 c s x)
(hf : DifferentiableWithinAt 𝕜 f s x)


theorem get_of_length_le {xs : IntList} (h : xs.length ≤ i) : xs.get i = 0

{i : Nat}
{xs : Lean.Omega.IntList}
(h : List.length xs ≤ i)


theorem toComplex_def' (x y : ℤ) : ((⟨x, y⟩ : ℤ[i]) : ℂ) = x + y * I

GaussianInt.toComplex { re := x, im := y } = ↑x + ↑y * Complex.I


theorem lsmul_injective [NoZeroSMulDivisors A M] {x : A} (hx : x ≠ 0) :
    Function.Injective (lsmul R B M x)

(R : Type u)
(A : Type w)
(B : Type u₁)
(M : Type v₁)
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[AddCommGroup M]
[Module R M]
[Module A M]
[Module B M]
[IsScalarTower R A M]
[IsScalarTower R B M]
[SMulCommClass A B M]
[NoZeroSMulDivisors A M]
{x : A}
(hx : x ≠ 0)

Function.Injective ⇑((Algebra.lsmul R B M) x)


/-- (Implementation Detail) The glue data associated to a disjoint union. -/
@[simps]
noncomputable
def disjointGlueData' : GlueData' Scheme

{ι : Type u}
(f : ι → AlgebraicGeometry.Scheme)

∀ (x x_1 : ι) (x_2 : x ≠ x_1), (AlgebraicGeometry.disjointGlueData' f).t x x_1 x_2 = 𝟙 ((fun x x_3 x => ∅) x x_1 x_2)


theorem l_sup_u [SemilatticeSup α] [SemilatticeSup β] (gi : GaloisInsertion l u) (a b : β) :
    l (u a ⊔ u b) = a ⊔ b

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[SemilatticeSup α]
[SemilatticeSup β]
(gi : GaloisInsertion l u)
(a b : β)


@[simp]
theorem mk'_add_self : (⟦G⟧ : Quotient setoid) + ⟦G⟧ = 0


theorem mul_eq_comp (f g : Module.End R M) : f * g = f.comp g

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(f g : Module.End R M)


/-- See `isUnit_iff_exists_and_exists` for a similar lemma with two existentials. -/
@[to_additive "See `isAddUnit_iff_exists_and_exists` for a similar lemma with two existentials."]
lemma isUnit_iff_exists [Monoid M] {x : M} : IsUnit x ↔ ∃ b, x * b = 1 ∧ b * x = 1


@[simp]
theorem summable_nat_rpow {p : ℝ} : Summable (fun n => (n : ℝ) ^ p : ℕ → ℝ) ↔ p < -1


lemma rank_eq_natTrailingDegree :
    rank R L = (polyCharpoly (ad R L).toLinearMap b).natTrailingDegree

(R : Type u_1)
(L : Type u_3)
{ι : Type u_5}
[CommRing R]
[Nontrivial R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[Module.Free R L]
[Fintype ι]
[DecidableEq ι]
(b : Basis ι R L)

LieAlgebra.rank R L = ((↑(LieAlgebra.ad R L)).polyCharpoly b).natTrailingDegree


theorem real_inner_self_abs (x : F) : |⟪x, x⟫_ℝ| = ⟪x, x⟫_ℝ

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(x : F)


/-- In an R₁ space, the closure of a compact set is the union of the closures of its points. -/
theorem IsCompact.closure_eq_biUnion_closure_singleton {K : Set X} (hK : IsCompact K) :
    closure K = ⋃ x ∈ K, closure {x}

{X : Type u_1}
[TopologicalSpace X]
[R1Space X]
{K : Set X}
(hK : IsCompact K)


/-- The *open mapping theorem* for holomorphic functions, global version: if a function `g : E → ℂ`
is analytic on a connected set `U`, then either it is constant on `U`, or it is open on `U` (in the
sense that it maps any open set contained in `U` to an open set in `ℂ`). -/
theorem AnalyticOn.is_constant_or_isOpen (hg : AnalyticOn ℂ g U) (hU : IsPreconnected U) :
    (∃ w, ∀ z ∈ U, g z = w) ∨ ∀ s ⊆ U, IsOpen s → IsOpen (g '' s)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{U : Set E}
{g : E → ℂ}
(hg : AnalyticOn ℂ g U)
(hU : IsPreconnected U)


lemma algHom_ext'' {F : Type*}
    [FunLike F (Unitization R A) C] [AlgHomClass F R (Unitization R A) C] {φ ψ : F}
    (h : ∀ a : A, φ a = ψ a) : φ = ψ

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
{C : Type u_5}
[Semiring C]
[Algebra R C]
{F : Type u_6}
[FunLike F (Unitization R A) C]
[AlgHomClass F R (Unitization R A) C]
{φ ψ : F}
(h : ∀ (a : A), φ ↑a = ψ ↑a)


/-- This is the same as `Matrix.l2_opNNNorm_def`, but with a more bundled RHS for square
matrices. -/
lemma cstar_nnnorm_def (A : Matrix n n 𝕜) : ‖A‖₊ = ‖toEuclideanCLM (n := n) (𝕜 := 𝕜) A‖₊

{𝕜 : Type u_1}
{n : Type u_3}
[RCLike 𝕜]
[Fintype n]
[DecidableEq n]
(A : Matrix n n 𝕜)


/-- Restrict the codomain of a continuous multilinear map to a submodule. -/
@[simps! toMultilinearMap apply_coe]
def codRestrict (f : ContinuousMultilinearMap R M₁ M₂) (p : Submodule R M₂) (h : ∀ v, f v ∈ p) :
    ContinuousMultilinearMap R M₁ p

{R : Type u}
{ι : Type v}
{M₁ : ι → Type w₁}
{M₂ : Type w₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]
(f : ContinuousMultilinearMap R M₁ M₂)
(p : Submodule R M₂)
(h : ∀ (v : (i : ι) → M₁ i), f v ∈ p)

(f.codRestrict p h).toMultilinearMap = f.codRestrict p h


@[to_additive]
theorem mrange_inr : mrange (inr M N) = prod ⊥ ⊤

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]

AddMonoidHom.mrange (AddMonoidHom.inr M N) = ⊥.prod ⊤


theorem exists_iff_exists_tuple {P : List α → Prop} :
    (∃ l : List α, P l) ↔ ∃ (n : _) (f : Fin n → α), P (List.ofFn f)


theorem right_mem_Ioc : b ∈ Ioc a b ↔ a < b


@[simp]
theorem Ici_prod_Ici (a : α) (b : β) : Ici a ×ˢ Ici b = Ici (a, b)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(a : α)
(b : β)

UpperSet.Ici a ×ˢ UpperSet.Ici b = UpperSet.Ici (a, b)


lemma sum_sFiniteSeq (μ : Measure α) [h : SFinite μ] : sum (sFiniteSeq μ) = μ

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[h : MeasureTheory.SFinite μ]

MeasureTheory.Measure.sum (MeasureTheory.sFiniteSeq μ) = μ


@[to_additive]
protected theorem inv_eq_of_mul_eq_one_right {a : α} (h : ↑u * a = 1) : ↑u⁻¹ = a

{α : Type u}
[Monoid α]
{u : αˣ}
{a : α}
(h : ↑u * a = 1)


theorem fold_hom {op' : β → β → β} [Std.Commutative op'] [Std.Associative op'] {m : α → β}
    (hm : ∀ x y, m (op x y) = op' (m x) (m y)) (b : α) (s : Multiset α) :
    (s.map m).fold op' (m b) = m (s.fold op b)

(op : α → α → α)

(hm : ∀ (x y : α), m (op x y) = op' (m x) (m y))

Multiset.fold op' (m b) (Multiset.map m s) = m (Multiset.fold op b s)


@[simp]
theorem recBotCoe_bot {C : WithBot α → Sort*} (d : C ⊥) (f : ∀ a : α, C a) :
    @recBotCoe _ C d f ⊥ = d

{α : Type u_1}
{C : WithBot α → Sort u_5}
(d : C ⊥)
(f : (a : α) → C ↑a)


theorem inducedOuterMeasure_eq_extend {s : Set α} (hs : MeasurableSet s) :
    inducedOuterMeasure m MeasurableSet.empty m0 s = extend m s

{m : (s : Set α) → MeasurableSet s → ℝ≥0∞}

(mU :
  ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), MeasurableSet (f i)),
    Pairwise (Disjoint on f) → m (⋃ i, f i) ⋯ = ∑' (i : ℕ), m (f i) ⋯)

(MeasureTheory.inducedOuterMeasure m ⋯ m0) s = MeasureTheory.extend m s


@[reassoc (attr := simp)]
theorem PreservesPushout.inr_iso_inv :
    G.map (pushout.inr _ _) ≫ (PreservesPushout.iso G f g).inv = pushout.inr _ _

[CategoryTheory.Limits.PreservesColimit (CategoryTheory.Limits.span f g) G]

[CategoryTheory.Limits.HasPushout (G.map f) (G.map g)]

G.map (CategoryTheory.Limits.pushout.inr f g) ≫ (CategoryTheory.Limits.PreservesPushout.iso G f g).inv =
  CategoryTheory.Limits.pushout.inr (G.map f) (G.map g)


@[simp]
theorem spanCompIso_hom_app_right : (spanCompIso F f g).hom.app WalkingSpan.right = 𝟙 _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
{X Y Z : C}
(f : X ⟶ Y)
(g : X ⟶ Z)

(CategoryTheory.Limits.spanCompIso F f g).hom.app CategoryTheory.Limits.WalkingSpan.right =
  𝟙 ((CategoryTheory.Limits.span f g ⋙ F).obj CategoryTheory.Limits.WalkingSpan.right)


/-- A commutative algebra is finitely generated if and only if it is a quotient
of a polynomial ring whose variables are indexed by a fintype. -/
theorem iff_quotient_mvPolynomial' : FiniteType R S ↔
    ∃ (ι : Type uS) (_ : Fintype ι) (f : MvPolynomial ι R →ₐ[R] S), Surjective f

{R : Type uR}
{S : Type uS}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]

Algebra.FiniteType R S ↔ ∃ ι x f, Function.Surjective ⇑f


@[simp]
theorem multiplicity.addValuation_apply {hp : Prime p} {r : R} :
    addValuation hp r = multiplicity p r

{R : Type u_1}
[CommRing R]
[IsDomain R]
{p : R}
[DecidableRel Dvd.dvd]
{hp : Prime p}
{r : R}

(multiplicity.addValuation hp) r = multiplicity p r


theorem support_swap_iff (x y : α) : support (swap x y) = {x, y} ↔ x ≠ y

{α : Type u_1}
[DecidableEq α]
[Fintype α]
(x y : α)

(Equiv.swap x y).support = {x, y} ↔ x ≠ y


theorem tsum_eapproxDiff (f : α → ℝ≥0∞) (hf : Measurable f) (a : α) :
    (∑' n, (eapproxDiff f n a : ℝ≥0∞)) = f a

{α : Type u_1}
[MeasurableSpace α]
(f : α → ℝ≥0∞)
(hf : Measurable f)
(a : α)

∑' (n : ℕ), ↑(↑(MeasureTheory.SimpleFunc.eapproxDiff f n) a) = f a


/-- Given an open cover on `X`, we may pull them back along a morphism `f : W ⟶ X` to obtain
an open cover of `W`. This is similar to `Scheme.OpenCover.pullbackCover`, but here we
take `pullback (𝒰.map x) f` instead of `pullback f (𝒰.map x)`. -/
@[simps]
def OpenCover.pullbackCover' {X W : Scheme.{u}} (𝒰 : X.OpenCover) (f : W ⟶ X) :
    W.OpenCover

{X W : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : W ⟶ X)


@[simp]
theorem cancel_unitInv_right {X Y : C} (f f' : X ⟶ e.inverse.obj (e.functor.obj Y)) :
    f ≫ e.unitInv.app Y = f' ≫ e.unitInv.app Y ↔ f = f'

CategoryTheory.CategoryStruct.comp f (e.unitInv.app Y) = CategoryTheory.CategoryStruct.comp f' (e.unitInv.app Y) ↔
  f = f'


@[simp]
theorem coe_polynomial (g : P →+*[M] Q) : (g.polynomial : P[X] → Q[X]) = map g

{M : Type u_1}
[Monoid M]
{P : Type u_2}
[CommSemiring P]
[MulSemiringAction M P]
{Q : Type u_3}
[CommSemiring Q]
[MulSemiringAction M Q]
(g : P →+*[M] Q)


protected theorem injective (h : α ≃ᵤ β) : Function.Injective h

{α : Type u}
{β : Type u_1}
[UniformSpace α]
[UniformSpace β]
(h : α ≃ᵤ β)


lemma diagonal_nonempty [Nonempty α] : (diagonal α).Nonempty


@[simp]
theorem cons_val_fin_one (x : α) (u : Fin 0 → α) : ∀ (i : Fin 1), vecCons x u i = x

{α : Type u}
(x : α)
(u : Fin 0 → α)
(i : Fin 1)


/-- An oplax functor `F` between bicategories `B` and `C` consists of a function between objects
`F.obj`, a function between 1-morphisms `F.map`, and a function between 2-morphisms `F.map₂`.

Unlike functors between categories, `F.map` do not need to strictly commute with the composition,
and do not need to strictly preserve the identity. Instead, there are specified 2-morphisms
`F.map (𝟙 a) ⟶ 𝟙 (F.obj a)` and `F.map (f ≫ g) ⟶ F.map f ≫ F.map g`.

`F.map₂` strictly commute with compositions and preserve the identity. They also preserve the
associator, the left unitor, and the right unitor modulo some adjustments of domains and codomains
of 2-morphisms.
-/
structure OplaxFunctor (B : Type u₁) [Bicategory.{w₁, v₁} B] (C : Type u₂)
  [Bicategory.{w₂, v₂} C] extends PrelaxFunctor B C where
  mapId (a : B) : map (𝟙 a) ⟶ 𝟙 (obj a)
  mapComp {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : map (f ≫ g) ⟶ map f ≫ map g
  mapComp_naturality_left :
    ∀ {a b c : B} {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c),
      map₂ (η ▷ g) ≫ mapComp f' g = mapComp f g ≫ map₂ η ▷ map g := by
    aesop_cat
  mapComp_naturality_right :
    ∀ {a b c : B} (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g'),
      map₂ (f ◁ η) ≫ mapComp f g' = mapComp f g ≫ map f ◁ map₂ η := by
    aesop_cat
  -- Porting note: `map₂_associator_aux` was used here in lean 3, but this was a hack
  -- to avoid a timeout; we revert this hack here (because it was causing other problems
  -- and was not necessary in lean 4)
  map₂_associator :
    ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d),
      map₂ (α_ f g h).hom ≫ mapComp f (g ≫ h) ≫ map f ◁ mapComp g h =
    mapComp (f ≫ g) h ≫ mapComp f g ▷ map h ≫ (α_ (map f) (map g) (map h)).hom := by
    aesop_cat
  map₂_leftUnitor :
    ∀ {a b : B} (f : a ⟶ b),
      map₂ (λ_ f).hom = mapComp (𝟙 a) f ≫ mapId a ▷ map f ≫ (λ_ (map f)).hom := by
    aesop_cat
  map₂_rightUnitor :
    ∀ {a b : B} (f : a ⟶ b),
      map₂ (ρ_ f).hom = mapComp f (𝟙 b) ≫ map f ◁ mapId b ≫ (ρ_ (map f)).hom := by
    aesop_cat

(self : CategoryTheory.OplaxFunctor B C)

self.map₂ (CategoryTheory.Bicategory.leftUnitor f).hom =
  CategoryTheory.CategoryStruct.comp (self.mapComp (CategoryTheory.CategoryStruct.id a) f)
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (self.mapId a) (self.map f))
      (CategoryTheory.Bicategory.leftUnitor (self.map f)).hom)


@[simp 1100] theorem headD_cons : @headD α (a::l) d = a

{α : Type u}
{a : α}
{l : List α}
{d : α}


lemma cfcₙHom_eq_cfcₙHom_of_cfcHom [UniqueNonUnitalContinuousFunctionalCalculus R A] {a : A}
    (ha : p a) : cfcₙHom (R := R) ha = cfcₙHom_of_cfcHom R ha

[h_cpct : ∀ (a : A), CompactSpace ↑(spectrum R a)]


protected theorem add_lt_add_of_le_of_lt [Preorder α] [CovariantClass α α (· + ·) (· < ·)]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] (ha : a ≠ ⊤) (hab : a ≤ b) (hcd : c < d) :
    a + c < b + d

[CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1]

[CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


@[to_additive]
theorem div_le_iff_le_mul' : a / b ≤ c ↔ a ≤ b * c

[CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


/-- The morphism in `ShortComplex C` associated to a morphism in `ShortComplex Cᵒᵖ` -/
@[simps]
def unopMap {S₁ S₂ : ShortComplex Cᵒᵖ} (φ : S₁ ⟶ S₂) : S₂.unop ⟶ S₁.unop

{S₁ S₂ : CategoryTheory.ShortComplex Cᵒᵖ}

(CategoryTheory.ShortComplex.unopMap φ).τ₁ = φ.τ₃.unop


theorem mem_atTop [Preorder α] (a : α) : { b : α | a ≤ b } ∈ @atTop α _


theorem mulHom_of_of {i j} (a : A i) (b : A j) :
    mulHom A (of A i a) (of A j b) = of A (i + j) (GradedMonoid.GMul.mul a b)

((DirectSum.mulHom A) ((DirectSum.of A i) a)) ((DirectSum.of A j) b) =
  (DirectSum.of A (i + j)) (GradedMonoid.GMul.mul a b)


/-- Formula for `completedCosZeta` as a Dirichlet series in the convergence range
(second version, with sum over `ℕ`). -/
lemma hasSum_nat_completedCosZeta (a : ℝ) {s : ℂ} (hs : 1 < re s) :
    HasSum (fun n : ℕ ↦ if n = 0 then 0 else Gammaℝ s * Real.cos (2 * π * a * n) / (n : ℂ) ^ s)
    (completedCosZeta a s)

HasSum (fun n => if n = 0 then 0 else s.Gammaℝ * ↑(Real.cos (2 * π * a * ↑n)) / ↑n ^ s)
  (HurwitzZeta.completedCosZeta (↑a) s)


@[simp]
theorem explicitCokernelIso_inv_π {X Y : SemiNormedGrp.{u}} (f : X ⟶ Y) :
    cokernel.π f ≫ (explicitCokernelIso f).inv = explicitCokernelπ f

CategoryTheory.Limits.cokernel.π f ≫ (SemiNormedGrp.explicitCokernelIso f).inv = SemiNormedGrp.explicitCokernelπ f


/-- Vertical inverse of a 2-commutative square -/
@[simps! iso'_hom_app iso'_inv_app]
def vInv (_ : CatCommSq T L.functor R.functor B) : CatCommSq B L.inverse R.inverse T

∀ (x : CategoryTheory.CatCommSq T L.functor R.functor B) (X : C₃),
  CategoryTheory.CatCommSq.iso'.inv.app X =
    CategoryTheory.CategoryStruct.comp (R.unitIso.hom.app (T.obj (L.inverse.obj X)))
      (CategoryTheory.CategoryStruct.comp
        (R.inverse.map ((CategoryTheory.CatCommSq.iso T L.functor R.functor B).hom.app (L.inverse.obj X)))
        (R.inverse.map (B.map (L.counitIso.hom.app X))))


theorem ContDiffWithinAt.differentiableWithinAt_iteratedFDerivWithin {m : ℕ}
    (h : ContDiffWithinAt 𝕜 n f s x) (hmn : (m : ℕ∞) < n) (hs : UniqueDiffOn 𝕜 (insert x s)) :
    DifferentiableWithinAt 𝕜 (iteratedFDerivWithin 𝕜 m f s) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ∞}
{m : ℕ}
(h : ContDiffWithinAt 𝕜 n f s x)
(hmn : ↑m < n)
(hs : UniqueDiffOn 𝕜 (insert x s))


@[reassoc (attr := simp)]
lemma associator_hom_snd_snd (X Y Z : C) :
    (α_ X Y Z).hom ≫ snd _ _ ≫ snd _ _ = snd _ _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.ChosenFiniteProducts C]
(X Y Z : C)

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).hom
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.ChosenFiniteProducts.snd X (CategoryTheory.MonoidalCategory.tensorObj Y Z))
      (CategoryTheory.ChosenFiniteProducts.snd Y Z)) =
  CategoryTheory.ChosenFiniteProducts.snd (CategoryTheory.MonoidalCategory.tensorObj X Y) Z


theorem whiskerRight_comp_bimod {W X Y Z : Mon_ C} {M M' : Bimod W X} (f : M ⟶ M') (N : Bimod X Y)
    (P : Bimod Y Z) :
    whiskerRight f (N.tensorBimod P) =
      (associatorBimod M N P).inv ≫
        whiskerRight (whiskerRight f N) P ≫ (associatorBimod M' N P).hom

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁} (CategoryTheory.MonoidalCategory.tensorLeft X)]

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁}
      (CategoryTheory.MonoidalCategory.tensorRight X)]

Bimod.whiskerRight f (N.tensorBimod P) =
  (M.associatorBimod N P).inv ≫ Bimod.whiskerRight (Bimod.whiskerRight f N) P ≫ (M'.associatorBimod N P).hom


theorem map₂_left_comm {f : α → δ → ε} {g : β → γ → δ} {f' : α → γ → δ'} {g' : β → δ' → ε}
    (h_left_comm : ∀ a b c, f a (g b c) = g' b (f' a c)) :
    map₂ f a (map₂ g b c) = map₂ g' b (map₂ f' a c)

{f : α → δ → ε}

{g : β → γ → δ}

(h_left_comm : ∀ (a : α) (b : β) (c : γ), f a (g b c) = g' b (f' a c))

Option.map₂ f a (Option.map₂ g b c) = Option.map₂ g' b (Option.map₂ f' a c)


@[to_additive] lemma leOnePart_le_one : a⁻ᵐ ≤ 1 ↔ a⁻¹ ≤ 1

{α : Type u_1}
[Lattice α]
[AddGroup α]
{a : α}


@[to_additive]
theorem div_right_comm : a / b / c = a / c / b

{α : Type u_1}
[DivisionCommMonoid α]
(a b c : α)


/-- *Engel's theorem*.

Note that this implies all traditional forms of Engel's theorem via
`LieModule.nontrivial_max_triv_of_isNilpotent`, `LieModule.isNilpotent_iff_forall`,
`LieAlgebra.isNilpotent_iff_forall`. -/
theorem LieAlgebra.isEngelian_of_isNoetherian [IsNoetherian R L] : LieAlgebra.IsEngelian R L

{R : Type u₁}
{L : Type u₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[IsNoetherian R L]


@[simp] lemma abs_mul_abs_self (a : α) : |a| * |a| = a * a

{α : Type u_1}
[LinearOrderedRing α]
(a : α)


protected theorem tendsto_mul (ha : a ≠ 0 ∨ b ≠ ∞) (hb : b ≠ 0 ∨ a ≠ ∞) :
    Tendsto (fun p : ℝ≥0∞ × ℝ≥0∞ => p.1 * p.2) (𝓝 (a, b)) (𝓝 (a * b))

{a b : ℝ≥0∞}
(ha : a ≠ 0 ∨ b ≠ ⊤)
(hb : b ≠ 0 ∨ a ≠ ⊤)

Filter.Tendsto (fun p => p.1 * p.2) (𝓝 (a, b)) (𝓝 (a * b))


theorem span_singleton_absNorm {I : Ideal S} (hI : (Ideal.absNorm I).Prime) :
    Ideal.span (singleton (Ideal.absNorm I : ℤ)) = I.comap (algebraMap ℤ S)

{S : Type u_1}
[CommRing S]
[IsDomain S]
[Nontrivial S]
[IsDedekindDomain S]
[Module.Free ℤ S]
{I : Ideal S}
(hI : Nat.Prime (Ideal.absNorm I))

Ideal.span {↑(Ideal.absNorm I)} = Ideal.comap (algebraMap ℤ S) I


@[simp]
theorem fderiv_const (c : F) : (fderiv 𝕜 fun _ : E => c) = 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(c : F)


/-- A sequence of functions `Fₙ` converges uniformly to a limiting function `f` w.r.t.
filter `p` iff the function `(n, x) ↦ (f x, Fₙ x)` converges along `p ×ˢ ⊤` to the uniformity.
In other words: one knows nothing about the behavior of `x` in this limit.
-/
theorem tendstoUniformly_iff_tendsto {F : ι → α → β} {f : α → β} {p : Filter ι} :
    TendstoUniformly F f p ↔ Tendsto (fun q : ι × α => (f q.2, F q.1 q.2)) (p ×ˢ ⊤) (𝓤 β)

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}

TendstoUniformly F f p ↔ Filter.Tendsto (fun q => (f q.2, F q.1 q.2)) (p ×ˢ ⊤) (𝓤 β)


@[reassoc (attr := simp)]
lemma rightDerivedNatTrans_fac (τ : F ⟶ F') :
    α ≫ whiskerLeft L (rightDerivedNatTrans RF RF' α α' W τ) = τ ≫ α'

{C : Type u_1}
{D : Type u_6}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_6} D]
[CategoryTheory.Category.{u_2, u_3} H]
(RF RF' : CategoryTheory.Functor D H)
{F F' : CategoryTheory.Functor C H}
{L : CategoryTheory.Functor C D}
(α : F ⟶ L.comp RF)
(α' : F' ⟶ L.comp RF')
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[RF.IsRightDerivedFunctor α W]
(τ : F ⟶ F')

CategoryTheory.CategoryStruct.comp α (CategoryTheory.whiskerLeft L (RF.rightDerivedNatTrans RF' α α' W τ)) =
  CategoryTheory.CategoryStruct.comp τ α'


@[simp]
theorem irrational_sub_int_iff : Irrational (x - m) ↔ Irrational x


@[simp]
theorem mem_map {f : ZFSet → ZFSet} [Definable 1 f] {x y : ZFSet} :
    y ∈ map f x ↔ ∃ z ∈ x, pair z (f z) = y

{f : ZFSet → ZFSet}
[PSet.Definable 1 f]
{x y : ZFSet}

y ∈ ZFSet.map f x ↔ ∃ z ∈ x, z.pair (f z) = y


@[to_additive]
theorem contMDiffAt_one [One M'] : ContMDiffAt I I' n (1 : M → M') x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{x : M}
{n : ℕ∞}
[Zero M']


/-- A semistandard Young tableau is a filling of the cells of a Young diagram by natural
numbers, such that the entries in each row are weakly increasing (left to right), and the entries
in each column are strictly increasing (top to bottom).

Here, a semistandard Young tableau is represented as an unrestricted function `ℕ → ℕ → ℕ` that, for
reasons of extensionality, is required to vanish outside `μ`. -/
structure SemistandardYoungTableau (μ : YoungDiagram) where
  /-- `entry i j` is value of the `(i, j)` entry of the SSYT `μ`. -/
  entry : ℕ → ℕ → ℕ
  /-- The entries in each row are weakly increasing (left to right). -/
  row_weak' : ∀ {i j1 j2 : ℕ}, j1 < j2 → (i, j2) ∈ μ → entry i j1 ≤ entry i j2
  /-- The entries in each column are strictly increasing (top to bottom). -/
  col_strict' : ∀ {i1 i2 j : ℕ}, i1 < i2 → (i2, j) ∈ μ → entry i1 j < entry i2 j
  /-- `entry` is required to be zero for all pairs `(i, j) ∉ μ`. -/
  zeros' : ∀ {i j}, (i, j) ∉ μ → entry i j = 0

{μ : YoungDiagram}
(self : SemistandardYoungTableau μ)
{i j1 j2 : ℕ}

j1 < j2 → (i, j2) ∈ μ → self.entry i j1 ≤ self.entry i j2


theorem setLaverage_const (hs₀ : μ s ≠ 0) (hs : μ s ≠ ∞) (c : ℝ≥0∞) : ⨍⁻ _x in s, c ∂μ = c

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs₀ : μ s ≠ 0)
(hs : μ s ≠ ⊤)
(c : ℝ≥0∞)


@[simp] theorem ite_false_decide_same (p : Prop) [h : Decidable p] (b : Bool) :
  (if p then b else decide p) = (decide p && b)


theorem Subset.union_eq_right {xs ys : List α} (h : xs ⊆ ys) : xs ∪ ys = ys

{α : Type u_1}
[DecidableEq α]
{xs ys : List α}
(h : xs ⊆ ys)


protected theorem le_of_lt {a b : Int} (h : a < b) : a ≤ b


@[simp] theorem addNat_subNat {i : Fin (n + m)} (h : m ≤ i) : addNat (subNat m i h) m = i

{n m : Nat}
{i : Fin (n + m)}
(h : m ≤ ↑i)


/-- The `i + j`-th element of a list coincides with the `j`-th element of the list obtained by
dropping the first `i` elements. Version designed to rewrite from the small list to the big list. -/
theorem getElem_drop' (L : List α) {i : Nat} {j : Nat} {h : j < (L.drop i).length} :
    (L.drop i)[j] = L[i + j]'(by
      rw [Nat.add_comm]
      exact Nat.add_lt_of_lt_sub (length_drop i L ▸ h))

{α : Type u_1}
(L : List α)
{i j : Nat}
{h : j < (List.drop i L).length}


@[to_additive (attr := simp)]
theorem noncommPiCoprod_mulSingle
    {hcomm : Pairwise fun i j : ι => ∀ x y : G, x ∈ H i → y ∈ H j → Commute x y}(i : ι) (y : H i) :
    noncommPiCoprod hcomm (Pi.mulSingle i y) = y

{hcomm : Pairwise fun i j => ∀ (x y : G), x ∈ H i → y ∈ H j → Commute x y}

(Subgroup.noncommPiCoprod hcomm) (Pi.mulSingle i y) = ↑y


theorem MeasurableEmbedding.aemeasurable_map_iff {g : β → γ} (hf : MeasurableEmbedding f) :
    AEMeasurable g (μ.map f) ↔ AEMeasurable (g ∘ f) μ

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
[MeasurableSpace γ]
{f : α → β}
{μ : MeasureTheory.Measure α}
{g : β → γ}
(hf : MeasurableEmbedding f)

AEMeasurable g (MeasureTheory.Measure.map f μ) ↔ AEMeasurable (g ∘ f) μ


theorem nhdsWithin_basis_ball {s : Set α} :
    (𝓝[s] x).HasBasis (fun ε : ℝ => 0 < ε) fun ε => ball x ε ∩ s

{α : Type u}
[PseudoMetricSpace α]
{x : α}
{s : Set α}

(𝓝[s] x).HasBasis (fun ε => 0 < ε) fun ε => Metric.ball x ε ∩ s


theorem lt_ack_right (m n : ℕ) : n < ack m n


/-- See also `Basis.toMatrix_reindex` which gives the `simp` normal form of this result. -/
theorem Basis.toMatrix_reindex' [DecidableEq ι] [DecidableEq ι'] (b : Basis ι R M) (v : ι' → M)
    (e : ι ≃ ι') : (b.reindex e).toMatrix v =
    Matrix.reindexAlgEquiv R R e (b.toMatrix (v ∘ e))

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_5}
{M : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[Fintype ι']
[Fintype ι]
[DecidableEq ι]
[DecidableEq ι']
(b : Basis ι R M)
(v : ι' → M)
(e : ι ≃ ι')

(b.reindex e).toMatrix v = (Matrix.reindexAlgEquiv R R e) (b.toMatrix (v ∘ ⇑e))


@[simp]
theorem toFinset_dedup (m : Multiset α) : m.dedup.toFinset = m.toFinset

{α : Type u_1}
[DecidableEq α]
(m : Multiset α)


theorem UpperSemicontinuousAt.comp_continuousAt_of_eq {f : α → β} {g : ι → α} {y : α} {x : ι}
    (hf : UpperSemicontinuousAt f y) (hg : ContinuousAt g x) (hy : g x = y) :
    UpperSemicontinuousAt (fun x ↦ f (g x)) x

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{ι : Type u_5}
[TopologicalSpace ι]
{f : α → β}
{g : ι → α}
{y : α}
{x : ι}
(hf : UpperSemicontinuousAt f y)
(hg : ContinuousAt g x)
(hy : g x = y)

UpperSemicontinuousAt (fun x => f (g x)) x


theorem ι_eq_v_add_smul_e0 (m : M) (r : R) : ι (Q' Q) (m, r) = v Q m + r • e0 Q

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(m : M)
(r : R)

(CliffordAlgebra.ι (CliffordAlgebra.EquivEven.Q' Q)) (m, r) =
  (CliffordAlgebra.EquivEven.v Q) m + r • CliffordAlgebra.EquivEven.e0 Q


lemma sup_eq_top_of_top_mem [OrderTop α] (h : ⊤ ∈ s) : sSup s = ⊤

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
[OrderTop α]
(h : ⊤ ∈ s)


@[simp]
theorem app_sub (X : C) (α β : F ⟶ G) : (α - β).app X = α.app X - β.app X

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive D]
{F G : CategoryTheory.Functor C D}
(X : C)
(α β : F ⟶ G)


/-- Note that most of the lemmas about powers of two refer to it as `sq`. -/
@[to_additive two_nsmul] lemma pow_two (a : M) : a ^ 2 = a * a


theorem isUnit_ι_of_isUnit {m : M} (h : IsUnit (Q m)) : IsUnit (ι Q m)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
{m : M}
(h : IsUnit (Q m))


lemma mem_over_iff {X : C} {Y : Over X} (S : Sieve Y) :
    S ∈ (J.over X) Y ↔ Sieve.overEquiv _ S ∈ J Y.left

(J : CategoryTheory.GrothendieckTopology C)

S ∈ (J.over X).sieves Y ↔ (CategoryTheory.Sieve.overEquiv Y) S ∈ J.sieves Y.left


lemma isHomLift {a : 𝒳.obj} {S : 𝒮} (ha : 𝒳.p.obj a = S) :
    IsHomLift 𝒴.p (𝟙 S) (α.toNatTrans.app a)

{𝒮 : Type u₁}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
{𝒳 : CategoryTheory.BasedCategory 𝒮}
{𝒴 : CategoryTheory.BasedCategory 𝒮}
{F G : CategoryTheory.BasedFunctor 𝒳 𝒴}
(α : CategoryTheory.BasedNatTrans F G)
{a : 𝒳.obj}
{S : 𝒮}
(ha : 𝒳.p.obj a = S)

𝒴.p.IsHomLift (CategoryTheory.CategoryStruct.id S) (α.app a)


theorem setToL1_zero_left' (hT : DominatedFinMeasAdditive μ T C)
    (h_zero : ∀ s, MeasurableSet s → μ s < ∞ → T s = 0) (f : α →₁[μ] E) : setToL1 hT f = 0

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(h_zero : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → T s = 0)


theorem IsRightRegular.left_of_commute {a : R}
    (ca : ∀ b, Commute a b) (h : IsRightRegular a) : IsLeftRegular a

{R : Type u_1}
[Mul R]
{a : R}
(ca : ∀ (b : R), Commute a b)
(h : IsRightRegular a)


@[simp] theorem filterMap_join (f : α → Option β) (L : List (List α)) :
    filterMap f (join L) = join (map (filterMap f) L)

{α : Type u_1}
{β : Type u_2}
(f : α → Option β)
(L : List (List α))

List.filterMap f L.join = (List.map (List.filterMap f) L).join


/-- If some right-translate of a function negates it, then the integral of the function with respect
to a right-invariant measure is 0. -/
@[to_additive
      "If some right-translate of a function negates it, then the integral of the function with
      respect to a right-invariant measure is 0."]
theorem integral_eq_zero_of_mul_right_eq_neg [IsMulRightInvariant μ] (hf' : ∀ x, f (x * g) = -f x) :
    ∫ x, f x ∂μ = 0

{G : Type u_4}
{E : Type u_5}
[MeasurableSpace G]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{μ : MeasureTheory.Measure G}
{f : G → E}
{g : G}
[Group G]
[MeasurableMul G]
[μ.IsMulRightInvariant]
(hf' : ∀ (x : G), f (x * g) = -f x)


theorem lift_comp_lift_apply_eq_self [PerfectRing L p] (x : L) :
    lift j i p (lift i j p x) = x

{K : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing K]
[CommRing L]
[CommRing M]
(i : K →+* L)
(j : K →+* M)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[ExpChar M p]
[PerfectRing M p]
[IsPRadical i p]
[IsPRadical j p]
[PerfectRing L p]
(x : L)

(PerfectRing.lift j i p) ((PerfectRing.lift i j p) x) = x


theorem isTopologicalBasis_of_subbasis_of_finiteInter {s : Set (Set α)} (hsg : t = generateFrom s)
    (hsi : FiniteInter s) : IsTopologicalBasis s

(hsg : t = TopologicalSpace.generateFrom s)


lemma density_le_one (hκν : fst κ ≤ ν) (a : α) (x : γ) (s : Set β) :
    density κ ν a x s ≤ 1

{κ : ProbabilityTheory.Kernel α (γ × β)}


theorem trop_sup_def (x y : Tropical R) : x ⊔ y = trop (untrop x ⊔ untrop y)

{R : Type u}
[LinearOrder R]
(x y : Tropical R)

x ⊔ y = Tropical.trop (Tropical.untrop x ⊔ Tropical.untrop y)


lemma AnalyticWithinOn.congr [CompleteSpace F] {f g : E → F} {s : Set E}
    (hf : AnalyticWithinOn 𝕜 f s) (hs : EqOn f g s) :
    AnalyticWithinOn 𝕜 g s

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f g : E → F}
{s : Set E}
(hf : AnalyticWithinOn 𝕜 f s)
(hs : Set.EqOn f g s)


theorem isMittagLeffler_of_surjective (h : ∀ ⦃i j : J⦄ (f : i ⟶ j), (F.map f).Surjective) :
    F.IsMittagLeffler

(h : ∀ ⦃i j : J⦄ (f : i ⟶ j), Function.Surjective (F.map f))


theorem bot_lt_mul [LT α] {a b : WithBot α} (ha : a ≠ ⊥) (hb : b ≠ ⊥) : ⊥ < a * b

{α : Type u_1}
[DecidableEq α]
[MulZeroClass α]
[LT α]
{a b : WithBot α}
(ha : a ≠ ⊥)
(hb : b ≠ ⊥)


/-- The house is the largest of the modulus of the conjugates of an algebraic number. -/
theorem house_eq_sup' (α : K) :
    house α = univ.sup' univ_nonempty (fun φ : K →+* ℂ ↦ ‖φ α‖₊)

{K : Type u_1}
[Field K]
[NumberField K]
(α : K)

NumberField.house α = ↑(Finset.univ.sup' ⋯ fun φ => ‖φ α‖₊)


/-- Normalization monoid: multiplying with `normUnit` gives a normal form for associated
elements. -/
class NormalizationMonoid (α : Type*) [CancelCommMonoidWithZero α] where
  /-- `normUnit` assigns to each element of the monoid a unit of the monoid. -/
  normUnit : α → αˣ
  /-- The proposition that `normUnit` maps `0` to the identity. -/
  normUnit_zero : normUnit 0 = 1
  /-- The proposition that `normUnit` respects multiplication of non-zero elements. -/
  normUnit_mul : ∀ {a b}, a ≠ 0 → b ≠ 0 → normUnit (a * b) = normUnit a * normUnit b
  /-- The proposition that `normUnit` maps units to their inverses. -/
  normUnit_coe_units : ∀ u : αˣ, normUnit u = u⁻¹

{α : Type u_2}
[CancelCommMonoidWithZero α]
[self : NormalizationMonoid α]
{a b : α}


lemma leftHomologyMap_eq [S₁.HasLeftHomology] [S₂.HasLeftHomology] :
    leftHomologyMap φ = h₁.leftHomologyIso.hom ≫ γ.φH ≫ h₂.leftHomologyIso.inv

(γ : CategoryTheory.ShortComplex.LeftHomologyMapData φ h₁ h₂)

CategoryTheory.ShortComplex.leftHomologyMap φ =
  CategoryTheory.CategoryStruct.comp h₁.leftHomologyIso.hom
    (CategoryTheory.CategoryStruct.comp γ.φH h₂.leftHomologyIso.inv)


/-- The counit isomorphism of the auto-equivalence of categories `triangleRotation C` of
`Triangle C` given by the rotation of triangles. -/
@[simps!]
def invRotCompRot : invRotate C ⋙ rotate C ≅ 𝟭 (Triangle C)

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(X : CategoryTheory.Pretriangulated.Triangle C)

(CategoryTheory.Pretriangulated.invRotCompRot.inv.app X).hom₂ = 𝟙 X.obj₂


/-- The uniqueness part of the universal property for quotients of an arbitrary type. -/
theorem lift_unique {r : Setoid α} {f : α → β} (H : r ≤ ker f) (g : Quotient r → β)
    (Hg : f = g ∘ Quotient.mk'') : Quotient.lift f H = g

{α : Type u_1}
{β : Type u_2}
{r : Setoid α}
{f : α → β}
(H : r ≤ Setoid.ker f)
(g : Quotient r → β)
(Hg : f = g ∘ Quotient.mk'')


theorem add_snd (a b : 𝓜(𝕜, A)) : (a + b).snd = a.snd + b.snd

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
(a b : 𝓜(𝕜, A))

(a + b).toProd.2 = a.toProd.2 + b.toProd.2


@[simp]
theorem one_add_natCast (m : ℕ) : 1 + (m : Ordinal) = succ m


@[simp]
theorem aeval_continuousMap_apply (g : R[X]) (f : C(α, R)) (x : α) :
    ((Polynomial.aeval f) g) x = g.eval (f x)

{R : Type u_1}
{α : Type u_2}
[TopologicalSpace α]
[CommSemiring R]
[TopologicalSpace R]
[TopologicalSemiring R]
(g : R[X])
(f : C(α, R))
(x : α)

((Polynomial.aeval f) g) x = Polynomial.eval (f x) g


theorem measure_Ioo_pos [DenselyOrdered X] {a b : X} : 0 < μ (Ioo a b) ↔ a < b

{X : Type u_1}
[TopologicalSpace X]
[LinearOrder X]
[OrderTopology X]
{m : MeasurableSpace X}
(μ : MeasureTheory.Measure X)
[μ.IsOpenPosMeasure]
[DenselyOrdered X]
{a b : X}


theorem continuous_induced_rng {g : γ → α} {t₂ : TopologicalSpace β} {t₁ : TopologicalSpace γ} :
    Continuous[t₁, induced f t₂] g ↔ Continuous[t₁, t₂] (f ∘ g)

{α : Type u}
{β : Type v}
{γ : Type u_1}
{f : α → β}
{g : γ → α}
{t₂ : TopologicalSpace β}
{t₁ : TopologicalSpace γ}


@[simp]
theorem inf_adj : (G₁ ⊓ G₂).Adj a b ↔ G₁.Adj a b ∧ G₂.Adj a b

{V : Type u}
{G : SimpleGraph V}
{G₁ G₂ : G.Subgraph}
{a b : V}


@[fun_prop]
theorem HasFDerivAt.hasFDerivWithinAt (h : HasFDerivAt f f' x) : HasFDerivWithinAt f f' s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
{s : Set E}
(h : HasFDerivAt f f' x)


/-- The Legendre symbol is a homomorphism of monoids with zero. -/
@[simps]
def hom : ℤ →*₀ ℤ


@[to_additive existing (attr := simp)]
lemma mulLeft_mul : Equiv.mulLeft (a * b) = Equiv.mulLeft a * Equiv.mulLeft b


theorem disjoint_of_le_left {s t u : Multiset α} (h : s ≤ u) : Disjoint u t → Disjoint s t

{α : Type u_1}
{s t u : Multiset α}
(h : s ≤ u)


protected theorem max_eq_max (a : Nat) : Nat.max a b = max a b


lemma bddAbove_range_pi {F : ι → ∀ a, π a} :
    BddAbove (range F) ↔ ∀ a, BddAbove (range fun i ↦ F i a)

{α : Type u}
{ι : Sort x}
{π : α → Type u_1}
[(a : α) → Preorder (π a)]
{F : ι → (a : α) → π a}

BddAbove (Set.range F) ↔ ∀ (a : α), BddAbove (Set.range fun i => F i a)


/-- The map `p ↦ v +ᵥ p` as an affine automorphism of an affine space.

Note that there is no need for an `AffineMap.constVAdd` as it is always an equivalence.
This is roughly to `DistribMulAction.toLinearEquiv` as `+ᵥ` is to `•`. -/
@[simps! apply linear]
def constVAdd (v : V₁) : P₁ ≃ᵃ[k] P₁

(k : Type u_1)
(P₁ : Type u_2)
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(v : V₁)

∀ (x : P₁), (AffineEquiv.constVAdd k P₁ v) x = v +ᵥ x


@[to_additive (attr := simp)]
theorem bot_mul : ⊥ * g = ⊥


@[simp]
theorem coeffs_lc (l : ι →₀ R) : h.coeffs (DualBases.lc e l) = l

{R : Type u_1}
{M : Type u_2}
{ι : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
{e : ι → M}
{ε : ι → Module.Dual R M}
[DecidableEq ι]
(h : Module.DualBases e ε)
(l : ι →₀ R)


@[to_additive]
theorem subset_union {H K L : S} : (H : Set G) ⊆ K ∪ L ↔ H ≤ K ∨ H ≤ L

{G : Type u_1}
[Group G]
{S : Type u_6}
[SetLike S G]
[SubgroupClass S G]
{H K L : S}

↑H ⊆ ↑K ∪ ↑L ↔ H ≤ K ∨ H ≤ L


theorem exists_nth_stream_eq_none_of_rat (q : ℚ) : ∃ n : ℕ, IntFractPair.stream q n = none

∃ n, GenContFract.IntFractPair.stream q n = none


lemma minpolyDiv_eq_of_isIntegrallyClosed [IsDomain R] [IsIntegrallyClosed R] [IsDomain S]
    [Algebra R K] [Algebra K S] [IsScalarTower R K S] [IsFractionRing R K] :
    minpolyDiv R x = minpolyDiv K x

{R : Type u_1}
(K : Type u_3)
{S : Type u_2}
[CommRing R]
[Field K]
[CommRing S]
[Algebra R S]
{x : S}
(hx : IsIntegral R x)
[IsDomain R]
[IsIntegrallyClosed R]
[IsDomain S]
[Algebra R K]
[Algebra K S]
[IsScalarTower R K S]
[IsFractionRing R K]


@[simp]
theorem abs_eq (x : ℝ≥0) : |(x : ℝ)| = x


protected lemma one_smul : smul α φ 1 m = m

{J : CategoryTheory.GrothendieckTopology C}

PresheafOfModules.Sheafify.smul α φ 1 m = m


protected theorem inf_le_right {a b : CauSeq α abs} : a ⊓ b ≤ b

{α : Type u_1}
[LinearOrderedField α]
{a b : CauSeq α abs}


@[norm_cast]
theorem coe_inj {q r : ℚ} : (↑q : ℚ_[p]) = ↑r ↔ q = r


theorem integral_add' {f g : α → G} (hf : Integrable f μ) (hg : Integrable g μ) :
    ∫ a, (f + g) a ∂μ = ∫ a, f a ∂μ + ∫ a, g a ∂μ

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → G}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)

∫ (a : α), (f + g) a ∂μ = ∫ (a : α), f a ∂μ + ∫ (a : α), g a ∂μ


@[to_additive]
theorem Nonempty.subset_one_iff (h : s.Nonempty) : s ⊆ 1 ↔ s = 1

{α : Type u_2}
[One α]
{s : Set α}
(h : s.Nonempty)


theorem edge_other_ne {e : Sym2 V} (he : e ∈ G.edgeSet) {v : V} (h : v ∈ e) :
    Sym2.Mem.other h ≠ v

{V : Type u}
(G : SimpleGraph V)
{e : Sym2 V}
(he : e ∈ G.edgeSet)
{v : V}
(h : v ∈ e)


@[simp]
theorem run_map (f : α → β) [LawfulMonad m] : (f <$> x).run = Option.map f <$> x.run

{α β : Type u}
{m : Type u → Type v}
(x : OptionT m α)
[Monad m]
(f : α → β)
[LawfulMonad m]


@[simp] theorem truncate_cons {x : BitVec w} : (cons a x).truncate w = x


lemma hasDerivAt_log {z : ℂ} (hz : z ∈ slitPlane) : HasDerivAt log z⁻¹ z


@[elab_as_elim]
theorem induction_on {p : Completion α → Prop} (a : Completion α) (hp : IsClosed { a | p a })
    (ih : ∀ a : α, p a) : p a

{α : Type u_1}
[UniformSpace α]
{p : UniformSpace.Completion α → Prop}
(a : UniformSpace.Completion α)
(hp : IsClosed {a | p a})
(ih : ∀ (a : α), p (↑α a))


theorem coe_lpPiLpₗᵢ [Fact (1 ≤ p)] (f : lp E p) : (lpPiLpₗᵢ E 𝕜 f : ∀ i, E i) = ⇑f

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
{p : ℝ≥0∞}
[Fintype α]
{𝕜 : Type u_3}
[NontriviallyNormedField 𝕜]
[(i : α) → NormedSpace 𝕜 (E i)]
[Fact (1 ≤ p)]
(f : ↥(lp E p))


theorem openToLocalization_apply (U : Opens (PrimeSpectrum.Top R)) (x : PrimeSpectrum.Top R)
    (hx : x ∈ U) (s : (structureSheaf R).1.obj (op U)) :
    openToLocalization R U x hx s = (s.1 ⟨x, hx⟩ : _)

(U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

(x : ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

(s : ↑((AlgebraicGeometry.Spec.structureSheaf R).val.obj (Opposite.op U)))

(AlgebraicGeometry.StructureSheaf.openToLocalization R U x hx) s = ↑s ⟨x, hx⟩


theorem toMatrix_mul_toMatrix : b.toMatrix b₂ * b₂.toMatrix b = 1

{ι : Type u₁}
{k : Type u₂}
{V : Type u₃}
{P : Type u₄}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(b : AffineBasis ι k P)
[Fintype ι]
(b₂ : AffineBasis ι k P)
[DecidableEq ι]


@[simp] theorem getD_cons_succ : getD (x :: xs) (n + 1) d = getD xs n d

∀ {α : Type u_1} {x : α} {xs : List α} {n : Nat} {d : α}, (x :: xs).getD (n + 1) d = xs.getD n d


/-- The identity map is conservative w.r.t. any measure. -/
protected theorem id (μ : Measure α) : Conservative id μ

{α : Type u_2}
[MeasurableSpace α]
(μ : MeasureTheory.Measure α)


theorem toJordanDecomposition_smul_real (s : SignedMeasure α) (r : ℝ) :
    (r • s).toJordanDecomposition = r • s.toJordanDecomposition

{α : Type u_1}
[MeasurableSpace α]
(s : MeasureTheory.SignedMeasure α)
(r : ℝ)


/-- Any element of the spectrum of a selfadjoint is real. -/
theorem IsSelfAdjoint.mem_spectrum_eq_re [StarModule ℂ A] {a : A} (ha : IsSelfAdjoint a) {z : ℂ}
    (hz : z ∈ spectrum ℂ a) : z = z.re

{A : Type u_1}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[StarModule ℂ A]
{a : A}
(ha : IsSelfAdjoint a)
{z : ℂ}
(hz : z ∈ spectrum ℂ a)


@[simp]
theorem nndist_homothety_center (p₁ p₂ : P) (c : 𝕜) :
    nndist (homothety p₁ c p₂) p₁ = ‖c‖₊ * nndist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
(p₁ p₂ : P)
(c : 𝕜)

nndist ((AffineMap.homothety p₁ c) p₂) p₁ = ‖c‖₊ * nndist p₁ p₂


@[to_additive]
lemma HasCompactMulSupport.exists_pos_le_norm [One E] (hf : HasCompactMulSupport f) :
    ∃ R : ℝ, 0 < R ∧ ∀ x : α, R ≤ ‖x‖ → f x = 1

{α : Type u_1}
{E : Type u_3}
[NormedAddGroup α]
{f : α → E}
[Zero E]
(hf : HasCompactSupport f)

∃ R, 0 < R ∧ ∀ (x : α), R ≤ ‖x‖ → f x = 0


theorem Ioi_inter_Iio : Ioi a ∩ Iio b = Ioo a b


/-- A morphism of comonoid objects. -/
@[ext]
structure Hom (M N : Comon_ C) where
  /-- The underlying morphism of a morphism of comonoid objects. -/
  hom : M.X ⟶ N.X
  hom_counit : hom ≫ N.counit = M.counit := by aesop_cat
  hom_comul : hom ≫ N.comul = M.comul ≫ (hom ⊗ hom) := by aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{M N : Comon_ C}
(self : M.Hom N)

self.hom ≫ N.comul = M.comul ≫ (self.hom ⊗ self.hom)


theorem dist_indicatorConstLp_eq_norm {t : Set α} {ht : MeasurableSet t} {hμt : μ t ≠ ∞} :
    dist (indicatorConstLp p hs hμs c) (indicatorConstLp p ht hμt c) =
      ‖indicatorConstLp p (hs.symmDiff ht) (measure_symmDiff_ne_top hμs hμt) c‖

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{s : Set α}
{hs : MeasurableSet s}
{hμs : μ s ≠ ⊤}
{c : E}
{t : Set α}
{ht : MeasurableSet t}
{hμt : μ t ≠ ⊤}

dist (MeasureTheory.indicatorConstLp p hs hμs c) (MeasureTheory.indicatorConstLp p ht hμt c) =
  ‖MeasureTheory.indicatorConstLp p ⋯ ⋯ c‖


/-- The identity prelax functor. -/
@[simps]
def id (B : Type u₁) [Bicategory.{w₁, v₁} B] : PrelaxFunctor B B

(B : Type u₁)
[CategoryTheory.Bicategory B]

(CategoryTheory.PrelaxFunctor.id B).toPrelaxFunctorStruct = CategoryTheory.PrelaxFunctorStruct.id B


/-- The two-variable Jacobi theta function is even in `z`. -/
lemma jacobiTheta₂_neg_left (z τ : ℂ) : jacobiTheta₂ (-z) τ = jacobiTheta₂ z τ


@[reassoc (attr := simp)]
lemma Qiso_hom_inv_id {X Y : C} (s : X ⟶ Y) (hs : W s) :
    (Q W).map s ≫ Qinv s hs = 𝟙 _

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[W.HasLeftCalculusOfFractions]
{X Y : C}
(s : X ⟶ Y)
(hs : W s)

CategoryTheory.CategoryStruct.comp ((CategoryTheory.MorphismProperty.LeftFraction.Localization.Q W).map s)
    (CategoryTheory.MorphismProperty.LeftFraction.Localization.Qinv s hs) =
  CategoryTheory.CategoryStruct.id ((CategoryTheory.MorphismProperty.LeftFraction.Localization.Q W).obj X)


@[simp]
theorem coe_toHomeomorph (e : α ≃o β) : ⇑e.toHomeomorph = e

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[PartialOrder β]
[TopologicalSpace α]
[TopologicalSpace β]
[OrderTopology α]
[OrderTopology β]
(e : α ≃o β)


@[simp]
lemma Submodule.one_le_finrank_iff [StrongRankCondition R] [NoZeroSMulDivisors R M]
    {S : Submodule R M} [Module.Finite R S] :
    1 ≤ finrank R S ↔ S ≠ ⊥

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
[StrongRankCondition R]
[NoZeroSMulDivisors R M]
{S : Submodule R M}
[Module.Finite R ↥S]

1 ≤ FiniteDimensional.finrank R ↥S ↔ S ≠ ⊥


lemma summable_jacobiTheta₂'_term_iff (z τ : ℂ) :
    Summable (jacobiTheta₂'_term · z τ) ↔ 0 < im τ

(Summable fun x => jacobiTheta₂'_term x z τ) ↔ 0 < τ.im


/-- See `lt_tsub_iff_left` for a stronger statement in a linear order. -/
theorem lt_tsub_iff_left_of_le (h : c ≤ b) : a < b - c ↔ c + a < b

[CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]

[ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


theorem prod_mono {S T : Subalgebra R A} {S₁ T₁ : Subalgebra R B} :
    S ≤ T → S₁ ≤ T₁ → prod S S₁ ≤ prod T T₁

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
{S T : Subalgebra R A}
{S₁ T₁ : Subalgebra R B}


theorem Perm.filter (p : α → Bool) {l₁ l₂ : List α} (s : l₁ ~ l₂) :
    filter p l₁ ~ filter p l₂

{α : Type u_1}
(p : α → Bool)
{l₁ l₂ : List α}
(s : l₁ ~ l₂)


@[simp]
theorem rcomap'_compose (r : Rel α β) (s : Rel β γ) : rcomap' r ∘ rcomap' s = rcomap' (r.comp s)

{α : Type u}
{β : Type v}
{γ : Type w}
(r : Rel α β)
(s : Rel β γ)

Filter.rcomap' r ∘ Filter.rcomap' s = Filter.rcomap' (r.comp s)


@[simp]
theorem coe_inf' : ((s.inf' H f : α) : WithTop α) = s.inf ((↑) ∘ f)

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
{s : Finset β}
(H : s.Nonempty)
(f : β → α)

↑(s.inf' H f) = s.inf (WithTop.some ∘ f)


theorem natTrans_ext (L : C ⥤ D) (W) [L.IsLocalization W] {F₁ F₂ : D ⥤ E} (τ τ' : F₁ ⟶ F₂)
    (h : ∀ X : C, τ.app (L.obj X) = τ'.app (L.obj X)) : τ = τ'

(h : ∀ (X : C), τ.app (L.obj X) = τ'.app (L.obj X))


lemma ne_zero_of_mem_factoredNumbers {s : Finset ℕ} {m : ℕ} (h : m ∈ factoredNumbers s) : m ≠ 0

{s : Finset ℕ}
{m : ℕ}
(h : m ∈ Nat.factoredNumbers s)


/-- Over a ring `R` of characteristic zero, `fun n => cyclotomic n R` is injective. -/
theorem cyclotomic_injective [CharZero R] : Function.Injective fun n => cyclotomic n R

{R : Type u_1}
[CommRing R]
[CharZero R]

Function.Injective fun n => Polynomial.cyclotomic n R


@[to_additive]
theorem op_bijective : Bijective (op : α → αᵐᵒᵖ)


@[to_additive]
theorem comap_equiv_eq_map_symm (f : N ≃* M) (K : Submonoid M) :
    K.comap f = K.map f.symm

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(f : N ≃+ M)
(K : AddSubmonoid M)

AddSubmonoid.comap f K = AddSubmonoid.map f.symm K


@[simp]
theorem _root_.Cardinal.toPartENat_eq_natCast_iff {c : Cardinal} {n : ℕ} :
    Cardinal.toPartENat c = n ↔ c = n


/-- Given any pair of coprime elements of `R`, there exists a matrix in `SL(2, R)` having those
entries as its left or right column. -/
lemma exists_SL2_col {a b : R} (hab : IsCoprime a b) (j : Fin 2) :
    ∃ g : SL(2, R), g 0 j = a ∧ g 1 j = b

{R : Type u_1}
[CommRing R]
{a b : R}
(hab : IsCoprime a b)
(j : Fin 2)


lemma SMulPosStrictMono.lift [SMulPosStrictMono α γ]
    (hf : ∀ {b₁ b₂}, f b₁ ≤ f b₂ ↔ b₁ ≤ b₂)
    (smul : ∀ (a : α) b, f (a • b) = a • f b)
    (zero : f 0 = 0) : SMulPosStrictMono α β

(hf : ∀ {b₁ b₂ : β}, f b₁ ≤ f b₂ ↔ b₁ ≤ b₂)

(smul : ∀ (a : α) (b : β), f (a • b) = a • f b)


@[simp] lemma symm_dualMap_evalEquiv :
    (evalEquiv R M).symm.dualMap = Dual.eval R (Dual R M)

(R : Type u_1)
(M : Type u_2)
[CommRing R]
[AddCommGroup M]
[Module R M]
[Module.IsReflexive R M]

↑(Module.evalEquiv R M).symm.dualMap = Module.Dual.eval R (Module.Dual R M)


theorem le_def [∀ i, LE (α i)] {a b : Σi, α i} : a ≤ b ↔ ∃ h : a.1 = b.1, h.rec a.2 ≤ b.2

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → LE (α i)]
{a b : (i : ι) × α i}


theorem prod_atTop_atTop_eq [Preorder α] [Preorder β] :
    (atTop : Filter α) ×ˢ (atTop : Filter β) = (atTop : Filter (α × β))

{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]

Filter.atTop ×ˢ Filter.atTop = Filter.atTop


lemma eventually_r_pos : ∀ᶠ (n : ℕ) in atTop, ∀ i, 0 < r i n

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)

∀ᶠ (n : ℕ) in Filter.atTop, ∀ (i : α), 0 < r i n


theorem dualRestrict_surjective : Function.Surjective W.dualRestrict

{K : Type u}
{V : Type v}
[Field K]
[AddCommGroup V]
[Module K V]
{W : Subspace K V}


theorem one_def (α : Type*) : (1 : Language.ring.Term α) = Constants.term oneFunc

1 = FirstOrder.Language.Constants.term FirstOrder.Ring.oneFunc


/-- **Equality case of the Rearrangement Inequality**: Pointwise scalar multiplication of `f` and
`g`, which monovary together, is unchanged by a permutation if and only if `f ∘ σ` and `g` monovary
together. Stated by permuting the entries of `f`. -/
theorem MonovaryOn.sum_comp_perm_smul_eq_sum_smul_iff (hfg : MonovaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) :
    ∑ i ∈ s, f (σ i) • g i = ∑ i ∈ s, f i • g i ↔ MonovaryOn (f ∘ σ) g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{s : Finset ι}
{σ : Equiv.Perm ι}
{f : ι → α}
{g : ι → β}
(hfg : MonovaryOn f g ↑s)
(hσ : {x | σ x ≠ x} ⊆ ↑s)

∑ i ∈ s, f (σ i) • g i = ∑ i ∈ s, f i • g i ↔ MonovaryOn (f ∘ ⇑σ) g ↑s


theorem image2_iInter_subset_left (s : ι → Set α) (t : Set β) :
    image2 f (⋂ i, s i) t ⊆ ⋂ i, image2 f (s i) t

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{ι : Sort u_4}
(f : α → β → γ)
(s : ι → Set α)
(t : Set β)

Set.image2 f (⋂ i, s i) t ⊆ ⋂ i, Set.image2 f (s i) t


@[simp, norm_cast]
theorem coeSubmodule_le_coeSubmodule : (N : Submodule R M) ≤ N' ↔ N ≤ N'

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(N N' : LieSubmodule R L M)


/-- A semiring is `Nontrivial` provided that there exists a nontrivial module over this semiring. -/
protected theorem Module.nontrivial (R M : Type*) [Semiring R] [Nontrivial M] [AddCommMonoid M]
    [Module R M] : Nontrivial R

(R : Type u_9)
(M : Type u_10)
[Semiring R]
[Nontrivial M]
[AddCommMonoid M]
[Module R M]


@[simp]
theorem comp_assoc (f : LocallyBoundedMap γ δ) (g : LocallyBoundedMap β γ)
    (h : LocallyBoundedMap α β) : (f.comp g).comp h = f.comp (g.comp h)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{δ : Type u_5}
[Bornology α]
[Bornology β]
[Bornology γ]
[Bornology δ]
(f : LocallyBoundedMap γ δ)
(g : LocallyBoundedMap β γ)
(h : LocallyBoundedMap α β)


@[to_additive (attr := simp)]
theorem mulETransformRight_one : mulETransformRight 1 x = x

{α : Type u_1}
[DecidableEq α]
[AddGroup α]
(x : Finset α × Finset α)


theorem injective_of_surjective_of_submodule
    {N : Submodule R M} (f : N →ₗ[R] M) (hf : Surjective f) : Injective f

{R : Type u}
[Semiring R]
[OrzechProperty R]
{M : Type v}
[AddCommMonoid M]
[Module R M]
[Module.Finite R M]
{N : Submodule R M}
(f : ↥N →ₗ[R] M)
(hf : Function.Surjective ⇑f)


theorem mem_toCone : x ∈ hs.toCone s ↔ ∃ c : 𝕜, 0 < c ∧ ∃ y ∈ s, c • y = x

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
{x : E}

x ∈ Convex.toCone s hs ↔ ∃ c, 0 < c ∧ ∃ y ∈ s, c • y = x


theorem Base.ncard_diff_comm (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) :
    (B₁ \ B₂).ncard = (B₂ \ B₁).ncard

{α : Type u_1}
{M : Matroid α}
{B₁ B₂ : Set α}
(hB₁ : M.Base B₁)
(hB₂ : M.Base B₂)


theorem isAmalgamation_restrict {R₁ R₂ : Presieve X} (h : R₁ ≤ R₂) (x : FamilyOfElements P R₂)
    (t : P.obj (op X)) (ht : x.IsAmalgamation t) : (x.restrict h).IsAmalgamation t

{P : CategoryTheory.Functor Cᵒᵖ (Type w)}

(x : CategoryTheory.Presieve.FamilyOfElements P R₂)

(CategoryTheory.Presieve.FamilyOfElements.restrict h x).IsAmalgamation t


theorem epi_inr_of_is_pushout_of_epi {t : PushoutCocone f g} (ht : IsColimit t) [Epi f] :
    Epi t.inr

{t : CategoryTheory.Limits.PushoutCocone f g}

(ht : CategoryTheory.Limits.IsColimit t)


theorem IsUnit.isRelPrime_left (h : IsUnit x) : IsRelPrime x y

{α : Type u_1}
[CommMonoid α]
{x y : α}
(h : IsUnit x)


theorem support_cycleOf_le [DecidableEq α] [Fintype α] (f : Perm α) (x : α) :
    support (f.cycleOf x) ≤ support f

{α : Type u_2}
[DecidableEq α]
[Fintype α]
(f : Equiv.Perm α)
(x : α)


/-- The trivial zeroes of the even Hurwitz zeta function. -/
theorem hurwitzZetaEven_neg_two_mul_nat_add_one (a : UnitAddCircle) (n : ℕ) :
    hurwitzZetaEven a (-2 * (n + 1)) = 0

HurwitzZeta.hurwitzZetaEven a (-2 * (↑n + 1)) = 0


@[to_additive (attr := simp)]
theorem prod_take_mul_prod_drop : ∀ (L : List M) (i : ℕ), (L.take i).prod * (L.drop i).prod = L.prod

{M : Type u_4}
[Monoid M]
(L : List M)
(i : ℕ)

(List.take i L).prod * (List.drop i L).prod = L.prod


lemma bijOn_reflection_root :
    BijOn (P.reflection i) (range P.root) (range P.root)

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i : ι)

Set.BijOn (⇑(P.reflection i)) (Set.range ⇑P.root) (Set.range ⇑P.root)


@[simp]
theorem binomial_apply_last (p : ℝ≥0∞) (h : p ≤ 1) (n : ℕ) :
    binomial p h n (.last n) = p^n

(PMF.binomial p h n) (Fin.last n) = p ^ n


lemma polynomialX_eq : W.polynomialX =
    C W.a₁ * X 1 * X 2 - (C 3 * X 0 ^ 2 + C (2 * W.a₂) * X 0 * X 2 + C W.a₄ * X 2 ^ 2)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)

W.polynomialX =
  MvPolynomial.C W.a₁ * MvPolynomial.X 1 * MvPolynomial.X 2 -
    (MvPolynomial.C 3 * MvPolynomial.X 0 ^ 2 + MvPolynomial.C (2 * W.a₂) * MvPolynomial.X 0 * MvPolynomial.X 2 +
      MvPolynomial.C W.a₄ * MvPolynomial.X 2 ^ 2)


lemma rpow_left_injective {x : ℝ} (hx : x ≠ 0) : Injective fun y : ℝ≥0∞ ↦ y ^ x


@[to_additive (attr := simp)]
theorem mulLeft_symm (a : G) : (Equiv.mulLeft a).symm = Equiv.mulLeft a⁻¹

Equiv.symm (Equiv.addLeft a) = Equiv.addLeft (-a)


theorem continuous_delayReflLeft : Continuous fun p : I × Path x y => delayReflLeft p.1 p.2

{X : Type u}
[TopologicalSpace X]
{x y : X}

Continuous fun p => Path.delayReflLeft p.1 p.2


theorem nullMeasurableSet_of_null_frontier {s : Set α} {μ : Measure α} (h : μ (frontier s) = 0) :
    NullMeasurableSet s μ

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
{s : Set α}
{μ : MeasureTheory.Measure α}
(h : μ (frontier s) = 0)


theorem one_lt_rank_of_one_lt_finrank (h : 1 < finrank R M) : 1 < Module.rank R M

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
(h : 1 < FiniteDimensional.finrank R M)


theorem Homeomorph.paracompactSpace_iff (e : X ≃ₜ Y) : ParacompactSpace X ↔ ParacompactSpace Y

{X : Type v}
{Y : Type w}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : X ≃ₜ Y)


theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
    Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P))

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
[loc : IsLocalization S P]
(h : S ≤ R⁰)


lemma prod_add (f g : ι → α) : ∏ a, (f a + g a) = ∑ t, (∏ a ∈ t, f a) * ∏ a ∈ tᶜ, g a

{ι : Type u_6}
{α : Type u_8}
[DecidableEq ι]
[Fintype ι]
[CommSemiring α]
(f g : ι → α)

∏ a : ι, (f a + g a) = ∑ t : Finset ι, (∏ a ∈ t, f a) * ∏ a ∈ tᶜ, g a


lemma IsRatCondKernelCDFAux.nonneg (hf : IsRatCondKernelCDFAux f κ ν) (a : α) :
    ∀ᵐ c ∂(ν a), ∀ q, 0 ≤ f (a, c) q

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)

∀ᵐ (c : β) ∂ν a, ∀ (q : ℚ), 0 ≤ f (a, c) q


/-- An open embedding of `X` into `Y`, with `X` nonempty, defines a partial homeomorphism
whose source is all of `X`. The converse is also true; see `PartialHomeomorph.to_openEmbedding`. -/
@[simps! (config := mfld_cfg) apply source target]
noncomputable def toPartialHomeomorph [Nonempty X] : PartialHomeomorph X Y

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(f : X → Y)
(h : OpenEmbedding f)
[Nonempty X]

(OpenEmbedding.toPartialHomeomorph f h).target = Set.range f


theorem wcovBy_congr_right (hab : AntisymmRel (· ≤ ·) a b) : c ⩿ a ↔ c ⩿ b

(hab : AntisymmRel (fun x x_1 => x ≤ x_1) a b)


@[simp, norm_cast]
theorem intCoe_mul [Ring R] {f g : ArithmeticFunction ℤ} :
    (↑(f * g) : ArithmeticFunction R) = ↑f * g

{R : Type u_1}
[Ring R]
{f g : ArithmeticFunction ℤ}


theorem ContDiffAt.arsinh (h : ContDiffAt ℝ n f a) : ContDiffAt ℝ n (fun x => arsinh (f x)) a

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{a : E}
{n : ℕ∞}
(h : ContDiffAt ℝ n f a)

ContDiffAt ℝ n (fun x => Real.arsinh (f x)) a


protected theorem iUnion {ι : Sort*} [Countable ι] {s : ι → Set α}
    (h : ∀ i, NullMeasurableSet (s i) μ) : NullMeasurableSet (⋃ i, s i) μ

(h : ∀ (i : ι), MeasureTheory.NullMeasurableSet (s i) μ)

MeasureTheory.NullMeasurableSet (⋃ i, s i) μ


theorem not_isUnit_of_natDegree_pos_of_isReduced [IsReduced R] (p : R[X])
    (hpl : 0 < p.natDegree) : ¬ IsUnit p

{R : Type u_1}
[CommRing R]
[IsReduced R]
(p : Polynomial R)
(hpl : 0 < p.natDegree)


theorem left_unique (hxz : IsCompl x z) (hyz : IsCompl y z) : x = y

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{x y z : α}
(hxz : IsCompl x z)
(hyz : IsCompl y z)


@[simp]
theorem toEquiv_inj {e₁ e₂ : M ≃ₛₗ[σ] M₂} : e₁.toEquiv = e₂.toEquiv ↔ e₁ = e₂

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module S M₂]
{σ : R →+* S}
{σ' : S →+* R}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
{e₁ e₂ : M ≃ₛₗ[σ] M₂}


theorem Real.mul_iSup_of_nonneg (ha : 0 ≤ r) (f : ι → ℝ) : (r * ⨆ i, f i) = ⨆ i, r * f i

{ι : Sort u_1}
{r : ℝ}
(ha : 0 ≤ r)
(f : ι → ℝ)


lemma integral_bilinear_hasLineDerivAt_right_eq_neg_left_of_integrable_aux1 [SigmaFinite μ]
    {f f' : E × ℝ → F} {g g' : E × ℝ → G} {B : F →L[ℝ] G →L[ℝ] W}
    (hf'g : Integrable (fun x ↦ B (f' x) (g x)) (μ.prod volume))
    (hfg' : Integrable (fun x ↦ B (f x) (g' x)) (μ.prod volume))
    (hfg : Integrable (fun x ↦ B (f x) (g x)) (μ.prod volume))
    (hf : ∀ x, HasLineDerivAt ℝ f (f' x) x (0, 1)) (hg : ∀ x, HasLineDerivAt ℝ g (g' x) x (0, 1)) :
    ∫ x, B (f x) (g' x) ∂(μ.prod volume) = - ∫ x, B (f' x) (g x) ∂(μ.prod volume)

(hf'g : MeasureTheory.Integrable (fun x => (B (f' x)) (g x)) (μ.prod MeasureTheory.volume))

(hfg' : MeasureTheory.Integrable (fun x => (B (f x)) (g' x)) (μ.prod MeasureTheory.volume))

(hfg : MeasureTheory.Integrable (fun x => (B (f x)) (g x)) (μ.prod MeasureTheory.volume))

(hf : ∀ (x : E × ℝ), HasLineDerivAt ℝ f (f' x) x (0, 1))

(hg : ∀ (x : E × ℝ), HasLineDerivAt ℝ g (g' x) x (0, 1))

∫ (x : E × ℝ), (B (f x)) (g' x) ∂μ.prod MeasureTheory.volume =
  -∫ (x : E × ℝ), (B (f' x)) (g x) ∂μ.prod MeasureTheory.volume


theorem exists_of_mem_bind {s : Computation α} {f : α → Computation β} {b} (h : b ∈ bind s f) :
    ∃ a ∈ s, b ∈ f a

{α : Type u}
{β : Type v}
{s : Computation α}
{f : α → Computation β}
{b : β}
(h : b ∈ s.bind f)


@[simp]
theorem tail_val' (B : Fin m.succ → n' → α) (j : n') :
    (vecTail fun i => B i j) = fun i => vecTail B i j

{α : Type u}
{m : ℕ}
{n' : Type uₙ}
(B : Fin m.succ → n' → α)
(j : n')

(Matrix.vecTail fun i => B i j) = fun i => Matrix.vecTail B i j


theorem forall_eventually_of_eventually_forall {f : Filter α} {p : α → β → Prop}
    (h : ∀ᶠ x in f, ∀ y, p x y) : ∀ y, ∀ᶠ x in f, p x y

{α : Type u}
{β : Type v}
{f : Filter α}
{p : α → β → Prop}
(h : ∀ᶠ (x : α) in f, ∀ (y : β), p x y)
(y : β)


/-- This is a slightly specialized form of [Hazewinkel, *Witt Vectors*][Haze09] 6.2 equation 5. -/
theorem iterate_verschiebung_mul_coeff (x y : 𝕎 R) (i j : ℕ) :
    (verschiebung^[i] x * verschiebung^[j] y).coeff (i + j) =
      x.coeff 0 ^ p ^ j * y.coeff 0 ^ p ^ i

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CharP R p]
(x y : WittVector p R)
(i j : ℕ)

((⇑WittVector.verschiebung)^[i] x * (⇑WittVector.verschiebung)^[j] y).coeff (i + j) =
  x.coeff 0 ^ p ^ j * y.coeff 0 ^ p ^ i


@[simp]
theorem sin_sub_two_pi (x : ℝ) : sin (x - 2 * π) = sin x


lemma d₁_eq_zero' {i₁ i₁' : I₁} (h : c₁.Rel i₁ i₁') (i₂ : I₂) (i₁₂ : I₁₂)
    (h' : ComplexShape.π c₁ c₂ c₁₂ ⟨i₁', i₂⟩ ≠ i₁₂) :
    K.d₁ c₁₂ i₁ i₂ i₁₂ = 0

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{I₁ : Type u_2}
{I₂ : Type u_3}
{I₁₂ : Type u_4}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c₁₂ : ComplexShape I₁₂)
[DecidableEq I₁₂]
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]
{i₁ i₁' : I₁}
(h : c₁.Rel i₁ i₁')
(i₂ : I₂)
(i₁₂ : I₁₂)
(h' : c₁.π c₂ c₁₂ (i₁', i₂) ≠ i₁₂)


@[simp]
theorem neg_domain (f : E →ₗ.[R] F) : (-f).domain = f.domain

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(f : E →ₗ.[R] F)


/-- A family of gluing data consists of
1. An index type `J`
2. A bundled topological space `U i` for each `i : J`.
3. An open set `V i j ⊆ U i` for each `i j : J`.
4. A transition map `t i j : V i j ⟶ V j i` for each `i j : ι`.
such that
6. `V i i = U i`.
7. `t i i` is the identity.
8. For each `x ∈ V i j ∩ V i k`, `t i j x ∈ V j k`.
9. `t j k (t i j x) = t i k x`.

We can then glue the topological spaces `U i` together by identifying `V i j` with `V j i`.
-/
-- Porting note(#5171): removed `@[nolint has_nonempty_instance]`
structure MkCore where
  {J : Type u}
  U : J → TopCat.{u}
  V : ∀ i, J → Opens (U i)
  t : ∀ i j, (Opens.toTopCat _).obj (V i j) ⟶ (Opens.toTopCat _).obj (V j i)
  V_id : ∀ i, V i i = ⊤
  t_id : ∀ i, ⇑(t i i) = id
  t_inter : ∀ ⦃i j⦄ (k) (x : V i j), ↑x ∈ V i k → (((↑) : (V j i) → (U j)) (t i j x)) ∈ V j k
  cocycle :
    ∀ (i j k) (x : V i j) (h : ↑x ∈ V i k),
      -- Porting note: the underscore in the next line was `↑(t i j x)`, but Lean type-mismatched
      (((↑) : (V k j) → (U k)) (t j k ⟨_, t_inter k x h⟩)) = ((↑) : (V k i) → (U k)) (t i k ⟨x, h⟩)

(self : TopCat.GlueData.MkCore)
⦃i j : self.J⦄
(k : self.J)
(x : ↥(self.V i j))

↑x ∈ self.V i k → ↑((self.t i j) x) ∈ self.V j k


@[simp] lemma counit_natCast (n : ℕ) : counit (R := R) (n : A) = n

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Bialgebra R A]
(n : ℕ)


theorem HasBasis.limsup_eq_iInf_iSup {p : ι → Prop} {s : ι → Set β} {f : Filter β} {u : β → α}
    (h : f.HasBasis p s) : limsup u f = ⨅ (i) (_ : p i), ⨆ a ∈ s i, u a

{α : Type u_1}
{β : Type u_2}
{ι : Type u_4}
[CompleteLattice α]
{p : ι → Prop}
{s : ι → Set β}
{f : Filter β}
{u : β → α}
(h : f.HasBasis p s)

Filter.limsup u f = ⨅ i, ⨅ (_ : p i), ⨆ a ∈ s i, u a


theorem mono (h : μ₁ ⟂ₘ ν₁) (hμ : μ₂ ≤ μ₁) (hν : ν₂ ≤ ν₁) : μ₂ ⟂ₘ ν₂

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ₁ μ₂ ν₁ ν₂ : MeasureTheory.Measure α}
(h : μ₁ ⟂ₘ ν₁)
(hμ : μ₂ ≤ μ₁)
(hν : ν₂ ≤ ν₁)


@[simp]
theorem mem_sym2_iff {m : Sym2 α} : m ∈ s.sym2 ↔ ∀ a ∈ m, a ∈ s

{α : Type u_1}
{s : Finset α}
{m : Sym2 α}


@[simp] lemma _root_.finCongr_symm (h : m = n) : (finCongr h).symm = finCongr h.symm


/-- If `𝓕 : ι → X → α` tends to `f : X → α` *pointwise on `S : Set X`* along some nontrivial
filter, and if the family `𝓕` is equicontinuous, then the limit is continuous on `S`. -/
theorem Filter.Tendsto.continuousOn_of_equicontinuousOn {l : Filter ι} [l.NeBot] {F : ι → X → α}
    {f : X → α} {S : Set X} (h₁ : ∀ x ∈ S, Tendsto (F · x) l (𝓝 (f x)))
    (h₂ : EquicontinuousOn F S) : ContinuousOn f S

(h₁ : ∀ x ∈ S, Filter.Tendsto (fun x_1 => F x_1 x) l (nhds (f x)))


lemma subtypeEquivRight_apply {p q : α → Prop} (e : ∀ x, p x ↔ q x)
    (z : { x // p x }) : subtypeEquivRight e z = ⟨z, (e z.1).mp z.2⟩

{α : Sort u_1}
{p q : α → Prop}
(e : ∀ (x : α), p x ↔ q x)
(z : { x // p x })


theorem mem_iInter₂_of_mem {s : ∀ i, κ i → Set α} {a : α} (h : ∀ i j, a ∈ s i j) :
    a ∈ ⋂ (i) (j), s i j

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{s : (i : ι) → κ i → Set α}
{a : α}
(h : ∀ (i : ι) (j : κ i), a ∈ s i j)


theorem End_algebraMap_isUnit_inv_apply_eq_iff' {x : R}
    (h : IsUnit (algebraMap R (Module.End S M) x)) (m m' : M) :
    m' = (↑h.unit⁻¹ : Module.End S M) m ↔ m = x • m'

(h : IsUnit ((algebraMap R (Module.End S M)) x))


lemma mono_τ₂_of_exact_of_mono {S₁ S₂ : ShortComplex C} (φ : S₁ ⟶ S₂)
    (h₁ : S₁.Exact) [Mono S₁.f] [Mono S₂.f] [Mono φ.τ₁] [Mono φ.τ₃] : Mono φ.τ₂

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Balanced C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
(φ : S₁ ⟶ S₂)
(h₁ : S₁.Exact)
[CategoryTheory.Mono S₁.f]
[CategoryTheory.Mono S₂.f]
[CategoryTheory.Mono φ.τ₁]
[CategoryTheory.Mono φ.τ₃]


@[simp, bv_toNat] theorem toNat_ofFin (x : Fin (2^n)) : (BitVec.ofFin x).toNat = x.val


/-- Given an integrable function `g`, the conditional expectations of `g` with respect to
a sequence of sub-σ-algebras is uniformly integrable. -/
theorem Integrable.uniformIntegrable_condexp {ι : Type*} [IsFiniteMeasure μ] {g : α → ℝ}
    (hint : Integrable g μ) {ℱ : ι → MeasurableSpace α} (hℱ : ∀ i, ℱ i ≤ m0) :
    UniformIntegrable (fun i => μ[g|ℱ i]) 1 μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{ι : Type u_2}
[MeasureTheory.IsFiniteMeasure μ]
{g : α → ℝ}
(hint : MeasureTheory.Integrable g μ)
{ℱ : ι → MeasurableSpace α}
(hℱ : ∀ (i : ι), ℱ i ≤ m0)

MeasureTheory.UniformIntegrable (fun i => μ[g|ℱ i]) 1 μ


@[simp] theorem Measure.coe_toOuterMeasure (μ : Measure α) : ⇑μ.toOuterMeasure = μ

{α : Type u_1}
[MeasurableSpace α]
(μ : MeasureTheory.Measure α)


@[simp]
theorem snd_inr [Zero R] (a : A) : (a : Unitization R A).snd = a

(R : Type u_1)
{A : Type u_2}
[Zero R]
(a : A)


theorem countP_pos {s} : 0 < countP p s ↔ ∃ a ∈ s, p a

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
{s : Multiset α}


@[simp]
theorem erase_insert_eq_erase (s : Finset α) (a : α) : (insert a s).erase a = s.erase a

{α : Type u_1}
[DecidableEq α]
(s : Finset α)
(a : α)


@[simp]
theorem opMulEquiv_toEquiv [Mul α] : ((opMulEquiv : α ≃* αᵃᵒᵖ) : α ≃ αᵃᵒᵖ) = opEquiv


@[simp, norm_cast]
theorem coe_ofNat (n : ℕ) [n.AtLeastTwo] :
    ((no_index (OfNat.ofNat n) : ℝ≥0) : ℝ≥0∞) = OfNat.ofNat n


/-- If `S` is an unramified `R`-algebra, then `R`-projective implies `S`-projective. -/
lemma projective_of_restrictScalars [Module.Projective R M] : Module.Projective S M

(R S : Type u_2)
[CommRing R]
[CommRing S]
[Algebra R S]
(M : Type u_1)
[AddCommGroup M]
[Module R M]
[Module S M]
[IsScalarTower R S M]
[Algebra.FormallyUnramified R S]
[Algebra.EssFiniteType R S]
[Module.Projective R M]


lemma latticeClosure_min : s ⊆ t → IsSublattice t → latticeClosure s ⊆ t

{α : Type u_2}
[Lattice α]
{s t : Set α}


@[ext]
theorem ext (h : ∀ a, f a = g a) : f = g

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[MulZeroOneClass α]
[MulZeroOneClass β]
{f g : α →*₀o β}
(h : ∀ (a : α), f a = g a)


/-- If every element belongs to at least `n` Finsets, then the sum of their sizes is at least `n`
times how many they are. -/
theorem le_sum_card [Fintype α] (h : ∀ a, n ≤ (B.filter (a ∈ ·)).card) :
    Fintype.card α * n ≤ ∑ s ∈ B, s.card

(h : ∀ (a : α), n ≤ (Finset.filter (fun x => a ∈ x) B).card)


@[to_additive (attr := simp)]
theorem ofList_symm : (@ofList α).symm = toList


theorem succ_mul_choose_eq : ∀ n k, succ n * choose n k = choose (succ n) (succ k) * succ k

n.succ * n.choose k = n.succ.choose k.succ * k.succ


/-- The elements of the Hilbert basis `fourierBasis` are the functions `fourierLp 2`, i.e. the
monomials `fourier n` on the circle considered as elements of `L²`. -/
@[simp]
theorem coe_fourierBasis : ⇑(@fourierBasis T hT) = @fourierLp T hT 2 _

(fun i => fourierBasis.repr.symm (lp.single 2 i 1)) = fourierLp 2


@[to_additive]
theorem copy_eq {s : Set M} (hs : s = S) : S.copy s hs = S

{M : Type u_1}
[Add M]
{S : AddSubsemigroup M}
{s : Set M}
(hs : s = ↑S)


/-- In a linearly ordered field with the order topology, if `f` tends to `Filter.atTop` and `g`
tends to a negative constant `C` then `f * g` tends to `Filter.atBot`. -/
theorem Filter.Tendsto.atTop_mul_neg {C : 𝕜} (hC : C < 0) (hf : Tendsto f l atTop)
    (hg : Tendsto g l (𝓝 C)) : Tendsto (fun x => f x * g x) l atBot

{𝕜 : Type u_1}
{α : Type u_2}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{l : Filter α}
{f g : α → 𝕜}
{C : 𝕜}
(hC : C < 0)
(hf : Filter.Tendsto f l Filter.atTop)
(hg : Filter.Tendsto g l (𝓝 C))

Filter.Tendsto (fun x => f x * g x) l Filter.atBot


/-- The image of a monoid hom is a submonoid of the codomain. -/
@[to_additive "The image of an `AddMonoid` hom is an `AddSubmonoid` of the codomain."]
theorem Range.isSubmonoid {γ : Type*} [Monoid γ] {f : M → γ} (hf : IsMonoidHom f) :
    IsSubmonoid (Set.range f)

{M : Type u_1}
[Monoid M]
{γ : Type u_3}
[Monoid γ]
{f : M → γ}
(hf : IsMonoidHom f)


@[elab_as_elim]
theorem DenseRange.induction_on₃ [TopologicalSpace β] {e : α → β} {p : β → β → β → Prop}
    (he : DenseRange e) (hp : IsClosed { q : β × β × β | p q.1 q.2.1 q.2.2 })
    (h : ∀ a₁ a₂ a₃, p (e a₁) (e a₂) (e a₃)) (b₁ b₂ b₃ : β) : p b₁ b₂ b₃

(h : ∀ (a₁ a₂ a₃ : α), p (e a₁) (e a₂) (e a₃))


theorem HasBasis.prod_self (hl : la.HasBasis pa sa) :
    (la ×ˢ la).HasBasis pa fun i => sa i ×ˢ sa i

{α : Type u_1}
{ι : Sort u_4}
{la : Filter α}
{pa : ι → Prop}
{sa : ι → Set α}
(hl : la.HasBasis pa sa)


@[simp]
theorem piecewise_insert_of_ne {i j : α} (h : i ≠ j) [∀ i, Decidable (i ∈ insert j s)] :
    (insert j s).piecewise f g i = s.piecewise f g i

{α : Type u_1}
{δ : α → Sort u_6}
(s : Set α)
(f g : (i : α) → δ i)
[(j : α) → Decidable (j ∈ s)]
{i j : α}
(h : i ≠ j)
[(i : α) → Decidable (i ∈ insert j s)]


theorem card_interedges_comm (s t : Finset α) : (interedges r s t).card = (interedges r t s).card

{α : Type u_4}
{r : α → α → Prop}
[DecidableRel r]
(hr : Symmetric r)
(s t : Finset α)

(Rel.interedges r s t).card = (Rel.interedges r t s).card


@[to_additive]
theorem image_smul_comm [DecidableEq β] [DecidableEq γ] [SMul α β] [SMul α γ] (f : β → γ) (a : α)
    (s : Finset β) : (∀ b, f (a • b) = a • f b) → (a • s).image f = a • s.image f

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[DecidableEq β]
[DecidableEq γ]
[VAdd α β]
[VAdd α γ]
(f : β → γ)
(a : α)
(s : Finset β)

(∀ (b : β), f (a +ᵥ b) = a +ᵥ f b) → Finset.image f (a +ᵥ s) = a +ᵥ Finset.image f s


/-- Positive integer values of a morphism `φ` and its value on `-1` completely determine `φ`. -/
theorem ext_rat_on_pnat (same_on_neg_one : f (-1) = g (-1))
    (same_on_pnat : ∀ n : ℕ, 0 < n → f n = g n) : f = g

(same_on_pnat : ∀ (n : ℕ), 0 < n → f ↑n = g ↑n)


theorem innerDualCone_iUnion {ι : Sort*} (f : ι → Set H) :
    (⋃ i, f i).innerDualCone = ⨅ i, (f i).innerDualCone

{H : Type u_5}
[NormedAddCommGroup H]
[InnerProductSpace ℝ H]
{ι : Sort u_6}
(f : ι → Set H)


theorem right_triangle (e : a ≌ b) :
    rightZigzagIso e.unit e.counit = ρ_ e.inv ≪≫ (λ_ e.inv).symm

(e : CategoryTheory.Bicategory.Equivalence a b)

CategoryTheory.Bicategory.rightZigzagIso e.unit e.counit =
  CategoryTheory.Bicategory.rightUnitor e.inv ≪≫ (CategoryTheory.Bicategory.leftUnitor e.inv).symm


/-- If `x` satisfies Liouville condition with exponent `p` and `q < p`, then `x`
satisfies Liouville condition with exponent `q` and constant `1`. -/
theorem frequently_lt_rpow_neg (h : LiouvilleWith p x) (hlt : q < p) :
    ∃ᶠ n : ℕ in atTop, ∃ m : ℤ, x ≠ m / n ∧ |x - m / n| < n ^ (-q)

{p q x : ℝ}
(h : LiouvilleWith p x)
(hlt : q < p)

∃ᶠ (n : ℕ) in Filter.atTop, ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < ↑n ^ (-q)


@[to_additive]
theorem toList_of_mul (x : α) (xs : FreeMonoid α) : toList (of x * xs) = x :: toList xs

{α : Type u_1}
(x : α)
(xs : FreeAddMonoid α)

FreeAddMonoid.toList (FreeAddMonoid.of x + xs) = x :: FreeAddMonoid.toList xs


theorem mem_addGroupFilterBasis (i) : (B i : Set A) ∈ hB.toRingFilterBasis.toAddGroupFilterBasis

{A : Type u_1}
{ι : Type u_2}
[Ring A]
[Nonempty ι]
{B : ι → AddSubgroup A}
(hB : RingSubgroupsBasis B)
(i : ι)

↑(B i) ∈ RingFilterBasis.toAddGroupFilterBasis


/-- Adding a gift horse left option does not change the value of `x`. A gift horse left option is
 a game `x'` with `x' ⧏ x`. It is called "gift horse" because it seems like Left has gotten the
 "gift" of a new option, but actually the value of the game did not change. -/
lemma insertLeft_equiv_of_lf {x x' : PGame} (h : x' ⧏ x) : insertLeft x x' ≈ x


/-- Equipping a type with the trivial topology is right adjoint to the forgetful functor
`Top ⥤ Type`. -/
@[simps! unit counit]
def adj₂ : forget TopCat.{u} ⊣ trivial

TopCat.adj₂.counit = { app := fun X => id, naturality := TopCat.adj₂.proof_3 }


lemma bdd_below_bdd_above_iff_subset_uIcc (s : Set α) :
    BddBelow s ∧ BddAbove s ↔ ∃ a b, s ⊆ [[a, b]]

BddBelow s ∧ BddAbove s ↔ ∃ a b, s ⊆ Set.uIcc a b


lemma twoCocycles_ρ_map_inv_sub_map_inv (f : twoCocycles A) (g : G) :
    A.ρ g (f.1 (g⁻¹, g)) - f.1 (g, g⁻¹)
      = f.1 (1, 1) - f.1 (g, 1)

{k G : Type u}
[CommRing k]
[Group G]
{A : Rep k G}
(f : ↥(groupCohomology.twoCocycles A))
(g : G)


theorem realize_castLE_of_eq {m n : ℕ} (h : m = n) {h' : m ≤ n} {φ : L.BoundedFormula α m}
    {v : α → M} {xs : Fin n → M} : (φ.castLE h').Realize v xs ↔ φ.Realize v (xs ∘ cast h)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{m n : ℕ}
(h : m = n)
{h' : m ≤ n}
{φ : L.BoundedFormula α m}
{v : α → M}
{xs : Fin n → M}

(FirstOrder.Language.BoundedFormula.castLE h' φ).Realize v xs ↔ φ.Realize v (xs ∘ Fin.cast h)


theorem of_disjoint_iUnion [Countable β] {f : β → Set α} (hf₁ : ∀ i, MeasurableSet (f i))
    (hf₂ : Pairwise (Disjoint on f)) : v (⋃ i, f i) = ∑' i, v (f i)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
[T2Space M]
{v : MeasureTheory.VectorMeasure α M}
[Countable β]
{f : β → Set α}
(hf₁ : ∀ (i : β), MeasurableSet (f i))
(hf₂ : Pairwise (Disjoint on f))


theorem subset_iInter₂_iff {s : Set α} {t : ∀ i, κ i → Set α} :
    (s ⊆ ⋂ (i) (j), t i j) ↔ ∀ i j, s ⊆ t i j

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{s : Set α}
{t : (i : ι) → κ i → Set α}

s ⊆ ⋂ i, ⋂ j, t i j ↔ ∀ (i : ι) (j : κ i), s ⊆ t i j


theorem reflTransGen_idem : ReflTransGen (ReflTransGen r) = ReflTransGen r

Relation.ReflTransGen (Relation.ReflTransGen r) = Relation.ReflTransGen r


theorem mul_cancel_right_mem_nonZeroDivisors {x y r : R} (hr : r ∈ R⁰) : x * r = y * r ↔ x = y

{R : Type u_5}
[Ring R]
{x y r : R}
(hr : r ∈ R⁰)


@[simp, norm_cast]
theorem coe_pow (x : R) (n : ℕ) : (↑(x ^ n) : c.Quotient) = (x : c.Quotient) ^ n

{R : Type u_2}
[Add R]
[Monoid R]
(c : RingCon R)
(x : R)
(n : ℕ)


lemma preservesZeroMorphisms_of_iso {F₁ F₂ : C ⥤ D} [F₁.PreservesZeroMorphisms] (e : F₁ ≅ F₂) :
    F₂.PreservesZeroMorphisms


theorem unbounded_lt_Ici [SemilatticeSup α] (a : α) : Unbounded (· < ·) (Ici a)

{α : Type u_1}
[SemilatticeSup α]
(a : α)

Set.Unbounded (fun x x_1 => x < x_1) (Set.Ici a)


theorem join_of_equivalence {r' : α → α → Prop} (hr : Equivalence r) (h : ∀ a b, r' a b → r a b) :
    Join r' a b → r a b

{α : Type u_1}
{r : α → α → Prop}
{a b : α}
{r' : α → α → Prop}
(hr : Equivalence r)
(h : ∀ (a b : α), r' a b → r a b)


@[simp]
theorem radical_idem : radical (radical I) = radical I

{R : Type u}
[CommSemiring R]
(I : Ideal R)


@[simp] lemma bddAbove_smul_iff_of_neg (ha : a < 0) : BddAbove (a • s) ↔ BddBelow s

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[OrderedAddCommGroup β]
[Module α β]
[PosSMulMono α β]
{s : Set β}
{a : α}
(ha : a < 0)


@[simp]
theorem comp_toLinearMap (f : A →ₐ[R] B) (g : B →ₐ[R] C) :
    (g.comp f).toLinearMap = g.toLinearMap.comp f.toLinearMap

{R : Type u}
{A : Type v}
{B : Type w}
{C : Type u₁}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Semiring C]
[Algebra R A]
[Algebra R B]
[Algebra R C]
(f : A →ₐ[R] B)
(g : B →ₐ[R] C)

(g.comp f).toLinearMap = g.toLinearMap ∘ₗ f.toLinearMap


/-- The oplax functor associated with a pseudofunctor. -/
@[simps]
def toOplax : OplaxFunctor B C

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.Pseudofunctor B C)


/-- Composition of pseudofunctors. -/
@[simps]
def comp (F : Pseudofunctor B C) (G : Pseudofunctor C D) : Pseudofunctor B D

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{D : Type u₃}
[CategoryTheory.Bicategory D]
(F : CategoryTheory.Pseudofunctor B C)
(G : CategoryTheory.Pseudofunctor C D)
(a : B)

(F.comp G).mapId a = G.map₂Iso (F.mapId a) ≪≫ G.mapId (F.obj a)


theorem mem_range_succ_iff {a b : ℕ} : a ∈ Finset.range b.succ ↔ a ≤ b


@[simp]
theorem coe_mul [MulZeroClass β] [ContinuousMul β] (f g : C₀(α, β)) : ⇑(f * g) = f * g

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[MulZeroClass β]
[ContinuousMul β]
(f g : α →C₀ β)


@[to_additive (attr := simp) norm_zero]
theorem norm_one' : ‖(1 : E)‖ = 0


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) ofDual_smul']
theorem pow_ofDual [Pow α β] (a : α) (b : βᵒᵈ) : a ^ ofDual b = a ^ b

{α : Type u_1}
{β : Type u_2}
[Pow α β]
(a : α)
(b : βᵒᵈ)


theorem continuous_iSup_dom {t₁ : ι → TopologicalSpace α} {t₂ : TopologicalSpace β} :
    Continuous[iSup t₁, t₂] f ↔ ∀ i, Continuous[t₁ i, t₂] f

{α : Type u}
{β : Type v}
{f : α → β}
{ι : Sort u_2}
{t₁ : ι → TopologicalSpace α}
{t₂ : TopologicalSpace β}


theorem LinearMap.toMatrix_smulBasis_right {G} [Group G] [DistribMulAction G M₂]
    [SMulCommClass G R M₂] (g : G) (f : M₁ →ₗ[R] M₂) :
    LinearMap.toMatrix v₁ (g • v₂) f =
      LinearMap.toMatrix v₁ v₂ (DistribMulAction.toLinearMap _ _ g⁻¹ ∘ₗ f)

{R : Type u_1}
[CommSemiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype n]
[Finite m]
[DecidableEq n]
{M₁ : Type u_5}
{M₂ : Type u_6}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R M₁]
[Module R M₂]
(v₁ : Basis n R M₁)
(v₂ : Basis m R M₂)
{G : Type u_7}
[Group G]
[DistribMulAction G M₂]
[SMulCommClass G R M₂]
(g : G)
(f : M₁ →ₗ[R] M₂)

(LinearMap.toMatrix v₁ (g • v₂)) f = (LinearMap.toMatrix v₁ v₂) (DistribMulAction.toLinearMap R M₂ g⁻¹ ∘ₗ f)


@[ext]
theorem ext {f g : A →ₛₙₐ[φ] B} (h : ∀ x, f x = g x) : f = g

{R : Type u}
{S : Type u₁}
[Monoid R]
[Monoid S]
{φ : R →* S}
{A : Type v}
{B : Type w}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction S B]
{f g : A →ₛₙₐ[φ] B}
(h : ∀ (x : A), f x = g x)


theorem span_singleton_dvd_span_singleton_iff_dvd {a b : R} :
    Ideal.span {a} ∣ Ideal.span ({b} : Set R) ↔ a ∣ b

{R : Type u_1}
[CommRing R]
[IsDomain R]
[IsPrincipalIdealRing R]
{a b : R}


theorem comp_inv_eq_id (α : X ≅ Y) {f : X ⟶ Y} : f ≫ α.inv = 𝟙 X ↔ f = α.hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
(α : X ≅ Y)
{f : X ⟶ Y}

CategoryTheory.CategoryStruct.comp f α.inv = CategoryTheory.CategoryStruct.id X ↔ f = α.hom


theorem self_trans_symm (f : α ≃. β) : f.trans f.symm = ofSet { a | (f a).isSome }

f.trans f.symm = PEquiv.ofSet {a | (f a).isSome = true}


theorem foldr_induction' (f : α → β → β) (H : LeftCommutative f) (x : β) (q : α → Prop)
    (p : β → Prop) (s : Multiset α) (hpqf : ∀ a b, q a → p b → p (f a b)) (px : p x)
    (q_s : ∀ a ∈ s, q a) : p (foldr f H x s)

(f : α → β → β)

(hpqf : ∀ (a : α) (b : β), q a → p b → p (f a b))


theorem normalize_normalized_factor {a : α} :
    ∀ x : α, x ∈ normalizedFactors a → normalize x = x

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
[UniqueFactorizationMonoid α]
{a : α}
(x : α)

x ∈ UniqueFactorizationMonoid.normalizedFactors a → normalize x = x


@[to_additive add_zsmul]
lemma zpow_add (a : G) (m n : ℤ) : a ^ (m + n) = a ^ m * a ^ n

{G : Type u_3}
[AddGroup G]
(a : G)
(m n : ℤ)


theorem support_X [Nontrivial R] : (X n : MvPolynomial σ R).support = {Finsupp.single n 1}

{R : Type u}
{σ : Type u_1}
{n : σ}
[CommSemiring R]
[Nontrivial R]

(MvPolynomial.X n).support = {Finsupp.single n 1}


private theorem le_norm_flip (f : E →SL[σ₁₃] F →SL[σ₂₃] G) : ‖f‖ ≤ ‖flip f‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{𝕜₃ : Type u_3}
{E : Type u_4}
{F : Type u_6}
{G : Type u_8}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[SeminormedAddCommGroup G]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NontriviallyNormedField 𝕜₃]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[NormedSpace 𝕜₃ G]
{σ₂₃ : 𝕜₂ →+* 𝕜₃}
{σ₁₃ : 𝕜 →+* 𝕜₃}
[RingHomIsometric σ₂₃]
[RingHomIsometric σ₁₃]
(f : E →SL[σ₁₃] F →SL[σ₂₃] G)


lemma one_lt_iff_ne_zero_and_ne_one : ∀ {n : ℕ}, 1 < n ↔ n ≠ 0 ∧ n ≠ 1


/-- `x ↦ x / a` as an order isomorphism. -/
@[to_additive (attr := simps!) "`x ↦ x - a` as an order isomorphism."]
def OrderIso.divRight (a : α) : α ≃o α

[CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


/-- This proves that Inf and restrict commute for outer measures, so long as the set of
outer measures is nonempty. -/
theorem restrict_sInf_eq_sInf_restrict (m : Set (OuterMeasure α)) {s : Set α} (hm : m.Nonempty) :
    restrict s (sInf m) = sInf (restrict s '' m)

(m : Set (MeasureTheory.OuterMeasure α))

(MeasureTheory.OuterMeasure.restrict s) (sInf m) = sInf (⇑(MeasureTheory.OuterMeasure.restrict s) '' m)


@[to_additive (attr := simp, norm_cast)]
theorem coe_pow (x : H) (n : ℕ) : ((x ^ n : H) : G) = (x : G) ^ n

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
(x : ↥H)
(n : ℕ)


theorem List.mem_foldr_sup_support_iff [Zero M] {l : List (ι →₀ M)} {x : ι} :
    x ∈ l.foldr (Finsupp.support · ⊔ ·) ∅ ↔ ∃ f ∈ l, x ∈ f.support

{ι : Type u_1}
{M : Type u_2}
[DecidableEq ι]
[Zero M]
{l : List (ι →₀ M)}
{x : ι}

x ∈ List.foldr (fun x x_1 => x.support ⊔ x_1) ∅ l ↔ ∃ f ∈ l, x ∈ f.support


@[simp] theorem rTensor_refl : (refl R N).rTensor M = refl R _

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
(N : Type u_5)
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]

LinearEquiv.rTensor M (LinearEquiv.refl R N) = LinearEquiv.refl R (TensorProduct R N M)


@[simp]
theorem arg_eq_arg {z w : circle} : arg z = arg w ↔ z = w


theorem linearIndependent_option {v : Option ι → V} : LinearIndependent K v ↔
    LinearIndependent K (v ∘ (↑) : ι → V) ∧
      v none ∉ Submodule.span K (range (v ∘ (↑) : ι → V))

{ι : Type u'}
{K : Type u_3}
{V : Type u}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{v : Option ι → V}

LinearIndependent K v ↔ LinearIndependent K (v ∘ some) ∧ v none ∉ Submodule.span K (Set.range (v ∘ some))


@[simp] theorem leftInvSeq_singleton (i : B) : lis [i] = [s i]

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(i : B)


theorem isCompact_compactCovering (n : ℕ) : IsCompact (compactCovering X n)

(X : Type u_1)
[TopologicalSpace X]
[SigmaCompactSpace X]
(n : ℕ)


@[simp] theorem commutatorMap_apply [Div G] (g : G) : commutatorMap φ g = g / φ g

{G : Type u_1}
(φ : G → G)
[Div G]
(g : G)


/-- Let `x` be a point in a discrete subset `s` of a topological space, then there exists an open
set that only meets `s` at `x`.  -/
theorem isOpen_inter_eq_singleton_of_mem_discrete {s : Set X} [DiscreteTopology s] {x : X}
    (hx : x ∈ s) : ∃ U : Set X, IsOpen U ∧ U ∩ s = {x}

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
[DiscreteTopology ↑s]
{x : X}
(hx : x ∈ s)


/-- A component that corresponds to zero in the direct limit is already zero in some
bigger module in the directed system. -/
theorem of.zero_exact [IsDirected ι (· ≤ ·)] {i x} (hix : of G (fun i j h => f' i j h) i x = 0) :
    ∃ (j : _) (hij : i ≤ j), f' i j hij x = 0

[DirectedSystem G fun i j h => ⇑(f' i j h)]

(hix : (Ring.DirectLimit.of G (fun i j h => ⇑(f' i j h)) i) x = 0)

∃ j, ∃ (hij : i ≤ j), (f' i j hij) x = 0


/-- UV-compression is injective on the elements it moves. See `UV.compress`. -/
theorem sup_sdiff_injOn [GeneralizedBooleanAlgebra α] (u v : α) :
    { x | Disjoint u x ∧ v ≤ x }.InjOn fun x => (x ⊔ u) \ v

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
(u v : α)

Set.InjOn (fun x => (x ⊔ u) \ v) {x | Disjoint u x ∧ v ≤ x}


theorem Real.sin_eq_tsum (r : ℝ) :
    Real.sin r = ∑' n : ℕ, (-1) ^ n * r ^ (2 * n + 1) / ↑(2 * n + 1)!


private theorem Perfect.small_diam_aux (ε_pos : 0 < ε) {x : α} (xC : x ∈ C) :
    let D := closure (EMetric.ball x (ε / 2) ∩ C)
    Perfect D ∧ D.Nonempty ∧ D ⊆ C ∧ EMetric.diam D ≤ ε

{α : Type u_1}
[MetricSpace α]
{C : Set α}
(hC : Perfect C)
{ε : ENNReal}
(ε_pos : 0 < ε)
{x : α}
(xC : x ∈ C)

let D := closure (EMetric.ball x (ε / 2) ∩ C);
Perfect D ∧ D.Nonempty ∧ D ⊆ C ∧ EMetric.diam D ≤ ε


theorem pointwise_smul_le_iff {a : α} {S T : AddSubmonoid A} : a • S ≤ T ↔ S ≤ a⁻¹ • T

{α : Type u_1}
{A : Type u_5}
[AddMonoid A]
[Group α]
[DistribMulAction α A]
{a : α}
{S T : AddSubmonoid A}

a • S ≤ T ↔ S ≤ a⁻¹ • T


@[simp]
theorem sub_left : Commute a c → Commute b c → Commute (a - b) c

{R : Type x}
[NonUnitalNonAssocRing R]
{a b c : R}


theorem Disjoint.of_disjoint_inf_of_le' (h : Disjoint (a ⊓ b) c) (hle : b ≤ c) : Disjoint a b

{α : Type u_1}
[SemilatticeInf α]
[OrderBot α]
{a b c : α}
(h : Disjoint (a ⊓ b) c)
(hle : b ≤ c)


theorem codisjoint_himp_self_left : Codisjoint (x ⇨ y) x

{α : Type u}
{x y : α}
[BooleanAlgebra α]


@[to_additive]
theorem Normal.comap {H : Subgroup N} (hH : H.Normal) (f : G →* N) : (H.comap f).Normal

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{H : Subgroup N}
(hH : H.Normal)
(f : G →* N)


@[to_additive]
theorem toProd_surjective : Surjective (toProd : M ∗ N →* M × N)

{M : Type u_1}
{N : Type u_2}
[Monoid M]
[Monoid N]


theorem add_one_lt_exp {x : ℝ} (hx : x ≠ 0) : x + 1 < Real.exp x


/-- For every span `j ⟵ i ⟶ j'`, there
   exists a cocone `j ⟶ k ⟵ j'` such that the square commutes. -/
theorem span {i j j' : C} (f : i ⟶ j) (f' : i ⟶ j') :
    ∃ (k : C) (g : j ⟶ k) (g' : j' ⟶ k), f ≫ g = f' ≫ g'

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.IsFilteredOrEmpty C]
{i j j' : C}
(f : i ⟶ j)
(f' : i ⟶ j')

∃ k g g', CategoryTheory.CategoryStruct.comp f g = CategoryTheory.CategoryStruct.comp f' g'


@[simp]
theorem reverse_neg (f : R[X]) : reverse (-f) = -reverse f

{R : Type u_1}
[Ring R]
(f : Polynomial R)


theorem nmul_le_iff₃' :
    a ⨳ (b ⨳ c) ≤ d ↔
      ∀ a' < a, ∀ b' < b, ∀ c' < c,
        a' ⨳ (b ⨳ c) ♯ a ⨳ (b' ⨳ c) ♯ a ⨳ (b ⨳ c') ♯ a' ⨳ (b' ⨳ c') <
          d ♯ a' ⨳ (b' ⨳ c) ♯ a' ⨳ (b ⨳ c') ♯ a ⨳ (b' ⨳ c')


/-- The product `∏ (X - a)` for `a` inside the multiset `p.roots` divides `p`. -/
theorem prod_multiset_X_sub_C_dvd (p : R[X]) : (p.roots.map fun a => X - C a).prod ∣ p

{R : Type u}
[CommRing R]
[IsDomain R]
(p : Polynomial R)

(Multiset.map (fun a => Polynomial.X - Polynomial.C a) p.roots).prod ∣ p


@[to_additive]
theorem mulSupport_mul_inv : (mulSupport fun x => f x * (g x)⁻¹) ⊆ mulSupport f ∪ mulSupport g

{α : Type u_1}
{G : Type u_9}
[DivisionMonoid G]
(f g : α → G)

(Function.mulSupport fun x => f x * (g x)⁻¹) ⊆ Function.mulSupport f ∪ Function.mulSupport g


theorem condexpIndL1Fin_ae_eq_condexpIndSMul (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
    (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) :
    condexpIndL1Fin hm hs hμs x =ᵐ[μ] condexpIndSMul hm hs hμs x

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[NormedSpace ℝ G]
(hm : m ≤ m0)
[MeasureTheory.SigmaFinite (μ.trim hm)]
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(x : G)

↑↑(MeasureTheory.condexpIndL1Fin hm hs hμs x) =ᵐ[μ] ↑↑(MeasureTheory.condexpIndSMul hm hs hμs x)


theorem Injective.eq_iff' (I : Injective f) {a b : α} {c : β} (h : f b = c) : f a = c ↔ a = b

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
(I : Function.Injective f)
{a b : α}
{c : β}
(h : f b = c)


theorem ContDiff.pow {f : E → 𝔸} (hf : ContDiff 𝕜 n f) : ∀ m : ℕ, ContDiff 𝕜 n fun x => f x ^ m

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{n : ℕ∞}
{𝔸 : Type u_3}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{f : E → 𝔸}
(hf : ContDiff 𝕜 n f)
(m : ℕ)


theorem isUnit_gcd_of_eq_mul_gcd {α : Type*} [CancelCommMonoidWithZero α] [GCDMonoid α]
    {x y x' y' : α} (ex : x = gcd x y * x') (ey : y = gcd x y * y') (h : gcd x y ≠ 0) :
    IsUnit (gcd x' y')

{α : Type u_2}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
{x y x' y' : α}
(ex : x = gcd x y * x')
(ey : y = gcd x y * y')
(h : gcd x y ≠ 0)


theorem mul_right_bijective_of_finite₀ {a : M} (ha : a ≠ 0) : Bijective fun b => a * b

{M : Type u_1}
[CancelMonoidWithZero M]
[Finite M]
{a : M}
(ha : a ≠ 0)


theorem dvd_of_dvd_pow (hp : Prime p) {a : α} {n : ℕ} (h : p ∣ a ^ n) : p ∣ a

{α : Type u_1}
[CommMonoidWithZero α]
{p : α}
(hp : Prime p)
{a : α}
{n : ℕ}
(h : p ∣ a ^ n)


theorem EuclideanSpace.dist_eq {𝕜 : Type*} [RCLike 𝕜] {n : Type*} [Fintype n]
    (x y : EuclideanSpace 𝕜 n) : dist x y = √(∑ i, dist (x i) (y i) ^ 2)

{𝕜 : Type u_8}
[RCLike 𝕜]
{n : Type u_9}
[Fintype n]
(x y : EuclideanSpace 𝕜 n)

dist x y = √(∑ i : n, dist (x i) (y i) ^ 2)


@[norm_cast]
theorem nat_ceil_coe [OrderedSemiring α] [FloorSemiring α] (a : { r : α // 0 ≤ r }) :
    ⌈(a : α)⌉₊ = ⌈a⌉₊

{α : Type u_1}
[OrderedSemiring α]
[FloorSemiring α]
(a : { r // 0 ≤ r })

⌈↑a⌉₊ = ⌈a⌉₊