/-- For every universe `w`, `C` is filtered if and only if every finite diagram in `C` with shape
    in `w` admits a cocone. -/
theorem iff_cocone_nonempty : IsFiltered C ↔
    ∀ {J : Type w} [SmallCategory J] [FinCategory J] (F : J ⥤ C), Nonempty (Cocone F)

(C : Type u)
[CategoryTheory.Category.{v, u} C]

CategoryTheory.IsFiltered C ↔
  ∀ {J : Type w} [inst : CategoryTheory.SmallCategory J] [inst_1 : CategoryTheory.FinCategory J]
    (F : CategoryTheory.Functor J C), Nonempty (CategoryTheory.Limits.Cocone F)


theorem Quiver.Hom.unop_inj {X Y : Cᵒᵖ} :
    Function.Injective (Quiver.Hom.unop : (X ⟶ Y) → (Opposite.unop Y ⟶ Opposite.unop X))


theorem natDegree_eq_zero_of_isUnit (h : IsUnit p) : natDegree p = 0

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
{p : R[X]}
(h : IsUnit p)


@[simp]
theorem mk_le_mk_iff [∀ i, LE (α i)] {i : ι} {a b : α i} : (⟨i, a⟩ : Sigma α) ≤ ⟨i, b⟩ ↔ a ≤ b

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


@[simp]
theorem map_fun (φ : M ↪[L] N) {n : ℕ} (f : L.Functions n) (x : Fin n → M) :
    φ (funMap f x) = funMap f (φ ∘ x)

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(φ : L.Embedding M N)
{n : ℕ}
(f : L.Functions n)
(x : Fin n → M)

