theorem measure_Ioo_eq_zero [DenselyOrdered X] {a b : X} : μ (Ioo a b) = 0 ↔ b ≤ a

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


@[simp] lemma log_lt_zero_iff {x : ℝ≥0∞} : log x < 0 ↔ x < 1


theorem ContDiffWithinAt.cos {n} (hf : ContDiffWithinAt ℝ n f s x) :
    ContDiffWithinAt ℝ n (fun x => Real.cos (f x)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffWithinAt ℝ n f s x)


/-- Two morphisms into a limit are equal if their compositions with
  each cone morphism are equal. -/
theorem hom_ext (h : IsLimit t) {W : C} {f f' : W ⟶ t.pt}
    (w : ∀ j, f ≫ t.π.app j = f' ≫ t.π.app j) :
    f = f'

(w : ∀ (j : J), f ≫ t.π.app j = f' ≫ t.π.app j)


@[simp]
theorem integral_inv (h : (0 : ℝ) ∉ [[a, b]]) : ∫ x in a..b, x⁻¹ = log (b / a)

∫ (x : ℝ) in a..b, x⁻¹ = Real.log (b / a)


@[simp]
theorem eqToIso_refl {X : C} (p : X = X) : eqToIso p = Iso.refl X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : C}
(p : X = X)

CategoryTheory.eqToIso p = CategoryTheory.Iso.refl X


/-- `SetTheory.PGame.State S` describes how to interpret `s : S` as a state of a combinatorial game.
Use `SetTheory.PGame.ofState s` or `SetTheory.Game.ofState s` to construct the game.

`SetTheory.PGame.State.l : S → Finset S` and `SetTheory.PGame.State.r : S → Finset S` describe
the states reachable by a move by Left or Right. `SetTheory.PGame.State.turnBound : S → ℕ`
gives an upper bound on the number of possible turns remaining from this state.
-/
class State (S : Type u) where
  turnBound : S → ℕ
  l : S → Finset S
  r : S → Finset S
  left_bound : ∀ {s t : S}, t ∈ l s → turnBound t < turnBound s
  right_bound : ∀ {s t : S}, t ∈ r s → turnBound t < turnBound s

{S : Type u}
[self : SetTheory.PGame.State S]
{s t : S}

t ∈ SetTheory.PGame.State.r s → SetTheory.PGame.State.turnBound t < SetTheory.PGame.State.turnBound s


@[simp]
theorem coe_of (α : Type*) [Lattice α] [BoundedOrder α] : ↥(of α) = α

(α : Type u_1)
[Lattice α]
[BoundedOrder α]


@[measurability]
theorem measurable_cos : Measurable cos


theorem typevecCasesCons₂_appendFun (n : ℕ) (t t' : Type*) (v v' : TypeVec n)
    {β : (v ::: t) ⟹ (v' ::: t') → Sort*}
    (F : ∀ (f : t → t') (fs : v ⟹ v'), β (fs ::: f))
    (f fs) :
    typevecCasesCons₂ n t t' v v' F (fs ::: f) = F f fs

(F : (f : t → t') → (fs : v.Arrow v') → β (fs ::: f))

TypeVec.typevecCasesCons₂ n t t' v v' F (fs ::: f) = F f fs


@[to_additive]
theorem commute_inl_inr (m : M) (n : N) : Commute (inl M N m) (inr M N n)

{M : Type u_5}
{N : Type u_6}
[AddZeroClass M]
[AddZeroClass N]
(m : M)
(n : N)

AddCommute ((AddMonoidHom.inl M N) m) ((AddMonoidHom.inr M N) n)


theorem eqRec_heq {α : Sort u} {φ : α → Sort v} {a a' : α} : (h : a = a') → (p : φ a) → HEq (Eq.recOn (motive := fun x _ => φ x) h p) p

{α : Sort u}
{φ : α → Sort v}
{a a' : α}
(h : a = a')
(p : φ a)


@[measurability]
theorem measurable_from_top [MeasurableSpace β] {f : α → β} : Measurable[⊤] f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace β]
{f : α → β}


/-- **Rice's Theorem** -/
theorem rice (C : Set (ℕ →. ℕ)) (h : ComputablePred fun c => eval c ∈ C) {f g} (hf : Nat.Partrec f)
    (hg : Nat.Partrec g) (fC : f ∈ C) : g ∈ C

(h : ComputablePred fun c => c.eval ∈ C)


@[to_additive]
theorem TopologicalGroup.t2Space_of_one_sep (H : ∀ x : G, x ≠ 1 → ∃ U ∈ 𝓝 (1 : G), x ∉ U) :
    T2Space G

(H : ∀ (x : G), x ≠ 0 → ∃ U ∈ 𝓝 0, x ∉ U)


theorem eq_ones_iff_length {c : Composition n} : c = ones n ↔ c.length = n


@[to_additive]
theorem comap_map_eq_of_injective (S : Subsemigroup M) : (S.map f).comap f = S

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{f : AddHom M N}
(hf : Function.Injective ⇑f)
(S : AddSubsemigroup M)

AddSubsemigroup.comap f (AddSubsemigroup.map f S) = S


theorem add_conj (z : ℂ) : z + conj z = (2 * z.re : ℝ)


@[simp]
theorem sub_right (h : SemiconjBy a x y) (h' : SemiconjBy a x' y') :
    SemiconjBy a (x - x') (y - y')

{R : Type x}
[NonUnitalNonAssocRing R]
{a x y x' y' : R}
(h : SemiconjBy a x y)
(h' : SemiconjBy a x' y')


theorem uniformity_basis_edist_inv_two_pow :
    (𝓤 α).HasBasis (fun _ => True) fun n : ℕ => { p : α × α | edist p.1 p.2 < 2⁻¹ ^ n }

(𝓤 α).HasBasis (fun x => True) fun n => {p | edist p.1 p.2 < 2⁻¹ ^ n}


theorem mul_pf [Mul α] (p₁ : (a₁:α) = b₁) (p₂ : a₂ = b₂) : a₁ * a₂ = b₁ * b₂

{α : Type u_1}
{a₁ a₂ b₁ b₂ : α}
[Mul α]
(p₁ : a₁ = b₁)
(p₂ : a₂ = b₂)


@[simp, norm_cast]
theorem coe_ennreal_top : ((⊤ : ℝ≥0∞) : EReal) = ⊤


theorem Finite.exists_finset_coe {s : Set α} (h : s.Finite) : ∃ s' : Finset α, ↑s' = s


theorem IsCompact.preimage_continuous [CompactSpace X] [T2Space Y] {f : X → Y} {s : Set Y}
    (hs : IsCompact s) (hf : Continuous f) : IsCompact (f ⁻¹' s)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[CompactSpace X]
[T2Space Y]
{f : X → Y}
{s : Set Y}
(hs : IsCompact s)
(hf : Continuous f)


theorem eq_bot_of_rank_le_one (h : Module.rank F S ≤ 1) [Module.Free F S] : S = ⊥

{F : Type u_1}
{E : Type u_2}
[CommRing F]
[StrongRankCondition F]
[Ring E]
[Algebra F E]
{S : Subalgebra F E}
(h : Module.rank F ↥S ≤ 1)
[Module.Free F ↥S]


/-- Permuting a vector on the left of a dot product can be transferred to the right. -/
@[simp]
theorem comp_equiv_symm_dotProduct (e : m ≃ n) : u ∘ e.symm ⬝ᵥ x = u ⬝ᵥ x ∘ e

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[Fintype m]
[Fintype n]
[NonUnitalNonAssocSemiring α]
(u : m → α)
(x : n → α)
(e : m ≃ n)


theorem minimalPeriod_prod_map (f : α → α) (g : β → β) (x : α × β) :
    minimalPeriod (Prod.map f g) x = (minimalPeriod f x.1).lcm (minimalPeriod g x.2)

{α : Type u_1}
{β : Type u_2}
(f : α → α)
(g : β → β)
(x : α × β)

Function.minimalPeriod (Prod.map f g) x = (Function.minimalPeriod f x.1).lcm (Function.minimalPeriod g x.2)


@[simp]
theorem coe_id : ⇑(sInfHom.id α) = id


protected theorem generate (B : FilterBasis α) : generate B.sets = B.filter


theorem IsMaximal.mem_or_not_mem (h : T.IsMaximal) (φ : L.Sentence) : φ ∈ T ∨ φ.not ∈ T

{L : FirstOrder.Language}
{T : L.Theory}
(h : T.IsMaximal)
(φ : L.Sentence)

φ ∈ T ∨ FirstOrder.Language.Formula.not φ ∈ T


@[to_additive (attr := simp)]
theorem upperClosure_mul_distrib : upperClosure (s * t) = upperClosure s * upperClosure t

{α : Type u_1}
[OrderedAddCommGroup α]
(s t : Set α)

upperClosure (s + t) = upperClosure s + upperClosure t


@[norm_cast] -- Porting note: no longer a `simp`
theorem coe_iSup₂ (f : ∀ i, κ i → UpperSet α) :
    (↑(⨆ (i) (j), f i j) : Set α) = ⋂ (i) (j), f i j

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_5}
[LE α]
(f : (i : ι) → κ i → UpperSet α)


theorem UInt8.toNat_mod (x y : UInt8) : (x % y).toNat = x.toNat % y.toNat


theorem finrank_R [Fintype σ] : FiniteDimensional.finrank K (R σ K) = Fintype.card (σ → K)

(σ K : Type u)
[Fintype K]
[Field K]
[Fintype σ]

FiniteDimensional.finrank K (MvPolynomial.R σ K) = Fintype.card (σ → K)


@[simp]
theorem coeSubtype : ⇑S.subtype = ((↑) : S → M)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
(S : L.Substructure M)


theorem inf_equiv_inf {a₁ b₁ a₂ b₂ : CauSeq α abs} (ha : a₁ ≈ a₂) (hb : b₁ ≈ b₂) :
    a₁ ⊓ b₁ ≈ a₂ ⊓ b₂

{α : Type u_1}
[LinearOrderedField α]
{a₁ b₁ a₂ b₂ : CauSeq α abs}
(ha : a₁ ≈ a₂)
(hb : b₁ ≈ b₂)

a₁ ⊓ b₁ ≈ a₂ ⊓ b₂


/-- Two submonoids are equal if they have the same elements. -/
@[to_additive (attr := ext) "Two `AddSubmonoid`s are equal if they have the same elements."]
theorem ext {S T : Submonoid M} (h : ∀ x, x ∈ S ↔ x ∈ T) : S = T

{M : Type u_1}
[MulOneClass M]
{S T : Submonoid M}
(h : ∀ (x : M), x ∈ S ↔ x ∈ T)


@[simp]
theorem toOpposite_symm_apply (r : Rᵐᵒᵖ) : (toOpposite R).symm r = unop r

(R : Type u_4)
[NonUnitalCommSemiring R]
(r : Rᵐᵒᵖ)

(RingEquiv.toOpposite R).symm r = MulOpposite.unop r


@[scoped simp]
theorem map_const [AddZeroClass G] [Add H] [AddConstMapClass F G H a b] (f : F) :
    f a = f 0 + b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{a : G}
{b : H}
[AddZeroClass G]
[Add H]
[AddConstMapClass F G H a b]
(f : F)


/-- The additive version of `AddMonoidAlgebra.addMonoidAlgebraEquivDirectSum`.  -/
@[simps (config := .asFn)]
def addMonoidAlgebraAddEquivDirectSum [DecidableEq ι] [Semiring M] [∀ m : M, Decidable (m ≠ 0)] :
    AddMonoidAlgebra M ι ≃+ ⨁ _ : ι, M

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[Semiring M]
[(m : M) → Decidable (m ≠ 0)]


@[simp]
protected theorem dense_span (b : HilbertBasis ι 𝕜 E) :
    (span 𝕜 (Set.range b)).topologicalClosure = ⊤

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(b : HilbertBasis ι 𝕜 E)

(Submodule.span 𝕜 (Set.range fun i => b.repr.symm (lp.single 2 i 1))).topologicalClosure = ⊤


/-- An embedding of complex shapes `e` satisfies `e.IsRelIff` if the implication
`e.rel` is an equivalence. -/
class IsRelIff : Prop where
  rel' (i₁ i₂ : ι) (h : c'.Rel (e.f i₁) (e.f i₂)) : c.Rel i₁ i₂

{ι : Type u_1}
{ι' : Type u_2}
{c : ComplexShape ι}
{c' : ComplexShape ι'}
{e : c.Embedding c'}
[self : e.IsRelIff]
(i₁ i₂ : ι)
(h : c'.Rel (e.f i₁) (e.f i₂))


/-- A blunt cone (one not containing `0`) is always salient. -/
theorem Blunt.salient {S : ConvexCone 𝕜 E} : S.Blunt → S.Salient

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
{S : ConvexCone 𝕜 E}


theorem Monic.add_of_right (hq : Monic q) (hpq : degree p < degree q) : Monic (p + q)

{R : Type u}
[Semiring R]
{p q : R[X]}
(hq : q.Monic)
(hpq : p.degree < q.degree)


@[simp]
theorem _root_.AffineEquiv.sOppSide_map_iff {s : AffineSubspace R P} {x y : P} (f : P ≃ᵃ[R] P') :
    (s.map ↑f).SOppSide (f x) (f y) ↔ s.SOppSide x y

{R : Type u_1}
{V : Type u_2}
{V' : Type u_3}
{P : Type u_4}
{P' : Type u_5}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[AddCommGroup V']
[Module R V']
[AddTorsor V' P']
{s : AffineSubspace R P}
{x y : P}
(f : P ≃ᵃ[R] P')

(AffineSubspace.map (↑f) s).SOppSide (f x) (f y) ↔ s.SOppSide x y


theorem mem_def {a : α} {s : Set α} : a ∈ s ↔ s a


/-- When a left homology data `h` of a short complex `S` is preserved by a functor `F`,
this is the induced left homology data `h.map F` for the short complex `S.map F`. -/
@[simps]
noncomputable def map : (S.map F).LeftHomologyData


theorem add_compLpL [Fact (1 ≤ p)] (L L' : E →L[𝕜] F) :
    (L + L').compLpL p μ = L.compLpL p μ + L'.compLpL p μ

{α : Type u_1}
{E : Type u_2}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
{𝕜 : Type u_5}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
[Fact (1 ≤ p)]
(L L' : E →L[𝕜] F)

ContinuousLinearMap.compLpL p μ (L + L') = ContinuousLinearMap.compLpL p μ L + ContinuousLinearMap.compLpL p μ L'


@[simp high]
lemma realContinuousMapZeroOfNNReal_apply_comp_toReal (φ : C(X, ℝ≥0)₀ →⋆ₙₐ[ℝ≥0] A)
    (f : C(X, ℝ≥0)₀) :
    φ.realContinuousMapZeroOfNNReal ((ContinuousMapZero.mk ⟨toReal, continuous_coe⟩ rfl).comp f) =
      φ f

(φ : ContinuousMapZero X NNReal →⋆ₙₐ[NNReal] A)

φ.realContinuousMapZeroOfNNReal
    ({ toFun := NNReal.toReal, continuous_toFun := NNReal.continuous_coe, map_zero' := ⋯ }.comp f) =
  φ f


theorem comp_open_symm_mem_uniformity_sets {s : Set (α × α)} (hs : s ∈ 𝓤 α) :
    ∃ t ∈ 𝓤 α, IsOpen t ∧ SymmetricRel t ∧ t ○ t ⊆ s

{α : Type ua}
[UniformSpace α]
{s : Set (α × α)}
(hs : s ∈ 𝓤 α)


@[to_additive]
theorem union_smul : (s₁ ∪ s₂) • t = s₁ • t ∪ s₂ • t

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{s₁ s₂ : Set α}
{t : Set β}


theorem forall_mem_cons {p : α → Prop} {a : α} {s : Multiset α} :
    (∀ x ∈ a ::ₘ s, p x) ↔ p a ∧ ∀ x ∈ s, p x

{α : Type u_1}
{p : α → Prop}
{a : α}
{s : Multiset α}


/-- Given a MonoidHom `f : M →* N` and Submonoid `S ⊆ M` such that `f(S) ⊆ Nˣ`, for all
`y ∈ S`, `(f y)⁻¹` is unique. -/
@[to_additive
    "Given an AddMonoidHom `f : M →+ N` and Submonoid `S ⊆ M` such that
`f(S) ⊆ AddUnits N`, for all `y ∈ S`, `- (f y)` is unique."]
theorem inv_unique {f : M →* N} (h : ∀ y : S, IsUnit (f y)) {y : S} {z : N} (H : f y * z = 1) :
    (IsUnit.liftRight (f.restrict S) h y)⁻¹ = z

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{f : M →* N}
(h : ∀ (y : ↥S), IsUnit (f ↑y))
{y : ↥S}
{z : N}
(H : f ↑y * z = 1)

↑((IsUnit.liftRight (f.restrict S) h) y)⁻¹ = z


@[csimp] theorem replaceF_eq_replaceFTR : @replaceF = @replaceFTR

(α : Type u_1)
(p : α → Option α)
(acc : Array α)
(xs : List α)

List.replaceFTR.go p xs acc = acc.data ++ List.replaceF p xs


@[simp, push_cast]
theorem nndist_eq_hammingDist (x y : Hamming β) :
    nndist x y = hammingDist (ofHamming x) (ofHamming y)

{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
(x y : Hamming β)

nndist x y = ↑(hammingDist (Hamming.ofHamming x) (Hamming.ofHamming y))


/-- The Yoneda embedding for `R`-linear categories `C`,
sending an object `X : C` to the `Module R`-valued presheaf on `C`,
with value on `Y : Cᵒᵖ` given by `Module.of R (unop Y ⟶ X)`. -/
@[simps]
def linearYoneda : C ⥤ Cᵒᵖ ⥤ ModuleCat R

(R : Type w)
[Ring R]
(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear R C]
{X₁ X₂ : C}
(f : X₁ ⟶ X₂)
(Y : Cᵒᵖ)

((CategoryTheory.linearYoneda R C).map f).app Y =
  ModuleCat.ofHom (CategoryTheory.Linear.rightComp R (Opposite.unop Y) f)


@[simp]
theorem smallSets_bot : (⊥ : Filter α).smallSets = pure ∅


@[simp, norm_cast] lemma coe_div (p q : ℚ≥0) : ((p / q : ℚ≥0) : ℚ) = p / q


/-- A *rack* is an automorphic set (a set with an action on itself by
bijections) that is self-distributive.  It is a shelf such that each
element's action is invertible.

The notations `x ◃ y` and `x ◃⁻¹ y` denote the action and the
inverse action, respectively, and they are right associative.
-/
class Rack (α : Type u) extends Shelf α where
  /-- The inverse actions of the elements -/
  invAct : α → α → α
  /-- Proof of left inverse -/
  left_inv : ∀ x, Function.LeftInverse (invAct x) (act x)
  /-- Proof of right inverse -/
  right_inv : ∀ x, Function.RightInverse (invAct x) (act x)

Function.RightInverse (Rack.invAct x) (Shelf.act x)


theorem exists_of_isRight_left (h₁ : LiftRel r s x y) (h₂ : x.isRight) :
    ∃ b d, s b d ∧ x = inr b ∧ y = inr d

{α : Type u}
{β : Type v}
{γ : Type u_1}
{δ : Type u_2}
{r : α → γ → Prop}
{s : β → δ → Prop}
{x : α ⊕ β}
{y : γ ⊕ δ}
(h₁ : Sum.LiftRel r s x y)
(h₂ : x.isRight = true)

∃ b d, s b d ∧ x = Sum.inr b ∧ y = Sum.inr d


theorem valid'_nil {o₁ o₂} (h : Bounded nil o₁ o₂) : Valid' o₁ (@nil α) o₂

{α : Type u_1}
[Preorder α]
{o₁ : WithBot α}
{o₂ : WithTop α}
(h : Ordnode.nil.Bounded o₁ o₂)


@[simp]
theorem contMDiff_transDiffeomorph_left {f : M → M'} :
    ContMDiff (I.transDiffeomorph e) I' n f ↔ ContMDiff I I' n f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
(e : E ≃ₘ⟮𝓘(𝕜, E), 𝓘(𝕜, F)⟯ F)
{f : M → M'}


@[simp]
theorem lowerCrossingTime_zero : lowerCrossingTime a b f N 0 = hitting f (Set.Iic a) ⊥ N

{Ω : Type u_1}
{ι : Type u_2}
[Preorder ι]
[OrderBot ι]
[InfSet ι]
{a b : ℝ}
{f : ι → Ω → ℝ}
{N : ι}

MeasureTheory.lowerCrossingTime a b f N 0 = MeasureTheory.hitting f (Set.Iic a) ⊥ N


@[simp]
theorem rpow_eq_top_iff {x : ℝ≥0∞} {y : ℝ} : x ^ y = ⊤ ↔ x = 0 ∧ y < 0 ∨ x = ⊤ ∧ 0 < y


@[simp] theorem insert_replicate_ne {a b : α} (h : !b == a) :
    (replicate n a).insert b = b :: replicate n a

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{n : Nat}
{a b : α}
(h : (!b == a) = true)

List.insert b (List.replicate n a) = b :: List.replicate n a


/-- Apply a linear map on the output of a bilinear form. -/
@[simps!]
def compBilinForm (f : R →ₗ[R'] R') (B : BilinForm R M) : BilinForm R' M

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{R' : Type u_7}
[CommSemiring R']
[Algebra R' R]
[Module R' M]
[IsScalarTower R' R M]
(f : R →ₗ[R'] R')
(B : LinearMap.BilinForm R M)

∀ (a m : M), ((f.compBilinForm B) a) m = f ((B a) m)


theorem eq_zero_of_sign_eq_zero : ∀ {a : Int}, sign a = 0 → a = 0


/-- Apply the linear equivalence `f` to the basis vectors. -/
@[simps]
protected def map : Basis ι R M'

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
{M' : Type u_7}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M']
[Module R M']
(b : Basis ι R M)
(f : M ≃ₗ[R] M')


/-- An ordered commutative group is a commutative group
with a partial order in which multiplication is strictly monotone. -/
class OrderedCommGroup (α : Type u) extends CommGroup α, PartialOrder α where
  /-- Multiplication is monotone in an ordered commutative group. -/
  protected mul_le_mul_left : ∀ a b : α, a ≤ b → ∀ c : α, c * a ≤ c * b

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


theorem Base.encard_diff_comm (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) :
    (B₁ \ B₂).encard = (B₂ \ B₁).encard

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


theorem ofNat_kronecker [Semiring α] [DecidableEq l] (a : ℕ) [a.AtLeastTwo] (B : Matrix m n α) :
    (no_index (OfNat.ofNat a) : Matrix l l α) ⊗ₖ B =
      Matrix.reindex (.prodComm _ _) (.prodComm _ _)
        (blockDiagonal fun _ => (OfNat.ofNat a : α) • B)

{α : Type u_2}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
[Semiring α]
[DecidableEq l]
(a : ℕ)
[a.AtLeastTwo]
(B : Matrix m n α)

Matrix.kroneckerMap (fun x x_1 => x * x_1) (OfNat.ofNat a) B =
  (Matrix.reindex (Equiv.prodComm m l) (Equiv.prodComm n l)) (Matrix.blockDiagonal fun x => OfNat.ofNat a • B)


@[simp]
theorem fstHom_comp_map (f : M →ₗ[R'] N) :
    (fstHom R' R' N).comp (map f) = fstHom R' R' M

{R' : Type u}
{M : Type v}
[CommSemiring R']
[AddCommMonoid M]
[Module R' M]
[Module R'ᵐᵒᵖ M]
[IsCentralScalar R' M]
{N : Type u_3}
[AddCommMonoid N]
[Module R' N]
[Module R'ᵐᵒᵖ N]
[IsCentralScalar R' N]
(f : M →ₗ[R'] N)

(TrivSqZeroExt.fstHom R' R' N).comp (TrivSqZeroExt.map f) = TrivSqZeroExt.fstHom R' R' M


/-- An object whose fiber is inhabited is not initial. -/
lemma not_initial_of_inhabited {X : C} (x : F.obj X) (h : IsInitial X) : False

(F : CategoryTheory.Functor C FintypeCat)


@[to_additive]
theorem mrange_inr' : mrange (inr M N) = comap (fst M N) ⊥

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

AddMonoidHom.mrange (AddMonoidHom.inr M N) = AddSubmonoid.comap (AddMonoidHom.fst M N) ⊥


theorem iInf_unpair {α} [CompleteLattice α] (f : ℕ → ℕ → α) :
    ⨅ n : ℕ, f n.unpair.1 n.unpair.2 = ⨅ (i : ℕ) (j : ℕ), f i j

{α : Type u_1}
[CompleteLattice α]
(f : ℕ → ℕ → α)

⨅ n, f (Nat.unpair n).1 (Nat.unpair n).2 = ⨅ i, ⨅ j, f i j


@[simp] lemma mop_inv_associator (X Y Z : C) :
    (α_ X Y Z).inv.mop = (α_ (mop Z) (mop Y) (mop X)).hom

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

(CategoryTheory.MonoidalCategory.associator X Y Z).inv.mop =
  (CategoryTheory.MonoidalCategory.associator { unmop := Z } { unmop := Y } { unmop := X }).hom


@[simp]
theorem cancel_right {f₁ f₂ : C(β, γ)} {g : C(α, β)} (hg : Surjective g) :
    f₁.comp g = f₂.comp g ↔ f₁ = f₂

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
{f₁ f₂ : C(β, γ)}
{g : C(α, β)}
(hg : Function.Surjective ⇑g)


/-- A structure designed to hold the hypotheses for the Mellin-functional-equation argument
(most general version: rapid decay at `∞` up to constant terms) -/
structure WeakFEPair where
  /-- The functions whose Mellin transform we study -/
  (f g : ℝ → E)
  /-- Weight (exponent in the functional equation) -/
  (k : ℝ)
  /-- Root number -/
  (ε : ℂ)
  /-- Constant terms at `∞` -/
  (f₀ g₀ : E)
  (hf_int : LocallyIntegrableOn f (Ioi 0))
  (hg_int : LocallyIntegrableOn g (Ioi 0))
  (hk : 0 < k)
  (hε : ε ≠ 0)
  (h_feq : ∀ x ∈ Ioi 0, f (1 / x) = (ε * ↑(x ^ k)) • g x)
  (hf_top (r : ℝ) : (f · - f₀) =O[atTop] (· ^ r))
  (hg_top (r : ℝ) : (g · - g₀) =O[atTop] (· ^ r))

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(self : WeakFEPair E)

MeasureTheory.LocallyIntegrableOn self.f (Set.Ioi 0) MeasureTheory.volume


theorem _root_.ClosedEmbedding.setIntegral_map [TopologicalSpace X] [BorelSpace X] {Y}
    [MeasurableSpace Y] [TopologicalSpace Y] [BorelSpace Y] {g : X → Y} {f : Y → E} (s : Set Y)
    (hg : ClosedEmbedding g) : ∫ y in s, f y ∂Measure.map g μ = ∫ x in g ⁻¹' s, f (g x) ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{μ : MeasureTheory.Measure X}
[TopologicalSpace X]
[BorelSpace X]
{Y : Type u_5}
[MeasurableSpace Y]
[TopologicalSpace Y]
[BorelSpace Y]
{g : X → Y}
{f : Y → E}
(s : Set Y)
(hg : ClosedEmbedding g)

∫ (y : Y) in s, f y ∂MeasureTheory.Measure.map g μ = ∫ (x : X) in g ⁻¹' s, f (g x) ∂μ


@[to_additive]
theorem measure_mul_right_ne_zero (h2s : μ s ≠ 0) (y : G) : μ ((fun x => x * y) ⁻¹' s) ≠ 0

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
{s : Set G}
[MeasurableInv G]
[μ.IsMulLeftInvariant]
(h2s : μ s ≠ 0)
(y : G)


theorem lt_ord_succ_card (o : Ordinal) : o < (succ o.card).ord


/-- For a non-trivial space, the affine span of a set is `⊤` iff its vector span is `⊤`. -/
theorem affineSpan_eq_top_iff_vectorSpan_eq_top_of_nontrivial {s : Set P} [Nontrivial P] :
    affineSpan k s = ⊤ ↔ vectorSpan k s = ⊤

(k : Type u_1)
(V : Type u_2)
(P : Type u_3)
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{s : Set P}
[Nontrivial P]


theorem single_mul_apply_of_not_exists_mul [Mul G] (r : k) {g g' : G} (x : MonoidAlgebra k G)
    (h : ¬∃ d, g' = g * d) : (single g r * x) g' = 0

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Mul G]
(r : k)
{g g' : G}
(x : MonoidAlgebra k G)
(h : ¬∃ d, g' = g * d)


theorem coeff_expand {p : ℕ} (hp : 0 < p) (f : R[X]) (n : ℕ) :
    (expand R p f).coeff n = if p ∣ n then f.coeff (n / p) else 0

{R : Type u}
[CommSemiring R]
{p : ℕ}
(hp : 0 < p)
(f : R[X])
(n : ℕ)

((Polynomial.expand R p) f).coeff n = if p ∣ n then f.coeff (n / p) else 0


/-- The product of a family of triangles. -/
@[simps!]
def productTriangle : Triangle C

(T : J → CategoryTheory.Pretriangulated.Triangle C)

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₁]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₂]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₃]

[CategoryTheory.Limits.HasProduct fun j => (CategoryTheory.shiftFunctor C 1).obj (T j).obj₁]

(CategoryTheory.Pretriangulated.productTriangle T).obj₁ = ∏ᶜ fun j => (T j).obj₁


theorem norm_zero_iff (f : PadicSeq p) : f.norm = 0 ↔ f ≈ 0

{p : ℕ}
[Fact (Nat.Prime p)]
(f : PadicSeq p)


lemma mem_piFinset_succ {x : ∀ i, α i} {s : ∀ i, Finset (α i)} :
    x ∈ piFinset s ↔ x 0 ∈ s 0 ∧ tail x ∈ piFinset (tail s)

{n : ℕ}
{α : Fin (n + 1) → Type u_1}
{x : (i : Fin (n + 1)) → α i}
{s : (i : Fin (n + 1)) → Finset (α i)}

x ∈ Fintype.piFinset s ↔ x 0 ∈ s 0 ∧ Fin.tail x ∈ Fintype.piFinset (Fin.tail s)


lemma coe_strictMono : Monotone (Finsupp.toFun : (ι →₀ α) → ι → α)

{ι : Type u_1}
{α : Type u_2}
[Zero α]
[Preorder α]


protected theorem IsRegular.eq : IsRegular a → aᶜᶜ = a


@[simp]
theorem not_inr_le_inl [LE α] [LE β] {a : α} {b : β} : ¬inr b ≤ inl a

{α : Type u_1}
{β : Type u_2}
[LE α]
[LE β]
{a : α}
{b : β}


{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)


theorem subset_set_smul_iff₀ (ha : a ≠ 0) {A B : Set β} : A ⊆ a • B ↔ a⁻¹ • A ⊆ B

{α : Type u_2}
{β : Type u_3}
[GroupWithZero α]
[MulAction α β]
{a : α}
(ha : a ≠ 0)
{A B : Set β}

A ⊆ a • B ↔ a⁻¹ • A ⊆ B


@[simp]
theorem x_neg (a : Solution₁ d) : (-a).x = -a.x


@[to_additive]
theorem inv_mem_inv (hs : s ∈ f) : s⁻¹ ∈ f⁻¹

{α : Type u_2}
[InvolutiveNeg α]
{f : Filter α}
{s : Set α}
(hs : s ∈ f)


theorem isReal_conjugate_iff {φ : K →+* ℂ} : IsReal (conjugate φ) ↔ IsReal φ

NumberField.ComplexEmbedding.IsReal (NumberField.ComplexEmbedding.conjugate φ) ↔ NumberField.ComplexEmbedding.IsReal φ


lemma limsup_add_le_add_limsup
    (h : limsup u f ≠ ⊥ ∨ limsup v f ≠ ⊤) (h' : limsup u f ≠ ⊤ ∨ limsup v f ≠ ⊥) :
    limsup (u + v) f ≤ (limsup u f) + (limsup v f)

(h : Filter.limsup u f ≠ ⊥ ∨ Filter.limsup v f ≠ ⊤)

(h' : Filter.limsup u f ≠ ⊤ ∨ Filter.limsup v f ≠ ⊥)

Filter.limsup (u + v) f ≤ Filter.limsup u f + Filter.limsup v f


@[simp]
theorem coe_comap (s : NonUnitalSubsemiring S) (f : F) : (s.comap f : Set R) = f ⁻¹' s

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
(s : NonUnitalSubsemiring S)
(f : F)

↑(NonUnitalSubsemiring.comap f s) = ⇑f ⁻¹' ↑s


theorem norm_cexp_neg_mul_sq (b : ℂ) (x : ℝ) :
    ‖Complex.exp (-b * (x : ℂ) ^ 2)‖ = exp (-b.re * x ^ 2)

‖cexp (-b * ↑x ^ 2)‖ = rexp (-b.re * x ^ 2)


@[refl]
protected theorem Reachable.refl (u : V) : G.Reachable u u

{V : Type u}
{G : SimpleGraph V}
(u : V)


/-- A set in `E` which is open in the weak topology is open. -/
theorem WeakSpace.isOpen_of_isOpen (V : Set E)
    (hV : IsOpen ((continuousLinearMapToWeakSpace 𝕜 E) '' V : Set (WeakSpace 𝕜 E))) : IsOpen V

(hV : IsOpen (⇑(continuousLinearMapToWeakSpace 𝕜 E) '' V))


@[simp]
lemma Hom.comp_eq_comp {X Y Z : WalkingMulticospan fst snd}
    (f : X ⟶ Y) (g : Y ⟶ Z) : Hom.comp f g = f ≫ g

{X Y Z : CategoryTheory.Limits.WalkingMulticospan fst snd}

CategoryTheory.Limits.WalkingMulticospan.Hom.comp f g = CategoryTheory.CategoryStruct.comp f g


@[simp]
theorem coe_monoidHom_id : (id α : α →* α) = MonoidHom.id α

∀ {x : NonAssocSemiring α}, ↑(RingHom.id α) = MonoidHom.id α


/-- A measurable set `t ⊇ s` such that `μ t = μ s`. It even satisfies `μ (t ∩ u) = μ (s ∩ u)` for
any measurable set `u` if `μ s ≠ ∞`, see `measure_toMeasurable_inter`.
(This property holds without the assumption `μ s ≠ ∞` when the space is s-finite -- for example
σ-finite), see `measure_toMeasurable_inter_of_sFinite`).
If `s` is a null measurable set, then
we also have `t =ᵐ[μ] s`, see `NullMeasurableSet.toMeasurable_ae_eq`.
This notion is sometimes called a "measurable hull" in the literature. -/
irreducible_def toMeasurable (μ : Measure α) (s : Set α) : Set α

{α : Type u_6}
[MeasurableSpace α]
(μ : MeasureTheory.Measure α)
(s : Set α)

MeasureTheory.toMeasurable μ s =
  if h : ∃ t ⊇ s, MeasurableSet t ∧ t =ᵐ[μ] s then h.choose
  else
    if h' : ∃ t ⊇ s, MeasurableSet t ∧ ∀ (u : Set α), MeasurableSet u → μ (t ∩ u) = μ (s ∩ u) then h'.choose
    else ⋯.choose


theorem disjointed_subset (f : ℕ → Set α) (n : ℕ) : disjointed f n ⊆ f n


@[to_additive (attr := simp)]
theorem inv_le_div_iff_le_mul : b⁻¹ ≤ a / c ↔ c ≤ a * b

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


@[continuity]
theorem continuous (h : HomotopyEquiv X Y) : Continuous h

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₕ Y)


theorem rotate'_eq_drop_append_take :
    ∀ {l : List α} {n : ℕ}, n ≤ l.length → l.rotate' n = l.drop n ++ l.take n

n ≤ l.length → l.rotate' n = List.drop n l ++ List.take n l


@[simp]
theorem coe_mk {s : Set E} {h₁ h₂} : ↑(@mk 𝕜 _ _ _ _ s h₁ h₂) = s

{h₁ : ∀ ⦃c : 𝕜⦄, 0 < c → ∀ ⦃x : E⦄, x ∈ s → c • x ∈ s}

{h₂ : ∀ ⦃x : E⦄, x ∈ s → ∀ ⦃y : E⦄, y ∈ s → x + y ∈ s}

↑{ carrier := s, smul_mem' := h₁, add_mem' := h₂ } = s


theorem HasFDerivAt.comp_hasDerivWithinAt (hl : HasFDerivAt l l' (f x))
    (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (l ∘ f) (l' f') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → F}
{f' : F}
(x : 𝕜)
{s : Set 𝕜}
{l : F → E}
{l' : F →L[𝕜] E}
(hl : HasFDerivAt l l' (f x))
(hf : HasDerivWithinAt f f' s x)


protected theorem isOpen_preimage (hf : QuotientMap f) {s : Set Y} : IsOpen (f ⁻¹' s) ↔ IsOpen s

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : QuotientMap f)
{s : Set Y}


@[simp] lemma op_add [Add α] (x y : α) : op (x + y) = op x + op y

MulOpposite.op (x + y) = MulOpposite.op x + MulOpposite.op y


theorem image₂_inter_left [DecidableEq α] (hf : Injective2 f) :
    image₂ f (s ∩ s') t = image₂ f s t ∩ image₂ f s' t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s s' : Finset α}
{t : Finset β}
[DecidableEq α]
(hf : Function.Injective2 f)

Finset.image₂ f (s ∩ s') t = Finset.image₂ f s t ∩ Finset.image₂ f s' t


theorem Set.Finite.isGδ {s : Set X} [T1Space X] (hs : s.Finite) : IsGδ s

{X : Type u_1}
[TopologicalSpace X]
[FirstCountableTopology X]
{s : Set X}
[T1Space X]
(hs : s.Finite)


@[simp] lemma negMulLog_zero : negMulLog (0 : ℝ) = 0


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

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


@[simp]
theorem neg_sup (S T : Submodule R M) : -(S ⊔ T) = -S ⊔ -T

{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommGroup M]
[Module R M]
(S T : Submodule R M)


theorem rpow_two (x : ℝ≥0∞) : x ^ (2 : ℝ) = x ^ 2


theorem exists_unit_of_abs (a : ℤ) : ∃ (u : ℤ) (_ : IsUnit u), (Int.natAbs a : ℤ) = u * a

∃ u, ∃ (_ : IsUnit u), ↑a.natAbs = u * a


@[simp, reassoc]
theorem lift_fac (H' : Set.range g.1.base ⊆ Set.range f.1.base) : lift f g H' ≫ f = g

[H : AlgebraicGeometry.IsOpenImmersion f]

(H' : Set.range ⇑g.val.base ⊆ Set.range ⇑f.val.base)

AlgebraicGeometry.IsOpenImmersion.lift f g H' ≫ f = g


@[simp]
theorem stalkToFiberRingHom_germ' (U : Opens (ProjectiveSpectrum.top 𝒜))
    (x : ProjectiveSpectrum.top 𝒜) (hx : x ∈ U) (s : (Proj.structureSheaf 𝒜).1.obj (op U)) :
    stalkToFiberRingHom 𝒜 x ((Proj.structureSheaf 𝒜).presheaf.germ ⟨x, hx⟩ s) = (s.1 ⟨x, hx⟩ : _)

(U : TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))

(s : ↑((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).val.obj (Opposite.op U)))

(AlgebraicGeometry.stalkToFiberRingHom 𝒜 x)
    (((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).presheaf.germ ⟨x, hx⟩) s) =
  ↑s ⟨x, hx⟩


lemma equation_add_iff (x₁ x₂ y₁ L : R) :
    W.Equation (W.addX x₁ x₂ L) (W.negAddY x₁ x₂ y₁ L) ↔
      (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
(x₁ x₂ y₁ L : R)

W.Equation (W.addX x₁ x₂ L) (W.negAddY x₁ x₂ y₁ L) ↔ Polynomial.eval (W.addX x₁ x₂ L) (W.addPolynomial x₁ y₁ L) = 0


theorem Chain'.drop (h : Chain' R l) (n : ℕ) : Chain' R (drop n l)

{α : Type u}
{R : α → α → Prop}
{l : List α}
(h : List.Chain' R l)
(n : ℕ)


theorem val_le {n : ℕ} [NeZero n] (a : ZMod n) : a.val ≤ n


theorem pullback_snd_eq :
    LightProfinite.pullback.snd f g = (pullbackIsoPullback f g).hom ≫ Limits.pullback.snd f g

{X Y B : LightProfinite}
(f : X ⟶ B)
(g : Y ⟶ B)

LightProfinite.pullback.snd f g =
  CategoryTheory.CategoryStruct.comp (LightProfinite.pullbackIsoPullback f g).hom
    (CategoryTheory.Limits.pullback.snd f g)


theorem effectiveEpi_iff_surjective {X Y : LightProfinite.{u}} (f : X ⟶ Y) :
    EffectiveEpi f ↔ Function.Surjective f

CategoryTheory.EffectiveEpi f ↔ Function.Surjective ⇑f


theorem condCount_empty {s : Set Ω} : condCount s ∅ = 0

{Ω : Type u_1}
[MeasurableSpace Ω]
{s : Set Ω}


@[simp]
theorem eqToIso.inv {X Y : C} (p : X = Y) : (eqToIso p).inv = eqToHom p.symm

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
(p : X = Y)

(CategoryTheory.eqToIso p).inv = CategoryTheory.eqToHom ⋯


@[simp]
theorem ContinuousLinearMap.coe_mkOfIsCompactOperator {f : M₁ →ₛₗ[σ₁₂] M₂}
    (hf : IsCompactOperator f) : (ContinuousLinearMap.mkOfIsCompactOperator hf : M₁ → M₂) = f

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NontriviallyNormedField 𝕜₁]
[NontriviallyNormedField 𝕜₂]
{σ₁₂ : 𝕜₁ →+* 𝕜₂}
[RingHomIsometric σ₁₂]
{M₁ : Type u_3}
{M₂ : Type u_4}
[TopologicalSpace M₁]
[AddCommGroup M₁]
[TopologicalSpace M₂]
[AddCommGroup M₂]
[Module 𝕜₁ M₁]
[Module 𝕜₂ M₂]
[TopologicalAddGroup M₁]
[ContinuousConstSMul 𝕜₁ M₁]
[TopologicalAddGroup M₂]
[ContinuousSMul 𝕜₂ M₂]
{f : M₁ →ₛₗ[σ₁₂] M₂}
(hf : IsCompactOperator ⇑f)

⇑(ContinuousLinearMap.mkOfIsCompactOperator hf) = ⇑f


@[to_additive (attr := simp)]
theorem coe_inv_interval : (↑(s⁻¹) : Interval α) = (↑s)⁻¹

{α : Type u_2}
[OrderedAddCommGroup α]
(s : NonemptyInterval α)


/--
The topology given by the closure operator `J.close` on a Grothendieck topology is the same as `J`.
-/
theorem topologyOfClosureOperator_self :
    (topologyOfClosureOperator J₁.closureOperator fun X Y => J₁.pullback_close) = J₁

(J₁ : CategoryTheory.GrothendieckTopology C)

CategoryTheory.topologyOfClosureOperator J₁.closureOperator ⋯ = J₁


theorem natAbs_le_iff_sq_le {a b : ℤ} : a.natAbs ≤ b.natAbs ↔ a ^ 2 ≤ b ^ 2


theorem isFixedPt_gfp : IsFixedPt f (gfp f)

{α : Type u}
[CompleteLattice α]
(f : α →o α)

Function.IsFixedPt (⇑f) (OrderHom.gfp f)


/-- Formula for orthogonal projection onto a single vector. -/
theorem orthogonalProjection_singleton {v : E} (w : E) :
    (orthogonalProjection (𝕜 ∙ v) w : E) = (⟪v, w⟫ / ((‖v‖ ^ 2 : ℝ) : 𝕜)) • v

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{v : E}
(w : E)

↑((orthogonalProjection (Submodule.span 𝕜 {v})) w) = (⟪v, w⟫_𝕜 / ↑(‖v‖ ^ 2)) • v


/-- At an invertible element `x` of a normed algebra `R`, the Fréchet derivative of the inversion
operation is the linear map `fun t ↦ - x⁻¹ * t * x⁻¹`.

TODO: prove that `Ring.inverse` is analytic and use it to prove a `HasStrictFDerivAt` lemma.
TODO (low prio): prove a version without assumption `[CompleteSpace R]` but within the set of
units. -/
@[fun_prop]
theorem hasFDerivAt_ring_inverse (x : Rˣ) :
    HasFDerivAt Ring.inverse (-mulLeftRight 𝕜 R ↑x⁻¹ ↑x⁻¹) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{R : Type u_6}
[NormedRing R]
[NormedAlgebra 𝕜 R]
[CompleteSpace R]
(x : Rˣ)

HasFDerivAt Ring.inverse (-((ContinuousLinearMap.mulLeftRight 𝕜 R) ↑x⁻¹) ↑x⁻¹) ↑x


theorem ae_le_pi {β : ι → Type*} [∀ i, Preorder (β i)] {f f' : ∀ i, α i → β i}
    (h : ∀ i, f i ≤ᵐ[μ i] f' i) :
    (fun (x : ∀ i, α i) i => f i (x i)) ≤ᵐ[Measure.pi μ] fun x i => f' i (x i)

{μ : (i : ι) → MeasureTheory.Measure (α i)}

[∀ (i : ι), MeasureTheory.SigmaFinite (μ i)]

(fun x i => f i (x i)) ≤ᵐ[MeasureTheory.Measure.pi μ] fun x i => f' i (x i)


@[simp 1100]
theorem dNext_zero_chainComplex (f : ∀ i j, P.X i ⟶ Q.X j) : dNext 0 f = 0

{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{P Q : ChainComplex V ℕ}
(f : (i j : ℕ) → P.X i ⟶ Q.X j)


theorem deriv_fderiv : smulRight (1 : 𝕜 →L[𝕜] 𝕜) (deriv f x) = fderiv 𝕜 f x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}

ContinuousLinearMap.smulRight 1 (deriv f x) = fderiv 𝕜 f x


theorem comp_differentiableWithinAt_iff {f : G → E} {s : Set G} {x : G} :
    DifferentiableWithinAt 𝕜 (iso ∘ f) s x ↔ DifferentiableWithinAt 𝕜 f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(iso : E ≃ₗᵢ[𝕜] F)
{f : G → E}
{s : Set G}
{x : G}

DifferentiableWithinAt 𝕜 (⇑iso ∘ f) s x ↔ DifferentiableWithinAt 𝕜 f s x


/-- The element `0` is right-regular if and only if `R` is trivial. -/
theorem isRightRegular_zero_iff_subsingleton : IsRightRegular (0 : R) ↔ Subsingleton R


theorem rename_prod_mk_eval₂ (j : τ) (g : σ → MvPolynomial σ R) :
    rename (Prod.mk j) (p.eval₂ C g) = p.eval₂ C fun x => rename (Prod.mk j) (g x)

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_4}
[CommSemiring R]
(p : MvPolynomial σ R)
(j : τ)
(g : σ → MvPolynomial σ R)

(MvPolynomial.rename (Prod.mk j)) (MvPolynomial.eval₂ MvPolynomial.C g p) =
  MvPolynomial.eval₂ MvPolynomial.C (fun x => (MvPolynomial.rename (Prod.mk j)) (g x)) p


@[to_additive]
theorem map_comap_eq_self_of_surjective {f : G →* N} (h : Function.Surjective f) (H : Subgroup N) :
    map f (comap f H) = H

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
(h : Function.Surjective ⇑f)
(H : AddSubgroup N)

AddSubgroup.map f (AddSubgroup.comap f H) = H


lemma _root_.Finset.eventuallyLE_iInter {ι : Type*} (s : Finset ι) {f g : ι → Set α}
    (hle : ∀ i ∈ s, f i ≤ᶠ[l] g i) : (⋂ i ∈ s, f i) ≤ᶠ[l] (⋂ i ∈ s, g i)

{α : Type u}
{l : Filter α}
{ι : Type u_2}
(s : Finset ι)
{f g : ι → Set α}
(hle : ∀ i ∈ s, f i ≤ᶠ[l] g i)


@[simp, norm_cast]
theorem coe_one : ((1 : ℤ_[p]) : ℚ_[p]) = 1


@[simp]
theorem Bool.inf_eq_band : (· ⊓ ·) = and


lemma restrictScalarsId'App_inv_apply (M : ModuleCat R) (x : M) :
    (restrictScalarsId'App f hf M).inv x = x

{R : Type u₁}
[Ring R]
(f : R →+* R)
(hf : f = RingHom.id R)
(M : ModuleCat R)
(x : ↑M)

(ModuleCat.restrictScalarsId'App f hf M).inv x = x


/-- The `p`-adic valuation of `n!` is equal to the `p`-adic valuation of the factorial of the
largest multiple of `p` below `n`, i.e. `(p * ⌊n / p⌋)!`. -/
@[simp] theorem padicValNat_mul_div_factorial (n : ℕ) [hp : Fact p.Prime] :
    padicValNat p (p * (n / p))! = padicValNat p n !

{p : ℕ}
(n : ℕ)
[hp : Fact (Nat.Prime p)]


/-- The binary cofan whose point is `coprod F G`. -/
@[simps!]
def binaryCoproductCocone : BinaryCofan F G

(F G : CategoryTheory.Functor C (Type w))

∀ {X Y : C} (f : X ⟶ Y) (x : F.obj X ⊕ G.obj X),
  (CategoryTheory.FunctorToTypes.binaryCoproductCocone F G).pt.map f x =
    Sum.rec (motive := fun t => x = t → F.obj Y ⊕ G.obj Y) (fun val h => Sum.inl (F.map f val))
      (fun val h => Sum.inr (G.map f val)) x ⋯


theorem isVonNBounded_iff {s : Set E} : Bornology.IsVonNBounded 𝕜 s ↔ Bornology.IsBounded s

(𝕜 : Type u_1)
{E : Type u_3}
[NontriviallyNormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}


theorem isGreatest_max' : IsGreatest (↑s) (s.max' H)

{α : Type u_2}
[LinearOrder α]
(s : Finset α)
(H : s.Nonempty)


/-- The shadow of a family of `r`-sets is a family of `r - 1`-sets. -/
protected theorem _root_.Set.Sized.shadow (h𝒜 : (𝒜 : Set (Finset α)).Sized r) :
    (∂ 𝒜 : Set (Finset α)).Sized (r - 1)

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{r : ℕ}
(h𝒜 : Set.Sized r ↑𝒜)


lemma QuasiIso.exact_iff {S₁ S₂ : ShortComplex C} (φ : S₁ ⟶ S₂)
    [S₁.HasHomology] [S₂.HasHomology] [QuasiIso φ] : S₁.Exact ↔ S₂.Exact


theorem isLittleO_pow_sub_sub (x₀ : E') {m : ℕ} (h : 1 < m) :
    (fun x => ‖x - x₀‖ ^ m) =o[𝓝 x₀] fun x => x - x₀

{E' : Type u_6}
[SeminormedAddCommGroup E']
(x₀ : E')
{m : ℕ}
(h : 1 < m)


theorem continuous_min : Continuous fun p : α × α => min p.1 p.2

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]


theorem constantCoeff_wittStructureRat (Φ : MvPolynomial idx ℚ) (h : constantCoeff Φ = 0) (n : ℕ) :
    constantCoeff (wittStructureRat p Φ n) = 0

(p : ℕ)
{idx : Type u_2}
[hp : Fact (Nat.Prime p)]
(Φ : MvPolynomial idx ℚ)
(h : MvPolynomial.constantCoeff Φ = 0)
(n : ℕ)

MvPolynomial.constantCoeff (wittStructureRat p Φ n) = 0


theorem toFun_eq_coe (f : α →+*o β) : f.toFun = f

{α : Type u_2}
{β : Type u_3}
[NonAssocSemiring α]
[Preorder α]
[NonAssocSemiring β]
[Preorder β]
(f : α →+*o β)


theorem nonempty_of_mem {x} (h : x ∈ s) : s.Nonempty

{α : Type u}
{s : Set α}
{x : α}
(h : x ∈ s)


@[reassoc (attr := simp)]
theorem counitInv_functor_comp (e : C ≌ D) (X : C) :
    e.counitInv.app (e.functor.obj X) ≫ e.functor.map (e.unitInv.app X) = 𝟙 (e.functor.obj X)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : C ≌ D)
(X : C)

CategoryTheory.CategoryStruct.comp (e.counitInv.app (e.functor.obj X)) (e.functor.map (e.unitInv.app X)) =
  CategoryTheory.CategoryStruct.id (e.functor.obj X)


/-- The Gelfand transform is an isometry when the algebra is a C⋆-algebra over `ℂ`. -/
theorem gelfandTransform_isometry : Isometry (gelfandTransform ℂ A)

(A : Type u_1)
[NormedCommRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[StarModule ℂ A]

Isometry ⇑(WeakDual.gelfandTransform ℂ A)


/-- The inclusion functor from sheaves to presheaves. -/
@[simps]
def sheafToPresheaf : Sheaf J A ⥤ Cᵒᵖ ⥤ A

(J : CategoryTheory.GrothendieckTopology C)

(CategoryTheory.sheafToPresheaf J A).obj self = self.val


/-- `f : α →+* β` has a trivial codomain iff `f 1 = 0`. -/
theorem codomain_trivial_iff_map_one_eq_zero : (0 : β) = 1 ↔ f 1 = 0

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), 0 = 1 ↔ f 1 = 0


theorem impartialAux_def {G : PGame} :
    G.ImpartialAux ↔
      (G ≈ -G) ∧ (∀ i, ImpartialAux (G.moveLeft i)) ∧ ∀ j, ImpartialAux (G.moveRight j)

G.ImpartialAux ↔
  G ≈ -G ∧ (∀ (i : G.LeftMoves), (G.moveLeft i).ImpartialAux) ∧ ∀ (j : G.RightMoves), (G.moveRight j).ImpartialAux


theorem TopologicalSpace.ext_iff_isClosed {t₁ t₂ : TopologicalSpace X} :
    t₁ = t₂ ↔ ∀ s, IsClosed[t₁] s ↔ IsClosed[t₂] s

{X : Type u}
{t₁ t₂ : TopologicalSpace X}

t₁ = t₂ ↔ ∀ (s : Set X), IsClosed s ↔ IsClosed s


@[to_additive]
theorem map_comap_eq_self {f : G →* N} {H : Subgroup N} (h : H ≤ f.range) :
    map f (comap f H) = H

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
{H : AddSubgroup N}
(h : H ≤ f.range)


theorem topologicalSpace_mono [TopologicalSpace F] [TopologicalAddGroup F] (h : 𝔖₂ ⊆ 𝔖₁) :
    instTopologicalSpace σ F 𝔖₁ ≤ instTopologicalSpace σ F 𝔖₂

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NormedField 𝕜₁]
[NormedField 𝕜₂]
(σ : 𝕜₁ →+* 𝕜₂)
{E : Type u_3}
(F : Type u_4)
[AddCommGroup E]
[Module 𝕜₁ E]
[TopologicalSpace E]
[AddCommGroup F]
[Module 𝕜₂ F]
{𝔖₁ 𝔖₂ : Set (Set E)}
[TopologicalSpace F]
[TopologicalAddGroup F]
(h : 𝔖₂ ⊆ 𝔖₁)

UniformConvergenceCLM.instTopologicalSpace σ F 𝔖₁ ≤ UniformConvergenceCLM.instTopologicalSpace σ F 𝔖₂


theorem mul_le_mul_right {n m : Nat} (k : Nat) (h : n ≤ m) : n * k ≤ m * k


@[simp]
theorem compPMap_apply (g : F →ₗ[R] G) (f : E →ₗ.[R] F) (x) : g.compPMap f x = g (f x)

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{G : Type u_4}
[AddCommGroup G]
[Module R G]
(g : F →ₗ[R] G)
(f : E →ₗ.[R] F)
(x : ↥(g.compPMap f).domain)


@[simp]
lemma ofBijective_symm_apply_apply (f : α → β) (hf : Bijective f) (x : α) :
    (ofBijective f hf).symm (f x) = x

{α : Sort u}
{β : Sort v}
(f : α → β)
(hf : Function.Bijective f)
(x : α)


@[to_additive]
theorem inv_mem_inv (ha : a ∈ s) : a⁻¹ ∈ s⁻¹

{α : Type u_2}
[OrderedCommGroup α]
(s : NonemptyInterval α)
(a : α)
(ha : a ∈ s)


@[simp] theorem run_modify [Monad m] (f : σ → σ) (s : σ) : (modify f : StateT σ m PUnit).run s = pure (⟨⟩, f s)

{m : Type u_1 → Type u_2}
{σ : Type u_1}
[Monad m]
(f : σ → σ)
(s : σ)

(modify f).run s = pure (PUnit.unit, f s)


theorem wEquiv.refl {α : TypeVec n} (x : q.P.W α) : WEquiv x x

{n : ℕ}
{F : TypeVec.{u} (n + 1) → Type u}
[q : MvQPF F]
{α : TypeVec.{u} n}
(x : (MvQPF.P F).W α)


theorem exp_multiset_sum (s : Multiset ℂ) : exp s.sum = (s.map exp).prod

Complex.exp s.sum = (Multiset.map Complex.exp s).prod


theorem Intersecting.not_compl_mem {s : Set α} (hs : s.Intersecting) {a : α} (ha : a ∈ s) :
    aᶜ ∉ s

{α : Type u_1}
[BooleanAlgebra α]
{s : Set α}
(hs : s.Intersecting)
{a : α}
(ha : a ∈ s)


/-- A topological space is quasi-separated if the intersections of any pairs of compact open
subsets are still compact. -/
@[mk_iff]
class QuasiSeparatedSpace (α : Type*) [TopologicalSpace α] : Prop where
  /-- The intersection of two open compact subsets of a quasi-separated space is compact. -/
  inter_isCompact :
    ∀ U V : Set α, IsOpen U → IsCompact U → IsOpen V → IsCompact V → IsCompact (U ∩ V)

QuasiSeparatedSpace α ↔ ∀ (U V : Set α), IsOpen U → IsCompact U → IsOpen V → IsCompact V → IsCompact (U ∩ V)


@[simp]
theorem _root_.OrderIso.isBoundedUnder_le_comp [Preorder α] [Preorder β] (e : α ≃o β) {l : Filter γ}
    {u : γ → α} : (IsBoundedUnder (· ≤ ·) l fun x => e (u x)) ↔ IsBoundedUnder (· ≤ ·) l u

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Preorder α]
[Preorder β]
(e : α ≃o β)
{l : Filter γ}
{u : γ → α}

(Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l fun x => e (u x)) ↔ Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l u


theorem prod_smul_empty (w : NormalWord d) : w.prod • empty = w

{d : Monoid.PushoutI.NormalWord.Transversal φ}

w.prod • Monoid.PushoutI.NormalWord.empty = w


theorem ext_inner_left_basis {ι : Type*} {x y : E} (b : Basis ι 𝕜 E)
    (h : ∀ i : ι, ⟪b i, x⟫ = ⟪b i, y⟫) : x = y

(h : ∀ (i : ι), ⟪b i, x⟫_𝕜 = ⟪b i, y⟫_𝕜)


theorem tendsto_left_nhds_uniformity {a : α} : Tendsto (fun a' => (a, a')) (𝓝 a) (𝓤 α)

Filter.Tendsto (fun a' => (a, a')) (𝓝 a) (𝓤 α)


@[simp]
theorem funMap_sumInr [(L'.sum L).Structure M] [(LHom.sumInr : L →ᴸ L'.sum L).IsExpansionOn M] {n}
    {f : L.Functions n} {x : Fin n → M} : @funMap (L'.sum L) M _ n (Sum.inr f) x = funMap f x

FirstOrder.Language.Structure.funMap (Sum.inr f) x = FirstOrder.Language.Structure.funMap f x


@[simp]
theorem subtypeEquiv_apply {p : α → Prop} {q : β → Prop}
    (e : α ≃ β) (h : ∀ a : α, p a ↔ q (e a)) (x : { x // p x }) :
    e.subtypeEquiv h x = ⟨e x, (h _).1 x.2⟩

{α : Sort u_1}
{β : Sort u_2}
{p : α → Prop}
{q : β → Prop}
(e : α ≃ β)
(h : ∀ (a : α), p a ↔ q (e a))
(x : { x // p x })


lemma uncurry_obj_injective {F₁ F₂ : B ⥤ C ⥤ D} (h : uncurry.obj F₁ = uncurry.obj F₂) :
    F₁ = F₂

{F₁ F₂ : CategoryTheory.Functor B (CategoryTheory.Functor C D)}

(h : CategoryTheory.uncurry.obj F₁ = CategoryTheory.uncurry.obj F₂)


theorem dual_rotateR (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (rotateR l x r) = rotateL (dual r) x (dual l)

{α : Type u_1}
(l : Ordnode α)
(x : α)
(r : Ordnode α)

(l.rotateR x r).dual = r.dual.rotateL x l.dual


theorem get?_zip (s : Seq α) (t : Seq β) (n : ℕ) :
    get? (zip s t) n = Option.map₂ Prod.mk (get? s n) (get? t n)

{α : Type u}
{β : Type v}
(s : Stream'.Seq α)
(t : Stream'.Seq β)
(n : ℕ)

(s.zip t).get? n = Option.map₂ Prod.mk (s.get? n) (t.get? n)


@[trans]
protected theorem trans [Monoid α] : ∀ {x y z : α}, x ~ᵤ y → y ~ᵤ z → x ~ᵤ z


@[simp, fun_prop]
protected theorem DifferentiableAt.prod_map (hf : DifferentiableAt 𝕜 f p.1)
    (hf₂ : DifferentiableAt 𝕜 f₂ p.2) : DifferentiableAt 𝕜 (fun p : E × G => (f p.1, f₂ p.2)) p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{G' : Type u_5}
[NormedAddCommGroup G']
[NormedSpace 𝕜 G']
{f : E → F}
{f₂ : G → G'}
(p : E × G)
(hf : DifferentiableAt 𝕜 f p.1)
(hf₂ : DifferentiableAt 𝕜 f₂ p.2)

DifferentiableAt 𝕜 (fun p => (f p.1, f₂ p.2)) p


theorem of_unramified_and_smooth [h₁ : FormallyUnramified R A]
    [h₂ : FormallySmooth R A] : FormallyEtale R A

{R : Type u}
[CommSemiring R]
{A : Type u}
[Semiring A]
[Algebra R A]
[h₁ : Algebra.FormallyUnramified R A]
[h₂ : Algebra.FormallySmooth R A]


@[simp]
theorem equivOfMinpoly_symm (pb : PowerBasis A S) (pb' : PowerBasis A S')
    (h : minpoly A pb.gen = minpoly A pb'.gen) :
    (pb.equivOfMinpoly pb' h).symm = pb'.equivOfMinpoly pb h.symm

(pb.equivOfMinpoly pb' h).symm = pb'.equivOfMinpoly pb ⋯


protected theorem mul_lt_mul_of_lt_of_lt {a b c d : Nat} (hac : a < c) (hbd : b < d) :
    a * b < c * d


@[to_additive]
protected theorem Injective [Mul α] [PartialOrder α] {a : α} (ha : MulLECancellable a) :
    Injective (a * ·)

{α : Type u_1}
[Mul α]
[PartialOrder α]
{a : α}
(ha : MulLECancellable a)


theorem localization_away_map_finite (r : R) [IsLocalization.Away r R']
    [IsLocalization.Away (f r) S'] (hf : f.Finite) : (IsLocalization.Away.map R' S' f r).Finite

{R S : Type u}
[CommRing R]
[CommRing S]
(R' S' : Type u)
[CommRing R']
[CommRing S']
(f : R →+* S)
[Algebra R R']
[Algebra S S']
(r : R)
[IsLocalization.Away r R']
[IsLocalization.Away (f r) S']
(hf : f.Finite)


theorem exists_subset_encard_eq {k : ℕ∞} (hk : k ≤ s.encard) : ∃ t, t ⊆ s ∧ t.encard = k

{α : Type u_1}
{s : Set α}
{k : ℕ∞}
(hk : k ≤ s.encard)


@[simp]
theorem disjiUnion_map_sigma_mk :
    s.disjiUnion (fun i => (t i).map (Embedding.sigmaMk i)) pairwiseDisjoint_map_sigmaMk =
      s.sigma t

{ι : Type u_1}
{α : ι → Type u_2}
{s : Finset ι}
{t : (i : ι) → Finset (α i)}

s.disjiUnion (fun i => Finset.map (Function.Embedding.sigmaMk i) (t i)) ⋯ = s.sigma t


lemma MapsTo.comp_left (g : β → γ) (hf : MapsTo f s t) : MapsTo (g ∘ f) s (g '' t)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
{t : Set β}
{f : α → β}
(g : β → γ)
(hf : Set.MapsTo f s t)


theorem StronglyMeasurable.integral_kernel_prod_right' ⦃f : α × β → E⦄ (hf : StronglyMeasurable f) :
    StronglyMeasurable fun x => ∫ y, f (x, y) ∂κ x

⦃f : α × β → E⦄

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable fun x => ∫ (y : β), f (x, y) ∂κ x


@[to_additive]
theorem le_comap_of_map_le {T : Subsemigroup N} {f : M →ₙ* N} : S.map f ≤ T → S ≤ T.comap f

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(S : AddSubsemigroup M)
{T : AddSubsemigroup N}
{f : AddHom M N}

AddSubsemigroup.map f S ≤ T → S ≤ AddSubsemigroup.comap f T


theorem mul (f g : F[X]) (hf : f ≠ 0) (hg : g ≠ 0) [IsSplittingField F K f]
    [IsSplittingField K L (g.map <| algebraMap F K)] : IsSplittingField F L (f * g)

[Polynomial.IsSplittingField K L (Polynomial.map (algebraMap F K) g)]


{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[AddGroup β]
[TopologicalAddGroup β]
(f : α →C₀ β)


/-- `MeasureTheory.Lp.compMeasurePreserving` as a linear map. -/
@[simps]
def compMeasurePreservingₗ (f : α → β) (hf : MeasurePreserving f μ μb) :
    Lp E p μb →ₗ[𝕜] Lp E p μ

(hf : MeasureTheory.MeasurePreserving f μ μb)

∀ (a : ↥(MeasureTheory.Lp E p μb)),
  (MeasureTheory.Lp.compMeasurePreservingₗ 𝕜 f hf) a = (↑(MeasureTheory.Lp.compMeasurePreserving f hf)).toFun a


@[reassoc (attr := simp), elementwise]
lemma appLE_appIso_inv {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] {U : Y.Opens}
    {V : X.Opens} (e : V ≤ f ⁻¹ᵁ U) :
    f.appLE U V e ≫ (f.appIso V).inv =
        Y.presheaf.map (homOfLE <| (f.image_le_image_of_le e).trans
          (f.image_preimage_eq_opensRange_inter U ▸ inf_le_right)).op

(e : V ≤ (TopologicalSpace.Opens.map f.val.base).obj U)

AlgebraicGeometry.Scheme.Hom.appLE f U V e ≫ (AlgebraicGeometry.Scheme.Hom.appIso f V).inv =
  Y.presheaf.map (CategoryTheory.homOfLE ⋯).op


theorem ext (A₁ A₂ : IndexSet Δ) (h₁ : A₁.1 = A₂.1) (h₂ : A₁.e ≫ eqToHom (by rw [h₁]) = A₂.e) :
    A₁ = A₂

(A₁ A₂ : SimplicialObject.Splitting.IndexSet Δ)

(h₂ : A₁.e ≫ CategoryTheory.eqToHom ⋯ = A₂.e)


theorem dropWhile_eq (p : Char → Bool) (s : String) : s.dropWhile p = ⟨s.1.dropWhile p⟩

s.dropWhile p = { data := List.dropWhile p s.data }


theorem DvdNotUnit.not_unit [CommMonoidWithZero α] {p q : α} (hp : DvdNotUnit p q) : ¬IsUnit q

{α : Type u_1}
[CommMonoidWithZero α]
{p q : α}
(hp : DvdNotUnit p q)


theorem tendsto_sin_pi_div_two : Tendsto sin (𝓝[<] (π / 2)) (𝓝 1)

Filter.Tendsto Real.sin (𝓝[<] (Real.pi / 2)) (𝓝 1)


@[to_additive]
theorem lipschitzWith_iff_norm_div_le {f : E → F} {C : ℝ≥0} :
    LipschitzWith C f ↔ ∀ x y, ‖f x / f y‖ ≤ C * ‖x / y‖

{E : Type u_3}
{F : Type u_4}
[SeminormedGroup E]
[SeminormedGroup F]
{f : E → F}
{C : ℝ≥0}

LipschitzWith C f ↔ ∀ (x y : E), ‖f x / f y‖ ≤ ↑C * ‖x / y‖


@[simp]
theorem Quotient.equiv_symm {R M N : Type*} [CommRing R] [AddCommGroup M] [Module R M]
    [AddCommGroup N] [Module R N] (P : Submodule R M) (Q : Submodule R N) (f : M ≃ₗ[R] N)
    (hf : P.map f = Q) :
    (Quotient.equiv P Q f hf).symm =
      Quotient.equiv Q P f.symm ((Submodule.map_symm_eq_iff f).mpr hf)

{R : Type u_5}
{M : Type u_6}
{N : Type u_7}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : Submodule R M)
(Q : Submodule R N)
(f : M ≃ₗ[R] N)
(hf : Submodule.map f P = Q)

(Submodule.Quotient.equiv P Q f hf).symm = Submodule.Quotient.equiv Q P f.symm ⋯


@[simp]
theorem AlgEquiv.restrictNormal_commutes [Normal F E] (x : E) :
    algebraMap E K₂ (χ.restrictNormal E x) = χ (algebraMap E K₁ x)

{F : Type u_1}
{K₁ : Type u_3}
{K₂ : Type u_4}
[Field F]
[Field K₁]
[Field K₂]
[Algebra F K₁]
[Algebra F K₂]
(χ : K₁ ≃ₐ[F] K₂)
(E : Type u_6)
[Field E]
[Algebra F E]
[Algebra E K₁]
[Algebra E K₂]
[IsScalarTower F E K₁]
[IsScalarTower F E K₂]
[Normal F E]
(x : E)

(algebraMap E K₂) ((χ.restrictNormal E) x) = χ ((algebraMap E K₁) x)


@[to_additive]
theorem sup_eq_closure (N N' : Submonoid M) : N ⊔ N' = closure ((N : Set M) ∪ (N' : Set M))

{M : Type u_1}
[MulOneClass M]
(N N' : Submonoid M)


@[to_additive]
theorem HasProd.multipliable (h : HasProd f a) : Multipliable f

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}
(h : HasProd f a)


theorem exists_succ_nth_stream_of_fr_zero {ifp_succ_n : IntFractPair K}
    (stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp_succ_n)
    (succ_nth_fr_eq_zero : ifp_succ_n.fr = 0) :
    ∃ ifp_n : IntFractPair K, IntFractPair.stream v n = some ifp_n ∧ ifp_n.fr⁻¹ = ⌊ifp_n.fr⁻¹⌋

{ifp_succ_n : GenContFract.IntFractPair K}

(stream_succ_nth_eq : GenContFract.IntFractPair.stream v (n + 1) = some ifp_succ_n)

∃ ifp_n, GenContFract.IntFractPair.stream v n = some ifp_n ∧ ifp_n.fr⁻¹ = ↑⌊ifp_n.fr⁻¹⌋


@[simp]
theorem decode_encode [DecidableEq α] (s : Sym (Option α) n.succ) : decode (encode s) = s

{α : Type u_1}
{n : ℕ}
[DecidableEq α]
(s : Sym (Option α) n.succ)

SymOptionSuccEquiv.decode (SymOptionSuccEquiv.encode s) = s


@[simp] theorem all_cons : (a::l).all f = (f a && l.all f)

∀ {α : Type u_1} {a : α} {l : List α} {f : α → Bool}, (a :: l).all f = (f a && l.all f)


/-- Reformulation of `hasSum_expZeta_of_one_lt_re` using `LSeriesHasSum`. -/
lemma LSeriesHasSum_exp (a : ℝ) {s : ℂ} (hs : 1 < re s) :
    LSeriesHasSum (cexp <| 2 * π * I * a * ·) s (expZeta a s)

LSeriesHasSum (fun x => cexp (2 * ↑π * Complex.I * ↑a * ↑x)) s (HurwitzZeta.expZeta (↑a) s)


@[simp, mfld_simps]
theorem restr_univ {e : PartialHomeomorph X Y} : e.restr univ = e

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e : PartialHomeomorph X Y}


/-- Maximal intersecting families are upper sets. Finset version. -/
theorem Intersecting.isUpperSet' {s : Finset α} (hs : (s : Set α).Intersecting)
    (h : ∀ t : Finset α, (t : Set α).Intersecting → s ⊆ t → s = t) : IsUpperSet (s : Set α)

(h : ∀ (t : Finset α), (↑t).Intersecting → s ⊆ t → s = t)


theorem interior_reProdIm (s t : Set ℝ) : interior (s ×ℂ t) = interior s ×ℂ interior t


@[simp] theorem sum_append : Nat.sum (l₁ ++ l₂) = Nat.sum l₁ + Nat.sum l₂


theorem measurable_lineDeriv_uncurry [MeasurableSpace F] [BorelSpace F]
    (hf : Continuous f) : Measurable (fun (p : E × E) ↦ lineDeriv 𝕜 f p.1 p.2)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[LocallyCompactSpace 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[MeasurableSpace E]
[OpensMeasurableSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f : E → F}
[SecondCountableTopology E]
[MeasurableSpace F]
[BorelSpace F]
(hf : Continuous f)

Measurable fun p => lineDeriv 𝕜 f p.1 p.2


theorem coe_center : ↑(center R) = Set.center R


/-- Combine two `PartialEquiv`s using `Set.piecewise`. The source of the new `PartialEquiv` is
`s.ite e.source e'.source = e.source ∩ s ∪ e'.source \ s`, and similarly for target.  The function
sends `e.source ∩ s` to `e.target ∩ t` using `e` and `e'.source \ s` to `e'.target \ t` using `e'`,
and similarly for the inverse function. The definition assumes `e.isImage s t` and
`e'.isImage s t`. -/
@[simps (config := .asFn)]
def piecewise (e e' : PartialEquiv α β) (s : Set α) (t : Set β) [∀ x, Decidable (x ∈ s)]
    [∀ y, Decidable (y ∈ t)] (H : e.IsImage s t) (H' : e'.IsImage s t) :
    PartialEquiv α β

{α : Type u_1}
{β : Type u_2}
(e e' : PartialEquiv α β)
(s : Set α)
(t : Set β)
[(x : α) → Decidable (x ∈ s)]
[(y : β) → Decidable (y ∈ t)]
(H : e.IsImage s t)
(H' : e'.IsImage s t)

(e.piecewise e' s t H H').source = s.ite e.source e'.source


theorem u_sSup_l_image [CompleteLattice α] [CompleteLattice β] (gi : GaloisCoinsertion l u)
    (s : Set α) : u (sSup (l '' s)) = sSup s

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[CompleteLattice α]
[CompleteLattice β]
(gi : GaloisCoinsertion l u)
(s : Set α)


theorem closure_unionᵢ {ι} (s : ι → Set M) : closure L (⋃ i, s i) = ⨆ i, closure L (s i)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{ι : Sort u_3}
(s : ι → Set M)

(FirstOrder.Language.Substructure.closure L).toFun (⋃ i, s i) =
  ⨆ i, (FirstOrder.Language.Substructure.closure L).toFun (s i)


@[simp] lemma latticeClosure_empty : latticeClosure (∅ : Set α) = ∅


lemma map_prod_map {α' : Type*} [MeasurableSpace α'] {β' : Type*} [MeasurableSpace β']
    {f : α → α'} {g : β → β'} (f_mble : Measurable f) (g_mble : Measurable g) :
    (μ.map f_mble.aemeasurable).prod (ν.map g_mble.aemeasurable)
      = (μ.prod ν).map (f_mble.prod_map g_mble).aemeasurable

(μ : MeasureTheory.ProbabilityMeasure α)

(ν : MeasureTheory.ProbabilityMeasure β)

(μ.map ⋯).prod (ν.map ⋯) = (μ.prod ν).map ⋯


/-- The language of the map is the map of the language. -/
@[simp]
theorem matches'_map (f : α → β) :
    ∀ P : RegularExpression α, (P.map f).matches' = Language.map f P.matches'

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(P : RegularExpression α)

(RegularExpression.map f P).matches' = (Language.map f) P.matches'


/-- Given `Uᵢ ×[Z] Y`, this is the glued fibered product `X ×[Z] Y`. -/
@[simps U V f t t', simps (config := .lemmasOnly) J]
def gluing : Scheme.GlueData.{u}

[∀ (i : 𝒰.J), CategoryTheory.Limits.HasPullback (𝒰.map i ≫ f) g]

(AlgebraicGeometry.Scheme.Pullback.gluing 𝒰 f g).J = 𝒰.J


@[simp]
theorem funUnique_symm_apply {α β : Type*} [Unique α] [Preorder β] :
    ((funUnique α β).symm : β → α → β) = Function.const α

{α : Type u_6}
{β : Type u_7}
[Unique α]
[Preorder β]

⇑(OrderIso.funUnique α β).symm = Function.const α


/--
If `(M', f : M ⟶ M')` satisfies universal property of localized module, then `M'` is isomorphic to
`LocalizedModule S M` as an `R`-module.
-/
@[simps!]
noncomputable def iso : LocalizedModule S M ≃ₗ[R] M'

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]

∀ (a : M'),
  (IsLocalizedModule.iso S f).symm a = (Equiv.ofBijective ⇑(IsLocalizedModule.fromLocalizedModule S f) ⋯).symm a


theorem le_def {α} {a b : DynkinSystem α} : a ≤ b ↔ a.Has ≤ b.Has

{α : Type u_2}
{a b : MeasurableSpace.DynkinSystem α}


theorem neg_eq_self_mod_two (a : ZMod 2) : -a = a


/-- `f` is a measure preserving map w.r.t. measures `μa` and `μb` if `f` is measurable
and `map f μa = μb`. -/
structure MeasurePreserving (f : α → β)
  (μa : Measure α := by volume_tac) (μb : Measure β := by volume_tac) : Prop where
  protected measurable : Measurable f
  protected map_eq : map f μa = μb

{μa : autoParam (MeasureTheory.Measure α) _auto✝}

{μb : autoParam (MeasureTheory.Measure β) _auto✝¹}

(self : MeasureTheory.MeasurePreserving f μa μb)


theorem coeff_frobeniusFun (x : 𝕎 R) (n : ℕ) :
    coeff (frobeniusFun x) n = MvPolynomial.aeval x.coeff (frobeniusPoly p n)

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

x.frobeniusFun.coeff n = (MvPolynomial.aeval x.coeff) (WittVector.frobeniusPoly p n)


@[simp] theorem toBialgebraCatIso_refl : toBialgebraCatIso (BialgEquiv.refl R X) = .refl _

{R : Type u}
[CommRing R]
{X : Type v}
[Ring X]
[Bialgebra R X]

(BialgEquiv.refl R X).toBialgebraCatIso = CategoryTheory.Iso.refl (BialgebraCat.of R X)


@[to_additive]
theorem map_sup (H K : Subgroup G) (f : G →* N) : (H ⊔ K).map f = H.map f ⊔ K.map f

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

Subgroup.map f (H ⊔ K) = Subgroup.map f H ⊔ Subgroup.map f K


@[simp]
theorem inv_whiskerRight {X Y : C} (f : X ⟶ Y) (Z : C) [IsIso f] :
    inv (f ▷ Z) = inv f ▷ Z

{C : Type u}
[𝒞 : CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{X Y : C}
(f : X ⟶ Y)
(Z : C)
[CategoryTheory.IsIso f]

CategoryTheory.inv (CategoryTheory.MonoidalCategory.whiskerRight f Z) =
  CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.inv f) Z


protected theorem RightInverse.id {g : β → α} {f : α → β} (h : RightInverse g f) : f ∘ g = id

{α : Type u₁}
{β : Type u₂}
{g : β → α}
{f : α → β}
(h : Function.RightInverse g f)


/-- Linear equivalence between dependent functions `(i : Fin 2) → M i` and `M 0 × M 1`. -/
@[simps (config := { simpRhs := true, fullyApplied := false }) symm_apply]
def piFinTwo (M : Fin 2 → Type v)
    [(i : Fin 2) → AddCommMonoid (M i)] [(i : Fin 2) → Module R (M i)] :
    ((i : Fin 2) → M i) ≃ₗ[R] M 0 × M 1

(R : Type u)
[Semiring R]
(M : Fin 2 → Type v)
[(i : Fin 2) → AddCommMonoid (M i)]
[(i : Fin 2) → Module R (M i)]

⇑(LinearEquiv.piFinTwo R M).symm = fun p => Fin.cons p.1 (Fin.cons p.2 finZeroElim)


theorem inner_re_zero_left (x : E) : re ⟪0, x⟫ = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x : E)


theorem range_iff_surjective : range f = univ ↔ Surjective f

{α : Type u_1}
{ι : Sort u_4}
{f : ι → α}

Set.range f = Set.univ ↔ Function.Surjective f


/-- `AbsoluteValue.abs` is `abs` as a bundled `AbsoluteValue`. -/
@[simps]
protected def abs : AbsoluteValue S S

{S : Type u_6}
[LinearOrderedRing S]
(a : S)


theorem ofLe_eq_comap_incl : ofLe h = K.comap K'.incl

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{K K' : LieSubalgebra R L}
(h : K ≤ K')

LieSubalgebra.ofLe h = LieSubalgebra.comap K'.incl K


@[simp]
theorem nextOr_self_cons_cons (xs : List α) (x y d : α) : nextOr (x :: y :: xs) x d = y

{α : Type u_1}
[DecidableEq α]
(xs : List α)
(x y d : α)


/-- The composition of lax braided monoidal functors. -/
@[simps!]
def comp (F : LaxBraidedFunctor C D) (G : LaxBraidedFunctor D E) : LaxBraidedFunctor C E

(F : CategoryTheory.LaxBraidedFunctor C D)

(G : CategoryTheory.LaxBraidedFunctor D E)

(F.comp G).μ X Y = G.μ (F.obj X) (F.obj Y) ≫ G.map (F.μ X Y)


@[simp]
protected theorem map_add [DecidableEq ι] (m : ∀ i, M₁ i) (i : ι) (x y : M₁ i) :
    f (update m i (x + y)) = f (update m i x) + f (update m i y)

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)
[DecidableEq ι]
(m : (i : ι) → M₁ i)
(i : ι)
(x y : M₁ i)

f (Function.update m i (x + y)) = f (Function.update m i x) + f (Function.update m i y)


/-- Limit cones on `F` are unique up to isomorphism. -/
@[simps]
def uniqueUpToIso {s t : Cone F} (P : IsLimit s) (Q : IsLimit t) : s ≅ t

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{s t : CategoryTheory.Limits.Cone F}
(P : CategoryTheory.Limits.IsLimit s)
(Q : CategoryTheory.Limits.IsLimit t)

(P.uniqueUpToIso Q).hom = Q.liftConeMorphism s


@[simp] lemma traceForm_eq_zero_of_isTrivial [IsTrivial L M] :
    traceForm R L M = 0

(R : Type u_1)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieModule.IsTrivial L M]


theorem forall_mem_zpowers {x : G} {p : G → Prop} : (∀ g ∈ zpowers x, p g) ↔ ∀ m : ℤ, p (x ^ m)

{G : Type u_1}
[Group G]
{x : G}
{p : G → Prop}

(∀ g ∈ Subgroup.zpowers x, p g) ↔ ∀ (m : ℤ), p (x ^ m)


theorem set_of_valid (cs cs' : List Char) (c' : Char) :
    set ⟨cs ++ cs'⟩ ⟨utf8Len cs⟩ c' = ⟨cs ++ cs'.modifyHead fun _ => c'⟩

{ data := cs ++ cs' }.set { byteIdx := String.utf8Len cs } c' = { data := cs ++ List.modifyHead (fun x => c') cs' }


@[to_additive]
theorem append_append_left_iff : ∀ L, Red (L ++ L₁) (L ++ L₂) ↔ Red L₁ L₂

{α : Type u}
{L₁ L₂ : List (α × Bool)}
(L : List (α × Bool))

FreeAddGroup.Red (L ++ L₁) (L ++ L₂) ↔ FreeAddGroup.Red L₁ L₂


theorem exists_root {f : Polynomial (AlgebraicClosureAux k)}
    (hfm : f.Monic) (hfi : Irreducible f) : ∃ x : AlgebraicClosureAux k, f.eval x = 0

(k : Type u)
[Field k]
{f : (AlgebraicClosureAux k)[X]}
(hfm : f.Monic)
(hfi : Irreducible f)


theorem inl_aut_inv (g : G) (n : N) : (inl ((φ g)⁻¹ n) : N ⋊[φ] G) = inr g⁻¹ * inl n * inr g

{N : Type u_1}
{G : Type u_2}
[Group N]
[Group G]
{φ : G →* MulAut N}
(g : G)
(n : N)

SemidirectProduct.inl ((φ g)⁻¹ n) = SemidirectProduct.inr g⁻¹ * SemidirectProduct.inl n * SemidirectProduct.inr g


theorem norm_eq_card_dsupport (f : lp E 0) : ‖f‖ = (lp.memℓp f).finite_dsupport.toFinset.card

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
(f : ↥(lp E 0))


@[simp]
lemma map_b₄ : (W.map φ).b₄ = φ W.b₄

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
{A : Type v}
[CommRing A]
(φ : R →+* A)


/-- The equivalence between `CompleteLat` and itself induced by `OrderDual` both ways. -/
@[simps functor inverse]
def dualEquiv : CompleteLat ≌ CompleteLat


{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Ring R]
[AddCommGroup M]
[Module R M]
[TopologicalSpace M]
[AddCommGroup N]
[Module R N]
[TopologicalSpace N]
(f : M [⋀^ι]→L[R] N)
[TopologicalAddGroup N]


theorem algebraMap_pushforward_stalk :
    algebraMap R ((Spec.topMap f _* (structureSheaf S).1).stalk p) =
      f ≫ StructureSheaf.toPushforwardStalk f p

{R S : CommRingCat}
(f : R ⟶ S)
(p : PrimeSpectrum ↑R)

algebraMap ↑R
    ↑(((TopCat.Presheaf.pushforward CommRingCat (AlgebraicGeometry.Spec.topMap f)).obj
            (AlgebraicGeometry.Spec.structureSheaf ↑S).val).stalk
        p) =
  CategoryTheory.CategoryStruct.comp f (AlgebraicGeometry.StructureSheaf.toPushforwardStalk f p)


lemma cancel_right_div_gcd' (hm : 0 < m) (hcd : c ≡ d [MOD m]) (h : a * c ≡ b * d [MOD m]) :
    a ≡ b [MOD m / gcd m c]

{m a b c d : ℕ}
(hm : 0 < m)
(hcd : c ≡ d [MOD m])
(h : a * c ≡ b * d [MOD m])


theorem isTotallySeparated_empty : IsTotallySeparated (∅ : Set α)


@[deprecated exists_eq_left (since := "2024-04-06")]
theorem bex_eq_left {a : α} : (∃ (x : _) (_ : x = a), p x) ↔ p a


theorem exists_gt (f : CauSeq α abs) : ∃ a : α, f < const a

{α : Type u_1}
[LinearOrderedField α]
(f : CauSeq α abs)


lemma eval_C_X_comp_eval₂_map_C_X :
    (evalRingHom (C X : R[X][Y])).comp (eval₂RingHom (mapRingHom <| algebraMap R R[X][Y]) (C Y)) =
      .id _

(Polynomial.evalRingHom (Polynomial.C Polynomial.X)).comp
    (Polynomial.eval₂RingHom (Polynomial.mapRingHom (algebraMap R R[X][Y])) (Polynomial.C Y)) =
  RingHom.id R[X][Y]


theorem isRadical_vanishingIdeal (s : Set (PrimeSpectrum R)) : (vanishingIdeal s).IsRadical

{R : Type u}
[CommSemiring R]
(s : Set (PrimeSpectrum R))


@[to_additive]
theorem iInter_mul_subset (s : ι → Set α) (t : Set α) : (⋂ i, s i) * t ⊆ ⋂ i, s i * t

{α : Type u_2}
{ι : Sort u_5}
[Mul α]
(s : ι → Set α)
(t : Set α)


@[simp]
theorem mem_star_iff (S : Subalgebra R A) (x : A) : x ∈ star S ↔ star x ∈ S

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
(S : Subalgebra R A)
(x : A)


/-- For every `n ∈ ℕ` and every ideal `I`, `val_v(I^n) = n*val_v(I)`. -/
theorem count_pow (n : ℕ) (I : FractionalIdeal R⁰ K) :
    count K v (I ^ n) = n * count K v I

(v : IsDedekindDomain.HeightOneSpectrum R)

FractionalIdeal.count K v (I ^ n) = ↑n * FractionalIdeal.count K v I


theorem coproductIso_mk_comp_inv {J : Type v} (F : J → TypeMax.{v, u}) (j : J) :
    (↾fun x : F j => (⟨j, x⟩ : Σj, F j)) ≫ (coproductIso F).inv = Sigma.ι F j

(↾fun x => ⟨j, x⟩) ≫ (CategoryTheory.Limits.Types.coproductIso F).inv = CategoryTheory.Limits.Sigma.ι F j


@[to_additive] private lemma mabs_mul_eq_mul_mabs_le (hab : a ≤ b) :
    |a * b|ₘ = |a|ₘ * |b|ₘ ↔ 1 ≤ a ∧ 1 ≤ b ∨ a ≤ 1 ∧ b ≤ 1

{α : Type u_1}
[LinearOrderedCommGroup α]
{a b : α}
(hab : a ≤ b)

mabs (a * b) = mabs a * mabs b ↔ 1 ≤ a ∧ 1 ≤ b ∨ a ≤ 1 ∧ b ≤ 1


@[simp]
theorem Ioc_diff_right : Ioc a b \ {b} = Ioo a b

{α : Type u_1}
[PartialOrder α]
{a b : α}


protected lemma ContinuousAt.partialSups (hf : ∀ k ≤ n, ContinuousAt (f k) x) :
    ContinuousAt (partialSups f n) x

{L : Type u_1}
[SemilatticeSup L]
[TopologicalSpace L]
[ContinuousSup L]
{X : Type u_2}
[TopologicalSpace X]
{f : ℕ → X → L}
{n : ℕ}
{x : X}
(hf : ∀ k ≤ n, ContinuousAt (f k) x)


protected theorem mul_zero' [NeZero n] (k : Fin n) : k * 0 = 0


theorem of_nat (m : ℕ) : padicNorm p m ≤ 1

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(m : ℕ)


theorem _root_.Disjoint.of_image (h : Disjoint (f '' s) (f '' t)) : Disjoint s t

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{s t : Set α}
(h : Disjoint (f '' s) (f '' t))


/-- If two filters are disjoint, then a function cannot tend to both of them along a non-trivial
filter. -/
theorem Tendsto.not_tendsto {f : α → β} {a : Filter α} {b₁ b₂ : Filter β} (hf : Tendsto f a b₁)
    [NeBot a] (hb : Disjoint b₁ b₂) : ¬Tendsto f a b₂

{α : Type u}
{β : Type v}
{f : α → β}
{a : Filter α}
{b₁ b₂ : Filter β}
(hf : Filter.Tendsto f a b₁)
[a.NeBot]
(hb : Disjoint b₁ b₂)


theorem div_nonzero {I J : FractionalIdeal R₁⁰ K} (h : J ≠ 0) :
    I / J = ⟨I / J, fractional_div_of_nonzero h⟩

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[frac : IsFractionRing R₁ K]
[IsDomain R₁]
{I J : FractionalIdeal R₁⁰ K}
(h : J ≠ 0)


@[simp] theorem smul_imJ [SMul S R] (s : S) : (s • a).imJ = s • a.imJ

{S : Type u_1}
{R : Type u_3}
[CommRing R]
(a : ℍ[R])
[SMul S R]
(s : S)


@[to_additive]
theorem mulSupport_curry (f : α × β → M) :
    (mulSupport f.curry) = (mulSupport f).image Prod.fst

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[One M]
(f : α × β → M)

Function.mulSupport (Function.curry f) = Prod.fst '' Function.mulSupport f


/-- `AffineMap.linear` on endomorphisms is a `MonoidHom`. -/
@[simps]
def linearHom : (P1 →ᵃ[k] P1) →* V1 →ₗ[k] V1

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
(self : P1 →ᵃ[k] P1)


@[simp]
theorem add_closure_setOf_eq_single :
    AddSubmonoid.closure { f : α →₀ M | ∃ a b, f = single a b } = ⊤

{α : Type u_1}
{M : Type u_5}
[AddZeroClass M]

AddSubmonoid.closure {f | ∃ a b, f = Finsupp.single a b} = ⊤


@[simp]
theorem toFinset_image2 (f : α → β → γ) (s : Set α) (t : Set β) [Fintype s] [Fintype t]
    [Fintype (image2 f s t)] : (image2 f s t).toFinset = Finset.image₂ f s.toFinset t.toFinset

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
(f : α → β → γ)
(s : Set α)
(t : Set β)
[Fintype ↑s]
[Fintype ↑t]
[Fintype ↑(Set.image2 f s t)]

(Set.image2 f s t).toFinset = Finset.image₂ f s.toFinset t.toFinset


@[simp] lemma mem_sInf {S : Set (Sublattice α)} : a ∈ sInf S ↔ ∀ L ∈ S, a ∈ L

{α : Type u_2}
[Lattice α]
{a : α}
{S : Set (Sublattice α)}


theorem Subsemiring.isClosed_topologicalClosure (s : Subsemiring α) :
    IsClosed (s.topologicalClosure : Set α)

{α : Type u_1}
[TopologicalSpace α]
[Semiring α]
[TopologicalSemiring α]
(s : Subsemiring α)


/-- A morphism between source objects `S ⟶ S'`
contravariantly induces a functor between structured arrows,
`StructuredArrow S' T ⥤ StructuredArrow S T`.

Ideally this would be described as a 2-functor from `D`
(promoted to a 2-category with equations as 2-morphisms)
to `Cat`.
-/
@[simps!]
def map (f : S ⟶ S') : StructuredArrow S' T ⥤ StructuredArrow S T

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{S S' : D}
{T : CategoryTheory.Functor C D}
(f : S ⟶ S')

∀ {X Y : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit S') T} (f_1 : X ⟶ Y),
  ((CategoryTheory.StructuredArrow.map f).map f_1).right = f_1.right


theorem get_mono (h : l.Sorted (· ≤ ·)) : Monotone l.get

(h : List.Sorted (fun x x_1 => x ≤ x_1) l)


theorem IsExtrFilter.filter_inf (h : IsExtrFilter f l a) (l') : IsExtrFilter f (l ⊓ l') a

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{l : Filter α}
{a : α}
(h : IsExtrFilter f l a)
(l' : Filter α)


/-- If `K` is of characteristic `0` and there is a primitive `n`-th root of unity in `K`,
then `cyclotomic n K` comes from a unique polynomial with integer coefficients. -/
theorem unique_int_coeff_of_cycl {K : Type*} [CommRing K] [IsDomain K] [CharZero K] {ζ : K}
    {n : ℕ+} (h : IsPrimitiveRoot ζ n) :
    ∃! P : ℤ[X], map (Int.castRingHom K) P = cyclotomic' n K

{K : Type u_2}
[CommRing K]
[IsDomain K]
[CharZero K]
{ζ : K}
{n : ℕ+}
(h : IsPrimitiveRoot ζ ↑n)

∃! P, Polynomial.map (Int.castRingHom K) P = Polynomial.cyclotomic' (↑n) K


theorem rat_sup_continuous_lemma {ε : α} {a₁ a₂ b₁ b₂ : α} :
    abs (a₁ - b₁) < ε → abs (a₂ - b₂) < ε → abs (a₁ ⊔ a₂ - b₁ ⊔ b₂) < ε

{α : Type u_1}
[LinearOrderedField α]
{ε a₁ a₂ b₁ b₂ : α}

|a₁ - b₁| < ε → |a₂ - b₂| < ε → |a₁ ⊔ a₂ - b₁ ⊔ b₂| < ε


@[simp]
theorem moment_zero (hp : p ≠ 0) : moment 0 p μ = 0

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{p : ℕ}
{μ : MeasureTheory.Measure Ω}
(hp : p ≠ 0)


theorem of_targetAffineLocally_of_isPullback
    {P : AffineTargetMorphismProperty} [P.IsLocal]
    {X Y UX UY : Scheme.{u}} [IsAffine UY] {f : X ⟶ Y} {iY : UY ⟶ Y} [IsOpenImmersion iY]
    {iX : UX ⟶ X} {f' : UX ⟶ UY} (h : IsPullback iX f' f iY) (hf : targetAffineLocally P f) :
    P f'

(h : CategoryTheory.IsPullback iX f' f iY)

(hf : AlgebraicGeometry.targetAffineLocally P f)


/-- If a set `S` generates, as algebra, `MonoidAlgebra R M`, then the set of supports of elements
of `S` generates `MonoidAlgebra R M`. -/
theorem support_gen_of_gen {S : Set (MonoidAlgebra R M)} (hS : Algebra.adjoin R S = ⊤) :
    Algebra.adjoin R (⋃ f ∈ S, of R M '' (f.support : Set M)) = ⊤

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[Monoid M]
{S : Set (MonoidAlgebra R M)}
(hS : Algebra.adjoin R S = ⊤)

Algebra.adjoin R (⋃ f ∈ S, ⇑(MonoidAlgebra.of R M) '' ↑f.support) = ⊤


theorem isTotallyDisconnected_of_isTotallySeparated {s : Set α} (H : IsTotallySeparated s) :
    IsTotallyDisconnected s

{α : Type u}
[TopologicalSpace α]
{s : Set α}
(H : IsTotallySeparated s)


@[simp] lemma zero_τ₁ : Hom.τ₁ (0 : S₁ ⟶ S₂) = 0

CategoryTheory.ShortComplex.Hom.τ₁ 0 = 0


@[simp]
theorem injOn_singleton (f : α → β) (a : α) : InjOn f {a}

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(a : α)


theorem dist_midpoint_midpoint_le' (p₁ p₂ p₃ p₄ : P) :
    dist (midpoint 𝕜 p₁ p₂) (midpoint 𝕜 p₃ p₄) ≤ (dist p₁ p₃ + dist p₂ p₄) / ‖(2 : 𝕜)‖

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

dist (midpoint 𝕜 p₁ p₂) (midpoint 𝕜 p₃ p₄) ≤ (dist p₁ p₃ + dist p₂ p₄) / ‖2‖


protected theorem Nodup.pi {s : Multiset α} {t : ∀ a, Multiset (β a)} :
    Nodup s → (∀ a ∈ s, Nodup (t a)) → Nodup (pi s t)

{α : Type u_1}
[DecidableEq α]
{β : α → Type u_2}
{s : Multiset α}
{t : (a : α) → Multiset (β a)}

s.Nodup → (∀ a ∈ s, (t a).Nodup) → (s.pi t).Nodup


protected lemma disjoint_iff [SemilatticeInf α] [OrderBot α] {x y : Iic a} :
    Disjoint x y ↔ Disjoint (x : α) (y : α)

{α : Type u_1}
{a : α}
[SemilatticeInf α]
[OrderBot α]
{x y : ↑(Set.Iic a)}


@[simp]
theorem toSubgraph_reverse (p : G.Walk u v) : p.reverse.toSubgraph = p.toSubgraph

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(p : G.Walk u v)


@[to_additive (attr := simp)] lemma image_coe : ((↑) : G → Q) '' N = 1

{G : Type u}
[AddGroup G]
(N : AddSubgroup G)
[nN : N.Normal]


theorem le_iff_le {a : α} {b : β} : l a ≤ b ↔ a ≤ u b

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{a : α}
{b : β}


@[to_additive (attr := simp)]
theorem coe_of (R : Type u) [Group R] : ↑(Grp.of R) = R


@[simp] theorem ForInStep.bindList_nil [Monad m] (f : α → β → m (ForInStep β))
    (s : ForInStep β) : s.bindList f [] = pure s

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(f : α → β → m (ForInStep β))
(s : ForInStep β)


/--
The equivalence between `IrreducibleCloseds α` and `{x : Set α // IsIrreducible x ∧ IsClosed x }`.
-/
@[simps apply symm_apply]
def equivSubtype : IrreducibleCloseds α ≃ { x : Set α // IsIrreducible x ∧ IsClosed x }

(a : { x // IsIrreducible x ∧ IsClosed x })

TopologicalSpace.IrreducibleCloseds.equivSubtype.symm a = { carrier := ↑a, is_irreducible' := ⋯, is_closed' := ⋯ }


theorem coeff_C (n : ℕ) (a : R) : coeff R n (C R a : R⟦X⟧) = if n = 0 then a else 0

{R : Type u_1}
[Semiring R]
(n : ℕ)
(a : R)

(PowerSeries.coeff R n) ((PowerSeries.C R) a) = if n = 0 then a else 0


@[simp]
theorem center_eq_top : center M = ⊤


private lemma XYIdeal'_mul_inv {x y : F} (h : W.Nonsingular x y) :
    XYIdeal W x (C y) * (XYIdeal W x (C <| W.negY x y) *
        (XIdeal W x : FractionalIdeal W.CoordinateRing⁰ W.FunctionField)⁻¹) = 1

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x y : F}
(h : W.Nonsingular x y)

↑(WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x (Polynomial.C y)) *
    (↑(WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x (Polynomial.C (W.negY x y))) *
      (↑(WeierstrassCurve.Affine.CoordinateRing.XIdeal W x))⁻¹) =
  1


theorem card_supp_le_succ_natDegree (p : R[X]) : p.support.card ≤ p.natDegree + 1


private lemma X_u₁_spec : S.X ^ 3 * S.u₁ = S.x

(S : FermatLastTheoremForThreeGen.Solution hζ)

FermatLastTheoremForThreeGen.Solution.X S ^ 3 * ↑(FermatLastTheoremForThreeGen.Solution.u₁ S) =
  FermatLastTheoremForThreeGen.Solution.x S


theorem Submodule.finrank_le_one_iff_isPrincipal
    (W : Submodule K V) [Module.Free K W] [Module.Finite K W] :
    finrank K W ≤ 1 ↔ W.IsPrincipal

{K : Type u}
{V : Type v}
[Ring K]
[StrongRankCondition K]
[AddCommGroup V]
[Module K V]
(W : Submodule K V)
[Module.Free K ↥W]
[Module.Finite K ↥W]

FiniteDimensional.finrank K ↥W ≤ 1 ↔ W.IsPrincipal


lemma primeSpectrumProd_symm_inl (x) :
    (primeSpectrumProd R S).symm (.inl x) = comap (RingHom.fst R S) x

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
(x : PrimeSpectrum R)

(PrimeSpectrum.primeSpectrumProd R S).symm (Sum.inl x) = (PrimeSpectrum.comap (RingHom.fst R S)) x


@[simp] theorem Bool.and_self (b : Bool) : (b && b) = b


theorem essSup_smul_measure {f : α → β} {c : ℝ≥0∞} (hc : c ≠ 0) :
    essSup f (c • μ) = essSup f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[CompleteLattice β]
{f : α → β}
{c : ℝ≥0∞}
(hc : c ≠ 0)


/-- A surjective morphism of topological groups is open when the source group is sigma-compact and
the target group is a Baire space (for instance a locally compact group). -/
@[to_additive]
theorem MonoidHom.isOpenMap_of_sigmaCompact
    {H : Type*} [Group H] [TopologicalSpace H] [BaireSpace H] [T2Space H] [ContinuousMul H]
    (f : G →* H) (hf : Function.Surjective f) (h'f : Continuous f) :
    IsOpenMap f

{G : Type u_1}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
[SigmaCompactSpace G]
{H : Type u_3}
[Group H]
[TopologicalSpace H]
[BaireSpace H]
[T2Space H]
[ContinuousMul H]
(f : G →* H)
(hf : Function.Surjective ⇑f)
(h'f : Continuous ⇑f)


theorem achart_def (x : M) : achart H x = ⟨chartAt H x, chart_mem_atlas H x⟩

(H : Type u)
{M : Type u_2}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
(x : M)


/-- The sine of an angle in a right-angled triangle multiplied by the hypotenuse equals the
opposite side, version subtracting vectors. -/
theorem sin_angle_sub_mul_norm_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) :
    Real.sin (angle x (x - y)) * ‖x - y‖ = ‖y‖

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)

Real.sin (InnerProductGeometry.angle x (x - y)) * ‖x - y‖ = ‖y‖


theorem transpose_nonsing_inv : A⁻¹ᵀ = Aᵀ⁻¹

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)


@[simp]
theorem toStructuredArrow_obj (X) :
    (toStructuredArrow F).obj X =
      { left := ⟨⟨⟩⟩
        right := X.1
        hom := fun _ => X.2 }

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : CategoryTheory.Functor C (Type w))
(X : F.Elements)

(CategoryTheory.CategoryOfElements.toStructuredArrow F).obj X =
  { left := { as := PUnit.unit }, right := X.fst, hom := fun x => X.snd }


@[reassoc (attr := simp)]
lemma leftDerivedZeroIsoSelf_hom_inv_id_app (X : C) :
    F.fromLeftDerivedZero.app X ≫ F.leftDerivedZeroIsoSelf.inv.app X = 𝟙 _

CategoryTheory.CategoryStruct.comp (F.fromLeftDerivedZero.app X) (F.leftDerivedZeroIsoSelf.inv.app X) =
  CategoryTheory.CategoryStruct.id ((F.leftDerived 0).obj X)


theorem pow_lt_self_of_lt_one (h₀ : 0 < a) (h₁ : a < 1) (hn : 1 < n) : a ^ n < a

{R : Type u_3}
[StrictOrderedSemiring R]
{a : R}
{n : ℕ}
(h₀ : 0 < a)
(h₁ : a < 1)
(hn : 1 < n)


/-- An 'unapplied' analogue of `Finset.prod_apply`. -/
@[to_additive "An 'unapplied' analogue of `Finset.sum_apply`."]
theorem Finset.prod_fn {α : Type*} {β : α → Type*} {γ} [∀ a, CommMonoid (β a)] (s : Finset γ)
    (g : γ → ∀ a, β a) : ∏ c ∈ s, g c = fun a ↦ ∏ c ∈ s, g c a

{α : Type u_1}
{β : α → Type u_2}
{γ : Type u_3}
[(a : α) → AddCommMonoid (β a)]
(s : Finset γ)
(g : γ → (a : α) → β a)


theorem setOf_set {s : Set α} : setOf s = s


/-- If the distance between any two points in a set is bounded by some constant, this constant
bounds the diameter. -/
theorem diam_le {d : ℝ≥0∞} (h : ∀ x ∈ s, ∀ y ∈ s, edist x y ≤ d) : diam s ≤ d

{α : Type u}
[PseudoEMetricSpace α]
{s : Set α}
{d : ℝ≥0∞}
(h : ∀ x ∈ s, ∀ y ∈ s, edist x y ≤ d)


@[to_additive]
theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 }

(M₁ : Type u_6)
(M₂ : Type u_7)
[TopologicalSpace M₂]
[T2Space M₂]
[One M₁]
[One M₂]


theorem pair_lt_max_add_one_sq (m n : ℕ) : pair m n < (max m n + 1) ^ 2


lemma setLIntegral_stieltjesOfMeasurableRat [IsFiniteKernel κ] (hf : IsRatCondKernelCDF f κ ν)
    (a : α) (x : ℝ) {s : Set β} (hs : MeasurableSet s) :
    ∫⁻ b in s, ENNReal.ofReal (stieltjesOfMeasurableRat f hf.measurable (a, b) x) ∂(ν a)
      = κ a (s ×ˢ Iic x)

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

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDF f κ ν)

∫⁻ (b : β) in s, ENNReal.ofReal (↑(ProbabilityTheory.stieltjesOfMeasurableRat f ⋯ (a, b)) x) ∂ν a =
  (κ a) (s ×ˢ Set.Iic x)


theorem IsModularLattice.inf_sup_inf_assoc {x y z : α} : x ⊓ z ⊔ y ⊓ z = (x ⊓ z ⊔ y) ⊓ z

{α : Type u_1}
[Lattice α]
[IsModularLattice α]
{x y z : α}


theorem continuous_insertNth' {n : ℕ} {i : Fin (n + 1)} :
    Continuous fun p : α × Vector α n => Vector.insertNth p.1 i p.2

{α : Type u_1}
[TopologicalSpace α]
{n : ℕ}
{i : Fin (n + 1)}

Continuous fun p => Mathlib.Vector.insertNth p.1 i p.2


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

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


theorem HasEigenvalue.exists_hasEigenvector {f : End R M} {μ : R} (hμ : f.HasEigenvalue μ) :
    ∃ v, f.HasEigenvector μ v

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f : Module.End R M}
{μ : R}
(hμ : f.HasEigenvalue μ)


@[to_additive]
theorem mem_map_equiv {f : M ≃* N} {K : Subsemigroup M} {x : N} :
    x ∈ K.map (f : M →ₙ* N) ↔ f.symm x ∈ K

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M ≃* N}
{K : Subsemigroup M}
{x : N}

x ∈ Subsemigroup.map (↑f) K ↔ f.symm x ∈ K


@[to_additive (attr := simp) index_eq_one]
theorem index_eq_one : H.index = 1 ↔ H = ⊤

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}


@[simp]
theorem not_isPredLimit_pred (a : α) : ¬IsPredLimit (pred a)

{α : Type u_1}
[Preorder α]
[PredOrder α]
[NoMinOrder α]
(a : α)


/-- We can upgrade `e.functor` to a monoidal functor from `C` to `D` with the transported structure.
-/
@[simps!]
def toTransported (e : C ≌ D) : MonoidalFunctor C (Transported e)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : C ≌ D)
(X Y : C)

(CategoryTheory.Monoidal.toTransported e).μ X Y =
  e.symm.unit.app (e.functor.obj (e.inverse.obj (e.functor.obj X) ⊗ e.inverse.obj (e.functor.obj Y))) ≫
    CategoryTheory.inv
        (e.functor.map (e.unitIso.hom.app (e.inverse.obj (e.functor.obj X) ⊗ e.inverse.obj (e.functor.obj Y)))) ≫
      e.functor.map (e.symm.counit.app X ⊗ e.symm.counit.app Y)


/-- The `ratio` is equal to the distance ratio for any two points
with nonzero finite distance; `dist` version -/
theorem ratio_unique_of_dist_ne_zero {α β} {F : Type*} [PseudoMetricSpace α] [PseudoMetricSpace β]
    [FunLike F α β] [DilationClass F α β] {f : F} {x y : α} {r : ℝ≥0} (hxy : dist x y ≠ 0)
    (hr : dist (f x) (f y) = r * dist x y) : r = ratio f

{α : Type u_7}
{β : Type u_8}
{F : Type u_6}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
[FunLike F α β]
[DilationClass F α β]
{f : F}
{x y : α}
{r : ℝ≥0}
(hxy : dist x y ≠ 0)
(hr : dist (f x) (f y) = ↑r * dist x y)


@[to_additive (attr := simp)] theorem range_swap : MonoidHom.range (swap G H) = ⊤

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
[AddGroup H]


/-- Any basis is a maximal linear independent set.
-/
theorem maximal [Nontrivial R] (b : Basis ι R M) : b.linearIndependent.Maximal

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
(b : Basis ι R M)


/-- The right unitor isomorphism for binary products with the terminal object. -/
@[simps]
def prod.rightUnitor (P : C) [HasBinaryProduct P (⊤_ C)] : P ⨯ ⊤_ C ≅ P

[CategoryTheory.Limits.HasBinaryProduct P (⊤_ C)]

(CategoryTheory.Limits.prod.rightUnitor P).inv =
  CategoryTheory.Limits.prod.lift (𝟙 P) (CategoryTheory.Limits.terminal.from P)


theorem lt_iInf_iff : a < iInf f ↔ ∃ b, a < b ∧ ∀ i, b ≤ f i

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{f : ι → α}
{a : α}

a < iInf f ↔ ∃ b, a < b ∧ ∀ (i : ι), b ≤ f i


theorem RingEquiv.bot_maximal_iff (e : R ≃+* S) :
    (⊥ : Ideal R).IsMaximal ↔ (⊥ : Ideal S).IsMaximal

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(e : R ≃+* S)


theorem hasLimitsOfShape_iff_isLeftAdjoint_const :
    HasLimitsOfShape J C ↔ IsLeftAdjoint (const J : C ⥤ _)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]

CategoryTheory.Limits.HasLimitsOfShape J C ↔ (CategoryTheory.Functor.const J).IsLeftAdjoint


/-- Swap the `ᵐᵒᵖ` on an algebra isomorphism to the opposite side. -/
@[simps!]
def opComm : (A ≃ₐ[R] Bᵐᵒᵖ) ≃ (Aᵐᵒᵖ ≃ₐ[R] B)

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]

∀ (a : Aᵐᵒᵖ ≃ₐ[R] B) (a_1 : A), (AlgEquiv.opComm.symm a) a_1 = MulOpposite.op (a (MulOpposite.op a_1))


/-- In the specific case of multilinear maps on spaces indexed by `Fin (n+1)`, where one can build
an element of `∀ (i : Fin (n+1)), M i` using `cons`, one can express directly the multiplicativity
of a multilinear map along the first variable. -/
theorem cons_smul (f : MultilinearMap R M M₂) (m : ∀ i : Fin n, M i.succ) (c : R) (x : M 0) :
    f (cons (c • x) m) = c • f (cons x m)

[(i : Fin n.succ) → AddCommMonoid (M i)]

f (Fin.cons (c • x) m) = c • f (Fin.cons x m)


theorem USize.toNat_add (x y : USize) : (x + y).toNat = (x.toNat + y.toNat) % USize.size


theorem countable_meas_level_set_pos {α β : Type*} {_ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] [MeasurableSpace β] [MeasurableSingletonClass β] {g : α → β}
    (g_mble : Measurable g) : Set.Countable { t : β | 0 < μ { a : α | g a = t } }

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [inst : MeasureTheory.SFinite μ] [inst : MeasurableSpace β]
  [inst_1 : MeasurableSingletonClass β] {g : α → β}, Measurable g → {t | 0 < μ {a | g a = t}}.Countable


@[simp] lemma Even.mul_right (ha : Even a) (b) : Even (a * b)

{α : Type u_2}
[Semiring α]
{a : α}
(ha : Even a)
(b : α)


@[to_additive]
theorem eq_bot_iff_forall : H = ⊥ ↔ ∀ x ∈ H, x = (1 : G)

{G : Type u_1}
[Group G]
(H : Subgroup G)


@[simp]
theorem conj_apply [AddGroup G] (g h : G) : conj g h = g + h + -g

(Additive.toMul (AddAut.conj g)) h = g + h + -g


theorem log_div_log : log x / log b = logb b x


@[simp]
theorem norm_eq_padic_norm {q : ℚ_[p]} (hq : ‖q‖ ≤ 1) : @norm ℤ_[p] _ ⟨q, hq⟩ = ‖q‖

{p : ℕ}
[Fact (Nat.Prime p)]
{q : ℚ_[p]}
(hq : ‖q‖ ≤ 1)

‖⟨q, hq⟩‖ = ‖q‖


@[simp]
lemma homMap_homMap (f : L₁.obj X ⟶ L₁.obj Y) :
    Ψ.homMap L₂ L₃ (Φ.homMap L₁ L₂ f) = (Φ.comp Ψ).homMap L₁ L₃ f

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

{W₃ : CategoryTheory.MorphismProperty C₃}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

(Ψ : CategoryTheory.LocalizerMorphism W₂ W₃)


theorem Basis.det_apply (v : ι → M) : e.det v = Matrix.det (e.toMatrix v)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
(e : Basis ι R M)
(v : ι → M)


theorem modByMonic_eq_sub_mul_div :
    ∀ (p : R[X]) {q : R[X]} (_hq : Monic q), p %ₘ q = p - q * (p /ₘ q)

{R : Type u}
[Ring R]
(p : R[X])
{q : R[X]}
(_hq : q.Monic)


theorem geom_sum_X_comp_X_add_one_eq_sum (n : ℕ) :
    (∑ i ∈ range n, (X : R[X]) ^ i).comp (X + 1) =
      (Finset.range n).sum fun i : ℕ => (n.choose (i + 1) : R[X]) * X ^ i

(∑ i ∈ Finset.range n, Polynomial.X ^ i).comp (Polynomial.X + 1) =
  ∑ i ∈ Finset.range n, ↑(n.choose (i + 1)) * Polynomial.X ^ i


theorem exists_frequently_lt_of_liminf_ne_top {ι : Type*} {l : Filter ι} {x : ι → ℝ}
    (hx : liminf (fun n => (Real.nnabs (x n) : ℝ≥0∞)) l ≠ ∞) : ∃ R, ∃ᶠ n in l, x n < R

(hx : Filter.liminf (fun n => ↑(Real.nnabs (x n))) l ≠ ⊤)


theorem pointToPoint_zeroLocus_le (I : Ideal (MvPolynomial σ k)) :
    pointToPoint '' MvPolynomial.zeroLocus I ≤ PrimeSpectrum.zeroLocus ↑I

{k : Type u_1}
[Field k]
{σ : Type u_2}
(I : Ideal (MvPolynomial σ k))

MvPolynomial.pointToPoint '' MvPolynomial.zeroLocus I ≤ PrimeSpectrum.zeroLocus ↑I


@[to_additive]
theorem mem_centralizer_iff {z : M} : z ∈ centralizer S ↔ ∀ g ∈ S, g * z = z * g

{M : Type u_1}
{S : Set M}
[Semigroup M]
{z : M}

z ∈ Subsemigroup.centralizer S ↔ ∀ g ∈ S, g * z = z * g


theorem pos_size_of_mem {x : α} {t : Ordset α} (h_mem : x ∈ t) : 0 < size t

{α : Type u_1}
[Preorder α]
[DecidableRel fun x x_1 => x ≤ x_1]
{x : α}
{t : Ordset α}
(h_mem : x ∈ t)


@[to_additive]
-- Porting note: removed `protected` (needs to be in namespace)
theorem topologicalGroup_induced {F : Type*} [Group H] [FunLike F H G] [MonoidHomClass F H G]
    (f : F) :
    @TopologicalGroup H (induced f ‹_›) _

{G : Type w}
{H : Type x}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{F : Type u_1}
[Group H]
[FunLike F H G]
[MonoidHomClass F H G]
(f : F)


theorem ClassGroup.mk0_eq_mk0_iff [IsDedekindDomain R] {I J : (Ideal R)⁰} :
    ClassGroup.mk0 I = ClassGroup.mk0 J ↔
      ∃ (x y : R) (_hx : x ≠ 0) (_hy : y ≠ 0), Ideal.span {x} * (I : Ideal R) =
      Ideal.span {y} * J

{R : Type u_1}
[CommRing R]
[IsDomain R]
[IsDedekindDomain R]
{I J : ↥(Ideal R)⁰}

ClassGroup.mk0 I = ClassGroup.mk0 J ↔ ∃ x y, ∃ (_ : x ≠ 0) (_ : y ≠ 0), Ideal.span {x} * ↑I = Ideal.span {y} * ↑J


/-- The category of right resolutions of an object in the target category
of a localizer morphism. -/
structure RightResolution (X₂ : C₂) where
  /-- an object in the source category -/
  {X₁ : C₁}
  /-- a morphism to an object of the form `Φ.functor.obj X₁` -/
  w : X₂ ⟶ Φ.functor.obj X₁
  hw : W₂ w

{Φ : CategoryTheory.LocalizerMorphism W₁ W₂}


theorem exists_erase_eq [LawfulBEq α] {a : α} {l : List α} (h : a ∈ l) :
    ∃ l₁ l₂, a ∉ l₁ ∧ l = l₁ ++ a :: l₂ ∧ l.erase a = l₁ ++ l₂

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a : α}
{l : List α}
(h : a ∈ l)

∃ l₁ l₂, ¬a ∈ l₁ ∧ l = l₁ ++ a :: l₂ ∧ l.erase a = l₁ ++ l₂


theorem mul_by_divBy (s : S) (p : LocalizedModule S M) :
    algebraMap R (Module.End R (LocalizedModule S M)) s (divBy s p) = p

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
(s : ↥S)
(p : LocalizedModule S M)

((algebraMap R (Module.End R (LocalizedModule S M))) ↑s) ((LocalizedModule.divBy s) p) = p


@[simp]
theorem isSymm_adjMatrix [Zero α] [One α] : (G.adjMatrix α).IsSymm

{V : Type u_1}
{α : Type u_2}
(G : SimpleGraph V)
[DecidableRel G.Adj]
[Zero α]
[One α]


/-- Functoriality maps for `ComposableArrows.sc`. -/
@[simps!]
def scMap {S₁ S₂ : ComposableArrows C n} (φ : S₁ ⟶ S₂) (h₁ : S₁.IsComplex) (h₂ : S₂.IsComplex)
    (i : ℕ) (hi : i + 2 ≤ n := by omega) :
    S₁.sc h₁ i ⟶ S₂.sc h₂ i

{S₁ S₂ : CategoryTheory.ComposableArrows C n}

(CategoryTheory.ComposableArrows.scMap φ h₁ h₂ i hi).τ₁ = φ.app ⟨i, ⋯⟩


theorem oneCoboundaries_of_mem_range_apply {f : G → A} (h : f ∈ LinearMap.range (dZero A)) :
    (oneCoboundariesOfMemRange h).1.1 = f

(h : f ∈ LinearMap.range (groupCohomology.dZero A))

↑↑(groupCohomology.oneCoboundariesOfMemRange h) = f


@[to_additive (attr := simp, norm_cast)]
theorem coe_inv [Inv β] (f : α →ₛ β) : ⇑(f⁻¹) = (⇑f)⁻¹

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Neg β]
(f : MeasureTheory.SimpleFunc α β)


@[simp]
theorem card_ord (c) : (ord c).card = c


/-- A collection of elements in an `AddCommGroup` designated as "non-negative".
This is useful for constructing an `OrderedAddCommGroup`
by choosing a positive cone in an existing `AddCommGroup`. -/
-- Porting note(#5171): @[nolint has_nonempty_instance]
structure PositiveCone (α : Type*) [AddCommGroup α] where
  /-- The characteristic predicate of a positive cone. `nonneg a` means that `0 ≤ a` according to
  the cone. -/
  nonneg : α → Prop
  /-- The characteristic predicate of a positive cone. `pos a` means that `0 < a` according to
  the cone. -/
  pos : α → Prop := fun a => nonneg a ∧ ¬nonneg (-a)
  pos_iff : ∀ a, pos a ↔ nonneg a ∧ ¬nonneg (-a) := by intros; rfl
  zero_nonneg : nonneg 0
  add_nonneg : ∀ {a b}, nonneg a → nonneg b → nonneg (a + b)
  nonneg_antisymm : ∀ {a}, nonneg a → nonneg (-a) → a = 0

{α : Type u_1}
[AddCommGroup α]
(self : AddCommGroup.PositiveCone α)


{α : Type u_2}
[BooleanAlgebra α]
(a : α)


lemma id_pushforward (X : TopCat.{w}) : pushforward C (𝟙 X) = 𝟭 (X.Presheaf C)

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

TopCat.Presheaf.pushforward C (𝟙 X) = 𝟭 (TopCat.Presheaf C X)


/-- A braided monoidal category is a monoidal category equipped with a braiding isomorphism
`β_ X Y : X ⊗ Y ≅ Y ⊗ X`
which is natural in both arguments,
and also satisfies the two hexagon identities.
-/
class BraidedCategory (C : Type u) [Category.{v} C] [MonoidalCategory.{v} C] where
  /-- The braiding natural isomorphism. -/
  braiding : ∀ X Y : C, X ⊗ Y ≅ Y ⊗ X
  braiding_naturality_right :
    ∀ (X : C) {Y Z : C} (f : Y ⟶ Z),
      X ◁ f ≫ (braiding X Z).hom = (braiding X Y).hom ≫ f ▷ X := by
    aesop_cat
  braiding_naturality_left :
    ∀ {X Y : C} (f : X ⟶ Y) (Z : C),
      f ▷ Z ≫ (braiding Y Z).hom = (braiding X Z).hom ≫ Z ◁ f := by
    aesop_cat
  /-- The first hexagon identity. -/
  hexagon_forward :
    ∀ X Y Z : C,
      (α_ X Y Z).hom ≫ (braiding X (Y ⊗ Z)).hom ≫ (α_ Y Z X).hom =
        ((braiding X Y).hom ▷ Z) ≫ (α_ Y X Z).hom ≫ (Y ◁ (braiding X Z).hom) := by
    aesop_cat
  /-- The second hexagon identity. -/
  hexagon_reverse :
    ∀ X Y Z : C,
      (α_ X Y Z).inv ≫ (braiding (X ⊗ Y) Z).hom ≫ (α_ Z X Y).inv =
        (X ◁ (braiding Y Z).hom) ≫ (α_ X Z Y).inv ≫ ((braiding X Z).hom ▷ Y) := by
    aesop_cat

[self : CategoryTheory.BraidedCategory C]

(α_ X Y Z).hom ≫ (β_ X (Y ⊗ Z)).hom ≫ (α_ Y Z X).hom = (β_ X Y).hom ▷ Z ≫ (α_ Y X Z).hom ≫ Y ◁ (β_ X Z).hom


@[to_additive]
theorem mulIndicator_union_of_disjoint (h : Disjoint s t) (f : α → M) :
    mulIndicator (s ∪ t) f = fun a => mulIndicator s f a * mulIndicator t f a

{α : Type u_1}
{M : Type u_4}
[MulOneClass M]
{s t : Set α}
(h : Disjoint s t)
(f : α → M)

(s ∪ t).mulIndicator f = fun a => s.mulIndicator f a * t.mulIndicator f a


theorem IsCoprime.mul_dvd (H : IsCoprime x y) (H1 : x ∣ z) (H2 : y ∣ z) : x * y ∣ z

{R : Type u}
[CommSemiring R]
{x y z : R}
(H : IsCoprime x y)
(H1 : x ∣ z)
(H2 : y ∣ z)


theorem iInf_comm {f : ι → ι' → α} : ⨅ (i) (j), f i j = ⨅ (j) (i), f i j

{α : Type u_1}
{ι : Sort u_5}
{ι' : Sort u_6}
[CompleteLattice α]
{f : ι → ι' → α}


theorem IsBlock.mk_mem {B : Set X} :
    IsBlock G B ↔ ∀ (g : G) (a : X) (_ : a ∈ B) (_ : g • a ∈ B), g • B = B

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
{B : Set X}

MulAction.IsBlock G B ↔ ∀ (g : G), ∀ a ∈ B, g • a ∈ B → g • B = B


@[simp] theorem true_beq  : ∀b, (true  == b) =  b


theorem NormedAddGroupHom.ker_le_ker_completion (f : NormedAddGroupHom G H) :
    (toCompl.comp <| incl f.ker).range ≤ f.completion.ker

{G : Type u_1}
[SeminormedAddCommGroup G]
{H : Type u_2}
[SeminormedAddCommGroup H]
(f : NormedAddGroupHom G H)

(NormedAddCommGroup.toCompl.comp (NormedAddGroupHom.incl f.ker)).range ≤ f.completion.ker


lemma IsRatCondKernelCDFAux.integrable_iInf_rat_gt (hf : IsRatCondKernelCDFAux f κ ν)
    [IsFiniteKernel ν] (a : α) (q : ℚ) :
    Integrable (fun t ↦ ⨅ r : Ioi q, f (a, t) r) (ν a)

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

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)

MeasureTheory.Integrable (fun t => ⨅ r, f (a, t) ↑r) (ν a)


/-- To show `j` and `k` agree on the whole localization, it suffices to show they agree
on the image of the base ring, if they preserve `1` and `*`. -/
protected theorem ext (j k : S → P) (hj1 : j 1 = 1) (hk1 : k 1 = 1)
    (hjm : ∀ a b, j (a * b) = j a * j b) (hkm : ∀ a b, k (a * b) = k a * k b)
    (h : ∀ a, j (algebraMap R S a) = k (algebraMap R S a)) : j = k

(hjm : ∀ (a b : S), j (a * b) = j a * j b)

(hkm : ∀ (a b : S), k (a * b) = k a * k b)

(h : ∀ (a : R), j ((algebraMap R S) a) = k ((algebraMap R S) a))


theorem smul_apply (r : R) (f : AddMonoid.End A) (x : A) : (r • f) x = r • f x

{R : Type u_1}
{A : Type u_4}
[Monoid R]
[AddCommMonoid A]
[DistribMulAction R A]
(r : R)
(f : AddMonoid.End A)
(x : A)


/-- Prefer putting constants to the left of `X ^ n`.

This lemma is the loop-avoiding `simp` version of `X_pow_mul`. -/
@[simp]
theorem X_pow_mul_C (r : R) (n : ℕ) : X ^ n * C r = C r * X ^ n

{R : Type u}
[Semiring R]
(r : R)
(n : ℕ)

Polynomial.X ^ n * Polynomial.C r = Polynomial.C r * Polynomial.X ^ n


lemma pred_lt_pred_of_not_isMin (h : a < b) (ha : ¬ IsMin a) : pred a < pred b

{α : Type u_1}
[Preorder α]
[PredOrder α]
{a b : α}
(h : a < b)
(ha : ¬IsMin a)


theorem comp₂ {f : γ → δ →. σ} {g : α → β → γ} {h : α → β → δ} (hf : Partrec₂ f)
    (hg : Computable₂ g) (hh : Computable₂ h) : Partrec₂ fun a b => f (g a b) (h a b)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{σ : Type u_5}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
[Primcodable δ]
[Primcodable σ]
{f : γ → δ →. σ}
{g : α → β → γ}
{h : α → β → δ}
(hf : Partrec₂ f)
(hg : Computable₂ g)
(hh : Computable₂ h)


theorem intDegree_add {x y : RatFunc K} (hxy : x + y ≠ 0) :
    (x + y).intDegree =
      (x.num * y.denom + x.denom * y.num).natDegree - (x.denom * y.denom).natDegree

{K : Type u}
[Field K]
{x y : RatFunc K}
(hxy : x + y ≠ 0)

(x + y).intDegree = ↑(x.num * y.denom + x.denom * y.num).natDegree - ↑(x.denom * y.denom).natDegree


@[simp]
theorem modEq_iff_int_modEq {a b z : ℤ} : a ≡ b [PMOD z] ↔ a ≡ b [ZMOD z]


theorem length_pos (irrefl : Irreflexive r) : 0 < s.length ↔ {x | x ∈ s}.Nontrivial

{α : Type u_1}
{r : Rel α α}
{s : RelSeries r}
(irrefl : Irreflexive r)


theorem measure_eq_top_of_lintegral_ne_top {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (hμf : ∫⁻ x, f x ∂μ ≠ ∞) : μ {x | f x = ∞} = 0

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : AEMeasurable f μ)
(hμf : ∫⁻ (x : α), f x ∂μ ≠ ⊤)