φ (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (⇑φ ∘ x)


theorem RelEmbedding.minimals_preimage_eq (f : r ↪r s) (y : Set β) :
    minimals r (f ⁻¹' y) = f ⁻¹' minimals s (y ∩ range f)

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ↪r s)
(y : Set β)

minimals r (⇑f ⁻¹' y) = ⇑f ⁻¹' minimals s (y ∩ Set.range ⇑f)


theorem models_formula_iff {φ : L.Formula α} :
    T ⊨ᵇ φ ↔ ∀ (M : ModelType.{u, v, max u v} T) (v : α → M), φ.Realize v

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
{φ : L.Formula α}

T ⊨ᵇ φ ↔ ∀ (M : T.ModelType) (v : α → ↑M), φ.Realize v


/-- `e` and `ε` have characteristic properties of a basis and its dual -/
-- @[nolint has_nonempty_instance] Porting note (#5171): removed
structure Module.DualBases (e : ι → M) (ε : ι → Dual R M) : Prop where
  eval : ∀ i j : ι, ε i (e j) = if i = j then 1 else 0
  protected total : ∀ {m : M}, (∀ i, ε i m = 0) → m = 0
  protected finite : ∀ m : M, { i | ε i m ≠ 0 }.Finite := by
      use_finite_instance

{R : Type u_1}
{M : Type u_2}
{ι : Type u_3}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[DecidableEq ι]
{e : ι → M}
{ε : ι → Module.Dual R M}
(self : Module.DualBases e ε)
(m : M)


@[simp]
lemma prime_pow_iff [CancelCommMonoidWithZero α] {p : α} {n : ℕ} :
    Prime (p ^ n) ↔ Prime p ∧ n = 1

{α : Type u_1}
[CancelCommMonoidWithZero α]
{p : α}
{n : ℕ}


@[simp]
theorem completeGraph_eq_top (V : Type u) : completeGraph V = ⊤


@[simp]
theorem encode_inr (b : β) : @encode (α ⊕ β) _ (Sum.inr b) = 2 * (encode b) + 1

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

Encodable.encode (Sum.inr b) = 2 * Encodable.encode b + 1


@[simp] protected theorem fdiv_zero : ∀ a : Int, fdiv a 0 = 0


@[simp] -- Porting note (#10618): simp can prove this
theorem intervalIntegrable_const [IsLocallyFiniteMeasure μ] {c : E} :
    IntervalIntegrable (fun _ => c) μ a b


@[simp]
theorem basisFun_repr (x : EuclideanSpace 𝕜 ι) (i : ι) : (basisFun ι 𝕜).repr x i = x i

(ι : Type u_1)
(𝕜 : Type u_3)
[RCLike 𝕜]
[Fintype ι]
(x : EuclideanSpace 𝕜 ι)
(i : ι)

(EuclideanSpace.basisFun ι 𝕜).repr x i = x i


lemma absorbent_iff_inv_smul {s : Set α} :
    Absorbent G₀ s ↔ ∀ x, ∀ᶠ c in cobounded G₀, c⁻¹ • x ∈ s

{G₀ : Type u_1}
{α : Type u_2}
[GroupWithZero G₀]
[Bornology G₀]
[MulAction G₀ α]
{s : Set α}

Absorbent G₀ s ↔ ∀ (x : α), ∀ᶠ (c : G₀) in Bornology.cobounded G₀, c⁻¹ • x ∈ s


@[simp, norm_cast]
theorem neg_apply (f : CauSeq β abv) (i) : (-f) i = -f i

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(f : CauSeq β abv)
(i : ℕ)


@[simp, norm_cast] lemma val_ratCast (q : ℚ) : (q : selfAdjoint R) = (q : R)

{R : Type u_1}
[Field R]
[StarRing R]
(q : ℚ)


theorem range_comp_subset_range (f : α → β) (g : β → γ) : range (g ∘ f) ⊆ range g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β)
(g : β → γ)


@[to_additive (attr := simp)]
theorem toMulHom_eq_coe (f : M ≃* N) : f.toMulHom = ↑f

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(f : M ≃+ N)


@[simp]
theorem nhdsWithin_Ioc_eq_nhdsWithin_Iic (h : a < b) : 𝓝[Ioc a b] b = 𝓝[≤] b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{a b : α}
(h : a < b)


@[simp] lemma mem_Ioc : x ∈ Ioc a b ↔ a < x ∧ x ≤ b

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
{a b x : α}


theorem leftInverse_of_surjective_of_rightInverse {f : α → β} {g : β → α} (surjf : Surjective f)
    (rfg : RightInverse f g) : LeftInverse f g

{α : Sort u₁}
{β : Sort u₂}
{f : α → β}
{g : β → α}
(surjf : Function.Surjective f)
(rfg : Function.RightInverse f g)


theorem setToL1_mono {T : Set α → G' →L[ℝ] G''} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C)
    (hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f g : α →₁[μ] G'}
    (hfg : f ≤ g) : setToL1 hT f ≤ setToL1 hT g

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x)

(MeasureTheory.L1.setToL1 hT) f ≤ (MeasureTheory.L1.setToL1 hT) g


theorem toIdeal_iInf₂ {κ : Sort*} {κ' : κ → Sort*} (s : ∀ i, κ' i → HomogeneousIdeal 𝒜) :
    (⨅ (i) (j), s i j).toIdeal = ⨅ (i) (j), (s i j).toIdeal

(s : (i : κ) → κ' i → HomogeneousIdeal 𝒜)

(⨅ i, ⨅ j, s i j).toIdeal = ⨅ i, ⨅ j, (s i j).toIdeal


@[simp]
theorem mem_toSubalgebra {p : Submodule R A} {h_one h_mul} {x} :
    x ∈ p.toSubalgebra h_one h_mul ↔ x ∈ p

{h_mul : ∀ (x y : A), x ∈ p → y ∈ p → x * y ∈ p}


@[simp] lemma map_surjective : Surjective (PLift.map f) ↔ Surjective f

Function.Surjective (PLift.map f) ↔ Function.Surjective f


/-- The map from a normed group to its completion, as a normed group hom. -/
@[simps] -- Porting note: added `@[simps]`
def NormedAddCommGroup.toCompl : NormedAddGroupHom G (Completion G)

{G : Type u_1}
[SeminormedAddCommGroup G]

∀ (a : G), NormedAddCommGroup.toCompl a = ↑G a


/-- `yoneda'` induces an equivalence of category between `Type u` and
`SheafOfTypes typesGrothendieckTopology`. -/
@[simps!]
noncomputable def typeEquiv : Type u ≌ SheafOfTypes typesGrothendieckTopology

∀ {X Y : Type u} (f : X ⟶ Y) (Y_1 : Type uᵒᵖ)
  (g :
    ((fun X =>
            { obj := fun Y => Opposite.unop Y ⟶ X,
              map := fun {X_1 Y} f g => CategoryTheory.CategoryStruct.comp f.unop g, map_id := ⋯, map_comp := ⋯ })
          X).obj
      Y_1)
  (a : Opposite.unop Y_1), (CategoryTheory.typeEquiv.functor.map f).val.app Y_1 g a = f (g a)


theorem iSup_lt_of_isRegular {ι} {f : ι → Cardinal} {c} (hc : IsRegular c) (hι : #ι < c) :
    (∀ i, f i < c) → iSup f < c

{ι : Type u_2}
{f : ι → Cardinal.{u_2}}
{c : Cardinal.{u_2}}
(hc : c.IsRegular)
(hι : #ι < c)


theorem mod_coprime {a b : ℕ} (hab : Nat.Coprime a b) : ∃ y : ℤ, a * y ≡ 1 [ZMOD b]


/-- `q` is the minimum factor of `mersenne p`, so `M p = 0` in `X q`. -/
theorem mersenne_coe_X (p : ℕ) : (mersenne p : X (q p)) = 0


theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
    (I : FractionalIdeal S P) = J ↔ I = J

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


@[to_additive contMDiffWithinAt_of_not_mem]
theorem contMDiffWithinAt_of_not_mem_mulTSupport {f : M → M'} [One M'] {x : M}
    (hx : x ∉ mulTSupport f) (n : ℕ∞) (s : Set M) : ContMDiffWithinAt I I' n f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
[One M']
{x : M}
(hx : x ∉ mulTSupport f)
(n : ℕ∞)
(s : Set M)


/-- See also `Finset.prod_pi_mulSingle'`. -/
@[to_additive "See also `Finset.sum_pi_single'`."]
lemma prod_pi_mulSingle' (i : ι) (a : α) : ∏ j, Pi.mulSingle i a j = a

{ι : Type u_6}
{α : Type u_8}
[Fintype ι]
[AddCommMonoid α]
[DecidableEq ι]
(i : ι)
(a : α)


theorem isLinearMap_add [AddCommMonoid M] [Module R M] :
    IsLinearMap R fun x : M × M => x.1 + x.2

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]


theorem contDiffOn_pi : ContDiffOn 𝕜 n Φ s ↔ ∀ i, ContDiffOn 𝕜 n (fun x => Φ x i) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}
{n : ℕ∞}
{ι : Type u_3}
[Fintype ι]
{F' : ι → Type u_5}
[(i : ι) → NormedAddCommGroup (F' i)]
[(i : ι) → NormedSpace 𝕜 (F' i)]
{Φ : E → (i : ι) → F' i}

ContDiffOn 𝕜 n Φ s ↔ ∀ (i : ι), ContDiffOn 𝕜 n (fun x => Φ x i) s


theorem tidy_sat {s x v} (w : s.sat' x v) : (tidyConstraint s x).sat' (tidyCoeffs s x) v

{s : Lean.Omega.Constraint}
{x v : Lean.Omega.Coeffs}
(w : s.sat' x v = true)

(Lean.Omega.tidyConstraint s x).sat' (Lean.Omega.tidyCoeffs s x) v = true


theorem Pairwise.insert_of_symmetric (hs : s.Pairwise r) (hr : Symmetric r)
    (h : ∀ b ∈ s, a ≠ b → r a b) : (insert a s).Pairwise r

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{a : α}
(hs : s.Pairwise r)
(hr : Symmetric r)
(h : ∀ b ∈ s, a ≠ b → r a b)


theorem disjoint : Pairwise fun i j => Disjoint (s i) (s j)

{ι : Type u_1}
{α : Type u_2}
{s : ι → Set α}
(hs : IndexedPartition s)


theorem append_right_injective (s : List α) : Injective fun t ↦ s ++ t


@[simp]
theorem pullbackConeOfRightIso_π_app_left : (pullbackConeOfRightIso f g).π.app left = 𝟙 _

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

(CategoryTheory.Limits.pullbackConeOfRightIso f g).π.app CategoryTheory.Limits.WalkingCospan.left =
  𝟙
    (((CategoryTheory.Functor.const CategoryTheory.Limits.WalkingCospan).obj
          (CategoryTheory.Limits.pullbackConeOfRightIso f g).pt).obj
      CategoryTheory.Limits.WalkingCospan.left)


@[simp]
theorem sort_sorted (s : Finset α) : List.Sorted r (sort r s)

{α : Type u_1}
(r : α → α → Prop)
[DecidableRel r]
[IsTrans α r]
[IsAntisymm α r]
[IsTotal α r]
(s : Finset α)


theorem mono_measure (hf : IntervalIntegrable f ν a b) (h : μ ≤ ν) : IntervalIntegrable f μ a b

{E : Type u_3}
[NormedAddCommGroup E]
{f : ℝ → E}
{a b : ℝ}
{μ ν : MeasureTheory.Measure ℝ}
(hf : IntervalIntegrable f ν a b)
(h : μ ≤ ν)


theorem contDiffOn_prod {t : Finset ι} {f : ι → E → 𝔸'} (h : ∀ i ∈ t, ContDiffOn 𝕜 n (f i) s) :
    ContDiffOn 𝕜 n (fun y => ∏ i ∈ t, f i y) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}
{n : ℕ∞}
{𝔸' : Type u_4}
{ι : Type u_5}
[NormedCommRing 𝔸']
[NormedAlgebra 𝕜 𝔸']
{t : Finset ι}
{f : ι → E → 𝔸'}
(h : ∀ i ∈ t, ContDiffOn 𝕜 n (f i) s)


@[simp]
theorem card_attach : s.attach.card = s.card


theorem le_rank_iff_exists_linearIndependent [Module.Free K V] {c : Cardinal} :
    c ≤ Module.rank K V ↔ ∃ s : Set V, #s = c ∧ LinearIndependent K ((↑) : s → V)

{K : Type u}
{V : Type v}
[Ring K]
[StrongRankCondition K]
[AddCommGroup V]
[Module K V]
[Module.Free K V]
{c : Cardinal.{v}}

c ≤ Module.rank K V ↔ ∃ s, #↑s = c ∧ LinearIndependent (ι := { x // x ∈ s }) K Subtype.val


theorem Gamma_eq_integral {s : ℂ} (hs : 0 < s.re) : Gamma s = GammaIntegral s


@[simp]
lemma cfcₙ_zero : cfcₙ (0 : R → R) a = 0


@[to_additive (attr := simp)]
theorem div_eq_bot_iff : f / g = ⊥ ↔ f = ⊥ ∨ g = ⊥


lemma IsMeasurableRatCDF.iInf_rat_gt_eq {f : α → ℚ → ℝ} (hf : IsMeasurableRatCDF f) (a : α)
    (q : ℚ) :
    ⨅ r : Ioi q, f a r = f a q

{f : α → ℚ → ℝ}

(hf : ProbabilityTheory.IsMeasurableRatCDF f)


@[simp]
theorem vanishingIdeal_singleton (x : PrimeSpectrum R) :
    vanishingIdeal ({x} : Set (PrimeSpectrum R)) = x.asIdeal

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

PrimeSpectrum.vanishingIdeal {x} = x.asIdeal


/-- The product of two monotone functions is monotone. -/
@[to_additive add "The sum of two monotone functions is monotone."]
theorem MonotoneOn.mul' [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (swap (· * ·)) (· ≤ ·)] (hf : MonotoneOn f s) (hg : MonotoneOn g s) :
    MonotoneOn (fun x => f x * g x) s

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

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


@[to_additive (attr := simp, norm_cast) coe_le_zero]
theorem coe_le_one [LE α] {a : α} : (a : WithTop α) ≤ 1 ↔ a ≤ 1

↑a ≤ 0 ↔ a ≤ 0


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


@[to_additive]
theorem map_comap_le {S : Submonoid N} {f : F} : (S.comap f).map f ≤ S

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{S : Submonoid N}
{f : F}

Submonoid.map f (Submonoid.comap f S) ≤ S


@[simp]
theorem zero_apply (x : E) : (0 : Seminorm 𝕜 E) x = 0

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]
(x : E)


lemma cyclesMap'_eq : cyclesMap' φ h₁.left h₂.left = γ.left.φK

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

CategoryTheory.ShortComplex.cyclesMap' φ h₁.left h₂.left = γ.left.φK


@[simp]
theorem preimage_sphere (x : E) (r : ℝ) : f ⁻¹' Metric.sphere (f x) r = Metric.sphere x r

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(f : E →ₛₗᵢ[σ₁₂] E₂)
(x : E)
(r : ℝ)

⇑f ⁻¹' Metric.sphere (f x) r = Metric.sphere x r


@[simp] theorem enum_nil : ([] : List α).enum = []


theorem Multiplicative.isNormalSubgroup_iff [AddGroup A] {s : Set A} :
    @IsNormalSubgroup (Multiplicative A) _ s ↔ IsNormalAddSubgroup s

IsNormalSubgroup s ↔ IsNormalAddSubgroup s


@[simp] theorem lcm_self (m : Nat) : lcm m m = m


/-- Reinterpret a top homomorphism as a bot homomorphism between the dual lattices. -/
@[simps]
protected def dual :
    TopHom α β ≃ BotHom αᵒᵈ βᵒᵈ

{α : Type u_2}
{β : Type u_3}
[LE α]
[OrderTop α]
[LE β]
[OrderTop β]
(f : TopHom α β)
(a : α)


@[measurability, fun_prop]
theorem AEMeasurable.coe_nnreal_ennreal {f : α → ℝ≥0} {μ : Measure α} (hf : AEMeasurable f μ) :
    AEMeasurable (fun x => (f x : ℝ≥0∞)) μ

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℝ≥0}
{μ : MeasureTheory.Measure α}
(hf : AEMeasurable f μ)


@[to_additive]
theorem isometry_smul {M : Type u} (X : Type w) [PseudoEMetricSpace X] [SMul M X]
    [IsometricSMul M X] (c : M) : Isometry (c • · : X → X)


@[to_additive (attr := simp)]
lemma aestabilizer_empty : aestabilizer G μ ∅ = ⊤

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [inst : MeasureTheory.VAddInvariantMeasure G α μ],
  AddAction.aestabilizer G μ ∅ = ⊤


@[reassoc (attr := simp)]
lemma opcyclesToCycles_naturality :
    opcyclesMap φ i ≫ opcyclesToCycles L i j = opcyclesToCycles K i j ≫ cyclesMap φ j

HomologicalComplex.opcyclesMap φ i ≫ L.opcyclesToCycles i j = K.opcyclesToCycles i j ≫ HomologicalComplex.cyclesMap φ j


@[simp]
theorem BinaryFan.assoc_snd {X Y Z : C} {sXY : BinaryFan X Y} {sYZ : BinaryFan Y Z}
    (Q : IsLimit sYZ) (s : BinaryFan sXY.pt Z) :
    (BinaryFan.assoc Q s).snd = Q.lift (BinaryFan.mk (s.fst ≫ sXY.snd) s.snd)

{sXY : CategoryTheory.Limits.BinaryFan X Y}

{sYZ : CategoryTheory.Limits.BinaryFan Y Z}

(s : CategoryTheory.Limits.BinaryFan sXY.pt Z)

(CategoryTheory.Limits.BinaryFan.assoc Q s).snd =
  Q.lift (CategoryTheory.Limits.BinaryFan.mk (CategoryTheory.CategoryStruct.comp s.fst sXY.snd) s.snd)


/-- A combination of two points expressed with `lineMap` lies in their affine span. -/
theorem AffineMap.lineMap_mem_affineSpan_pair (r : k) (p₁ p₂ : P) :
    AffineMap.lineMap p₁ p₂ r ∈ line[k, p₁, p₂]

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(r : k)
(p₁ p₂ : P)

(AffineMap.lineMap p₁ p₂) r ∈ affineSpan k {p₁, p₂}


@[to_additive]
theorem union_mul : (s₁ ∪ s₂) * t = s₁ * t ∪ s₂ * t

{α : Type u_2}
[DecidableEq α]
[Add α]
{s₁ s₂ t : Finset α}


@[simp]
theorem toBoolAlg_zero : toBoolAlg (0 : α) = ⊥


theorem ule_eq_not_ult (x y : BitVec w) : x.ule y = !y.ult x


theorem length_ne_zero_of_nontrivial (h : {x | x ∈ s}.Nontrivial) : s.length ≠ 0

{α : Type u_1}
{r : Rel α α}
{s : RelSeries r}
(h : {x | x ∈ s}.Nontrivial)


/-- A basic equivalence `A ≅ B'` obtained by composing `eA : A ≅ A'` and `e' : A' ≅ B'`. -/
@[simps! functor inverse unitIso_hom_app]
def equivalence₀ : A ≌ B'

{A : Type u_1}
{A' : Type u_2}
{B' : Type u_4}
[CategoryTheory.Category.{u_5, u_1} A]
[CategoryTheory.Category.{u_6, u_2} A']
[CategoryTheory.Category.{u_7, u_4} B']
(eA : A ≌ A')
(e' : A' ≌ B')

(AlgebraicTopology.DoldKan.Compatibility.equivalence₀ eA e').functor = eA.functor ⋙ e'.functor


@[to_additive]
lemma prod_map_le_prod_map {s : Multiset ι} (f : ι → α) (g : ι → α) (h : ∀ i, i ∈ s → f i ≤ g i) :
    (s.map f).prod ≤ (s.map g).prod

{ι : Type u_1}
{α : Type u_2}
[OrderedAddCommMonoid α]
{s : Multiset ι}
(f g : ι → α)
(h : ∀ i ∈ s, f i ≤ g i)

(Multiset.map f s).sum ≤ (Multiset.map g s).sum


protected theorem sub_mem : a ∈ I → b ∈ I → a - b ∈ I

{α : Type u}
[Ring α]
(I : Ideal α)
{a b : α}


theorem vecMulVec_apply [Mul α] (w : m → α) (v : n → α) (i j) : vecMulVec w v i j = w i * v j

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[Mul α]
(w : m → α)
(v : n → α)
(i : m)
(j : n)


@[simp]
theorem map_rel (φ : M →[L] N) {n : ℕ} (r : L.Relations n) (x : Fin n → M) :
    RelMap r x → RelMap r (φ ∘ x)

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(φ : L.Hom M N)
{n : ℕ}
(r : L.Relations n)
(x : Fin n → M)

FirstOrder.Language.Structure.RelMap r x → FirstOrder.Language.Structure.RelMap r (⇑φ ∘ x)


/-- This is just a special case of the global `smul_mul_assoc` lemma that requires less typeclass
search (and was here first). -/
@[simp]
protected theorem smul_mul_assoc (r : R) (x y : A) : r • x * y = r • (x * y)

{R : Type u}
{A : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(r : R)
(x y : A)


lemma eventually_one_sub_smoothingFn_nonneg : ∀ᶠ (n : ℕ) in atTop, 0 ≤ 1 - ε n

∀ᶠ (n : ℕ) in Filter.atTop, 0 ≤ 1 - AkraBazziRecurrence.smoothingFn ↑n


theorem last_pos' [NeZero n] : 0 < last n


/-- The counit in `Presheaf.stalkFunctor ⊣ skyscraperPresheafFunctor`
-/
@[simps]
protected def counit :
    skyscraperPresheafFunctor p₀ ⋙ (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⟶ 𝟭 C

[(U : TopologicalSpace.Opens ↑X) → Decidable (p₀ ∈ U)]

(StalkSkyscraperPresheafAdjunctionAuxs.counit p₀).app c = (skyscraperPresheafStalkOfSpecializes p₀ c ⋯).hom


protected theorem surjOn : SurjOn e e.source e.target

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)


lemma mul_eq_one_iff_eq_inv₀ (hb : b ≠ 0) : a * b = 1 ↔ a = b⁻¹

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b : G₀}
(hb : b ≠ 0)


/-- `(q → r) → (p → q) → q → r` -/
theorem himp_le_himp_himp_himp : b ⇨ c ≤ (a ⇨ b) ⇨ a ⇨ c

{α : Type u_2}
[GeneralizedHeytingAlgebra α]
{a b c : α}


theorem disjSups_union_right : s ○ (t₁ ∪ t₂) = s ○ t₁ ∪ s ○ t₂

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
[OrderBot α]
[DecidableRel Disjoint]
{s t₁ t₂ : Finset α}

s.disjSups (t₁ ∪ t₂) = s.disjSups t₁ ∪ s.disjSups t₂


theorem any_iff (s : String) (p : Char → Bool) : any s p ↔ ∃ c ∈ s.1, p c

s.any p = true ↔ ∃ c, c ∈ s.data ∧ p c = true


theorem ulower_up : Primrec (ULower.up : ULower α → α)


/-- Binary **rearrangement inequality**. -/
lemma mul_add_mul_lt_mul_add_mul' [ExistsAddOfLE α] [MulPosStrictMono α]
    [CovariantClass α α (· + ·) (· < ·)] [ContravariantClass α α (· + ·) (· < ·)]
    (hba : b < a) (hdc : d < c) : a * d + b * c < a * c + b * d

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

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


@[to_additive exists_addOrderOf_eq_prime_pow_iff]
theorem exists_orderOf_eq_prime_pow_iff :
    (∃ k : ℕ, orderOf x = p ^ k) ↔ ∃ m : ℕ, x ^ (p : ℕ) ^ m = 1

{G : Type u_1}
[AddMonoid G]
{x : G}
{p : ℕ}
[hp : Fact (Nat.Prime p)]

(∃ k, addOrderOf x = p ^ k) ↔ ∃ m, p ^ m • x = 0


@[simp]
theorem prod_zero (μ : Measure α) : μ.prod (0 : Measure β) = 0

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


/-- Note that this implies that exponentials of pure imaginary quaternions are unit quaternions
since in that case the RHS is `1` via `NormedSpace.exp_zero` and `norm_one`. -/
@[simp]
theorem norm_exp (q : ℍ[ℝ]) : ‖exp ℝ q‖ = ‖exp ℝ q.re‖

‖NormedSpace.exp ℝ q‖ = ‖NormedSpace.exp ℝ q.re‖


@[reassoc (attr := simp)]
lemma restrictStalkIso_inv_eq_germ :
    X.presheaf.germ ⟨f x, show f x ∈ h.isOpenMap.functor.obj V from ⟨x, hx, rfl⟩⟩ ≫
      (X.restrictStalkIso h x).inv = (X.restrict h).presheaf.germ ⟨x, hx⟩

X.presheaf.germ ⟨f x, ⋯⟩ ≫ (X.restrictStalkIso h x).inv = (X.restrict h).presheaf.germ ⟨x, hx⟩


/-- Projection from `G ≃+c[a, a] G` to permutations `G ≃ G`, as a monoid homomorphism. -/
@[simps! apply]
def toPerm : (G ≃+c[a, a] G) →* Equiv.Perm G

{G : Type u_1}
[Add G]
{a : G}
(self : G ≃+c[a, a] G)

AddConstEquiv.toPerm self = self.toEquiv


theorem exists_mem (x : α) : ∃ i, x ∈ s i

{ι : Type u_1}
{α : Type u_2}
{s : ι → Set α}
(hs : IndexedPartition s)
(x : α)


@[to_additive Ico_add_Ioc_subset]
theorem Ico_mul_Ioc_subset' [LocallyFiniteOrder α] (a b c d : α) :
    Ico a b * Ioc c d ⊆ Ioo (a * c) (b * d)

[CovariantClass α α (Function.swap HAdd.hAdd) LT.lt]

Finset.Ico a b + Finset.Ioc c d ⊆ Finset.Ioo (a + c) (b + d)


/-- The top submonoid is isomorphic to the monoid. -/
@[to_additive (attr := simps) "The top additive submonoid is isomorphic to the additive monoid."]
def topEquiv : (⊤ : Submonoid M) ≃* M


theorem _root_.Matrix.separatingLeft_toLinearMap₂'_iff_separatingLeft_toLinearMap₂
    {M : Matrix ι ι R₁} (b : Basis ι R₁ M₁) :
    (Matrix.toLinearMap₂' R₁ M).SeparatingLeft (R := R₁) ↔
      (Matrix.toLinearMap₂ b b M).SeparatingLeft

{R₁ : Type u_2}
{M₁ : Type u_7}
{ι : Type u_16}
[CommRing R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[DecidableEq ι]
[Fintype ι]
{M : Matrix ι ι R₁}
(b : Basis ι R₁ M₁)

((Matrix.toLinearMap₂' R₁) M).SeparatingLeft ↔ ((Matrix.toLinearMap₂ b b) M).SeparatingLeft


@[simp] theorem liftOrGet_none_left {f} {b : Option α} : liftOrGet f none b = b

{α : Type u_1}
{f : α → α → α}
{b : Option α}


theorem get_append_left {as bs : Array α} {h : i < (as ++ bs).size} (hlt : i < as.size) :
    (as ++ bs)[i] = as[i]

{α : Type u_1}
{i : Nat}
{as bs : Array α}
{h : i < (as ++ bs).size}
(hlt : i < as.size)


theorem add_neg {R} [Ring R] (a b : R) : a + -b = a - b


@[simp]
theorem KaehlerDifferential.mapBaseChange_tmul (x : B) (y : Ω[A⁄R]) :
    KaehlerDifferential.mapBaseChange R A B (x ⊗ₜ y) = x • KaehlerDifferential.map R R A B y

(R : Type u)
[CommRing R]
(A : Type u_2)
(B : Type u_3)
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra R B]
[Algebra A B]
[IsScalarTower R A B]
(x : B)
(y : Ω[A⁄R])

(KaehlerDifferential.mapBaseChange R A B) (x ⊗ₜ[A] y) = x • (KaehlerDifferential.map R R A B) y


theorem mk'_add (m₁ m₂ : M) (s : S) : mk' f (m₁ + m₂) s = mk' f m₁ s + mk' f m₂ s

{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]
(m₁ m₂ : M)
(s : ↥S)

IsLocalizedModule.mk' f (m₁ + m₂) s = IsLocalizedModule.mk' f m₁ s + IsLocalizedModule.mk' f m₂ s


@[to_additive]
theorem sup_subgroupOf_eq {H K L : Subgroup G} (hH : H ≤ L) (hK : K ≤ L) :
    H.subgroupOf L ⊔ K.subgroupOf L = (H ⊔ K).subgroupOf L

{G : Type u_1}
[AddGroup G]
{H K L : AddSubgroup G}
(hH : H ≤ L)
(hK : K ≤ L)

H.addSubgroupOf L ⊔ K.addSubgroupOf L = (H ⊔ K).addSubgroupOf L


theorem Independent.comp' {ι ι' : Sort*} {t : ι → α} {f : ι' → ι} (ht : Independent <| t ∘ f)
    (hf : Surjective f) : Independent t

(ht : CompleteLattice.Independent (t ∘ f))


theorem coverDense_inducedFunctor {B : ι → Opens X} (h : Opens.IsBasis (Set.range B)) :
    (inducedFunctor B).IsCoverDense (Opens.grothendieckTopology X)

(h : TopologicalSpace.Opens.IsBasis (Set.range B))

(CategoryTheory.inducedFunctor B).IsCoverDense (Opens.grothendieckTopology ↑X)


theorem sInf_eq_argmin_on (hs : s.Nonempty) : sInf s = argminOn id wellFounded_lt s hs

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
{s : Set α}
[IsWellOrder α fun x x_1 => x < x_1]
(hs : s.Nonempty)


lemma cfc_pow (f : R → R) (n : ℕ) (a : A)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (fun x ↦ (f x) ^ n) a = cfc f a ^ n


theorem principal_nfp_blsub₂ (op : Ordinal → Ordinal → Ordinal) (o : Ordinal) :
    Principal op (nfp (fun o' => blsub₂.{u, u, u} o' o' (@fun a _ b _ => op a b)) o)

(op : Ordinal.{u} → Ordinal.{u} → Ordinal.{u})

Ordinal.Principal op (Ordinal.nfp (fun o' => o'.blsub₂ o' fun a x b x => op a b) o)


@[simp]
theorem Γ_map {X Y : LocallyRingedSpace.{u}ᵒᵖ} (f : X ⟶ Y) : Γ.map f = f.unop.1.c.app (op ⊤)

{X Y : AlgebraicGeometry.LocallyRingedSpaceᵒᵖ}

AlgebraicGeometry.LocallyRingedSpace.Γ.map f = f.unop.val.c.app (Opposite.op ⊤)


lemma eval_minpolyDiv_of_aeval_eq_zero [IsDomain S] [DecidableEq S]
    {y} (hy : aeval y (minpoly R x) = 0) :
    (minpolyDiv R x).eval y = if x = y then aeval x (derivative <| minpoly R x) else 0

(hy : (Polynomial.aeval y) (minpoly R x) = 0)

Polynomial.eval y (minpolyDiv R x) = if x = y then (Polynomial.aeval x) (Polynomial.derivative (minpoly R x)) else 0


@[simp] lemma prob_compl_eq_zero_iff₀ (hs : NullMeasurableSet s μ) : μ sᶜ = 0 ↔ μ s = 1

(hs : MeasureTheory.NullMeasurableSet s μ)


lemma exact_iff_kernel_ι_comp_cokernel_π_zero [S.HasHomology]
    [HasKernel S.g] [HasCokernel S.f] :
    S.Exact ↔ kernel.ι S.g ≫ cokernel.π S.f = 0

S.Exact ↔
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.kernel.ι S.g) (CategoryTheory.Limits.cokernel.π S.f) = 0


@[simp]
theorem piCongrRight_refl {R ι : Type*} {A : ι → Type*} [CommSemiring R] [∀ i, Semiring (A i)]
    [∀ i, Algebra R (A i)] :
    (piCongrRight fun i => (AlgEquiv.refl : A i ≃ₐ[R] A i)) = AlgEquiv.refl

{R : Type u_1}
{ι : Type u_2}
{A : ι → Type u_3}
[CommSemiring R]
[(i : ι) → Semiring (A i)]
[(i : ι) → Algebra R (A i)]

(AlgEquiv.piCongrRight fun i => AlgEquiv.refl) = AlgEquiv.refl


theorem coe_add (p q : Seminorm 𝕜 E) : ⇑(p + q) = p + q

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]
(p q : Seminorm 𝕜 E)


@[simp]
theorem _root_.Set.smul_mem_centralizer {s : Set A} (r : R) {a : A} (ha : a ∈ s.centralizer) :
    r • a ∈ s.centralizer

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{s : Set A}
(r : R)
{a : A}
(ha : a ∈ s.centralizer)


theorem zpow_apply_mem_support {n : ℤ} {x : α} : (f ^ n) x ∈ f.support ↔ x ∈ f.support

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{f : Equiv.Perm α}
{n : ℤ}
{x : α}


@[simp] lemma map_toEnumFinset_fst (m : Multiset α) : m.toEnumFinset.val.map Prod.fst = m

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

Multiset.map Prod.fst m.toEnumFinset.val = m


theorem inf_eq_minDefault [SemilatticeInf α] [DecidableRel ((· ≤ ·) : α → α → Prop)]
    [IsTotal α (· ≤ ·)] :
    (· ⊓ ·) = (minDefault : α → α → α)

{α : Type u}
[SemilatticeInf α]
[DecidableRel fun x x_1 => x ≤ x_1]
[IsTotal α fun x x_1 => x ≤ x_1]


theorem _root_.Embedding.aestronglyMeasurable_comp_iff [PseudoMetrizableSpace β]
    [PseudoMetrizableSpace γ] {g : β → γ} {f : α → β} (hg : Embedding g) :
    AEStronglyMeasurable (fun x => g (f x)) μ ↔ AEStronglyMeasurable f μ

MeasureTheory.AEStronglyMeasurable (fun x => g (f x)) μ ↔ MeasureTheory.AEStronglyMeasurable f μ


@[simp] lemma truncatedInf_empty (a : α) : truncatedInf ∅ a = ⊥

{α : Type u_1}
[SemilatticeInf α]
[BoundedOrder α]
[DecidableRel fun x x_1 => x ≤ x_1]
(a : α)


@[to_additive VAddAntidiagonal.eq_of_fst_eq_fst]
theorem eq_of_fst_eq_fst (h : (x : G × P).fst = (y : G × P).fst) : x = y

{G : Type u_1}
{P : Type u_2}
{s : Set G}
{t : Set P}
{a : P}
[VAdd G P]
[IsCancelVAdd G P]
{x y : ↑(s.vaddAntidiagonal t a)}
(h : (↑x).1 = (↑y).1)


lemma proj_surjective (n : ℕ) : Function.Surjective (S.proj n)


@[simp]
theorem toMultiset_toDFinsupp (f : Π₀ _ : α, ℕ) :
    Multiset.toDFinsupp (DFinsupp.toMultiset f) = f

{α : Type u_1}
[DecidableEq α]
(f : Π₀ (x : α), ℕ)


theorem inr_injective : Function.Injective (inr R M M₂)

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

Function.Injective ⇑(LinearMap.inr R M M₂)


@[to_additive]
theorem contMDiff_finprod_cond (hc : ∀ i, p i → ContMDiff I' I n (f i))
    (hf : LocallyFinite fun i => mulSupport (f i)) :
    ContMDiff I' I n fun x => ∏ᶠ (i) (_ : p i), f i x

(hc : ∀ (i : ι), p i → ContMDiff I' I n (f i))

(hf : LocallyFinite fun i => Function.mulSupport (f i))

ContMDiff I' I n fun x => ∏ᶠ (i : ι) (_ : p i), f i x


theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x

(x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ))

‖x‖ ≤ NumberField.mixedEmbedding.convexBodySumFun x


@[simp]
theorem map_X (h : IsAdjoinRoot S f) : h.map X = h.root

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRoot S f)


@[simp] lemma forall_mem_not_eq {s : Finset α} {a : α} : (∀ b ∈ s, ¬ a = b) ↔ a ∉ s


@[simp]
theorem unop_id_op {X : C} : (𝟙 (op X)).unop = 𝟙 X

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

(CategoryTheory.CategoryStruct.id (Opposite.op X)).unop = CategoryTheory.CategoryStruct.id X


/-- If a finite group is the direct product of its Sylow groups, it is nilpotent -/
theorem isNilpotent_of_product_of_sylow_group
    (e : (∀ p : (Nat.card G).primeFactors, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G) :
    IsNilpotent G

(e : ((p : { x // x ∈ (Nat.card G).primeFactors }) → (P : Sylow (↑p) G) → ↥↑P) ≃* G)


lemma sSup_eq_bot' {s : Set α} : sSup s = ⊥ ↔ s = ∅ ∨ s = {⊥}

{α : Type u_1}
[CompleteLattice α]
{s : Set α}


theorem le_one (i : ι) (x : X) : f i x ≤ 1

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(f : PartitionOfUnity ι X s)
(i : ι)
(x : X)


/-- If the unique morphism from `A` to the terminal object is a monomorphism, `A` is subterminal.
The converse of `IsSubterminal.mono_terminal_from`.
-/
theorem isSubterminal_of_mono_terminal_from [HasTerminal C] [Mono (terminal.from A)] :
    IsSubterminal A


@[simp]
theorem leftUnitor_hom_apply {M : ModuleCat.{u} R} (r : R) (m : M) :
    ((λ_ M).hom : 𝟙_ (ModuleCat R) ⊗ M ⟶ M) (r ⊗ₜ[R] m) = r • m

{R : Type u}
[CommRing R]
{M : ModuleCat R}
(r : R)
(m : ↑M)

(CategoryTheory.MonoidalCategory.leftUnitor M).hom (r ⊗ₜ[R] m) = r • m


/-- If a free module is finite, then any arbitrary basis is finite. -/
lemma Module.Finite.finite_basis {R M} [Ring R] [Nontrivial R] [AddCommGroup M] [Module R M]
    {ι} [Module.Finite R M] (b : Basis ι R M) :
    _root_.Finite ι

{R : Type u_6}
{M : Type u_7}
[Ring R]
[Nontrivial R]
[AddCommGroup M]
[Module R M]
{ι : Type u_8}
[Module.Finite R M]
(b : Basis ι R M)


theorem localInverse_unique (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) {g : F → E}
    (hg : ∀ᶠ x in 𝓝 a, g (f x) = x) : ∀ᶠ y in 𝓝 (f a), g y = localInverse f f' a hf y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace E]
{f : E → F}
{f' : E ≃L[𝕜] F}
{a : E}
(hf : HasStrictFDerivAt f (↑f') a)
{g : F → E}
(hg : ∀ᶠ (x : E) in 𝓝 a, g (f x) = x)

∀ᶠ (y : F) in 𝓝 (f a), g y = HasStrictFDerivAt.localInverse f f' a hf y


theorem mem_or_compl_mem (f : Ultrafilter α) (s : Set α) : s ∈ f ∨ sᶜ ∈ f

{α : Type u}
(f : Ultrafilter α)
(s : Set α)

s ∈ f ∨ sᶜ ∈ f


/-- Bijection between a subsemiring `S` and its opposite. -/
@[simps!]
def addEquivOp (S : Subsemiring R) : S ≃+ S.op

{R : Type u_2}
[NonAssocSemiring R]
(S : Subsemiring R)
(b : { b // (fun x => x ∈ S.op) b })

↑(S.addEquivOp.symm b) = MulOpposite.unop ↑b


@[simp]
theorem coe_coeHom : ⇑coeHom = ((↑) : ℚ≥0 → ℚ)


/-- To show a property of all powers of `g` it suffices to show it is closed under multiplication
by `g` and `g⁻¹` on the left. For subgroups generated by more than one element, see
`Subgroup.closure_induction_left`. -/
@[to_additive "To show a property of all multiples of `g` it suffices to show it is closed under
addition by `g` and `-g` on the left. For additive subgroups generated by more than one element, see
`AddSubgroup.closure_induction_left`."]
lemma zpow_induction_left {g : G} {P : G → Prop} (h_one : P (1 : G))
    (h_mul : ∀ a, P a → P (g * a)) (h_inv : ∀ a, P a → P (g⁻¹ * a)) (n : ℤ) : P (g ^ n)

{G : Type u_3}
[Group G]
{g : G}
{P : G → Prop}
(h_one : P 1)
(h_mul : ∀ (a : G), P a → P (g * a))
(h_inv : ∀ (a : G), P a → P (g⁻¹ * a))
(n : ℤ)


lemma SMulPosReflectLT.toSMulPosMono [SMulPosReflectLT α β] : SMulPosMono α β

{α : Type u_1}
{β : Type u_2}
[SMul α β]
[Preorder α]
[LinearOrder β]
[Zero β]
[SMulPosReflectLT α β]


theorem _root_.IsCoatom.isMaximal (hI : IsCoatom I) : IsMaximal I

{P : Type u_1}
[LE P]
[IsDirected P fun x x_1 => x ≤ x_1]
[Nonempty P]
{I : Order.Ideal P}
(hI : IsCoatom I)


theorem exists_le_covBy_of_lt [IsStronglyCoatomic α] (h : a < b) : ∃ x, a ≤ x ∧ x ⋖ b

{α : Type u_4}
{a b : α}
[Preorder α]
[IsStronglyCoatomic α]
(h : a < b)


theorem interior_subset_gauge_lt_one (s : Set E) : interior s ⊆ { x | gauge s x < 1 }

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[ContinuousSMul ℝ E]
(s : Set E)


protected theorem Nat.lt_of_le_of_lt {n m k : Nat} (h₁ : LE.le n m) (h₂ : LT.lt m k) : LT.lt n k


@[to_additive]
theorem map_units (f : LocalizationMap S N) (y : S) : IsUnit (f.toMap y)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
(y : ↥S)


lemma le_and_le_add_one_iff : n ≤ m ∧ m ≤ n + 1 ↔ m = n ∨ m = n + 1


theorem lt_iff : μ < ν ↔ μ ≤ ν ∧ ∃ s, MeasurableSet s ∧ μ s < ν s

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}


/-- Scalar multiplication is analytic (jointly in both variables). The statement is a little
pedantic to allow towers of field extensions.

TODO: can we replace `𝕜'` with a "normed module" in such a way that `analyticAt_mul` is a special
case of this? -/
lemma analyticAt_smul [NormedSpace 𝕝 E] [IsScalarTower 𝕜 𝕝 E] (z : 𝕝 × E) :
    AnalyticAt 𝕜 (fun x : 𝕝 × E ↦ x.1 • x.2) z

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝕝 : Type u_7}
[NontriviallyNormedField 𝕝]
[NormedAlgebra 𝕜 𝕝]
[NormedSpace 𝕝 E]
[IsScalarTower 𝕜 𝕝 E]
(z : 𝕝 × E)


@[simp]
theorem toSubgraph_rotate [DecidableEq V] (c : G.Walk v v) (h : u ∈ c.support) :
    (c.rotate h).toSubgraph = c.toSubgraph

{V : Type u}
{G : SimpleGraph V}
{u v : V}
[DecidableEq V]
(c : G.Walk v v)
(h : u ∈ c.support)


/-- Two equivalent partial equivs have the same source. -/
theorem EqOnSource.source_eq {e e' : PartialEquiv α β} (h : e ≈ e') : e.source = e'.source

{α : Type u_1}
{β : Type u_2}
{e e' : PartialEquiv α β}
(h : e ≈ e')


/-- An almost everywhere sequential limit of almost everywhere strongly measurable functions is
almost everywhere strongly measurable. -/
theorem _root_.aestronglyMeasurable_of_tendsto_ae {ι : Type*} [PseudoMetrizableSpace β]
    (u : Filter ι) [NeBot u] [IsCountablyGenerated u] {f : ι → α → β} {g : α → β}
    (hf : ∀ i, AEStronglyMeasurable (f i) μ) (lim : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) u (𝓝 (g x))) :
    AEStronglyMeasurable g μ

{f : ι → α → β}

(hf : ∀ (i : ι), MeasureTheory.AEStronglyMeasurable (f i) μ)

(lim : ∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => f n x) u (𝓝 (g x)))


theorem castLE_of_eq {m n : Nat} (h : m = n) {h' : m ≤ n} : castLE h' = Fin.cast h


@[norm_cast]
theorem coeFn_inf {f g : Filtration ι m} : ⇑(f ⊓ g) = ⇑f ⊓ ⇑g

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[Preorder ι]
{f g : MeasureTheory.Filtration ι m}


/-- If `d₁ < d₂`, then for any set `s` we have either `μH[d₂] s = 0`, or `μH[d₁] s = ∞`. -/
theorem hausdorffMeasure_zero_or_top {d₁ d₂ : ℝ} (h : d₁ < d₂) (s : Set X) :
    μH[d₂] s = 0 ∨ μH[d₁] s = ∞

{X : Type u_2}
[EMetricSpace X]
[MeasurableSpace X]
[BorelSpace X]
{d₁ d₂ : ℝ}
(h : d₁ < d₂)
(s : Set X)


theorem measurable_generateFrom [MeasurableSpace α] {s : Set (Set β)} {f : α → β}
    (h : ∀ t ∈ s, MeasurableSet (f ⁻¹' t)) : @Measurable _ _ _ (generateFrom s) f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{s : Set (Set β)}
{f : α → β}
(h : ∀ t ∈ s, MeasurableSet (f ⁻¹' t))


lemma subsingleton (hx : 0 ∈ x) : Subsingleton (HomogeneousLocalization 𝒜 x)

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[CommRing R]
[CommRing A]
[Algebra R A]
(𝒜 : ι → Submodule R A)
{x : Submonoid A}
(hx : 0 ∈ x)


theorem dist_eq (x y : ℤ) : dist x y = |(x : ℝ) - y|


@[simp]
theorem pi_pi (s : ∀ i, Set (α i)) : Measure.pi μ (pi univ s) = ∏ i, μ i (s i)

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

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

(MeasureTheory.Measure.pi μ) (Set.univ.pi s) = ∏ i : ι, (μ i) (s i)


@[to_additive (attr := trans)]
theorem Red.trans : Red L₁ L₂ → Red L₂ L₃ → Red L₁ L₃

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

FreeAddGroup.Red L₁ L₂ → FreeAddGroup.Red L₂ L₃ → FreeAddGroup.Red L₁ L₃


@[simp]
theorem _root_.Set.up_empty : Set.up (∅ : Set α) = 0


/-- A set is stable under generalization iff it is an intersection of open sets. -/
lemma stableUnderGeneralization_iff_exists_sInter_eq {s : Set X} :
    StableUnderGeneralization s ↔ ∃ (S : Set (Set X)), (∀ s ∈ S, IsOpen s) ∧ ⋂₀ S = s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}

StableUnderGeneralization s ↔ ∃ S, (∀ s ∈ S, IsOpen s) ∧ ⋂₀ S = s


theorem exists_forall_closed_ball_dist_add_le_two_sub (hε : 0 < ε) :
    ∃ δ, 0 < δ ∧ ∀ ⦃x : E⦄, ‖x‖ ≤ 1 → ∀ ⦃y⦄, ‖y‖ ≤ 1 → ε ≤ ‖x - y‖ → ‖x + y‖ ≤ 2 - δ

(E : Type u_1)
[SeminormedAddCommGroup E]
[UniformConvexSpace E]
{ε : ℝ}
[NormedSpace ℝ E]
(hε : 0 < ε)

∃ δ, 0 < δ ∧ ∀ ⦃x : E⦄, ‖x‖ ≤ 1 → ∀ ⦃y : E⦄, ‖y‖ ≤ 1 → ε ≤ ‖x - y‖ → ‖x + y‖ ≤ 2 - δ


@[simp]
theorem app_nsmul (X : C) (α : F ⟶ G) (n : ℕ) : (n • α).app X = n • α.app X

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


@[simp]
theorem constantCoeff_wittNeg (n : ℕ) : constantCoeff (wittNeg p n) = 0

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

MvPolynomial.constantCoeff (WittVector.wittNeg p n) = 0


@[ext]
theorem toTopObj.ext {x : SimplexCategory} (f g : x.toTopObj) : (f : x → ℝ≥0) = g → f = g

{x : SimplexCategory}
(f g : ↑x.toTopObj)


theorem total_unique [Unique α] (l : α →₀ R) (v) :
    Finsupp.total α M R v l = l default • v default

{α : Type u_1}
{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Unique α]
(l : α →₀ R)
(v : α → M)

(Finsupp.total α M R v) l = l default • v default


/-- A CHSH tuple in a *-monoid consists of 4 self-adjoint involutions `A₀ A₁ B₀ B₁` such that
the `Aᵢ` commute with the `Bⱼ`.

The physical interpretation is that `A₀` and `A₁` are a pair of boolean observables which
are spacelike separated from another pair `B₀` and `B₁` of boolean observables.
-/
--@[nolint has_nonempty_instance] Porting note(#5171): linter not ported yet
structure IsCHSHTuple {R} [Monoid R] [StarMul R] (A₀ A₁ B₀ B₁ : R) : Prop where
  A₀_inv : A₀ ^ 2 = 1
  A₁_inv : A₁ ^ 2 = 1
  B₀_inv : B₀ ^ 2 = 1
  B₁_inv : B₁ ^ 2 = 1
  A₀_sa : star A₀ = A₀
  A₁_sa : star A₁ = A₁
  B₀_sa : star B₀ = B₀
  B₁_sa : star B₁ = B₁
  A₀B₀_commutes : A₀ * B₀ = B₀ * A₀
  A₀B₁_commutes : A₀ * B₁ = B₁ * A₀
  A₁B₀_commutes : A₁ * B₀ = B₀ * A₁
  A₁B₁_commutes : A₁ * B₁ = B₁ * A₁

{R : Type u_1}
[Monoid R]
[StarMul R]
{A₀ A₁ B₀ B₁ : R}
(self : IsCHSHTuple A₀ A₁ B₀ B₁)


theorem isPreconnected_iff_preconnectedSpace {s : Set α} : IsPreconnected s ↔ PreconnectedSpace s

{α : Type u}
[TopologicalSpace α]
{s : Set α}


@[simp]
lemma Hom.comp_id (f : Hom P P') : f.comp (Hom.id P) = f

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u_1}
{S' : Type u_2}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra R R']
[Algebra S S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
(f : P.Hom P')

f.comp (Algebra.Generators.Hom.id P) = f


@[simp]
lemma finsuppLeft_apply_tmul_apply (p : ι →₀ M) (n : N) (i : ι) :
    finsuppLeft R M N ι (p ⊗ₜ[R] n) i = p i ⊗ₜ[R] n

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_4}
[DecidableEq ι]
(p : ι →₀ M)
(n : N)
(i : ι)

((TensorProduct.finsuppLeft R M N ι) (p ⊗ₜ[R] n)) i = p i ⊗ₜ[R] n


@[simp]
theorem kahler_rightAngleRotation_left (x y : E) :
    o.kahler (J x) y = -Complex.I * o.kahler x y

[Fact (FiniteDimensional.finrank ℝ E = 2)]

(o.kahler (o.rightAngleRotation x)) y = -Complex.I * (o.kahler x) y


theorem cons_le_cons_iff (a : α) : a ::ₘ s ≤ a ::ₘ t ↔ s ≤ t

{α : Type u_1}
{s t : Multiset α}
(a : α)


@[simp]
theorem coeff_X_pow_self (n : ℕ) : coeff R n ((X : R⟦X⟧) ^ n) = 1

(PowerSeries.coeff R n) (PowerSeries.X ^ n) = 1


theorem map_map {π : P →+* R} (m : PerfectionMap p π) {σ : Q →+* S} (n : PerfectionMap p σ)
    (φ : R →+* S) (x : P) : σ (map p m n φ x) = φ (π x)

(p : ℕ)
[Fact (Nat.Prime p)]
{R : Type u₁}
[CommSemiring R]
[CharP R p]
{P : Type u₃}
[CommSemiring P]
[CharP P p]
[PerfectRing P p]
{S : Type u₂}
[CommSemiring S]
[CharP S p]
{Q : Type u₄}
[CommSemiring Q]
[CharP Q p]
[PerfectRing Q p]
{π : P →+* R}
(m : PerfectionMap p π)
{σ : Q →+* S}
(n : PerfectionMap p σ)
(φ : R →+* S)
(x : P)

σ ((PerfectionMap.map p m n φ) x) = φ (π x)


@[simp]
theorem sup_eq_union : ((· ⊔ ·) : Set α → Set α → Set α) = (· ∪ ·)

(fun x x_1 => x ⊔ x_1) = fun x x_1 => x ∪ x_1


@[simp]
theorem ofPiFork_π_app_right (c : Fork I.fstPiMap I.sndPiMap) (a) :
    (ofPiFork I c).π.app (WalkingMulticospan.right a) = c.ι ≫ I.fstPiMap ≫ Pi.π _ _

(I : CategoryTheory.Limits.MulticospanIndex C)

(c : CategoryTheory.Limits.Fork I.fstPiMap I.sndPiMap)

(CategoryTheory.Limits.Multifork.ofPiFork I c).π.app (CategoryTheory.Limits.WalkingMulticospan.right a) =
  CategoryTheory.CategoryStruct.comp c.ι
    (CategoryTheory.CategoryStruct.comp I.fstPiMap (CategoryTheory.Limits.Pi.π I.right a))


lemma Reachable.of_dist_ne_zero (h : G.dist u v ≠ 0) : G.Reachable u v

{V : Type u_1}
{G : SimpleGraph V}
{u v : V}
(h : G.dist u v ≠ 0)


@[simp] theorem ite_false (a b : α) : (if False then a else b) = b


theorem intersecting_iff_pairwise_not_disjoint :
    s.Intersecting ↔ (s.Pairwise fun a b => ¬Disjoint a b) ∧ s ≠ {⊥}

{α : Type u_1}
[SemilatticeInf α]
[OrderBot α]
{s : Set α}


@[simp]
theorem closure_iSup₂_closure (f : ∀ i, κ i → α) :
    c (⨆ (i) (j), c (f i j)) = c (⨆ (i) (j), f i j)

{α : Type u_1}
{ι : Sort u_2}
{κ : ι → Sort u_3}
[CompleteLattice α]
(c : ClosureOperator α)
(f : (i : ι) → κ i → α)

c (⨆ i, ⨆ j, c (f i j)) = c (⨆ i, ⨆ j, f i j)


/-- Given `f : NormedAddGroupHom G H` for some complete `G` and a subgroup `K` of `H`, if every
element `x` of `K` has a preimage under `f` whose norm is at most `C*‖x‖` then the same holds for
elements of the (topological) closure of `K` with constant `C+ε` instead of `C`, for any
positive `ε`.
-/
theorem controlled_closure_of_complete {f : NormedAddGroupHom G H} {K : AddSubgroup H} {C ε : ℝ}
    (hC : 0 < C) (hε : 0 < ε) (hyp : f.SurjectiveOnWith K C) :
    f.SurjectiveOnWith K.topologicalClosure (C + ε)

{G : Type u_1}
[NormedAddCommGroup G]
[CompleteSpace G]
{H : Type u_2}
[NormedAddCommGroup H]
{f : NormedAddGroupHom G H}
{K : AddSubgroup H}
{C ε : ℝ}
(hC : 0 < C)
(hε : 0 < ε)
(hyp : f.SurjectiveOnWith K C)


theorem solution_spec (a₁ a₂ : 𝕎 k) : solution p a₁ a₂ ^ (p - 1) = a₂.coeff 0 / a₁.coeff 0

(p : ℕ)
[hp : Fact (Nat.Prime p)]
{k : Type u_1}
[Field k]
[IsAlgClosed k]
(a₁ a₂ : WittVector p k)

WittVector.RecursionBase.solution p a₁ a₂ ^ (p - 1) = a₂.coeff 0 / a₁.coeff 0


@[simp]
theorem map_comp_c_app (F : J ⥤ PresheafedSpace.{_, _, v} C) {j₁ j₂ j₃}
    (f : j₁ ⟶ j₂) (g : j₂ ⟶ j₃) (U) :
    (F.map (f ≫ g)).c.app U =
      (F.map g).c.app U ≫
        ((pushforward C (F.map g).base).map (F.map f).c).app U ≫
          (pushforwardEq (congr_arg Hom.base (F.map_comp f g).symm) _).hom.app U

(F : J ⥤ AlgebraicGeometry.PresheafedSpace C)

(U : (TopologicalSpace.Opens ↑↑(F.obj j₃))ᵒᵖ)

(F.map (f ≫ g)).c.app U =
  (F.map g).c.app U ≫
    ((TopCat.Presheaf.pushforward C (F.map g).base).map (F.map f).c).app U ≫
      (TopCat.Presheaf.pushforwardEq ⋯ (F.obj j₁).presheaf).hom.app U


theorem inv_lt_one_iff_of_pos (h₀ : 0 < a) : a⁻¹ < 1 ↔ 1 < a

{α : Type u_2}
[LinearOrderedSemifield α]
{a : α}
(h₀ : 0 < a)


theorem apply_mono (μ : FiniteMeasure Ω) {s₁ s₂ : Set Ω} (h : s₁ ⊆ s₂) : μ s₁ ≤ μ s₂

{Ω : Type u_1}
[MeasurableSpace Ω]
(μ : MeasureTheory.FiniteMeasure Ω)
{s₁ s₂ : Set Ω}
(h : s₁ ⊆ s₂)


theorem HasBasis.ex_mem (h : l.HasBasis p s) : ∃ i, p i

{α : Type u_1}
{ι : Sort u_4}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}
(h : l.HasBasis p s)


/-- A particular case of Sard's Theorem. Let `f : E → F` be a map between finite dimensional real
vector spaces. Suppose that `f` is `C¹` smooth on a convex set `s` of Hausdorff dimension strictly
less than the dimension of `F`. Then the complement of the image `f '' s` is dense in `F`. -/
theorem ContDiffOn.dense_compl_image_of_dimH_lt_finrank [FiniteDimensional ℝ F] {f : E → F}
    {s t : Set E} (h : ContDiffOn ℝ 1 f s) (hc : Convex ℝ s) (ht : t ⊆ s)
    (htF : dimH t < finrank ℝ F) : Dense (f '' t)ᶜ

(htF : dimH t < ↑(FiniteDimensional.finrank ℝ F))


lemma exact₀ {Z : C} (I : InjectiveResolution Z) :
    (ShortComplex.mk _ _ I.ι_f_zero_comp_complex_d).Exact

(I : CategoryTheory.InjectiveResolution Z)

(CategoryTheory.ShortComplex.mk (I.ι.f 0) (I.cocomplex.d 0 1) ⋯).Exact


@[to_additive (attr := simp)]
theorem _root_.Subgroup.ker_inclusion {H K : Subgroup G} (h : H ≤ K) : (inclusion h).ker = ⊥

{G : Type u_1}
[AddGroup G]
{H K : AddSubgroup G}
(h : H ≤ K)


/-- A graded version of `Monoid`

Like `Monoid.npow`, this has an optional `GMonoid.gnpow` field to allow definitional control of
natural powers of a graded monoid. -/
class GMonoid [AddMonoid ι] extends GMul A, GOne A where
  /-- Multiplication by `one` on the left is the identity -/
  one_mul (a : GradedMonoid A) : 1 * a = a
  /-- Multiplication by `one` on the right is the identity -/
  mul_one (a : GradedMonoid A) : a * 1 = a
  /-- Multiplication is associative -/
  mul_assoc (a b c : GradedMonoid A) : a * b * c = a * (b * c)
  /-- Optional field to allow definitional control of natural powers -/
  gnpow : ∀ (n : ℕ) {i}, A i → A (n • i) := GMonoid.gnpowRec
  /-- The zeroth power will yield 1 -/
  gnpow_zero' : ∀ a : GradedMonoid A, GradedMonoid.mk _ (gnpow 0 a.snd) = 1 := by
    apply_gmonoid_gnpowRec_zero_tac
  /-- Successor powers behave as expected -/
  gnpow_succ' :
    ∀ (n : ℕ) (a : GradedMonoid A),
      (GradedMonoid.mk _ <| gnpow n.succ a.snd) = ⟨_, gnpow n a.snd⟩ * a := by
    apply_gmonoid_gnpowRec_succ_tac

{ι : Type u_1}
{A : ι → Type u_2}
[AddMonoid ι]
[self : GradedMonoid.GMonoid A]
(a : GradedMonoid A)

GradedMonoid.mk (0 • a.fst) (GradedMonoid.GMonoid.gnpow 0 a.snd) = 1


theorem sdiff_eq_symm (hy : y ≤ x) (h : x \ y = z) : x \ z = y

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]
(hy : y ≤ x)
(h : x \ y = z)


/-- If every dissociated subset of `s` has size at most `d`, then `s` is actually generated by a
subset of size at most `d`.

This is a dissociation analog of the fact that a set whose linearly independent subsets all have
size at most `d` is of dimension at most `d` itself. -/
@[to_additive "If every dissociated subset of `s` has size at most `d`, then `s` is actually
generated by a subset of size at most `d`.

This is a dissociation analog of the fact that a set whose linearly independent subspaces all have
size at most `d` is of dimension at most `d` itself."]
lemma exists_subset_mulSpan_card_le_of_forall_mulDissociated
    (hs : ∀ s', s' ⊆ s → MulDissociated (s' : Set α) → s'.card ≤ d) :
    ∃ s', s' ⊆ s ∧ s'.card ≤ d ∧ s ⊆ mulSpan s'

(hs : ∀ s' ⊆ s, AddDissociated ↑s' → s'.card ≤ d)


theorem card_eq_of_mem_parts_chunk (hs : s ∈ (chunk hP G ε hU).parts) :
    s.card = m ∨ s.card = m + 1

(hs : s ∈ (SzemerediRegularity.chunk hP G ε hU).parts)

s.card = Fintype.card α / SzemerediRegularity.stepBound P.parts.card ∨
  s.card = Fintype.card α / SzemerediRegularity.stepBound P.parts.card + 1


lemma primeSpectrum_finite : {I : Ideal R | I.IsPrime}.Finite

(R : Type u_1)
[CommRing R]
[IsArtinianRing R]


theorem zmodEquivTrunc_apply {x : ZMod (p ^ n)} :
    zmodEquivTrunc p n x = ZMod.castHom (by rfl) (TruncatedWittVector p n (ZMod p)) x

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

(TruncatedWittVector.zmodEquivTrunc p n) x = (ZMod.castHom ⋯ (TruncatedWittVector p n (ZMod p))) x


@[to_additive]
theorem hasProd_of_isLUB_of_one_le [LinearOrderedCommMonoid α] [TopologicalSpace α]
    [OrderTopology α] {f : ι → α} (i : α) (h : ∀ i, 1 ≤ f i)
    (hf : IsLUB (Set.range fun s ↦ ∏ i ∈ s, f i) i) : HasProd f i

(hf : IsLUB (Set.range fun s => ∏ i ∈ s, f i) i)


theorem lintegral_image_eq_lintegral_abs_det_fderiv_mul (hs : MeasurableSet s)
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) (g : E → ℝ≥0∞) :
    ∫⁻ x in f '' s, g x ∂μ = ∫⁻ x in s, ENNReal.ofReal |(f' x).det| * g (f x) ∂μ

∫⁻ (x : E) in f '' s, g x ∂μ = ∫⁻ (x : E) in s, ENNReal.ofReal |(f' x).det| * g (f x) ∂μ


@[simp]
theorem boundary_bot : ∂ (⊥ : α) = ⊥


@[simp]
theorem basisOf_apply (i : ι) (j : { j : ι // j ≠ i }) : b.basisOf i j = b ↑j -ᵥ b i

{ι : Type u_1}
{k : Type u_3}
{V : Type u_4}
{P : Type u_5}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(b : AffineBasis ι k P)
(i : ι)
(j : { j // j ≠ i })


theorem sub_apply_eq_zero_of_restrict_le_restrict (h_le : μ.restrict s ≤ ν.restrict s)
    (h_meas_s : MeasurableSet s) : (μ - ν) s = 0

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{s : Set α}
(h_le : μ.restrict s ≤ ν.restrict s)
(h_meas_s : MeasurableSet s)


@[simp]
theorem dualBasis_repr_apply (B : BilinForm K V) (hB : B.Nondegenerate) (b : Basis ι K V) (x i) :
    (B.dualBasis hB b).repr x i = B x (b i)

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
{ι : Type u_10}
[DecidableEq ι]
[Finite ι]
(B : LinearMap.BilinForm K V)
(hB : B.Nondegenerate)
(b : Basis ι K V)
(x : V)
(i : ι)

((B.dualBasis hB b).repr x) i = (B x) (b i)


/-- A variant of `Matrix.det_units_conj'`. -/
theorem det_conj' {M : Matrix m m α} (h : IsUnit M) (N : Matrix m m α) :
    det (M⁻¹ * N * M) = det N

{m : Type u}
{α : Type v}
[Fintype m]
[DecidableEq m]
[CommRing α]
{M : Matrix m m α}
(h : IsUnit M)
(N : Matrix m m α)


theorem real_inner_I_smul_self (x : E) :
    @Inner.inner ℝ E (Inner.rclikeToReal 𝕜 E) x ((I : 𝕜) • x) = 0

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


/-- A commutative Jordan multipication -/
class IsCommJordan [CommMagma A] : Prop where
  lmul_comm_rmul_rmul : ∀ a b : A, a * b * (a * a) = a * (b * (a * a))

{A : Type u_1}
[CommMagma A]
[self : IsCommJordan A]
(a b : A)


theorem IsStronglyAtomic.of_wellFounded_lt (h : WellFounded ((· < ·) : α → α → Prop)) :
    IsStronglyAtomic α

{α : Type u_2}
[PartialOrder α]
(h : WellFounded fun x x_1 => x < x_1)


@[to_additive]
nonrec theorem IsUnit.unop {M} [Monoid M] {m : Mᵐᵒᵖ} (h : IsUnit m) : IsUnit (unop m)

{M : Type u_2}
[AddMonoid M]
{m : Mᵃᵒᵖ}
(h : IsAddUnit m)


theorem smul_one_eq_diagonal [DecidableEq m] (a : α) :
    a • (1 : Matrix m m α) = diagonal fun _ => a

{m : Type u_2}
{α : Type v}
[NonAssocSemiring α]
[DecidableEq m]
(a : α)


theorem integral_eq_sub_of_hasDerivAt_of_tendsto (hab : a < b) {fa fb}
    (hderiv : ∀ x ∈ Ioo a b, HasDerivAt f (f' x) x) (hint : IntervalIntegrable f' volume a b)
    (ha : Tendsto f (𝓝[>] a) (𝓝 fa)) (hb : Tendsto f (𝓝[<] b) (𝓝 fb)) :
    ∫ y in a..b, f' y = fb - fa

(hderiv : ∀ x ∈ Set.Ioo a b, HasDerivAt f (f' x) x)

(hint : IntervalIntegrable f' MeasureTheory.volume a b)


theorem rank_span_set {s : Set M} (hs : LinearIndependent R (fun x => x : s → M)) :
    Module.rank R ↑(span R s) = #s

(hs : LinearIndependent R fun (x : ↑s) => ↑x)

Module.rank R ↥(Submodule.span R s) = #↑s


@[simp, norm_cast]
theorem cast_zero [Zero α] [One α] [Add α] [Neg α] : ((0 : ZNum) : α) = 0

{α : Type u_1}
[Zero α]
[One α]
[Add α]
[Neg α]


@[to_additive]
lemma Subgroup.ofUnits_mono : Monotone (Subgroup.ofUnits (M := M))


@[to_additive]
theorem cons_cons_iff (p) : Red (p :: L₁) (p :: L₂) ↔ Red L₁ L₂

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

FreeAddGroup.Red (p :: L₁) (p :: L₂) ↔ FreeAddGroup.Red L₁ L₂


theorem Summable.matrix_conjTranspose [StarAddMonoid R] [ContinuousStar R] {f : X → Matrix m n R}
    (hf : Summable f) : Summable fun x => (f x)ᴴ

{X : Type u_1}
{m : Type u_4}
{n : Type u_5}
{R : Type u_8}
[AddCommMonoid R]
[TopologicalSpace R]
[StarAddMonoid R]
[ContinuousStar R]
{f : X → Matrix m n R}
(hf : Summable f)


@[simp] lemma lt_singleton : s < {a} ↔ s = 0


/-- A functor to an `R`-linear category lifts to a functor from its `R`-linear completion.
-/
@[simps]
def lift (F : C ⥤ D) : Free R C ⥤ D

(R : Type u_1)
[CommRing R]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u}
[CategoryTheory.Category.{v, u} D]
[CategoryTheory.Preadditive D]
[CategoryTheory.Linear R D]
(F : C ⥤ D)
{X Y : CategoryTheory.Free R C}
(f : X ⟶ Y)

(CategoryTheory.Free.lift R F).map f = Finsupp.sum f fun f' r => r • F.map f'


theorem pderiv_eq_zero_of_not_mem_vars {i : σ} {f : MvPolynomial σ R} (h : i ∉ f.vars) :
    pderiv i f = 0

{R : Type u}
{σ : Type v}
[CommSemiring R]
{i : σ}
{f : MvPolynomial σ R}
(h : i ∉ f.vars)


theorem count_succ_eq_succ_count_iff {n : ℕ} : count p (n + 1) = count p n + 1 ↔ p n

{p : ℕ → Prop}
[DecidablePred p]
{n : ℕ}

Nat.count p (n + 1) = Nat.count p n + 1 ↔ p n


/-- The convolution `g * f` is `C^n` when `f` is locally integrable and `g` is `C^n` and compactly
supported. Version where `g` depends on an additional parameter in an open subset `s` of a
parameter space `P` (and the compact support `k` is independent of the parameter in `s`),
given in terms of composition with additional smooth functions. -/
theorem contDiffOn_convolution_left_with_param_comp [μ.IsAddLeftInvariant] [μ.IsNegInvariant]
    (L : E' →L[𝕜] E →L[𝕜] F) {s : Set P} {n : ℕ∞} {v : P → G} (hv : ContDiffOn 𝕜 n v s) {f : G → E}
    {g : P → G → E'} {k : Set G} (hs : IsOpen s) (hk : IsCompact k)
    (hgs : ∀ p, ∀ x, p ∈ s → x ∉ k → g p x = 0) (hf : LocallyIntegrable f μ)
    (hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ)) : ContDiffOn 𝕜 n (fun x => (g x ⋆[L, μ] f) (v x)) s

(hgs : ∀ (p : P) (x : G), p ∈ s → x ∉ k → g p x = 0)

(hf : MeasureTheory.LocallyIntegrable f μ)

(hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ Set.univ))

ContDiffOn 𝕜 n (fun x => MeasureTheory.convolution (g x) f L μ (v x)) s


{α : Type u_1}
(d : MeasurableSpace.DynkinSystem α)


@[continuity]
theorem continuous_conj : Continuous (conj : ℂ → ℂ)


theorem destutter_sublist : ∀ l : List α, l.destutter R <+ l

{α : Type u_1}
(R : α → α → Prop)
[DecidableRel R]
(l : List α)


@[simp]
theorem map_nil (f : α → β) : map f nil = nil

Stream'.Seq.map f Stream'.Seq.nil = Stream'.Seq.nil


@[simp]
theorem ediam_univ_of_noncompact [ProperSpace α] [NoncompactSpace α] :
    EMetric.diam (univ : Set α) = ∞

{α : Type u}
[PseudoMetricSpace α]
[ProperSpace α]
[NoncompactSpace α]


@[simp]
theorem rank_finsupp (ι : Type w) :
    Module.rank R (ι →₀ M) = Cardinal.lift.{v} #ι * Cardinal.lift.{w} (Module.rank R M)

(R : Type u)
(M : Type v)
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
[Module.Free R M]
(ι : Type w)

Module.rank R (ι →₀ M) = Cardinal.lift.{v, w} #ι * Cardinal.lift.{w, v} (Module.rank R M)


lemma MonovaryOn.div_left₀ (hf₁ : ∀ i ∈ s, 0 ≤ f₁ i) (hf₂ : ∀ i ∈ s, 0 < f₂ i)
    (h₁ : MonovaryOn f₁ g s) (h₂ : AntivaryOn f₂ g s) : MonovaryOn (f₁ / f₂) g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemifield α]
[LinearOrderedSemifield β]
{s : Set ι}
{f₁ f₂ : ι → α}
{g : ι → β}
(hf₁ : ∀ i ∈ s, 0 ≤ f₁ i)
(hf₂ : ∀ i ∈ s, 0 < f₂ i)
(h₁ : MonovaryOn f₁ g s)
(h₂ : AntivaryOn f₂ g s)


theorem tangentBundleCore_coordChange_achart (x x' z : M) :
    (tangentBundleCore I M).coordChange (achart H x) (achart H x') z =
      fderivWithin 𝕜 (extChartAt I x' ∘ (extChartAt I x).symm) (range I) (extChartAt I x z)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
(x x' z : M)

(tangentBundleCore I M).coordChange (achart H x) (achart H x') z =
  fderivWithin 𝕜 (↑(extChartAt I x') ∘ ↑(extChartAt I x).symm) (Set.range ↑I) (↑(extChartAt I x) z)


/-- A simple sufficient condition for bounding `levyProkhorovEDist` between probability measures
from above. The condition involves only one of two natural bounds, the other bound is for free. -/
lemma levyProkhorovEDist_le_of_forall_le
    (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (δ : ℝ≥0∞)
    (h : ∀ ε B, δ < ε → ε < ∞ → MeasurableSet B → μ B ≤ ν (thickening ε.toReal B) + ε) :
    levyProkhorovEDist μ ν ≤ δ

(h : ∀ (ε : ℝ≥0∞) (B : Set Ω), δ < ε → ε < ⊤ → MeasurableSet B → μ B ≤ ν (Metric.thickening ε.toReal B) + ε)

MeasureTheory.levyProkhorovEDist μ ν ≤ δ


@[to_additive (attr := simp)]
theorem mk'_self' (y : S) : f.mk' (y : M) y = 1

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
(y : ↥S)


theorem map_add_le {x y g} (hx : v x ≤ g) (hy : v y ≤ g) : v (x + y) ≤ g

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation R Γ₀)
{x y : R}
{g : Γ₀}
(hx : v x ≤ g)
(hy : v y ≤ g)


theorem LinearMap.rank_le_of_injective (f : M →ₗ[R] M₁) (i : Injective f) :
    Module.rank R M ≤ Module.rank R M₁

{R : Type u}
{M M₁ : Type v}
[Ring R]
[AddCommGroup M]
[AddCommGroup M₁]
[Module R M]
[Module R M₁]
(f : M →ₗ[R] M₁)
(i : Function.Injective ⇑f)


theorem preimage_pi (s : Set ι) (t : ∀ i, Set (β i)) (f : ∀ i, α i → β i) :
    (fun (g : ∀ i, α i) i => f _ (g i)) ⁻¹' s.pi t = s.pi fun i => f i ⁻¹' t i

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

(fun g i => f i (g i)) ⁻¹' s.pi t = s.pi fun i => f i ⁻¹' t i


@[to_additive]
theorem closure_mono {s t : Set G} (h : s ⊆ t) : closure s ⊆ closure t

{G : Type u_1}
[Group G]
{s t : Set G}
(h : s ⊆ t)


theorem antitoneOn_const [Preorder α] [Preorder β] {c : β} {s : Set α} :
    AntitoneOn (fun _ : α ↦ c) s

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{c : β}
{s : Set α}


theorem of_add_int (m : ℤ) (h : Irrational (x + m)) : Irrational x

{x : ℝ}
(m : ℤ)
(h : Irrational (x + ↑m))


theorem sup_mul_inf (a b : Associates α) : (a ⊔ b) * (a ⊓ b) = a * b

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
(a b : Associates α)


@[reassoc]
theorem associator_inv_naturality_middle (X : C) {Y Y' : C} (f : Y ⟶ Y') (Z : C) :
    X ◁ f ▷ Z ≫ (α_ X Y' Z).inv = (α_ X Y Z).inv ≫ (X ◁ f) ▷ Z

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

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.MonoidalCategory.whiskerRight f Z))
    (CategoryTheory.MonoidalCategory.associator X Y' Z).inv =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).inv
    (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.whiskerLeft X f) Z)


/-- Ultrametric property of a p-adic valuation. -/
lemma add_eq_min {q r : ℚ} (hqr : q + r ≠ 0) (hq : q ≠ 0) (hr : r ≠ 0)
    (hval : padicValRat p q ≠ padicValRat p r) :
    padicValRat p (q + r) = min (padicValRat p q) (padicValRat p r)


/-- Rotating twice is equivalent to rotating by the sum of the angles. -/
@[simp]
theorem rotation_rotation (θ₁ θ₂ : Real.Angle) (x : V) :
    o.rotation θ₁ (o.rotation θ₂ x) = o.rotation (θ₁ + θ₂) x

[Fact (FiniteDimensional.finrank ℝ V = 2)]

(o.rotation θ₁) ((o.rotation θ₂) x) = (o.rotation (θ₁ + θ₂)) x


protected theorem inv_pow : ∀ {a : ℝ≥0∞} {n : ℕ}, (a ^ n)⁻¹ = a⁻¹ ^ n


theorem card_fintypeIoc : Fintype.card (Set.Ioc a b) = b - a


protected lemma posSemidef_add {A : Matrix m m R} {B : Matrix m m R}
    (hA : A.PosSemidef) (hB : B.PosDef) : (A + B).PosDef

{m : Type u_1}
{R : Type u_3}
[Fintype m]
[CommRing R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
{A B : Matrix m m R}
(hA : A.PosSemidef)
(hB : B.PosDef)


theorem EuclideanSpace.volume_ball (x : EuclideanSpace ℝ ι) (r : ℝ) :
    volume (Metric.ball x r) = (.ofReal r) ^ card ι *
      .ofReal (Real.sqrt π ^ card ι / Gamma (card ι / 2 + 1))

(ι : Type u_1)
[Nonempty ι]
[Fintype ι]
(x : EuclideanSpace ℝ ι)
(r : ℝ)

MeasureTheory.volume (Metric.ball x r) =
  ENNReal.ofReal r ^ Fintype.card ι *
    ENNReal.ofReal (√Real.pi ^ Fintype.card ι / Real.Gamma (↑(Fintype.card ι) / 2 + 1))


theorem wSameSide_iff_exists_left {s : AffineSubspace R P} {x y p₁ : P} (h : p₁ ∈ s) :
    s.WSameSide x y ↔ x ∈ s ∨ ∃ p₂ ∈ s, SameRay R (x -ᵥ p₁) (y -ᵥ p₂)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y p₁ : P}
(h : p₁ ∈ s)


@[to_additive (attr := simp)]
theorem inclusion_self (x : H) : inclusion le_rfl x = x

{G : Type u_1}
[AddGroup G]
{S : Type u_6}
{H : S}
[SetLike S G]
[AddSubgroupClass S G]
(x : ↥H)


/-- We say that a type has `MeasurableSub` if `(c - ·)` and `(· - c)` are measurable
functions. For a typeclass assuming measurability of `uncurry (-)` see `MeasurableSub₂`. -/
class MeasurableSub (G : Type*) [MeasurableSpace G] [Sub G] : Prop where
  measurable_const_sub : ∀ c : G, Measurable (c - ·)
  measurable_sub_const : ∀ c : G, Measurable (· - c)

{G : Type u_2}
[MeasurableSpace G]
[Sub G]
[self : MeasurableSub G]
(c : G)


theorem mem_col_iff {μ : YoungDiagram} {j : ℕ} {c : ℕ × ℕ} : c ∈ μ.col j ↔ c ∈ μ ∧ c.snd = j


theorem insert_insert_of_ne {a a'} {b : β a} {b' : β a'} (s : Finmap β) (h : a ≠ a') :
    (s.insert a b).insert a' b' = (s.insert a' b').insert a b

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a a' : α}
{b : β a}
{b' : β a'}
(s : Finmap β)
(h : a ≠ a')

Finmap.insert a' b' (Finmap.insert a b s) = Finmap.insert a b (Finmap.insert a' b' s)


theorem restrict_iUnion_apply [Countable ι] {s : ι → Set α} (hd : Pairwise (Disjoint on s))
    (hm : ∀ i, MeasurableSet (s i)) {t : Set α} (ht : MeasurableSet t) :
    μ.restrict (⋃ i, s i) t = ∑' i, μ.restrict (s i) t

{α : Type u_2}
{ι : Type u_6}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[Countable ι]
{s : ι → Set α}
(hd : Pairwise (Disjoint on s))
(hm : ∀ (i : ι), MeasurableSet (s i))
{t : Set α}
(ht : MeasurableSet t)

(μ.restrict (⋃ i, s i)) t = ∑' (i : ι), (μ.restrict (s i)) t


/-- Horizontal composition of natural isomorphisms. -/
@[simps]
def hcomp {F G : C ⥤ D} {H I : D ⥤ E} (α : F ≅ G) (β : H ≅ I) : F ⋙ H ≅ G ⋙ I

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
{F G : C ⥤ D}
{H I : D ⥤ E}
(α : F ≅ G)
(β : H ≅ I)

(CategoryTheory.NatIso.hcomp α β).inv = α.inv ◫ β.inv


Polynomial.Chebyshev.T R 1 = Polynomial.X


theorem ofNat_lt :
    (no_index (OfNat.ofNat m : α)) < (no_index (OfNat.ofNat n)) ↔
      (OfNat.ofNat m : ℕ) < OfNat.ofNat n

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

OfNat.ofNat m < OfNat.ofNat n ↔ OfNat.ofNat m < OfNat.ofNat n


theorem stk_nth_val {K : Type*} {Γ : K → Type*} {L : ListBlank (∀ k, Option (Γ k))} {k S} (n)
    (hL : ListBlank.map (proj k) L = ListBlank.mk (List.map some S).reverse) :
    L.nth n k = S.reverse.get? n

{L : Turing.ListBlank ((k : K) → Option (Γ k))}

(hL : Turing.ListBlank.map (Turing.proj k) L = Turing.ListBlank.mk (List.map some S).reverse)


/-- This structure permits to define a vector bundle when trivializations are given as local
equivalences but there is not yet a topology on the total space or the fibers.
The total space is hence given a topology in such a way that there is a fiber bundle structure for
which the partial equivalences are also partial homeomorphisms and hence vector bundle
trivializations. The topology on the fibers is induced from the one on the total space.

The field `exists_coordChange` is stated as an existential statement (instead of 3 separate
fields), since it depends on propositional information (namely `e e' ∈ pretrivializationAtlas`).
This makes it inconvenient to explicitly define a `coordChange` function when constructing a
`VectorPrebundle`. -/
-- Porting note(#5171): was @[nolint has_nonempty_instance]
structure VectorPrebundle where
  pretrivializationAtlas : Set (Pretrivialization F (π F E))
  pretrivialization_linear' : ∀ e, e ∈ pretrivializationAtlas → e.IsLinear R
  pretrivializationAt : B → Pretrivialization F (π F E)
  mem_base_pretrivializationAt : ∀ x : B, x ∈ (pretrivializationAt x).baseSet
  pretrivialization_mem_atlas : ∀ x : B, pretrivializationAt x ∈ pretrivializationAtlas
  exists_coordChange : ∀ᵉ (e ∈ pretrivializationAtlas) (e' ∈ pretrivializationAtlas),
    ∃ f : B → F →L[R] F, ContinuousOn f (e.baseSet ∩ e'.baseSet) ∧
      ∀ᵉ (b ∈ e.baseSet ∩ e'.baseSet) (v : F), f b v = (e' ⟨b, e.symm b v⟩).2
  totalSpaceMk_inducing : ∀ b : B, Inducing (pretrivializationAt b ∘ .mk b)

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
{E : B → Type u_4}
[NontriviallyNormedField R]
[(x : B) → AddCommMonoid (E x)]
[(x : B) → Module R (E x)]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
[(x : B) → TopologicalSpace (E x)]
(self : VectorPrebundle R F E)
(x : B)

x ∈ (self.pretrivializationAt x).baseSet


theorem lift_reverse [h : HasInvolutiveReverse V']
    (φ : Prefunctor V V') {X Y : Symmetrify V} (f : X ⟶ Y) :
    (Symmetrify.lift φ).map (Quiver.reverse f) = Quiver.reverse ((Symmetrify.lift φ).map f)

{V : Type u_2}
[Quiver V]
{V' : Type u_4}
[Quiver V']
[h : Quiver.HasInvolutiveReverse V']
(φ : V ⥤q V')
{X Y : Quiver.Symmetrify V}
(f : X ⟶ Y)

(Quiver.Symmetrify.lift φ).map (Quiver.reverse f) = Quiver.reverse ((Quiver.Symmetrify.lift φ).map f)


theorem Iff.trans (h₁ : a ↔ b) (h₂ : b ↔ c) : a ↔ c

{a b c : Prop}
(h₁ : a ↔ b)
(h₂ : b ↔ c)


lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂

(h₁ : Surreal.Multiplication.P3 x₁ x₂ y₁ y₂)

(h₂ : Surreal.Multiplication.P3 x₂ x₃ y₁ y₂)


theorem KleisliCat.comp_def {m} [Monad m] (α β γ : KleisliCat m) (xs : α ⟶ β) (ys : β ⟶ γ) (a : α) :
    (xs ≫ ys) a = xs a >>= ys

{m : Type u_1 → Type u_2}
[Monad m]
(α β γ : CategoryTheory.KleisliCat m)
(xs : α ⟶ β)
(ys : β ⟶ γ)
(a : α)

CategoryTheory.CategoryStruct.comp xs ys a = xs a >>= ys


theorem ext {x y : ℤ_[p]} : (x : ℚ_[p]) = y → x = y

{p : ℕ}
[Fact (Nat.Prime p)]
{x y : ℤ_[p]}


theorem moveRight_neg_symm {x : PGame} (i) :
    x.moveRight (toLeftMovesNeg.symm i) = -(-x).moveLeft i

{x : SetTheory.PGame}
(i : (-x).LeftMoves)

x.moveRight (SetTheory.PGame.toLeftMovesNeg.symm i) = -(-x).moveLeft i


@[simp] theorem map_eq (x : Id α) (f : α → β) : f <$> x = f x


@[fun_prop]
theorem DifferentiableWithinAt.inv' (hf : DifferentiableWithinAt 𝕜 h S z) (hz : h z ≠ 0) :
    DifferentiableWithinAt 𝕜 (fun x => (h x)⁻¹) S z

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{R : Type u_6}
[NormedDivisionRing R]
[NormedAlgebra 𝕜 R]
[CompleteSpace R]
{h : E → R}
{z : E}
{S : Set E}
(hf : DifferentiableWithinAt 𝕜 h S z)
(hz : h z ≠ 0)


theorem prod_iUnion {s : Set α} {t : ι → Set β} : (s ×ˢ ⋃ i, t i) = ⋃ i, s ×ˢ t i

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{s : Set α}
{t : ι → Set β}


@[simp]
theorem map_add' : ∀ x y, v (x + y) ≤ v x ∨ v (x + y) ≤ v y

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation R Γ₀)
(x y : R)


@[simp]
theorem preimage_sUnion {f : α → β} {s : Set (Set β)} : f ⁻¹' ⋃₀s = ⋃ t ∈ s, f ⁻¹' t

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


@[simp, measurability]
protected theorem MeasurableSet.cond {s₁ s₂ : Set α} (h₁ : MeasurableSet s₁)
    (h₂ : MeasurableSet s₂) {i : Bool} : MeasurableSet (cond i s₁ s₂)

{α : Type u_1}
{m : MeasurableSpace α}
{s₁ s₂ : Set α}
(h₁ : MeasurableSet s₁)
(h₂ : MeasurableSet s₂)
{i : Bool}


theorem ContDiff.inv {f : E → 𝕜'} {n} (hf : ContDiff 𝕜 n f) (h : ∀ x, f x ≠ 0) :
    ContDiff 𝕜 n fun x => (f x)⁻¹

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝕜' : Type u_4}
[NormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[CompleteSpace 𝕜']
{f : E → 𝕜'}
{n : ℕ∞}
(hf : ContDiff 𝕜 n f)
(h : ∀ (x : E), f x ≠ 0)


@[to_additive]
theorem copy_eq (K : Subgroup G) (s : Set G) (hs : s = ↑K) : K.copy s hs = K

{G : Type u_1}
[AddGroup G]
(K : AddSubgroup G)
(s : Set G)
(hs : s = ↑K)


@[to_additive]
theorem mem_sSup_of_mem {S : Set (Submonoid M)} {s : Submonoid M} (hs : s ∈ S) :
    ∀ {x : M}, x ∈ s → x ∈ sSup S

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


/-- A map of rings that is a semiring homomorphism is also a ring homomorphism. -/
theorem of_semiring {f : α → β} (H : IsSemiringHom f) : IsRingHom f

{α : Type u}
{β : Type v}
[Ring α]
[Ring β]
{f : α → β}
(H : IsSemiringHom f)


@[simp] theorem isGreatest_singleton : IsGreatest {a} a


@[simp]
theorem id_leftLim (x : ℝ) : leftLim StieltjesFunction.id x = x

Function.leftLim (↑StieltjesFunction.id) x = x


lemma mem_orthogonal (N : LieSubmodule R L M) (y : M) :
    y ∈ orthogonal Φ hΦ_inv N ↔ ∀ x ∈ N, Φ x y = 0

(hΦ_inv : LinearMap.BilinForm.lieInvariant L Φ)

y ∈ LieAlgebra.InvariantForm.orthogonal Φ hΦ_inv N ↔ ∀ x ∈ N, (Φ x) y = 0


@[to_additive]
theorem integral_inv_eq_self (f : G → E) (μ : Measure G) [IsInvInvariant μ] :
    ∫ x, f x⁻¹ ∂μ = ∫ x, f x ∂μ

{G : Type u_4}
{E : Type u_5}
[MeasurableSpace G]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[Group G]
[MeasurableInv G]
(f : G → E)
(μ : MeasureTheory.Measure G)
[μ.IsInvInvariant]


theorem size_eq_realSize : ∀ {t : Ordnode α}, Sized t → size t = realSize t


@[simp] lemma directLimitRight_tmul_of {i : ι} (m : M) (g : G i) :
    directLimitRight f M (m ⊗ₜ of _ _ _ _ _ g) = of _ _ _ _ i (m ⊗ₜ g)

{R : Type u_1}
[CommRing R]
{ι : Type u_2}
[DecidableEq ι]
[Preorder ι]
{G : ι → Type u_3}
[(i : ι) → AddCommGroup (G i)]
[(i : ι) → Module R (G i)]
(f : (i j : ι) → i ≤ j → G i →ₗ[R] G j)
(M : Type u_4)
[AddCommGroup M]
[Module R M]
[IsDirected ι fun x x_1 => x ≤ x_1]
{i : ι}
(m : M)
(g : G i)

(TensorProduct.directLimitRight f M) (m ⊗ₜ[R] (Module.DirectLimit.of R ι G f i) g) =
  (Module.DirectLimit.of R ι (fun x => M ⊗[R] G x) (fun i j h => LinearMap.lTensor M (f i j h)) i) (m ⊗ₜ[R] g)


theorem lt_succ_floor (a : α) : a < ⌊a⌋₊.succ

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
(a : α)


theorem not_of_iff_false : (p ↔ False) → ¬p


protected theorem continuousOn :
    ContinuousOn (uncurry v) (Icc v.tMin v.tMax ×ˢ closedBall v.x₀ v.R)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(v : PicardLindelof E)

ContinuousOn (Function.uncurry v.toFun) (Set.Icc v.tMin v.tMax ×ˢ Metric.closedBall v.x₀ ↑v.R)


theorem preimage_image (h : α ≃ᵤ β) (s : Set α) : h ⁻¹' (h '' s) = s

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


@[ext]
lemma hom_ext {A B : CommMon_ C} (f g : A ⟶ B) (h : f.hom = g.hom) : f = g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
{A B : CommMon_ C}
(f g : A ⟶ B)
(h : f.hom = g.hom)


theorem count_eq_of_nodup [DecidableEq α] {a : α} {l : List α} (d : Nodup l) :
    count a l = if a ∈ l then 1 else 0

{α : Type u}
[DecidableEq α]
{a : α}
{l : List α}
(d : l.Nodup)


theorem mem_sets {f : Filter α} (F : f.Realizer) {a : Set α} : a ∈ f ↔ ∃ b, F.F b ⊆ a

{α : Type u_1}
{f : Filter α}
(F : f.Realizer)
{a : Set α}


theorem MonotoneOn.quasilinearOn (hf : MonotoneOn f s) (hs : Convex 𝕜 s) : QuasilinearOn 𝕜 s f

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set E}
{f : E → β}
(hf : MonotoneOn f s)
(hs : Convex 𝕜 s)


lemma le_induce_union_right : G'.induce s' ≤ G'.induce (s ∪ s')

{V : Type u}
{G : SimpleGraph V}
{G' : G.Subgraph}
{s s' : Set V}


theorem ContinuousAt.comp₂_continuousWithinAt_of_eq {f : β × γ → δ} {g : α → β}
    {h : α → γ} {x : α} {s : Set α} {y : β × γ} (hf : ContinuousAt f y)
    (hg : ContinuousWithinAt g s x) (hh : ContinuousWithinAt h s x) (e : (g x, h x) = y) :
    ContinuousWithinAt (fun x ↦ f (g x, h x)) s x

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[TopologicalSpace δ]
{f : β × γ → δ}
{g : α → β}
{h : α → γ}
{x : α}
{s : Set α}
{y : β × γ}
(hf : ContinuousAt f y)
(hg : ContinuousWithinAt g s x)
(hh : ContinuousWithinAt h s x)
(e : (g x, h x) = y)

ContinuousWithinAt (fun x => f (g x, h x)) s x


lemma ne_of_ssuperset [IsIrrefl α (· ⊂ ·)] {a b : α} : a ⊂ b → b ≠ a

{α : Type u}
[HasSSubset α]
[IsIrrefl α fun x x_1 => x ⊂ x_1]
{a b : α}


@[simp]
lemma map_zero_one : map F f 0 1 (by simp) = f

(F : CategoryTheory.ComposableArrows C n)

CategoryTheory.ComposableArrows.Precomp.map F f 0 1 ⋯ = f


@[simp]
theorem pure_def (a : α) : (pure a : Set α) = {a}


/-- The lifting property of the equalizer as an equivalence. -/
@[simps]
def liftEquiv :
    { φ : NormedAddGroupHom V₁ V // f.comp φ = g.comp φ } ≃
      NormedAddGroupHom V₁ (f.equalizer g)

{V : Type u_1}
{W : Type u_2}
{V₁ : Type u_3}
[SeminormedAddCommGroup V]
[SeminormedAddCommGroup W]
[SeminormedAddCommGroup V₁]
{f g : NormedAddGroupHom V W}
(φ : { φ // f.comp φ = g.comp φ })

NormedAddGroupHom.Equalizer.liftEquiv φ = NormedAddGroupHom.Equalizer.lift ↑φ ⋯


protected theorem IsOpen.mem_nhds_iff (hs : IsOpen s) : s ∈ 𝓝 x ↔ x ∈ s

{X : Type u}
{x : X}
{s : Set X}
[TopologicalSpace X]
(hs : IsOpen s)

s ∈ 𝓝 x ↔ x ∈ s


lemma end_apply_apply (ij : ι × ι) (k : ι) : (b.end ij) (b k) = if ij.2 = k then b ij.1 else 0

{R : Type u_1}
{M : Type u_2}
{ι : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[Fintype ι]
[DecidableEq ι]
(b : Basis ι R M)
(ij : ι × ι)
(k : ι)


@[simp]
theorem pullback.congrHom_inv {X Y Z : C} {f₁ f₂ : X ⟶ Z} {g₁ g₂ : Y ⟶ Z} (h₁ : f₁ = f₂)
    (h₂ : g₁ = g₂) [HasPullback f₁ g₁] [HasPullback f₂ g₂] :
    (pullback.congrHom h₁ h₂).inv =
      pullback.map _ _ _ _ (𝟙 _) (𝟙 _) (𝟙 _) (by simp [h₁]) (by simp [h₂])

(CategoryTheory.Limits.pullback.congrHom h₁ h₂).inv =
  CategoryTheory.Limits.pullback.map f₂ g₂ f₁ g₁ (𝟙 X) (𝟙 Y) (𝟙 Z) ⋯ ⋯


theorem morphismRestrict_val_base {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) :
    ⇑(f ∣_ U).val.base = U.1.restrictPreimage f.val.base

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(U : Y.Opens)

⇑(f ∣_ U).val.base = U.carrier.restrictPreimage ⇑f.val.base


@[simp] theorem neg_imK : (-a).imK = -a.imK

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a : ℍ[R,c₁,c₂])


theorem fold_image_idem [DecidableEq α] {g : γ → α} {s : Finset γ} [hi : Std.IdempotentOp op] :
    (image g s).fold op b f = s.fold op b (f ∘ g)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{op : β → β → β}
[hc : Std.Commutative op]
[ha : Std.Associative op]
{f : α → β}
{b : β}
[DecidableEq α]
{g : γ → α}
{s : Finset γ}
[hi : Std.IdempotentOp op]

Finset.fold op b f (Finset.image g s) = Finset.fold op b (f ∘ g) s


@[simp, norm_cast]
theorem cast_intCast (h : m ∣ n) (k : ℤ) : (cast (k : ZMod n) : R) = k

{n : ℕ}
{R : Type u_1}
[Ring R]
{m : ℕ}
[CharP R m]
(h : m ∣ n)
(k : ℤ)


theorem degree_C_mul_X_pow_le (n : ℕ) (a : R) : degree (C a * X ^ n) ≤ n

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

(Polynomial.C a * Polynomial.X ^ n).degree ≤ ↑n


lemma FactorsThrough.extend_apply {g : α → γ} (hf : g.FactorsThrough f) (e' : β → γ) (a : α) :
    extend f g e' (f a) = g a

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
{g : α → γ}
(hf : Function.FactorsThrough g f)
(e' : β → γ)
(a : α)


theorem le_of_not_lt {x y : Int} (h : ¬ (x < y)) : y ≤ x


@[simp]
theorem map₂_nil (f : α → β → γ) : Vector.map₂ f nil nil = nil

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

Mathlib.Vector.map₂ f Mathlib.Vector.nil Mathlib.Vector.nil = Mathlib.Vector.nil


theorem leadingCoeff_C_mul_X_pow (a : R) (n : ℕ) : leadingCoeff (C a * X ^ n) = a

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

(Polynomial.C a * Polynomial.X ^ n).leadingCoeff = a


/-- If a collection of submodules has just two indices, `i` and `j`, then
`DirectSum.IsInternal` is equivalent to `isCompl`. -/
theorem isInternal_submodule_iff_isCompl (A : ι → Submodule R M) {i j : ι} (hij : i ≠ j)
    (h : (Set.univ : Set ι) = {i, j}) : IsInternal A ↔ IsCompl (A i) (A j)

{R : Type u}
[Ring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : Type u_1}
[AddCommGroup M]
[Module R M]
(A : ι → Submodule R M)
{i j : ι}
(hij : i ≠ j)
(h : Set.univ = {i, j})

DirectSum.IsInternal A ↔ IsCompl (A i) (A j)


theorem TotalSpace.mk_injective (b : B) : Injective (mk b : E b → TotalSpace F E)

{B : Type u_1}
{F : Type u_2}
{E : B → Type u_3}
(b : B)


lemma frattini_le_comap_frattini_of_surjective : frattini G ≤ (frattini H).comap φ

{G : Type u_1}
{H : Type u_2}
[Group G]
[Group H]
{φ : G →* H}
(hφ : Function.Surjective ⇑φ)

frattini G ≤ Subgroup.comap φ (frattini H)


@[to_additive]
theorem codisjoint_range_inl_range_inr :
    Codisjoint (MonoidHom.range (inl : G →* G ∗ H)) (MonoidHom.range inr)

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


lemma norm_prime_cpow_le_one_half (p : Nat.Primes) {s : ℂ} (hs : 1 < s.re) :
    ‖(p : ℂ) ^ (-s)‖ ≤ 1 / 2


theorem inf_sdiff_left : a \ b ⊓ a = a \ b

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b : α}


/-- The identity comonad. -/
@[simps!]
def id : Comonad C

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


/-- Natural division is always less than division in the field. -/
theorem cast_div_le {m n : ℕ} : ((m / n : ℕ) : α) ≤ m / n

{α : Type u_1}
[LinearOrderedSemifield α]
{m n : ℕ}


@[to_additive]
lemma mulIndicator_apply_le_one (h : a ∈ s → f a ≤ 1) : mulIndicator s f a ≤ 1

{α : Type u_2}
{M : Type u_4}
[Preorder M]
[One M]
{s : Set α}
{f : α → M}
{a : α}
(h : a ∈ s → f a ≤ 1)


theorem NodupKeys.eq_of_fst_eq {l : List (Sigma β)} (nd : NodupKeys l) {s s' : Sigma β} (h : s ∈ l)
    (h' : s' ∈ l) : s.1 = s'.1 → s = s'

{α : Type u}
{β : α → Type v}
{l : List (Sigma β)}
(nd : l.NodupKeys)
{s s' : Sigma β}
(h : s ∈ l)
(h' : s' ∈ l)


theorem _root_.totallyBounded_Icc (a b : α) : TotallyBounded (Icc a b)

{α : Type u}
[PseudoMetricSpace α]
[Preorder α]
[CompactIccSpace α]
(a b : α)


@[simp, mfld_simps]
theorem prod_symm (eX : PartialHomeomorph X X') (eY : PartialHomeomorph Y Y') :
    (eX.prod eY).symm = eX.symm.prod eY.symm

{X : Type u_1}
{X' : Type u_2}
{Y : Type u_3}
{Y' : Type u_4}
[TopologicalSpace X]
[TopologicalSpace X']
[TopologicalSpace Y]
[TopologicalSpace Y']
(eX : PartialHomeomorph X X')
(eY : PartialHomeomorph Y Y')


lemma zpow_zpow_self₀ (a : G₀) (m n : ℤ) : Commute (a ^ m) (a ^ n)

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


/-- Coercion to a function as a `RingHom`. -/
@[simps!]
def coeFnRingHom {α : Type*} {β : Type*} [TopologicalSpace α] [TopologicalSpace β] [Semiring β]
    [TopologicalSemiring β] : C(α, β) →+* α → β

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[Semiring β]
[TopologicalSemiring β]
(f : C(α, β))
(a : α)


theorem LinearIndependent.span_eq_top_of_card_eq_finrank' {ι : Type*}
    [Fintype ι] [FiniteDimensional K V] {b : ι → V} (lin_ind : LinearIndependent K b)
    (card_eq : Fintype.card ι = finrank K V) : span K (Set.range b) = ⊤

(card_eq : Fintype.card ι = FiniteDimensional.finrank K V)


/-- Conclude that `HD`, being Lipschitz, is continuous -/
private theorem HD_continuous : Continuous (HD : Cb X Y → ℝ)

{X : Type u}
{Y : Type v}
[MetricSpace X]
[Nonempty X]
[MetricSpace Y]
[Nonempty Y]


/-- If `E / F` is a finite separable extension of exponential characteristic `q`, if `{ u_i }` is a
family of elements of `E` which is `F`-linearly independent, then `{ u_i ^ (q ^ n) }` is also
`F`-linearly independent for any natural number `n`. A special case of
`LinearIndependent.map_pow_expChar_pow_of_isSeparable`
and is an intermediate result used to prove it. -/
private theorem LinearIndependent.map_pow_expChar_pow_of_fd_isSeparable
    [FiniteDimensional F E] [Algebra.IsSeparable F E]
    (h : LinearIndependent F v) : LinearIndependent F (v · ^ q ^ n)

{F : Type u}
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
(q n : ℕ)
[hF : ExpChar F q]
{ι : Type u_1}
{v : ι → E}
[FiniteDimensional F E]
[Algebra.IsSeparable F E]
(h : LinearIndependent F v)

LinearIndependent F fun x => v x ^ q ^ n


theorem offDiag_mono : Monotone (offDiag : Set α → Set (α × α))


theorem le_sqrt_of_sq_le (h : x ^ 2 ≤ y) : x ≤ √y


theorem unique_irreducible ⦃p q : R⦄ (hp : Irreducible p) (hq : Irreducible q) :
    Associated p q

(hR : DiscreteValuationRing.HasUnitMulPowIrreducibleFactorization R)


lemma rel_iff (x y : R) : I.ringCon x y ↔ x - y ∈ I

{R : Type u_1}
[NonUnitalNonAssocRing R]
(I : TwoSidedIdeal R)
(x y : R)


theorem inv_anti_mono (hI : I ≠ 0) (hJ : J ≠ 0) (hIJ : I ≤ J) : J⁻¹ ≤ I⁻¹

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


lemma coeFn_def (μ : FiniteMeasure Ω) : μ = fun s ↦ ((μ : Measure Ω) s).toNNReal

{Ω : Type u_1}
[MeasurableSpace Ω]
(μ : MeasureTheory.FiniteMeasure Ω)


@[simp]
theorem monomorphisms.iff : (monomorphisms C) f ↔ Mono f

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

CategoryTheory.MorphismProperty.monomorphisms C f ↔ CategoryTheory.Mono f


@[to_additive]
theorem norm_div_pos_iff : 0 < ‖a / b‖ ↔ a ≠ b

{E : Type u_6}
[NormedAddGroup E]
{a b : E}


theorem irrational_sqrt_natCast_iff {n : ℕ} : Irrational (√n) ↔ ¬IsSquare n


/-- `IsSkeletonOf C D F` says that `F : D ⥤ C` exhibits `D` as a skeletal full subcategory of `C`,
in particular `F` is a (strong) equivalence and `D` is skeletal.
-/
structure IsSkeletonOf (F : D ⥤ C) : Prop where
  /-- The category `D` has isomorphic objects equal -/
  skel : Skeletal D
  /-- The functor `F` is an equivalence -/
  eqv : F.IsEquivalence := by infer_instance

(self : CategoryTheory.IsSkeletonOf C D F)


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


theorem locallyFinite_sum {f : ι ⊕ ι' → Set X} :
    LocallyFinite f ↔ LocallyFinite (f ∘ Sum.inl) ∧ LocallyFinite (f ∘ Sum.inr)

{ι : Type u_1}
{ι' : Type u_2}
{X : Type u_4}
[TopologicalSpace X]
{f : ι ⊕ ι' → Set X}


@[simp] theorem counit_comp_lsingle (i : ι) : counit ∘ₗ (lsingle i : A →ₗ[R] _) = counit

(R : Type u)
(ι : Type v)
(A : Type w)
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[Coalgebra R A]
(i : ι)

Coalgebra.counit ∘ₗ Finsupp.lsingle i = Coalgebra.counit


theorem C_injective : Injective (C : R → R[X])


/-- If `γ` is an integral curve of a vector field `v`, then `γ t` is tangent to `v (γ t)` when
  expressed in the local chart around the initial point `γ t₀`. -/
lemma IsIntegralCurveOn.hasDerivAt (hγ : IsIntegralCurveOn γ v s) {t : ℝ} (ht : t ∈ s)
    (hsrc : γ t ∈ (extChartAt I (γ t₀)).source) :
    HasDerivAt ((extChartAt I (γ t₀)) ∘ γ)
      (tangentCoordChange I (γ t) (γ t₀) (γ t) (v (γ t))) t

HasDerivAt (↑(extChartAt I (γ t₀)) ∘ γ) ((tangentCoordChange I (γ t) (γ t₀) (γ t)) (v (γ t))) t


@[to_additive]
theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} :
    (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i ∈ s, f i a) t

{ι : Type u_1}
{M : Type u_3}
{X : Type u_5}
[TopologicalSpace X]
[TopologicalSpace M]
[AddCommMonoid M]
[ContinuousAdd M]
{f : ι → X → M}
(s : Finset ι)
{t : Set X}

(∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∑ i ∈ s, f i a) t


/-- If `S` is a nonempty subset of a finite group `G`, then `S ^ |G|` is a subgroup -/
@[to_additive (attr := simps!) smulCardAddSubgroup
  "If `S` is a nonempty subset of a finite add group `G`, then `|G| • S` is a subgroup"]
def powCardSubgroup {G : Type*} [Group G] [Fintype G] (S : Set G) (hS : S.Nonempty) : Subgroup G

{G : Type u_6}
[Group G]
[Fintype G]
(S : Set G)
(hS : S.Nonempty)

↑(powCardSubgroup S hS) = S ^ Fintype.card G


@[simp]
theorem unbot_coe (x : α) (h : (x : WithBot α) ≠ ⊥ := coe_ne_bot) : (x : WithBot α).unbot h = x

{α : Type u_1}
(x : α)
(h : ↑x ≠ ⊥ := ⋯)


theorem encard_eq_three {α : Type u_1} {s : Set α} :
    encard s = 3 ↔ ∃ x y z, x ≠ y ∧ x ≠ z ∧ y ≠ z ∧ s = {x, y, z}

s.encard = 3 ↔ ∃ x y z, x ≠ y ∧ x ≠ z ∧ y ≠ z ∧ s = {x, y, z}


theorem horiz_inv {f : W ≅ X} {i : Y ≅ Z} (p : CommSq f.hom g h i.hom) :
    CommSq f.inv h g i.inv

(p : CategoryTheory.CommSq f.hom g h i.hom)


theorem coe_algebraMap_norm [Algebra.IsSeparable K L] (x : 𝓞 L) :
    (algebraMap (𝓞 K) (𝓞 L) (norm K x) : L) = algebraMap K L (Algebra.norm K (x : L))

{L : Type u_1}
(K : Type u_2)
[Field K]
[Field L]
[Algebra K L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
(x : 𝓞 L)

↑((algebraMap (𝓞 K) (𝓞 L)) ((RingOfIntegers.norm K) x)) = (algebraMap K L) ((Algebra.norm K) ↑x)


lemma natCast_cpow_natCast_mul (n m : ℕ) (z : ℂ) : (n : ℂ) ^ (m * z) = ((n : ℂ) ^ m) ^ z


/-- The intersection of two covering sieves is covering.

See <https://stacks.math.columbia.edu/tag/00Z5> (1), or [MM92] Chapter III,
Section 2, Definition 1 (iv).
-/
theorem intersection_covering (rj : R ∈ J X) (sj : S ∈ J X) : R ⊓ S ∈ J X

(J : CategoryTheory.GrothendieckTopology C)


theorem Poly.of_denote_eq_cancelAux (ctx : Context) (fuel : Nat) (m₁ m₂ r₁ r₂ : Poly)
    (h : denote_eq ctx (cancelAux fuel m₁ m₂ r₁ r₂)) : denote_eq ctx (r₁.reverse ++ m₁, r₂.reverse ++ m₂)

(h : Nat.Linear.Poly.denote_eq ctx (Nat.Linear.Poly.cancelAux fuel m₁ m₂ r₁ r₂))

Nat.Linear.Poly.denote_eq ctx (List.reverse r₁ ++ m₁, List.reverse r₂ ++ m₂)


lemma gammaPDF_of_nonneg {a r x : ℝ} (hx : 0 ≤ x) :
    gammaPDF a r x = ENNReal.ofReal (r ^ a / (Gamma a) * x ^ (a-1) * exp (-(r * x)))

ProbabilityTheory.gammaPDF a r x = ENNReal.ofReal (r ^ a / Real.Gamma a * x ^ (a - 1) * rexp (-(r * x)))


theorem encard_diff_singleton_of_mem (h : a ∈ s) :
    (s \ {a}).encard = s.encard - 1

{α : Type u_1}
{s : Set α}
{a : α}
(h : a ∈ s)


@[simp]
theorem inv_natCast_num (a : ℕ) : (a : ℚ)⁻¹.num = Int.sign a


lemma ContinuousAt.finset_inf'_apply (hne : s.Nonempty) (hs : ∀ i ∈ s, ContinuousAt (f i) x) :
    ContinuousAt (fun a ↦ s.inf' hne (f · a)) x

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
{ι : Type u_3}
[SemilatticeInf L]
[ContinuousInf L]
{s : Finset ι}
{f : ι → X → L}
{x : X}
(hne : s.Nonempty)
(hs : ∀ i ∈ s, ContinuousAt (f i) x)

ContinuousAt (fun a => s.inf' hne fun x => f x a) x


theorem finiteType_holdsForLocalizationAway : HoldsForLocalizationAway @FiniteType


@[simp] lemma tensorAssoc_apply
    (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) (Q₃ : QuadraticForm R M₃)
    (x : (M₁ ⊗[R] M₂) ⊗[R] M₃) :
    tensorAssoc Q₁ Q₂ Q₃ x = TensorProduct.assoc R M₁ M₂ M₃ x

{R : Type uR}
{M₁ : Type uM₁}
{M₂ : Type uM₂}
{M₃ : Type uM₃}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[AddCommGroup M₃]
[Module R M₁]
[Module R M₂]
[Module R M₃]
[Invertible 2]
(Q₁ : QuadraticForm R M₁)
(Q₂ : QuadraticForm R M₂)
(Q₃ : QuadraticForm R M₃)
(x : (M₁ ⊗[R] M₂) ⊗[R] M₃)

(Q₁.tensorAssoc Q₂ Q₃) x = (TensorProduct.assoc R M₁ M₂ M₃) x


@[simp]
theorem degree_hermite (n : ℕ) : (hermite n).degree = n


@[simp]
lemma image_subtype_val_Ico {s : Set α} [OrdConnected s] (x y : s) :
    Subtype.val '' Ico x y = Ico x.1 y

{α : Type u_1}
[Preorder α]
{s : Set α}
[s.OrdConnected]
(x y : ↑s)

Subtype.val '' Set.Ico x y = Set.Ico ↑x ↑y


lemma realContinuousMapZeroOfNNReal_injective :
    Function.Injective (realContinuousMapZeroOfNNReal (X := X) (A := A))

{X : Type u_1}
[TopologicalSpace X]
[Zero X]
{A : Type u_2}
[NonUnitalRing A]
[StarRing A]
[Module ℝ A]


@[simp, norm_cast]
theorem coe_smul (r : R) (p : AddGroupSeminorm E) : ⇑(r • p) = r • ⇑p

{R : Type u_2}
{E : Type u_4}
[AddGroup E]
[SMul R ℝ]
[SMul R ℝ≥0]
[IsScalarTower R ℝ≥0 ℝ]
(r : R)
(p : AddGroupSeminorm E)


@[to_additive (attr := simp)]
lemma one_smul (b : α) : (1 : M) • b = b

(M : Type u_1)
{α : Type u_7}
[AddMonoid M]
[AddAction M α]
(b : α)


@[to_additive]
theorem lintegral_eq_tsum (h : IsFundamentalDomain G s μ) (f : α → ℝ≥0∞) :
    ∫⁻ x, f x ∂μ = ∑' g : G, ∫⁻ x in g • s, f x ∂μ

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

(f : α → ℝ≥0∞)

∫⁻ (x : α), f x ∂μ = ∑' (g : G), ∫⁻ (x : α) in g +ᵥ s, f x ∂μ


theorem pointwise_smul_def {a : M} (S : Subsemiring R) :
    a • S = S.map (MulSemiringAction.toRingHom _ _ a)

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[Semiring R]
[MulSemiringAction M R]
{a : M}
(S : Subsemiring R)

a • S = Subsemiring.map (MulSemiringAction.toRingHom M R a) S


theorem Bounded.weak {t : Ordnode α} {o₁ o₂} (h : Bounded t o₁ o₂) : Bounded t ⊥ ⊤

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


@[simp]
theorem monotone_map_iff {f : α → β} : Monotone (WithTop.map f) ↔ Monotone f

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


/-- The tangent of an angle in a right-angled triangle multiplied by the adjacent side equals
the opposite side, version subtracting vectors. -/
theorem tan_angle_sub_mul_norm_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) (h0 : x ≠ 0 ∨ y = 0) :
    Real.tan (angle x (x - y)) * ‖x‖ = ‖y‖

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

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


@[simp]
theorem mk_coe (f : A →ₗ[R] M) (h₁ h₂) : ((⟨f, h₁, h₂⟩ : Derivation R A M) : A → M) = f

(h₂ : ∀ (a b : A), f (a * b) = a • f b + b • f a)

⇑{ toLinearMap := f, map_one_eq_zero' := h₁, leibniz' := h₂ } = ⇑f


theorem disjoint_or_nonempty_inter (s t : Finset α) : Disjoint s t ∨ (s ∩ t).Nonempty

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


theorem models_sentence_of_mem {φ : L.Sentence} (h : φ ∈ T) : T ⊨ᵇ φ

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


/-- If `E` is a strictly convex normed space and `f : α → E` is a function such that `‖f x‖ ≤ C`
a.e., then either this function is a.e. equal to its average value, or the norm of its average value
is strictly less than `C`. -/
theorem ae_eq_const_or_norm_average_lt_of_norm_le_const [StrictConvexSpace ℝ E]
    (h_le : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) : f =ᵐ[μ] const α (⨍ x, f x ∂μ) ∨ ‖⨍ x, f x ∂μ‖ < C

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{μ : MeasureTheory.Measure α}
{f : α → E}
{C : ℝ}
[StrictConvexSpace ℝ E]
(h_le : ∀ᵐ (x : α) ∂μ, ‖f x‖ ≤ C)

f =ᵐ[μ] Function.const α (⨍ (x : α), f x ∂μ) ∨ ‖⨍ (x : α), f x ∂μ‖ < C


theorem dualDistrib_dualDistribInvOfBasis_right_inverse (b : Basis ι R M) (c : Basis κ R N) :
    comp (dualDistribInvOfBasis b c) (dualDistrib R M N) = LinearMap.id

{R : Type u_1}
{M : Type u_3}
{N : Type u_4}
{ι : Type u_5}
{κ : Type u_6}
[DecidableEq ι]
[DecidableEq κ]
[Fintype ι]
[Fintype κ]
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(b : Basis ι R M)
(c : Basis κ R N)

TensorProduct.dualDistribInvOfBasis b c ∘ₗ TensorProduct.dualDistrib R M N = LinearMap.id


@[simp]
theorem _root_.CategoryTheory.Functor.zero_obj [HasZeroObject D] (X : C) :
    IsZero ((0 : C ⥤ D).obj X)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
[CategoryTheory.Limits.HasZeroObject D]
(X : C)

CategoryTheory.Limits.IsZero ((CategoryTheory.Functor.toPrefunctor 0).obj X)


theorem card_le_one_iff_subsingleton_coe : s.card ≤ 1 ↔ Subsingleton (s : Type _)

s.card ≤ 1 ↔ Subsingleton { x // x ∈ s }


theorem nodupKeys_join {L : List (List (Sigma β))} :
    NodupKeys (join L) ↔ (∀ l ∈ L, NodupKeys l) ∧ Pairwise Disjoint (L.map keys)

{α : Type u}
{β : α → Type v}
{L : List (List (Sigma β))}

L.join.NodupKeys ↔ (∀ l ∈ L, l.NodupKeys) ∧ List.Pairwise List.Disjoint (List.map List.keys L)


@[simp] theorem isLUB_singleton : IsLUB {a} a


@[to_additive (attr := simp)]
theorem mul_apply [Mul β] [ContinuousMul β] (f g : C(α, β)) (x : α) : (f * g) x = f x * g x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[Add β]
[ContinuousAdd β]
(f g : C(α, β))
(x : α)


theorem not_forall₂_of_exists₂_not : (∃ x h, ¬P x h) → ¬∀ x h, P x h

{α : Sort u_1}
{p : α → Prop}
{P : (x : α) → p x → Prop}

(∃ x h, ¬P x h) → ¬∀ (x : α) (h : p x), P x h


@[to_additive] lemma Monovary.mul_right (h₁ : Monovary f g₁) (h₂ : Monovary f g₂) :
    Monovary f (g₁ * g₂)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedCommGroup α]
[LinearOrderedCommGroup β]
{f : ι → α}
{g₁ g₂ : ι → β}
(h₁ : Monovary f g₁)
(h₂ : Monovary f g₂)


@[simp] lemma abs_nnqsmul [DistribMulAction ℚ≥0 α] [PosSMulMono ℚ≥0 α] (q : ℚ≥0) (a : α) :
    |q • a| = q • |a|

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[DistribMulAction ℚ≥0 α]
[PosSMulMono ℚ≥0 α]
(q : ℚ≥0)
(a : α)


@[to_additive]
theorem finprod_eq_prod (f : α → M) (hf : (mulSupport f).Finite) :
    ∏ᶠ i : α, f i = ∏ i ∈ hf.toFinset, f i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
(f : α → M)
(hf : (Function.support f).Finite)

∑ᶠ (i : α), f i = ∑ i ∈ hf.toFinset, f i


@[simp, mfld_simps]
theorem mem_source_at : (⟨b, a⟩ : Z.TotalSpace) ∈ (Z.localTrivAt b).source

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
[NontriviallyNormedField R]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
{ι : Type u_5}
(Z : VectorBundleCore R B F ι)
(b : B)
(a : F)

{ proj := b, snd := a } ∈ (Z.localTrivAt b).source


/-- If `f` is a locally integrable real-valued function on `Ioi 0` which is `O(x ^ (-a))` at `∞`
and `O(x ^ (-b))` at `0`, then its Mellin transform integral converges for `b < s < a`. -/
theorem mellin_convergent_of_isBigO_scalar {a b : ℝ} {f : ℝ → ℝ} {s : ℝ}
    (hfc : LocallyIntegrableOn f <| Ioi 0) (hf_top : f =O[atTop] (· ^ (-a)))
    (hs_top : s < a) (hf_bot : f =O[𝓝[>] 0] (· ^ (-b))) (hs_bot : b < s) :
    IntegrableOn (fun t : ℝ => t ^ (s - 1) * f t) (Ioi 0)

(hfc : MeasureTheory.LocallyIntegrableOn f (Set.Ioi 0) MeasureTheory.volume)

(hf_top : f =O[Filter.atTop] fun x => x ^ (-a))

MeasureTheory.IntegrableOn (fun t => t ^ (s - 1) * f t) (Set.Ioi 0) MeasureTheory.volume


/-- If a category `has_image_maps`, then all commutative squares induce morphisms on images. -/
class HasImageMaps : Prop where
  has_image_map : ∀ {f g : Arrow C} (st : f ⟶ g), HasImageMap st

[self : CategoryTheory.Limits.HasImageMaps C]


theorem inv_mul {R} [DivisionRing R] {a₁ a₂ a₃ b₁ b₃ c}
    (_ : (a₁⁻¹ : R) = b₁) (_ : (a₃⁻¹ : R) = b₃)
    (_ : b₃ * (b₁ ^ a₂ * (nat_lit 1).rawCast) = c) :
    (a₁ ^ a₂ * a₃ : R)⁻¹ = c

{R : Type u_2}
[DivisionRing R]
{a₁ : R}
{a₂ : ℕ}
{a₃ b₁ b₃ c : R}

a₁⁻¹ = b₁ → a₃⁻¹ = b₃ → b₃ * (b₁ ^ a₂ * Nat.rawCast 1) = c → (a₁ ^ a₂ * a₃)⁻¹ = c


theorem map_span (s : Set P₁) : (affineSpan k s).map f = affineSpan k (f '' s)

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(f : P₁ →ᵃ[k] P₂)
(s : Set P₁)

AffineSubspace.map f (affineSpan k s) = affineSpan k (⇑f '' s)


protected theorem isIrrefl [RelHomClass F r s] (f : F) : ∀ [IsIrrefl β s], IsIrrefl α r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
{F : Type u_5}
[FunLike F α β]
[RelHomClass F r s]
(f : F)
[IsIrrefl β s]


@[simp]
theorem cokernel.desc_zero {W : C} {h} : cokernel.desc f (0 : Y ⟶ W) h = 0

CategoryTheory.Limits.cokernel.desc f 0 h = 0


@[to_additive]
theorem hasProd_single {f : β → α} (b : β) (hf : ∀ (b') (_ : b' ≠ b), f b' = 1) : HasProd f (f b)

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
(b : β)
(hf : ∀ (b' : β), b' ≠ b → f b' = 1)


@[simp]
theorem snd_equivOfRightInverse (f₁ : M →L[R] M₂) (f₂ : M₂ →L[R] M)
    (h : Function.RightInverse f₂ f₁) (x : M) :
    ((equivOfRightInverse f₁ f₂ h x).2 : M) = x - f₂ (f₁ x)

{R : Type u_1}
[Ring R]
{M : Type u_3}
[TopologicalSpace M]
[AddCommGroup M]
[Module R M]
{M₂ : Type u_4}
[TopologicalSpace M₂]
[AddCommGroup M₂]
[Module R M₂]
[TopologicalAddGroup M]
(f₁ : M →L[R] M₂)
(f₂ : M₂ →L[R] M)
(h : Function.RightInverse ⇑f₂ ⇑f₁)
(x : M)

↑((ContinuousLinearEquiv.equivOfRightInverse f₁ f₂ h) x).2 = x - f₂ (f₁ x)


theorem IsLUB.isGLB_of_tendsto [Preorder γ] [TopologicalSpace γ] [OrderClosedTopology γ] :
    ∀ {f : α → γ} {s : Set α} {a : α} {b : γ},
      AntitoneOn f s → IsLUB s a → s.Nonempty → Tendsto f (𝓝[s] a) (𝓝 b) → IsGLB (f '' s) b

{α : Type u_1}
{γ : Type u_3}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[Preorder γ]
[TopologicalSpace γ]
[OrderClosedTopology γ]
{f : α → γ}
{s : Set α}
{a : α}
{b : γ}

AntitoneOn f s → IsLUB s a → s.Nonempty → Filter.Tendsto f (𝓝[s] a) (𝓝 b) → IsGLB (f '' s) b


theorem map_continuousAt (f : F) (a : α) : ContinuousAt f a

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[FunLike F α β]
[ContinuousMapClass F α β]
(f : F)
(a : α)


theorem toCotangent_range : LinearMap.range I.toCotangent = ⊤


/--
An isomorphism in `Dial C` can be induced by isomorphisms on the source and target,
which respect the respective relations on `X` and `Y`.
-/
@[simps] def isoMk {X Y : Dial C} (e₁ : X.src ≅ Y.src) (e₂ : X.tgt ≅ Y.tgt)
    (eq : X.rel = (Subobject.pullback (prod.map e₁.hom e₂.hom)).obj Y.rel) : X ≅ Y

(eq : X.rel = (CategoryTheory.Subobject.pullback (CategoryTheory.Limits.prod.map e₁.hom e₂.hom)).obj Y.rel)

(CategoryTheory.Dial.isoMk e₁ e₂ eq).hom.f = e₁.hom


@[simp]
theorem digits_zero (b : ℕ) : digits b 0 = []


@[simp]
theorem nodup_support {u v : V} (p : G.Path u v) : (p : G.Walk u v).support.Nodup

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


theorem one_quot : (⟨Quot.mk _ 1⟩ : RingQuot r) = 1

{R : Type uR}
[Semiring R]
(r : R → R → Prop)

{ toQuot := Quot.mk (RingQuot.Rel r) 1 } = 1


@[simp]
theorem map_of (x : α) : map f (of x) = of (f x)

{α : Type u}
{β : Type v}
(f : α → β)
(x : α)

(FreeRing.map f) (FreeRing.of x) = FreeRing.of (f x)


/-- `adjustToOrientation` gives an orthonormal basis with the required orientation. -/
@[simp]
theorem orientation_adjustToOrientation : (e.adjustToOrientation x).toBasis.orientation = x

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{ι : Type u_2}
[Fintype ι]
[DecidableEq ι]
[ne : Nonempty ι]
(e : OrthonormalBasis ι ℝ E)
(x : Orientation ℝ E ι)


@[simp]
protected theorem prime_pow (n : ℕ) : padicValNat p (p ^ n) = n

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


theorem IsVonNBounded.of_boundedSpace [BoundedSpace 𝕜] {s : Set E} : IsVonNBounded 𝕜 s

{𝕜 : Type u_1}
{E : Type u_3}
[SeminormedRing 𝕜]
[SMul 𝕜 E]
[Zero E]
[TopologicalSpace E]
[BoundedSpace 𝕜]
{s : Set E}