[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.RingTheory.Polynomial.GaussNorm).

[User]
You are editing a file in `Mathlib/RingTheory/Polynomial/GaussNorm.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.RingTheory.Polynomial.GaussNorm.le_gaussNorm`, L137-L141)
## Surrounding context in Mathlib/RingTheory/Polynomial/GaussNorm.lean
```lean
-- Mathlib.RingTheory.Polynomial.GaussNorm.gaussNorm (L53-L55)
def gaussNorm : ℝ

-- Mathlib.RingTheory.Polynomial.GaussNorm.gaussNorm_zero (L57-L60)
lemma gaussNorm_zero : gaussNorm v c 0 = 0

-- Mathlib.RingTheory.Polynomial.GaussNorm.exists_eq_gaussNorm (L61-L67)
theorem exists_eq_gaussNorm : ∃ i, p.gaussNorm v c = v (p.coeff i) * c ^ i
```

Relevant lemmas available in scope: `PowerSeries.le_gaussNorm`

```lean
lemma le_gaussNorm (hc : 0 ≤ c) (i : ℕ) : v (p.coeff i) * c ^ i ≤ p.gaussNorm v c := by
rw [← gaussNorm_coe_powerSeries _ _ hc, ← coeff_coe]
  apply PowerSeries.le_gaussNorm
  simpa using aux_bdd v p
```

## Edit instruction
Edit `le_gaussNorm` so it still compiles and the proof is simplified where possible. Return the full updated `le_gaussNorm` block.

You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.RingTheory.Polynomial.GaussNorm).

You are editing a file in `Mathlib/RingTheory/Polynomial/GaussNorm.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.RingTheory.Polynomial.GaussNorm.le_gaussNorm`, L137-L141)
## Surrounding context in Mathlib/RingTheory/Polynomial/GaussNorm.lean
```lean
-- Mathlib.RingTheory.Polynomial.GaussNorm.gaussNorm (L53-L55)
def gaussNorm : ℝ

-- Mathlib.RingTheory.Polynomial.GaussNorm.gaussNorm_zero (L57-L60)
lemma gaussNorm_zero : gaussNorm v c 0 = 0

-- Mathlib.RingTheory.Polynomial.GaussNorm.exists_eq_gaussNorm (L61-L67)
theorem exists_eq_gaussNorm : ∃ i, p.gaussNorm v c = v (p.coeff i) * c ^ i
```

Relevant lemmas available in scope: `PowerSeries.le_gaussNorm`

```lean
lemma le_gaussNorm (hc : 0 ≤ c) (i : ℕ) : v (p.coeff i) * c ^ i ≤ p.gaussNorm v c := by
rw [← gaussNorm_coe_powerSeries _ _ hc, ← coeff_coe]
  apply PowerSeries.le_gaussNorm
  simpa using aux_bdd v p
```

## Edit instruction
Edit `le_gaussNorm` so it still compiles and the proof is simplified where possible. Return the full updated `le_gaussNorm` block.


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Separation.Basic).

[User]
You are editing a file in `Mathlib/Topology/Separation/Basic.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Topology.Separation.Basic.t0Space_iff_not_inseparable`, L85-L88)
Open namespaces: sets., Function, Set, Filter, Topology, TopologicalSpace

## Surrounding context in Mathlib/Topology/Separation/Basic.lean
```lean
-- Mathlib.Topology.Separation.Basic.t0Space_iff_inseparable (L81-L84)
theorem t0Space_iff_inseparable (X : Type u) [TopologicalSpace X] :
    T0Space X ↔ ∀ x y : X, Inseparable x y → x = y

-- Mathlib.Topology.Separation.Basic.Inseparable (L89-L101)
theorem Inseparable.eq [T0Space X] {x y : X} (h : Inseparable x y) : x = y

-- Mathlib.Topology.Separation.Basic.isEmbedding_iff_isInducing (L102-L105)
lemma isEmbedding_iff_isInducing [TopologicalSpace Y] [T0Space X] {f : X → Y} :
    IsEmbedding f ↔ IsInducing f
```

```lean
theorem t0Space_iff_not_inseparable (X : Type u) [TopologicalSpace X] :
    T0Space X ↔ Pairwise fun x y : X => ¬Inseparable x y := by
simp only [t0Space_iff_inseparable, Ne, not_imp_not, Pairwise]
```

## Edit instruction
Edit `t0Space_iff_not_inseparable` so it still compiles and the proof is simplified where possible. Return the full updated `t0Space_iff_not_inseparable` block.

You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Separation.Basic).

You are editing a file in `Mathlib/Topology/Separation/Basic.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Topology.Separation.Basic.t0Space_iff_not_inseparable`, L85-L88)
Open namespaces: sets., Function, Set, Filter, Topology, TopologicalSpace

## Surrounding context in Mathlib/Topology/Separation/Basic.lean
```lean
-- Mathlib.Topology.Separation.Basic.t0Space_iff_inseparable (L81-L84)
theorem t0Space_iff_inseparable (X : Type u) [TopologicalSpace X] :
    T0Space X ↔ ∀ x y : X, Inseparable x y → x = y

-- Mathlib.Topology.Separation.Basic.Inseparable (L89-L101)
theorem Inseparable.eq [T0Space X] {x y : X} (h : Inseparable x y) : x = y

-- Mathlib.Topology.Separation.Basic.isEmbedding_iff_isInducing (L102-L105)
lemma isEmbedding_iff_isInducing [TopologicalSpace Y] [T0Space X] {f : X → Y} :
    IsEmbedding f ↔ IsInducing f
```

```lean
theorem t0Space_iff_not_inseparable (X : Type u) [TopologicalSpace X] :
    T0Space X ↔ Pairwise fun x y : X => ¬Inseparable x y := by
simp only [t0Space_iff_inseparable, Ne, not_imp_not, Pairwise]
```

## Edit instruction
Edit `t0Space_iff_not_inseparable` so it still compiles and the proof is simplified where possible. Return the full updated `t0Space_iff_not_inseparable` block.

mistral-common:Tekken v15 (Mistral chat template, [INST]/[SYSTEM_PROMPT])


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Combinatorics.Configuration).

[User]
You are editing a file in `Mathlib/Combinatorics/Configuration.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Combinatorics.Configuration.eq_or_eq_of_orthogonal`, L500-L509)
Open namespaces: Finset, Nondegenerate, HasPoints, (mkPoint, mkPoint_ax), HasLines, (mkLine, mkLine_ax)

## Surrounding context in Mathlib/Combinatorics/Configuration.lean
```lean
-- Mathlib.Combinatorics.Configuration.Dual (L47-L49)
def Dual

-- Mathlib.Combinatorics.Configuration.Dual (L93-L97)
instance Dual.Nondegenerate [Nondegenerate P L] : Nondegenerate (Dual L) (Dual P) where
  exists_point

-- Mathlib.Combinatorics.Configuration.Dual (L98-L102)
instance Dual.hasLines [HasPoints P L] : HasLines (Dual L) (Dual P)
```

Relevant lemmas available in scope: `crossProduct_eq_zero_of_dotProduct_eq_zero`

```lean
lemma eq_or_eq_of_orthogonal {a b c d : ℙ K (Fin 3 → K)} (hac : a.orthogonal c)
    (hbc : b.orthogonal c) (had : a.orthogonal d) (hbd : b.orthogonal d) :
    a = b ∨ c = d := by
induction a with | h a ha =>
  induction b with | h b hb =>
  induction c with | h c hc =>
  induction d with | h d hd =>
  rw [mk_eq_mk_iff_crossProduct_eq_zero, mk_eq_mk_iff_crossProduct_eq_zero]
  exact crossProduct_eq_zero_of_dotProduct_eq_zero hac hbc had hbd
```

## Edit instruction
Edit `eq_or_eq_of_orthogonal` so it still compiles and the proof is simplified where possible. Return the full updated `eq_or_eq_of_orthogonal` block.

You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Combinatorics.Configuration).

You are editing a file in `Mathlib/Combinatorics/Configuration.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Combinatorics.Configuration.eq_or_eq_of_orthogonal`, L500-L509)
Open namespaces: Finset, Nondegenerate, HasPoints, (mkPoint, mkPoint_ax), HasLines, (mkLine, mkLine_ax)

## Surrounding context in Mathlib/Combinatorics/Configuration.lean
```lean
-- Mathlib.Combinatorics.Configuration.Dual (L47-L49)
def Dual

-- Mathlib.Combinatorics.Configuration.Dual (L93-L97)
instance Dual.Nondegenerate [Nondegenerate P L] : Nondegenerate (Dual L) (Dual P) where
  exists_point

-- Mathlib.Combinatorics.Configuration.Dual (L98-L102)
instance Dual.hasLines [HasPoints P L] : HasLines (Dual L) (Dual P)
```

Relevant lemmas available in scope: `crossProduct_eq_zero_of_dotProduct_eq_zero`

```lean
lemma eq_or_eq_of_orthogonal {a b c d : ℙ K (Fin 3 → K)} (hac : a.orthogonal c)
    (hbc : b.orthogonal c) (had : a.orthogonal d) (hbd : b.orthogonal d) :
    a = b ∨ c = d := by
induction a with | h a ha =>
  induction b with | h b hb =>
  induction c with | h c hc =>
  induction d with | h d hd =>
  rw [mk_eq_mk_iff_crossProduct_eq_zero, mk_eq_mk_iff_crossProduct_eq_zero]
  exact crossProduct_eq_zero_of_dotProduct_eq_zero hac hbc had hbd
```

## Edit instruction
Edit `eq_or_eq_of_orthogonal` so it still compiles and the proof is simplified where possible. Return the full updated `eq_or_eq_of_orthogonal` block.


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Finset.Prod).

[User]
You are editing a file in `Mathlib/Data/Finset/Prod.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Data.Finset.Prod.disjoint_product`, L222-L224)
Open namespaces: Multiset

## Surrounding context in Mathlib/Data/Finset/Prod.lean
```lean
-- Mathlib.Data.Finset.Prod.instSProd (L48-L50)
instance instSProd : SProd (Finset α) (Finset β) (Finset (α × β)) where
  sprod

-- Mathlib.Data.Finset.Prod.product_eq_sprod (L52-L54)
theorem product_eq_sprod : Finset.product s t = s ×ˢ t

-- Mathlib.Data.Finset.Prod.product_val (L56-L58)
theorem product_val : (s ×ˢ t).1 = s.1 ×ˢ t.1
```

```lean
theorem disjoint_product : Disjoint (s ×ˢ t) (s' ×ˢ t') ↔ Disjoint s s' ∨ Disjoint t t' := by
simp_rw [← disjoint_coe, coe_product, Set.disjoint_prod]
```

## Edit instruction
Edit `disjoint_product` so it still compiles and the proof is simplified where possible. Return the full updated `disjoint_product` block.

You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Finset.Prod).

You are editing a file in `Mathlib/Data/Finset/Prod.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Data.Finset.Prod.disjoint_product`, L222-L224)
Open namespaces: Multiset

## Surrounding context in Mathlib/Data/Finset/Prod.lean
```lean
-- Mathlib.Data.Finset.Prod.instSProd (L48-L50)
instance instSProd : SProd (Finset α) (Finset β) (Finset (α × β)) where
  sprod

-- Mathlib.Data.Finset.Prod.product_eq_sprod (L52-L54)
theorem product_eq_sprod : Finset.product s t = s ×ˢ t

-- Mathlib.Data.Finset.Prod.product_val (L56-L58)
theorem product_val : (s ×ˢ t).1 = s.1 ×ˢ t.1
```

```lean
theorem disjoint_product : Disjoint (s ×ˢ t) (s' ×ˢ t') ↔ Disjoint s s' ∨ Disjoint t t' := by
simp_rw [← disjoint_coe, coe_product, Set.disjoint_prod]
```

## Edit instruction
Edit `disjoint_product` so it still compiles and the proof is simplified where possible. Return the full updated `disjoint_product` block.


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Lie.SkewAdjoint).

[User]
You are editing a file in `Mathlib/Algebra/Lie/SkewAdjoint.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Algebra.Lie.SkewAdjoint.mem_skewAdjointMatricesLieSubalgebra_unit_smul`, L153-L161)
Open namespaces: LinearMap, (BilinForm), scoped, Matrix

## Surrounding context in Mathlib/Algebra/Lie/SkewAdjoint.lean
```lean
-- Mathlib.Algebra.Lie.SkewAdjoint.LinearMap (L47-L57)
theorem LinearMap.BilinForm.isSkewAdjoint_bracket {f g : Module.End R M}
    (hf : f ∈ B.skewAdjointSubmodule) (hg : g ∈ B.skewAdjointSubmodule) :
    ⁅f, g⁆ ∈ B.skewAdjointSubmodule

-- Mathlib.Algebra.Lie.SkewAdjoint.skewAdjointLieSubalgebra (L58-L65)
def skewAdjointLieSubalgebra : LieSubalgebra R (Module.End R M)

-- Mathlib.Algebra.Lie.SkewAdjoint.skewAdjointLieSubalgebraEquiv (L66-L72)
def skewAdjointLieSubalgebraEquiv :
    skewAdjointLieSubalgebra (B.compl₁₂ (e : N →ₗ[R] M) e) ≃ₗ⁅R⁆ skewAdjointLieSubalgebra B
```

Relevant lemmas available in scope: `h`

```lean
theorem mem_skewAdjointMatricesLieSubalgebra_unit_smul (u : Rˣ) (J A : Matrix n n R) :
    A ∈ skewAdjointMatricesLieSubalgebra (u • J) ↔ A ∈ skewAdjointMatricesLieSubalgebra J := by
change A ∈ skewAdjointMatricesSubmodule (u • J) ↔ A ∈ skewAdjointMatricesSubmodule J
  simp only [mem_skewAdjointMatricesSubmodule, Matrix.IsSkewAdjoint, Matrix.IsAdjointPair]
  constructor <;> intro h
  · simpa using congr_arg (fun B => u⁻¹ • B) h
  · simp [h]

end SkewAdjointMatrices
```

## Edit instruction
Edit `mem_skewAdjointMatricesLieSubalgebra_unit_smul` so it still compiles and the proof is simplified where possible. Return the full updated `mem_skewAdjointMatricesLieSubalgebra_unit_smul` block.

You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Lie.SkewAdjoint).

You are editing a file in `Mathlib/Algebra/Lie/SkewAdjoint.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Algebra.Lie.SkewAdjoint.mem_skewAdjointMatricesLieSubalgebra_unit_smul`, L153-L161)
Open namespaces: LinearMap, (BilinForm), scoped, Matrix

## Surrounding context in Mathlib/Algebra/Lie/SkewAdjoint.lean
```lean
-- Mathlib.Algebra.Lie.SkewAdjoint.LinearMap (L47-L57)
theorem LinearMap.BilinForm.isSkewAdjoint_bracket {f g : Module.End R M}
    (hf : f ∈ B.skewAdjointSubmodule) (hg : g ∈ B.skewAdjointSubmodule) :
    ⁅f, g⁆ ∈ B.skewAdjointSubmodule

-- Mathlib.Algebra.Lie.SkewAdjoint.skewAdjointLieSubalgebra (L58-L65)
def skewAdjointLieSubalgebra : LieSubalgebra R (Module.End R M)

-- Mathlib.Algebra.Lie.SkewAdjoint.skewAdjointLieSubalgebraEquiv (L66-L72)
def skewAdjointLieSubalgebraEquiv :
    skewAdjointLieSubalgebra (B.compl₁₂ (e : N →ₗ[R] M) e) ≃ₗ⁅R⁆ skewAdjointLieSubalgebra B
```

Relevant lemmas available in scope: `h`

```lean
theorem mem_skewAdjointMatricesLieSubalgebra_unit_smul (u : Rˣ) (J A : Matrix n n R) :
    A ∈ skewAdjointMatricesLieSubalgebra (u • J) ↔ A ∈ skewAdjointMatricesLieSubalgebra J := by
change A ∈ skewAdjointMatricesSubmodule (u • J) ↔ A ∈ skewAdjointMatricesSubmodule J
  simp only [mem_skewAdjointMatricesSubmodule, Matrix.IsSkewAdjoint, Matrix.IsAdjointPair]
  constructor <;> intro h
  · simpa using congr_arg (fun B => u⁻¹ • B) h
  · simp [h]

end SkewAdjointMatrices
```

## Edit instruction
Edit `mem_skewAdjointMatricesLieSubalgebra_unit_smul` so it still compiles and the proof is simplified where possible. Return the full updated `mem_skewAdjointMatricesLieSubalgebra_unit_smul` block.


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.GroupWithZero.Range).

[User]
You are editing a file in `Mathlib/Algebra/GroupWithZero/Range.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Algebra.GroupWithZero.Range.valueGroup_def`, L99-L102)
Open namespaces: Set, Subgroup, Submonoid

## Surrounding context in Mathlib/Algebra/GroupWithZero/Range.lean
```lean
-- Mathlib.Algebra.GroupWithZero.Range.mrange_nontrivial (L59-L62)
lemma mrange_nontrivial :
    Nontrivial (MonoidHom.mrange f)

-- Mathlib.Algebra.GroupWithZero.Range.range_nontrivial (L63-L76)
lemma range_nontrivial :
    (Set.range f).Nontrivial

-- Mathlib.Algebra.GroupWithZero.Range.valueMonoid (L77-L85)
def valueMonoid : Submonoid Bˣ where
  carrier
```

```lean
lemma valueGroup_def : valueGroup f = Subgroup.closure (valueMonoid f) := rfl
/-- For a morphism of monoids with zero `f`, this is the smallest submonoid with zero of the
codomain containing the range of `f`. -/
```

## Edit instruction
Edit `valueGroup_def` so it still compiles and the proof is simplified where possible. Return the full updated `valueGroup_def` block.

You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.GroupWithZero.Range).

You are editing a file in `Mathlib/Algebra/GroupWithZero/Range.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Algebra.GroupWithZero.Range.valueGroup_def`, L99-L102)
Open namespaces: Set, Subgroup, Submonoid

## Surrounding context in Mathlib/Algebra/GroupWithZero/Range.lean
```lean
-- Mathlib.Algebra.GroupWithZero.Range.mrange_nontrivial (L59-L62)
lemma mrange_nontrivial :
    Nontrivial (MonoidHom.mrange f)

-- Mathlib.Algebra.GroupWithZero.Range.range_nontrivial (L63-L76)
lemma range_nontrivial :
    (Set.range f).Nontrivial

-- Mathlib.Algebra.GroupWithZero.Range.valueMonoid (L77-L85)
def valueMonoid : Submonoid Bˣ where
  carrier
```

```lean
lemma valueGroup_def : valueGroup f = Subgroup.closure (valueMonoid f) := rfl
/-- For a morphism of monoids with zero `f`, this is the smallest submonoid with zero of the
codomain containing the range of `f`. -/
```

## Edit instruction
Edit `valueGroup_def` so it still compiles and the proof is simplified where possible. Return the full updated `valueGroup_def` block.


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Set.MemPartition).

[User]
You are editing a file in `Mathlib/Data/Set/MemPartition.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Data.Set.MemPartition.mem_memPartitionSet`, L136-L143)
Open namespaces: Set, Classical, in

## Surrounding context in Mathlib/Data/Set/MemPartition.lean
```lean
-- Mathlib.Data.Set.MemPartition.memPartition (L43-L46)
def memPartition (f : ℕ → Set α) : ℕ → Set (Set α)
  | 0 => {univ}
  | n + 1 => {s | ∃ u ∈ memPartition f n, s = u ∩ f n ∨ s = u \ f n}

-- Mathlib.Data.Set.MemPartition.memPartition_zero (L48-L49)
lemma memPartition_zero (f : ℕ → Set α) : memPartition f 0 = {univ}

-- Mathlib.Data.Set.MemPartition.memPartition_succ (L50-L53)
lemma memPartition_succ (f : ℕ → Set α) (n : ℕ) :
    memPartition f (n + 1) = {s | ∃ u ∈ memPartition f n, s = u ∩ f n ∨ s = u \ f n}
```

```lean
lemma mem_memPartitionSet (f : ℕ → Set α) (n : ℕ) (a : α) : a ∈ memPartitionSet f n a := by
induction n with
  | zero => simp [memPartitionSet]
  | succ n ih =>
    classical
    rw [memPartitionSet_succ]
    split_ifs with h <;> exact ⟨ih, h⟩
```

## Edit instruction
Edit `mem_memPartitionSet` so it still compiles and the proof is simplified where possible. Return the full updated `mem_memPartitionSet` block.

You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Set.MemPartition).

You are editing a file in `Mathlib/Data/Set/MemPartition.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Data.Set.MemPartition.mem_memPartitionSet`, L136-L143)
Open namespaces: Set, Classical, in

## Surrounding context in Mathlib/Data/Set/MemPartition.lean
```lean
-- Mathlib.Data.Set.MemPartition.memPartition (L43-L46)
def memPartition (f : ℕ → Set α) : ℕ → Set (Set α)
  | 0 => {univ}
  | n + 1 => {s | ∃ u ∈ memPartition f n, s = u ∩ f n ∨ s = u \ f n}

-- Mathlib.Data.Set.MemPartition.memPartition_zero (L48-L49)
lemma memPartition_zero (f : ℕ → Set α) : memPartition f 0 = {univ}

-- Mathlib.Data.Set.MemPartition.memPartition_succ (L50-L53)
lemma memPartition_succ (f : ℕ → Set α) (n : ℕ) :
    memPartition f (n + 1) = {s | ∃ u ∈ memPartition f n, s = u ∩ f n ∨ s = u \ f n}
```

```lean
lemma mem_memPartitionSet (f : ℕ → Set α) (n : ℕ) (a : α) : a ∈ memPartitionSet f n a := by
induction n with
  | zero => simp [memPartitionSet]
  | succ n ih =>
    classical
    rw [memPartitionSet_succ]
    split_ifs with h <;> exact ⟨ih, h⟩
```

## Edit instruction
Edit `mem_memPartitionSet` so it still compiles and the proof is simplified where possible. Return the full updated `mem_memPartitionSet` block.


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Algebra.Subalgebra.MulOpposite).

[User]
You are editing a file in `Mathlib/Algebra/Algebra/Subalgebra/MulOpposite.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Algebra.Algebra.Subalgebra.MulOpposite.op_sSup`, L104-L106)
```lean
theorem op_sSup (S : Set (Subalgebra R A)) : (sSup S).op = sSup (.unop ⁻¹' S) := opEquiv.map_sSup_eq_sSup_symm_preimage _
```

## Edit instruction
Edit `op_sSup` so it still compiles and the proof is simplified where possible. Return the full updated `op_sSup` block.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Algebra.Subalgebra.MulOpposite).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]You are editing a file in `Mathlib/Algebra/Algebra/Subalgebra/MulOpposite.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Algebra.Algebra.Subalgebra.MulOpposite.op_sSup`, L104-L106)
```lean
theorem op_sSup (S : Set (Subalgebra R A)) : (sSup S).op = sSup (.unop ⁻¹' S) := opEquiv.map_sSup_eq_sSup_symm_preimage _
```

## Edit instruction
Edit `op_sSup` so it still compiles and the proof is simplified where possible. Return the full updated `op_sSup` block.
[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.Normed.Group.Hom).

[User]
You are editing a file in `Mathlib/Analysis/Normed/Group/Hom.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Analysis.Normed.Group.Hom.coe_nsmul`, L471-L473)
Open namespaces: NNReal

## Surrounding context in Mathlib/Analysis/Normed/Group/Hom.lean
```lean
-- Mathlib.Analysis.Normed.Group.Hom.mkNormedAddGroupHom (L56-L61)
def mkNormedAddGroupHom (f : V →+ W) (C : ℝ) (h : ∀ v, ‖f v‖ ≤ C * ‖v‖) : NormedAddGroupHom V W

-- Mathlib.Analysis.Normed.Group.Hom.mkNormedAddGroupHom' (L62-L67)
def mkNormedAddGroupHom' (f : V →+ W) (C : ℝ≥0) (hC : ∀ x, ‖f x‖₊ ≤ C * ‖x‖₊) :
    NormedAddGroupHom V W

-- Mathlib.Analysis.Normed.Group.Hom.exists_pos_bound_of_bound (L68-L84)
theorem exists_pos_bound_of_bound {V W : Type*} [SeminormedAddCommGroup V]
    [SeminormedAddCommGroup W] {f : V → W} (M : ℝ) (h : ∀ x, ‖f x‖ ≤ M * ‖x‖) :
    ∃ N, 0 < N ∧ ∀ x, ‖f x‖ ≤ N * ‖x‖
```

```lean
theorem coe_nsmul (r : ℕ) (f : NormedAddGroupHom V₁ V₂) : ⇑(r • f) = r • ⇑f := rfl
```

## Edit instruction
Edit `coe_nsmul` so it still compiles and the proof is simplified where possible. Return the full updated `coe_nsmul` block.

You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.Normed.Group.Hom).

You are editing a file in `Mathlib/Analysis/Normed/Group/Hom.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Analysis.Normed.Group.Hom.coe_nsmul`, L471-L473)
Open namespaces: NNReal

## Surrounding context in Mathlib/Analysis/Normed/Group/Hom.lean
```lean
-- Mathlib.Analysis.Normed.Group.Hom.mkNormedAddGroupHom (L56-L61)
def mkNormedAddGroupHom (f : V →+ W) (C : ℝ) (h : ∀ v, ‖f v‖ ≤ C * ‖v‖) : NormedAddGroupHom V W

-- Mathlib.Analysis.Normed.Group.Hom.mkNormedAddGroupHom' (L62-L67)
def mkNormedAddGroupHom' (f : V →+ W) (C : ℝ≥0) (hC : ∀ x, ‖f x‖₊ ≤ C * ‖x‖₊) :
    NormedAddGroupHom V W

-- Mathlib.Analysis.Normed.Group.Hom.exists_pos_bound_of_bound (L68-L84)
theorem exists_pos_bound_of_bound {V W : Type*} [SeminormedAddCommGroup V]
    [SeminormedAddCommGroup W] {f : V → W} (M : ℝ) (h : ∀ x, ‖f x‖ ≤ M * ‖x‖) :
    ∃ N, 0 < N ∧ ∀ x, ‖f x‖ ≤ N * ‖x‖
```

```lean
theorem coe_nsmul (r : ℕ) (f : NormedAddGroupHom V₁ V₂) : ⇑(r • f) = r • ⇑f := rfl
```

## Edit instruction
Edit `coe_nsmul` so it still compiles and the proof is simplified where possible. Return the full updated `coe_nsmul` block.


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.CompleteBooleanAlgebra).

[User]
You are editing a file in `Mathlib/Order/CompleteBooleanAlgebra.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Order.CompleteBooleanAlgebra.Pi`, L626-L630)
Open namespaces: Function, Set, Order

## Surrounding context in Mathlib/Order/CompleteBooleanAlgebra.lean
```lean
-- Mathlib.Order.CompleteBooleanAlgebra.inf_sSup_eq (L83-L88)
theorem inf_sSup_eq {α : Type*} [Order.Frame α] {s : Set α} {a : α} :
    a ⊓ sSup s = ⨆ b ∈ s, a ⊓ b

-- Mathlib.Order.CompleteBooleanAlgebra.sup_sInf_eq (L93-L110)
theorem sup_sInf_eq {α : Type*} [Order.Coframe α] {s : Set α} {a : α} :
    a ⊔ sInf s = ⨅ b ∈ s, a ⊔ b

-- Mathlib.Order.CompleteBooleanAlgebra.le_iInf_iSup (L136-L139)
theorem le_iInf_iSup [CompleteLattice α] {f : ∀ a, κ a → α} :
    (⨆ g : ∀ a, κ a, ⨅ a, f a (g a)) ≤ ⨅ a, ⨆ b, f a b
```

```lean
instance Pi.instCompleteBooleanAlgebra {ι : Type*} {π : ι → Type*}
    [∀ i, CompleteBooleanAlgebra (π i)] : CompleteBooleanAlgebra (∀ i, π i) where
  __ := instBooleanAlgebra
__ := instCompleteDistribLattice
```

## Edit instruction
Edit `Pi` so it still compiles and the proof is simplified where possible. Return the full updated `Pi` block.

You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.CompleteBooleanAlgebra).

You are editing a file in `Mathlib/Order/CompleteBooleanAlgebra.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Order.CompleteBooleanAlgebra.Pi`, L626-L630)
Open namespaces: Function, Set, Order

## Surrounding context in Mathlib/Order/CompleteBooleanAlgebra.lean
```lean
-- Mathlib.Order.CompleteBooleanAlgebra.inf_sSup_eq (L83-L88)
theorem inf_sSup_eq {α : Type*} [Order.Frame α] {s : Set α} {a : α} :
    a ⊓ sSup s = ⨆ b ∈ s, a ⊓ b

-- Mathlib.Order.CompleteBooleanAlgebra.sup_sInf_eq (L93-L110)
theorem sup_sInf_eq {α : Type*} [Order.Coframe α] {s : Set α} {a : α} :
    a ⊔ sInf s = ⨅ b ∈ s, a ⊔ b

-- Mathlib.Order.CompleteBooleanAlgebra.le_iInf_iSup (L136-L139)
theorem le_iInf_iSup [CompleteLattice α] {f : ∀ a, κ a → α} :
    (⨆ g : ∀ a, κ a, ⨅ a, f a (g a)) ≤ ⨅ a, ⨆ b, f a b
```

```lean
instance Pi.instCompleteBooleanAlgebra {ι : Type*} {π : ι → Type*}
    [∀ i, CompleteBooleanAlgebra (π i)] : CompleteBooleanAlgebra (∀ i, π i) where
  __ := instBooleanAlgebra
__ := instCompleteDistribLattice
```

## Edit instruction
Edit `Pi` so it still compiles and the proof is simplified where possible. Return the full updated `Pi` block.


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.Distribution.SchwartzSpace.Basic).

[User]
You are editing a file in `Mathlib/Analysis/Distribution/SchwartzSpace/Basic.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Analysis.Distribution.SchwartzSpace.Basic.smulLeftCLM_const`, L754-L759)
Open namespaces: scoped, Nat, NNReal, ContDiff, Asymptotics, Filter, Topology, in

## Surrounding context in Mathlib/Analysis/Distribution/SchwartzSpace/Basic.lean
```lean
-- Mathlib.Analysis.Distribution.SchwartzSpace.Basic.instFunLike (L86-L90)
instance instFunLike : FunLike 𝓢(E, F) E F where
  coe f

-- Mathlib.Analysis.Distribution.SchwartzSpace.Basic.decay (L91-L96)
theorem decay (f : 𝓢(E, F)) (k n : ℕ) :
    ∃ C : ℝ, 0 < C ∧ ∀ x, ‖x‖ ^ k * ‖iteratedFDeriv ℝ n f x‖ ≤ C

-- Mathlib.Analysis.Distribution.SchwartzSpace.Basic.smooth (L98-L101)
theorem smooth (f : 𝓢(E, F)) (n : ℕ∞) : ContDiff ℝ n f
```

```lean
theorem smulLeftCLM_const (c : 𝕜) :
    smulLeftCLM F (fun (_ : E) ↦ c) = c • ContinuousLinearMap.id 𝕜 _ := by
ext f x
  have : (fun (_ : E) ↦ c).HasTemperateGrowth := by fun_prop
  simp [this]
```

## Edit instruction
Edit `smulLeftCLM_const` so it still compiles and the proof is simplified where possible. Return the full updated `smulLeftCLM_const` block.

You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.Distribution.SchwartzSpace.Basic).

You are editing a file in `Mathlib/Analysis/Distribution/SchwartzSpace/Basic.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Analysis.Distribution.SchwartzSpace.Basic.smulLeftCLM_const`, L754-L759)
Open namespaces: scoped, Nat, NNReal, ContDiff, Asymptotics, Filter, Topology, in

## Surrounding context in Mathlib/Analysis/Distribution/SchwartzSpace/Basic.lean
```lean
-- Mathlib.Analysis.Distribution.SchwartzSpace.Basic.instFunLike (L86-L90)
instance instFunLike : FunLike 𝓢(E, F) E F where
  coe f

-- Mathlib.Analysis.Distribution.SchwartzSpace.Basic.decay (L91-L96)
theorem decay (f : 𝓢(E, F)) (k n : ℕ) :
    ∃ C : ℝ, 0 < C ∧ ∀ x, ‖x‖ ^ k * ‖iteratedFDeriv ℝ n f x‖ ≤ C

-- Mathlib.Analysis.Distribution.SchwartzSpace.Basic.smooth (L98-L101)
theorem smooth (f : 𝓢(E, F)) (n : ℕ∞) : ContDiff ℝ n f
```

```lean
theorem smulLeftCLM_const (c : 𝕜) :
    smulLeftCLM F (fun (_ : E) ↦ c) = c • ContinuousLinearMap.id 𝕜 _ := by
ext f x
  have : (fun (_ : E) ↦ c).HasTemperateGrowth := by fun_prop
  simp [this]
```

## Edit instruction
Edit `smulLeftCLM_const` so it still compiles and the proof is simplified where possible. Return the full updated `smulLeftCLM_const` block.


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Int.GCD).

[User]
You are editing a file in `Mathlib/Data/Int/GCD.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Data.Int.GCD.gcd_eq_gcd_ab`, L174-L184)
```lean
theorem gcd_eq_gcd_ab : ∀ x y : ℤ, (gcd x y : ℤ) = x * gcdA x y + y * gcdB x y
  | (m : ℕ), (n : ℕ) => Nat.gcd_eq_gcd_ab _ _
  | (m : ℕ), -[n+1] =>
    show (_ : ℤ) = _ + -(n + 1) * -_ by rw [Int.neg_mul_neg]; apply Nat.gcd_eq_gcd_ab
  | -[m+1], (n : ℕ) =>
    show (_ : ℤ) = -(m + 1) * -_ + _ by rw [Int.neg_mul_neg]; apply Nat.gcd_eq_gcd_ab
  | -[m+1], -[n+1] =>
    show (_ : ℤ) = -(m + 1) * -_ + -(n + 1) * -_ by
      rw [Int.neg_mul_neg, Int.neg_mul_neg]
      apply Nat.gcd_eq_gcd_ab
```

## Edit instruction
Edit `gcd_eq_gcd_ab` so it still compiles and the proof is simplified where possible. Return the full updated `gcd_eq_gcd_ab` block.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Int.GCD).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]You are editing a file in `Mathlib/Data/Int/GCD.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Data.Int.GCD.gcd_eq_gcd_ab`, L174-L184)
```lean
theorem gcd_eq_gcd_ab : ∀ x y : ℤ, (gcd x y : ℤ) = x * gcdA x y + y * gcdB x y
  | (m : ℕ), (n : ℕ) => Nat.gcd_eq_gcd_ab _ _
  | (m : ℕ), -[n+1] =>
    show (_ : ℤ) = _ + -(n + 1) * -_ by rw [Int.neg_mul_neg]; apply Nat.gcd_eq_gcd_ab
  | -[m+1], (n : ℕ) =>
    show (_ : ℤ) = -(m + 1) * -_ + _ by rw [Int.neg_mul_neg]; apply Nat.gcd_eq_gcd_ab
  | -[m+1], -[n+1] =>
    show (_ : ℤ) = -(m + 1) * -_ + -(n + 1) * -_ by
      rw [Int.neg_mul_neg, Int.neg_mul_neg]
      apply Nat.gcd_eq_gcd_ab
```

## Edit instruction
Edit `gcd_eq_gcd_ab` so it still compiles and the proof is simplified where possible. Return the full updated `gcd_eq_gcd_ab` block.
[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Algebra.Spectrum.Quasispectrum).

[User]
You are editing a file in `Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Algebra.Algebra.Spectrum.Quasispectrum.apply_mem`, L506-L509)
Open namespaces: PreQuasiregular

## Surrounding context in Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean
```lean
-- Mathlib.Algebra.Algebra.Spectrum.Quasispectrum.despite (L18-L63)
instance despite the fact that `0 : R` is the identity in this monoid) so that one may access
the quasiregular elements of `R` as `(PreQuasiregular R)ˣ`, but also as a predicate
`IsQuasiregular`.

Quasiregularity is closely tied to invertibility. Indeed, `(PreQuasiregular A)ˣ` is isomorphic to
the subgroup of `Unitization R A` whose scalar part is `1`, whenever `A` is a non-unital
`R`-algebra, and moreover this isomorphism is implemented by the map
`(x : A) ↦ (1 + x : Unitization R A)`. It is because of this isomorphism, and the associated ties
with multiplicative invertibility, that we choose a `Monoid` (as opposed to an `AddMonoid`)
structure on `PreQuasiregular`.  In addition, in unital rings, we even have
`IsQuasiregular x ↔ IsUnit (1 + x)`.

The *quasispectrum* of `a : A` (with respect to `R`) is defined in terms of quasiregularity, and
this is the natural analogue of the `spectrum` for non-unital rings. Indeed, it is true that
`quasispectrum R a = spectrum R a ∪ {0}` when `A` is unital.

In Mathlib, the quasispectrum is the domain of the continuous functions associated to the
*non-unital* continuous functional calculus.

## Main definitions

+ `PreQuasiregular R`: a structure wrapping `R` that inherits a distinct `Monoid` instance when `R`
  is a non-unital semiring.
+ `Unitization.unitsFstOne`: the subgroup with carrier `{ x : (Unitization R A)ˣ | x.fst = 1 }`.
+ `unitsFstOne_mulEquiv_quasiregular`: the group isomorphism between
  `Unitization.unitsFstOne` and the units of `PreQuasiregular` (i.e., the quasiregular elements)
  which sends `(1, x) ↦ x`.
+ `IsQuasiregular x`: the proposition that `x : R` is a unit with respect to the monoid structure on
  `PreQuasiregular R`, i.e., there is some `u : (PreQuasiregular R)ˣ` such that `u.val` is
  identified with `x` (via the natural equivalence between `R` and `PreQuasiregular R`).
+ `quasispectrum R a`: in an algebra over the semifield `R`, this is the set
  `{r : R | (hr : IsUnit r) → ¬ IsQuasiregular (-(hr.unit⁻¹ • a))}`, which should be thought of
  as a version of the `spectrum` which is applicable in non-unital algebras.

## Main theorems

+ `isQuasiregular_iff_isUnit`: in a unital ring, `x` is quasiregular if and only if `1 + x` is
  a unit.
+ `quasispectrum_eq_spectrum_union_zero`: in a unital algebra `A` over a semifield `R`, the
  quasispectrum of `a : A` is the `spectrum` with zero added.
+ `Unitization.isQuasiregular_inr_iff`: `a : A` is quasiregular if and only if it is quasiregular
  in `Unitization R A` (via the coercion `Unitization.inr`).
+ `Unitization.quasispectrum_eq_spectrum_inr`: the quasispectrum of `a` in a non-unital `R`-algebra
  `A` is precisely the spectrum of `a` in `Unitization R A` (via the coercion `Unitization.inr`).
-/

-- Mathlib.Algebra.Algebra.Spectrum.Quasispectrum.equiv (L80-L83)
def equiv : R ≃ PreQuasiregular R where
  toFun

-- Mathlib.Algebra.Algebra.Spectrum.Quasispectrum.instOne (L84-L86)
instance instOne : One (PreQuasiregular R) where
  one
```

```lean
theorem apply_mem (h : QuasispectrumRestricts a f) {s : S} (hs : s ∈ quasispectrum S a) :
    f s ∈ quasispectrum R a := h.image ▸ ⟨s, hs, rfl⟩
```

## Edit instruction
Edit `apply_mem` so it still compiles and the proof is simplified where possible. Return the full updated `apply_mem` block.

You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Algebra.Spectrum.Quasispectrum).

You are editing a file in `Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean` (mathlib commit 5e932f97dd25535344f80f9dd8da3aab83df0fe6).

## Current excerpt (around `Mathlib.Algebra.Algebra.Spectrum.Quasispectrum.apply_mem`, L506-L509)
Open namespaces: PreQuasiregular

## Surrounding context in Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean
```lean
-- Mathlib.Algebra.Algebra.Spectrum.Quasispectrum.despite (L18-L63)
instance despite the fact that `0 : R` is the identity in this monoid) so that one may access
the quasiregular elements of `R` as `(PreQuasiregular R)ˣ`, but also as a predicate
`IsQuasiregular`.

Quasiregularity is closely tied to invertibility. Indeed, `(PreQuasiregular A)ˣ` is isomorphic to
the subgroup of `Unitization R A` whose scalar part is `1`, whenever `A` is a non-unital
`R`-algebra, and moreover this isomorphism is implemented by the map
`(x : A) ↦ (1 + x : Unitization R A)`. It is because of this isomorphism, and the associated ties
with multiplicative invertibility, that we choose a `Monoid` (as opposed to an `AddMonoid`)
structure on `PreQuasiregular`.  In addition, in unital rings, we even have
`IsQuasiregular x ↔ IsUnit (1 + x)`.

The *quasispectrum* of `a : A` (with respect to `R`) is defined in terms of quasiregularity, and
this is the natural analogue of the `spectrum` for non-unital rings. Indeed, it is true that
`quasispectrum R a = spectrum R a ∪ {0}` when `A` is unital.

In Mathlib, the quasispectrum is the domain of the continuous functions associated to the
*non-unital* continuous functional calculus.

## Main definitions

+ `PreQuasiregular R`: a structure wrapping `R` that inherits a distinct `Monoid` instance when `R`
  is a non-unital semiring.
+ `Unitization.unitsFstOne`: the subgroup with carrier `{ x : (Unitization R A)ˣ | x.fst = 1 }`.
+ `unitsFstOne_mulEquiv_quasiregular`: the group isomorphism between
  `Unitization.unitsFstOne` and the units of `PreQuasiregular` (i.e., the quasiregular elements)
  which sends `(1, x) ↦ x`.
+ `IsQuasiregular x`: the proposition that `x : R` is a unit with respect to the monoid structure on
  `PreQuasiregular R`, i.e., there is some `u : (PreQuasiregular R)ˣ` such that `u.val` is
  identified with `x` (via the natural equivalence between `R` and `PreQuasiregular R`).
+ `quasispectrum R a`: in an algebra over the semifield `R`, this is the set
  `{r : R | (hr : IsUnit r) → ¬ IsQuasiregular (-(hr.unit⁻¹ • a))}`, which should be thought of
  as a version of the `spectrum` which is applicable in non-unital algebras.

## Main theorems

+ `isQuasiregular_iff_isUnit`: in a unital ring, `x` is quasiregular if and only if `1 + x` is
  a unit.
+ `quasispectrum_eq_spectrum_union_zero`: in a unital algebra `A` over a semifield `R`, the
  quasispectrum of `a : A` is the `spectrum` with zero added.
+ `Unitization.isQuasiregular_inr_iff`: `a : A` is quasiregular if and only if it is quasiregular
  in `Unitization R A` (via the coercion `Unitization.inr`).
+ `Unitization.quasispectrum_eq_spectrum_inr`: the quasispectrum of `a` in a non-unital `R`-algebra
  `A` is precisely the spectrum of `a` in `Unitization R A` (via the coercion `Unitization.inr`).
-/

-- Mathlib.Algebra.Algebra.Spectrum.Quasispectrum.equiv (L80-L83)
def equiv : R ≃ PreQuasiregular R where
  toFun

-- Mathlib.Algebra.Algebra.Spectrum.Quasispectrum.instOne (L84-L86)
instance instOne : One (PreQuasiregular R) where
  one
```

```lean
theorem apply_mem (h : QuasispectrumRestricts a f) {s : S} (hs : s ∈ quasispectrum S a) :
    f s ∈ quasispectrum R a := h.image ▸ ⟨s, hs, rfl⟩
```

## Edit instruction
Edit `apply_mem` so it still compiles and the proof is simplified where possible. Return the full updated `apply_mem` block.


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Order.Sub.Defs).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

```lean
theorem antitone_const_tsub : Antitone fun x => c - x
```

Declaration: `Mathlib.Algebra.Order.Sub.Defs.antitone_const_tsub` (module Mathlib.Algebra.Order.Sub.Defs).

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Order.Sub.Defs).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

```lean
theorem antitone_const_tsub : Antitone fun x => c - x
```

Declaration: `Mathlib.Algebra.Order.Sub.Defs.antitone_const_tsub` (module Mathlib.Algebra.Order.Sub.Defs).[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.Normed.Affine.Isometry).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function, Set, Metric

## Surrounding context in Mathlib/Analysis/Normed/Affine/Isometry.lean
```lean
-- Mathlib.Analysis.Normed.Affine.Isometry.linear_eq_linearIsometry (L72-L75)
theorem linear_eq_linearIsometry : f.linear = f.linearIsometry.toLinearMap

-- Mathlib.Analysis.Normed.Affine.Isometry.coe_toAffineMap (L81-L83)
theorem coe_toAffineMap : ⇑f.toAffineMap = f

-- Mathlib.Analysis.Normed.Affine.Isometry.toAffineMap_injective (L84-L87)
theorem toAffineMap_injective : Injective (toAffineMap : (P →ᵃⁱ[𝕜] P₂) → P →ᵃ[𝕜] P₂)
```

```lean
def subtypeₐᵢ (s : AffineSubspace 𝕜 P) [Nonempty s] : s →ᵃⁱ[𝕜] P
```

Declaration: `Mathlib.Analysis.Normed.Affine.Isometry.subtypeₐᵢ` (module Mathlib.Analysis.Normed.Affine.Isometry).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.Normed.Affine.Isometry).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function, Set, Metric

## Surrounding context in Mathlib/Analysis/Normed/Affine/Isometry.lean
```lean
-- Mathlib.Analysis.Normed.Affine.Isometry.linear_eq_linearIsometry (L72-L75)
theorem linear_eq_linearIsometry : f.linear = f.linearIsometry.toLinearMap

-- Mathlib.Analysis.Normed.Affine.Isometry.coe_toAffineMap (L81-L83)
theorem coe_toAffineMap : ⇑f.toAffineMap = f

-- Mathlib.Analysis.Normed.Affine.Isometry.toAffineMap_injective (L84-L87)
theorem toAffineMap_injective : Injective (toAffineMap : (P →ᵃⁱ[𝕜] P₂) → P →ᵃ[𝕜] P₂)
```

```lean
def subtypeₐᵢ (s : AffineSubspace 𝕜 P) [Nonempty s] : s →ᵃⁱ[𝕜] P
```

Declaration: `Mathlib.Analysis.Normed.Affine.Isometry.subtypeₐᵢ` (module Mathlib.Analysis.Normed.Affine.Isometry).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Star.LinearMap).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: WithConv

## Surrounding context in Mathlib/Algebra/Star/LinearMap.lean
```lean
-- Mathlib.Algebra.Star.LinearMap.intrinsicStar (L45-L50)
instance intrinsicStar : Star (WithConv (E →ₗ[R] F)) where
  star f

-- Mathlib.Algebra.Star.LinearMap.intrinsicInvolutiveStar (L55-L58)
instance intrinsicInvolutiveStar : InvolutiveStar (WithConv (E →ₗ[R] F)) where
  star_involutive x

-- Mathlib.Algebra.Star.LinearMap.intrinsicStarAddMonoid (L59-L62)
instance intrinsicStarAddMonoid : StarAddMonoid (WithConv (E →ₗ[R] F)) where
  star_add x y
```

```lean
theorem intrinsicStar_mul' [SMulCommClass R' E E] [IsScalarTower R' E E] :
    star (toConv (mul' R' E)) = toConv (mul' R' E ∘ₗ TensorProduct.comm R' E E)
```

Declaration: `Mathlib.Algebra.Star.LinearMap.intrinsicStar_mul'` (module Mathlib.Algebra.Star.LinearMap).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Star.LinearMap).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: WithConv

## Surrounding context in Mathlib/Algebra/Star/LinearMap.lean
```lean
-- Mathlib.Algebra.Star.LinearMap.intrinsicStar (L45-L50)
instance intrinsicStar : Star (WithConv (E →ₗ[R] F)) where
  star f

-- Mathlib.Algebra.Star.LinearMap.intrinsicInvolutiveStar (L55-L58)
instance intrinsicInvolutiveStar : InvolutiveStar (WithConv (E →ₗ[R] F)) where
  star_involutive x

-- Mathlib.Algebra.Star.LinearMap.intrinsicStarAddMonoid (L59-L62)
instance intrinsicStarAddMonoid : StarAddMonoid (WithConv (E →ₗ[R] F)) where
  star_add x y
```

```lean
theorem intrinsicStar_mul' [SMulCommClass R' E E] [IsScalarTower R' E E] :
    star (toConv (mul' R' E)) = toConv (mul' R' E ∘ₗ TensorProduct.comm R' E E)
```

Declaration: `Mathlib.Algebra.Star.LinearMap.intrinsicStar_mul'` (module Mathlib.Algebra.Star.LinearMap).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Order.Monoid.Unbundled.Pow).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function

## Surrounding context in Mathlib/Algebra/Order/Monoid/Unbundled/Pow.lean
```lean
-- Mathlib.Algebra.Order.Monoid.Unbundled.Pow.one_le_pow_of_le (L36-L41)
theorem one_le_pow_of_le (ha : 1 ≤ a) : ∀ n : ℕ, 1 ≤ a ^ n
  | 0 => by simp
  | k + 1 => by
    rw [pow_succ]
    exact one_le_mul (one_le_pow_of_le ha k) ha

-- Mathlib.Algebra.Order.Monoid.Unbundled.Pow.pow_le_one_of_le (L43-L44)
theorem pow_le_one_of_le (ha : a ≤ 1) (n : ℕ) : a ^ n ≤ 1

-- Mathlib.Algebra.Order.Monoid.Unbundled.Pow.pow_lt_one_of_lt (L46-L52)
theorem pow_lt_one_of_lt {a : M} {n : ℕ} (h : a < 1) (hn : n ≠ 0) : a ^ n < 1
```

```lean
theorem Monotone.pow_const {f : β → M} (hf : Monotone f) : ∀ n : ℕ, Monotone fun a => f a ^ n
  | 0 => by simpa using monotone_const
  | n + 1 => by
    simp_rw [pow_succ]
    exact (Monotone.pow_const hf _).mul' hf
```

Declaration: `Mathlib.Algebra.Order.Monoid.Unbundled.Pow.Monotone` (module Mathlib.Algebra.Order.Monoid.Unbundled.Pow).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Order.Monoid.Unbundled.Pow).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function

## Surrounding context in Mathlib/Algebra/Order/Monoid/Unbundled/Pow.lean
```lean
-- Mathlib.Algebra.Order.Monoid.Unbundled.Pow.one_le_pow_of_le (L36-L41)
theorem one_le_pow_of_le (ha : 1 ≤ a) : ∀ n : ℕ, 1 ≤ a ^ n
  | 0 => by simp
  | k + 1 => by
    rw [pow_succ]
    exact one_le_mul (one_le_pow_of_le ha k) ha

-- Mathlib.Algebra.Order.Monoid.Unbundled.Pow.pow_le_one_of_le (L43-L44)
theorem pow_le_one_of_le (ha : a ≤ 1) (n : ℕ) : a ^ n ≤ 1

-- Mathlib.Algebra.Order.Monoid.Unbundled.Pow.pow_lt_one_of_lt (L46-L52)
theorem pow_lt_one_of_lt {a : M} {n : ℕ} (h : a < 1) (hn : n ≠ 0) : a ^ n < 1
```

```lean
theorem Monotone.pow_const {f : β → M} (hf : Monotone f) : ∀ n : ℕ, Monotone fun a => f a ^ n
  | 0 => by simpa using monotone_const
  | n + 1 => by
    simp_rw [pow_succ]
    exact (Monotone.pow_const hf _).mul' hf
```

Declaration: `Mathlib.Algebra.Order.Monoid.Unbundled.Pow.Monotone` (module Mathlib.Algebra.Order.Monoid.Unbundled.Pow).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.List.Sublists).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Nat

## Surrounding context in Mathlib/Data/List/Sublists.lean
```lean
-- Mathlib.Data.List.Sublists.sublists'_nil (L37-L39)
theorem sublists'_nil : sublists' (@nil α) = [[]]

-- Mathlib.Data.List.Sublists.sublists'_singleton (L41-L44)
theorem sublists'_singleton (a : α) : sublists' [a] = [[], [a]]

-- Mathlib.Data.List.Sublists.sublists'Aux (L45-L47)
def sublists'Aux (a : α) (r₁ r₂ : List (List α)) : List (List α)
```

```lean
theorem sublists'_cons (a : α) (l : List α) :
    sublists' (a :: l) = sublists' l ++ map (cons a) (sublists' l)
```

Declaration: `Mathlib.Data.List.Sublists.sublists'_cons` (module Mathlib.Data.List.Sublists).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.List.Sublists).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Nat

## Surrounding context in Mathlib/Data/List/Sublists.lean
```lean
-- Mathlib.Data.List.Sublists.sublists'_nil (L37-L39)
theorem sublists'_nil : sublists' (@nil α) = [[]]

-- Mathlib.Data.List.Sublists.sublists'_singleton (L41-L44)
theorem sublists'_singleton (a : α) : sublists' [a] = [[], [a]]

-- Mathlib.Data.List.Sublists.sublists'Aux (L45-L47)
def sublists'Aux (a : α) (r₁ r₂ : List (List α)) : List (List α)
```

```lean
theorem sublists'_cons (a : α) (l : List α) :
    sublists' (a :: l) = sublists' l ++ map (cons a) (sublists' l)
```

Declaration: `Mathlib.Data.List.Sublists.sublists'_cons` (module Mathlib.Data.List.Sublists).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Real, Topology, NNReal, ENNReal, Filter, ComplexConjugate, Finset, Set

## Surrounding context in Mathlib/Analysis/SpecialFunctions/Pow/Asymptotics.lean
```lean
-- Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics.tendsto_rpow_atTop (L36-L41)
theorem tendsto_rpow_atTop {y : ℝ} (hy : 0 < y) : Tendsto (fun x : ℝ => x ^ y) atTop atTop

-- Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics.tendsto_rpow_neg_nhdsGT_zero (L42-L47)
theorem tendsto_rpow_neg_nhdsGT_zero {y : ℝ} (hr : y < 0) :
    Tendsto (fun (x : ℝ) ↦ x ^ y) (𝓝[>] 0) atTop

-- Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics.tendsto_rpow_neg_atTop (L48-L52)
theorem tendsto_rpow_neg_atTop {y : ℝ} (hy : 0 < y) : Tendsto (fun x : ℝ => x ^ (-y)) atTop (𝓝 0)
```

```lean
theorem IsBigO.rpow_rpow_nhdsGE_zero_of_le {a b : ℝ} (h : a ≤ b) (hb : b ≠ 0) :
    (· ^ b : ℝ → ℝ) =O[𝓝[≥] 0] (· ^ a)
```

Declaration: `Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics.IsBigO` (module Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Real, Topology, NNReal, ENNReal, Filter, ComplexConjugate, Finset, Set

## Surrounding context in Mathlib/Analysis/SpecialFunctions/Pow/Asymptotics.lean
```lean
-- Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics.tendsto_rpow_atTop (L36-L41)
theorem tendsto_rpow_atTop {y : ℝ} (hy : 0 < y) : Tendsto (fun x : ℝ => x ^ y) atTop atTop

-- Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics.tendsto_rpow_neg_nhdsGT_zero (L42-L47)
theorem tendsto_rpow_neg_nhdsGT_zero {y : ℝ} (hr : y < 0) :
    Tendsto (fun (x : ℝ) ↦ x ^ y) (𝓝[>] 0) atTop

-- Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics.tendsto_rpow_neg_atTop (L48-L52)
theorem tendsto_rpow_neg_atTop {y : ℝ} (hy : 0 < y) : Tendsto (fun x : ℝ => x ^ (-y)) atTop (𝓝 0)
```

```lean
theorem IsBigO.rpow_rpow_nhdsGE_zero_of_le {a b : ℝ} (h : a ≤ b) (hb : b ≠ 0) :
    (· ^ b : ℝ → ℝ) =O[𝓝[≥] 0] (· ^ a)
```

Declaration: `Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics.IsBigO` (module Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Group.Pi.Lemmas).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

```lean
theorem Pi.mulSingle_inf [∀ i, SemilatticeInf (f i)] [∀ i, One (f i)] (i : I) (x y : f i) :
    Pi.mulSingle i (x ⊓ y) = Pi.mulSingle i x ⊓ Pi.mulSingle i y
```

Declaration: `Mathlib.Algebra.Group.Pi.Lemmas.Pi` (module Mathlib.Algebra.Group.Pi.Lemmas).

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Group.Pi.Lemmas).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

```lean
theorem Pi.mulSingle_inf [∀ i, SemilatticeInf (f i)] [∀ i, One (f i)] (i : I) (x y : f i) :
    Pi.mulSingle i (x ⊓ y) = Pi.mulSingle i x ⊓ Pi.mulSingle i y
```

Declaration: `Mathlib.Algebra.Group.Pi.Lemmas.Pi` (module Mathlib.Algebra.Group.Pi.Lemmas).[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Order.Rearrangement).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Equiv, Equiv.Perm, Finset, Function, OrderDual

## Surrounding context in Mathlib/Algebra/Order/Rearrangement.lean
```lean
-- Mathlib.Algebra.Order.Rearrangement.MonovaryOn (L70-L115)
theorem MonovaryOn.sum_smul_comp_perm_le_sum_smul (hfg : MonovaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) : ∑ i ∈ s, f i • g (σ i) ≤ ∑ i ∈ s, f i • g i

-- Mathlib.Algebra.Order.Rearrangement.AntivaryOn (L116-L121)
theorem AntivaryOn.sum_smul_le_sum_smul_comp_perm (hfg : AntivaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) : ∑ i ∈ s, f i • g i ≤ ∑ i ∈ s, f i • g (σ i)

-- Mathlib.Algebra.Order.Rearrangement.MonovaryOn (L122-L129)
theorem MonovaryOn.sum_comp_perm_smul_le_sum_smul (hfg : MonovaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) : ∑ i ∈ s, f (σ i) • g i ≤ ∑ i ∈ s, f i • g i
```

```lean
theorem Antivary.sum_smul_le_sum_smul_comp_perm (hfg : Antivary f g) :
    ∑ i, f i • g i ≤ ∑ i, f i • g (σ i)
```

Declaration: `Mathlib.Algebra.Order.Rearrangement.Antivary` (module Mathlib.Algebra.Order.Rearrangement).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Order.Rearrangement).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Equiv, Equiv.Perm, Finset, Function, OrderDual

## Surrounding context in Mathlib/Algebra/Order/Rearrangement.lean
```lean
-- Mathlib.Algebra.Order.Rearrangement.MonovaryOn (L70-L115)
theorem MonovaryOn.sum_smul_comp_perm_le_sum_smul (hfg : MonovaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) : ∑ i ∈ s, f i • g (σ i) ≤ ∑ i ∈ s, f i • g i

-- Mathlib.Algebra.Order.Rearrangement.AntivaryOn (L116-L121)
theorem AntivaryOn.sum_smul_le_sum_smul_comp_perm (hfg : AntivaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) : ∑ i ∈ s, f i • g i ≤ ∑ i ∈ s, f i • g (σ i)

-- Mathlib.Algebra.Order.Rearrangement.MonovaryOn (L122-L129)
theorem MonovaryOn.sum_comp_perm_smul_le_sum_smul (hfg : MonovaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) : ∑ i ∈ s, f (σ i) • g i ≤ ∑ i ∈ s, f i • g i
```

```lean
theorem Antivary.sum_smul_le_sum_smul_comp_perm (hfg : Antivary f g) :
    ∑ i, f i • g i ≤ ∑ i, f i • g (σ i)
```

Declaration: `Mathlib.Algebra.Order.Rearrangement.Antivary` (module Mathlib.Algebra.Order.Rearrangement).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Algebra.InfiniteSum.Order).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Finset, Filter, Function

## Surrounding context in Mathlib/Topology/Algebra/InfiniteSum/Order.lean
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Order.hasProd_le_of_prod_le (L31-L34)
lemma hasProd_le_of_prod_le [ClosedIicTopology α] [L.NeBot]
    (hf : HasProd f a L) (h : ∀ s, ∏ i ∈ s, f i ≤ c) : a ≤ c

-- Mathlib.Topology.Algebra.InfiniteSum.Order.hasProd_le (L54-L57)
theorem hasProd_le (h : ∀ i, f i ≤ g i) (hf : HasProd f a₁ L) (hg : HasProd g a₂ L) [L.NeBot] :
    a₁ ≤ a₂

-- Mathlib.Topology.Algebra.InfiniteSum.Order.hasProd_mono (L59-L61)
theorem hasProd_mono (hf : HasProd f a₁ L) (hg : HasProd g a₂ L) (h : f ≤ g) [L.NeBot] : a₁ ≤ a₂
```

```lean
theorem le_hasProd_of_le_prod [ClosedIciTopology α] [L.NeBot]
    (hf : HasProd f a L) (h : ∀ s, c ≤ ∏ i ∈ s, f i) : c ≤ a
```

Declaration: `Mathlib.Topology.Algebra.InfiniteSum.Order.le_hasProd_of_le_prod` (module Mathlib.Topology.Algebra.InfiniteSum.Order).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Algebra.InfiniteSum.Order).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Finset, Filter, Function

## Surrounding context in Mathlib/Topology/Algebra/InfiniteSum/Order.lean
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Order.hasProd_le_of_prod_le (L31-L34)
lemma hasProd_le_of_prod_le [ClosedIicTopology α] [L.NeBot]
    (hf : HasProd f a L) (h : ∀ s, ∏ i ∈ s, f i ≤ c) : a ≤ c

-- Mathlib.Topology.Algebra.InfiniteSum.Order.hasProd_le (L54-L57)
theorem hasProd_le (h : ∀ i, f i ≤ g i) (hf : HasProd f a₁ L) (hg : HasProd g a₂ L) [L.NeBot] :
    a₁ ≤ a₂

-- Mathlib.Topology.Algebra.InfiniteSum.Order.hasProd_mono (L59-L61)
theorem hasProd_mono (hf : HasProd f a₁ L) (hg : HasProd g a₂ L) (h : f ≤ g) [L.NeBot] : a₁ ≤ a₂
```

```lean
theorem le_hasProd_of_le_prod [ClosedIciTopology α] [L.NeBot]
    (hf : HasProd f a L) (h : ∀ s, c ≤ ∏ i ∈ s, f i) : c ≤ a
```

Declaration: `Mathlib.Topology.Algebra.InfiniteSum.Order.le_hasProd_of_le_prod` (module Mathlib.Topology.Algebra.InfiniteSum.Order).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.Interval.Finset.Fin).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Finset, Function

## Surrounding context in Mathlib/Order/Interval/Finset/Fin.lean
```lean
-- Mathlib.Order.Interval.Finset.Fin.instLocallyFiniteOrder (L33-L42)
instance instLocallyFiniteOrder (n : ℕ) : LocallyFiniteOrder (Fin n) where
  finsetIcc a b

-- Mathlib.Order.Interval.Finset.Fin.instLocallyFiniteOrderBot (L43-L46)
instance instLocallyFiniteOrderBot : ∀ n, LocallyFiniteOrderBot (Fin n)
  | 0 => IsEmpty.toLocallyFiniteOrderBot
  | _ + 1 => inferInstance

-- Mathlib.Order.Interval.Finset.Fin.instLocallyFiniteOrderTop (L47-L53)
instance instLocallyFiniteOrderTop : ∀ n, LocallyFiniteOrderTop (Fin n)
  | 0 => IsEmpty.toLocallyFiniteOrderTop
  | _ + 1 => inferInstance

variable {n}
variable {m : ℕ} (a b : Fin n)
```

```lean
theorem attachFin_Iic : attachFin (Iic a) (fun _x hx ↦ (mem_Iic.mp hx).trans_lt a.2) = Iic a
```

Declaration: `Mathlib.Order.Interval.Finset.Fin.attachFin_Iic` (module Mathlib.Order.Interval.Finset.Fin).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.Interval.Finset.Fin).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Finset, Function

## Surrounding context in Mathlib/Order/Interval/Finset/Fin.lean
```lean
-- Mathlib.Order.Interval.Finset.Fin.instLocallyFiniteOrder (L33-L42)
instance instLocallyFiniteOrder (n : ℕ) : LocallyFiniteOrder (Fin n) where
  finsetIcc a b

-- Mathlib.Order.Interval.Finset.Fin.instLocallyFiniteOrderBot (L43-L46)
instance instLocallyFiniteOrderBot : ∀ n, LocallyFiniteOrderBot (Fin n)
  | 0 => IsEmpty.toLocallyFiniteOrderBot
  | _ + 1 => inferInstance

-- Mathlib.Order.Interval.Finset.Fin.instLocallyFiniteOrderTop (L47-L53)
instance instLocallyFiniteOrderTop : ∀ n, LocallyFiniteOrderTop (Fin n)
  | 0 => IsEmpty.toLocallyFiniteOrderTop
  | _ + 1 => inferInstance

variable {n}
variable {m : ℕ} (a b : Fin n)
```

```lean
theorem attachFin_Iic : attachFin (Iic a) (fun _x hx ↦ (mem_Iic.mp hx).trans_lt a.2) = Iic a
```

Declaration: `Mathlib.Order.Interval.Finset.Fin.attachFin_Iic` (module Mathlib.Order.Interval.Finset.Fin).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Algebra.ContinuousAffineEquiv).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function

## Surrounding context in Mathlib/Topology/Algebra/ContinuousAffineEquiv.lean
```lean
-- Mathlib.Topology.Algebra.ContinuousAffineEquiv.toHomeomorph (L65-L67)
def toHomeomorph (e : P₁ ≃ᴬ[k] P₂) : P₁ ≃ₜ P₂ where
  __

-- Mathlib.Topology.Algebra.ContinuousAffineEquiv.toAffineEquiv_injective (L68-L71)
theorem toAffineEquiv_injective : Injective (toAffineEquiv : (P₁ ≃ᴬ[k] P₂) → P₁ ≃ᵃ[k] P₂)

-- Mathlib.Topology.Algebra.ContinuousAffineEquiv.instEquivLike (L72-L78)
instance instEquivLike : EquivLike (P₁ ≃ᴬ[k] P₂) P₁ P₂ where
  coe f
```

```lean
theorem preimage_image (e : P₁ ≃ᴬ[k] P₂) (s : Set P₁) : e ⁻¹' (e '' s) = s
```

Declaration: `Mathlib.Topology.Algebra.ContinuousAffineEquiv.preimage_image` (module Mathlib.Topology.Algebra.ContinuousAffineEquiv).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Algebra.ContinuousAffineEquiv).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function

## Surrounding context in Mathlib/Topology/Algebra/ContinuousAffineEquiv.lean
```lean
-- Mathlib.Topology.Algebra.ContinuousAffineEquiv.toHomeomorph (L65-L67)
def toHomeomorph (e : P₁ ≃ᴬ[k] P₂) : P₁ ≃ₜ P₂ where
  __

-- Mathlib.Topology.Algebra.ContinuousAffineEquiv.toAffineEquiv_injective (L68-L71)
theorem toAffineEquiv_injective : Injective (toAffineEquiv : (P₁ ≃ᴬ[k] P₂) → P₁ ≃ᵃ[k] P₂)

-- Mathlib.Topology.Algebra.ContinuousAffineEquiv.instEquivLike (L72-L78)
instance instEquivLike : EquivLike (P₁ ≃ᴬ[k] P₂) P₁ P₂ where
  coe f
```

```lean
theorem preimage_image (e : P₁ ≃ᴬ[k] P₂) (s : Set P₁) : e ⁻¹' (e '' s) = s
```

Declaration: `Mathlib.Topology.Algebra.ContinuousAffineEquiv.preimage_image` (module Mathlib.Topology.Algebra.ContinuousAffineEquiv).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.Normed.Algebra.Spectrum).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: NormedSpace, Topology, --, For, `NormedSpace.exp`., scoped, ENNReal, NNReal

## Surrounding context in Mathlib/Analysis/Normed/Algebra/Spectrum.lean
```lean
-- Mathlib.Analysis.Normed.Algebra.Spectrum.SpectralRadius (L76-L79)
theorem SpectralRadius.of_subsingleton [Subsingleton A] (a : A) :
    spectralRadius 𝕜 a = 0

-- Mathlib.Analysis.Normed.Algebra.Spectrum.spectralRadius_zero (L81-L84)
theorem spectralRadius_zero : spectralRadius 𝕜 (0 : A) = 0

-- Mathlib.Analysis.Normed.Algebra.Spectrum.spectralRadius_one (L86-L89)
theorem spectralRadius_one [Nontrivial A] :
    spectralRadius 𝕜 (1 : A) = 1
```

```lean
theorem coe_le_norm_of_mem {a : A} {r : ℝ≥0} (hr : r ∈ spectrum ℝ≥0 a) :
    r ≤ ‖a‖
```

Declaration: `Mathlib.Analysis.Normed.Algebra.Spectrum.coe_le_norm_of_mem` (module Mathlib.Analysis.Normed.Algebra.Spectrum).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.Normed.Algebra.Spectrum).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: NormedSpace, Topology, --, For, `NormedSpace.exp`., scoped, ENNReal, NNReal

## Surrounding context in Mathlib/Analysis/Normed/Algebra/Spectrum.lean
```lean
-- Mathlib.Analysis.Normed.Algebra.Spectrum.SpectralRadius (L76-L79)
theorem SpectralRadius.of_subsingleton [Subsingleton A] (a : A) :
    spectralRadius 𝕜 a = 0

-- Mathlib.Analysis.Normed.Algebra.Spectrum.spectralRadius_zero (L81-L84)
theorem spectralRadius_zero : spectralRadius 𝕜 (0 : A) = 0

-- Mathlib.Analysis.Normed.Algebra.Spectrum.spectralRadius_one (L86-L89)
theorem spectralRadius_one [Nontrivial A] :
    spectralRadius 𝕜 (1 : A) = 1
```

```lean
theorem coe_le_norm_of_mem {a : A} {r : ℝ≥0} (hr : r ∈ spectrum ℝ≥0 a) :
    r ≤ ‖a‖
```

Declaration: `Mathlib.Analysis.Normed.Algebra.Spectrum.coe_le_norm_of_mem` (module Mathlib.Analysis.Normed.Algebra.Spectrum).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Lie.Basic).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function

## Surrounding context in Mathlib/Algebra/Lie/Basic.lean
```lean
-- Mathlib.Algebra.Lie.Basic.leibniz_lie (L117-L119)
lemma leibniz_lie [Add M] [IsLieTower L₁ L₂ M] (x : L₁) (y : L₂) (m : M) :
    ⁅x, ⁅y, m⁆⁆ = ⁅⁅x, y⁆, m⁆ + ⁅y, ⁅x, m⁆⁆

-- Mathlib.Algebra.Lie.Basic.lie_swap_lie (L120-L129)
lemma lie_swap_lie [Bracket L₂ L₁] [AddCommGroup M] [IsLieTower L₁ L₂ M] [IsLieTower L₂ L₁ M]
    (x : L₁) (y : L₂) (m : M) : ⁅⁅x, y⁆, m⁆ = -⁅⁅y, x⁆, m⁆

-- Mathlib.Algebra.Lie.Basic.LieAlgebra (L130-L134)
theorem LieAlgebra.toModule_injective (L : Type*) [LieRing L] :
    Function.Injective (@LieAlgebra.toModule _ _ _ _ : LieAlgebra ℚ L → Module ℚ L)
```

```lean
theorem symm_bijective :
    Function.Bijective (LieModuleEquiv.symm : (M ≃ₗ⁅R,L⁆ N) → N ≃ₗ⁅R,L⁆ M)
```

Declaration: `Mathlib.Algebra.Lie.Basic.symm_bijective` (module Mathlib.Algebra.Lie.Basic).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Lie.Basic).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function

## Surrounding context in Mathlib/Algebra/Lie/Basic.lean
```lean
-- Mathlib.Algebra.Lie.Basic.leibniz_lie (L117-L119)
lemma leibniz_lie [Add M] [IsLieTower L₁ L₂ M] (x : L₁) (y : L₂) (m : M) :
    ⁅x, ⁅y, m⁆⁆ = ⁅⁅x, y⁆, m⁆ + ⁅y, ⁅x, m⁆⁆

-- Mathlib.Algebra.Lie.Basic.lie_swap_lie (L120-L129)
lemma lie_swap_lie [Bracket L₂ L₁] [AddCommGroup M] [IsLieTower L₁ L₂ M] [IsLieTower L₂ L₁ M]
    (x : L₁) (y : L₂) (m : M) : ⁅⁅x, y⁆, m⁆ = -⁅⁅y, x⁆, m⁆

-- Mathlib.Algebra.Lie.Basic.LieAlgebra (L130-L134)
theorem LieAlgebra.toModule_injective (L : Type*) [LieRing L] :
    Function.Injective (@LieAlgebra.toModule _ _ _ _ : LieAlgebra ℚ L → Module ℚ L)
```

```lean
theorem symm_bijective :
    Function.Bijective (LieModuleEquiv.symm : (M ≃ₗ⁅R,L⁆ N) → N ≃ₗ⁅R,L⁆ M)
```

Declaration: `Mathlib.Algebra.Lie.Basic.symm_bijective` (module Mathlib.Algebra.Lie.Basic).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Category.TopCommRingCat).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: CategoryTheory, Lean.PrettyPrinter.Delaborator

## Surrounding context in Mathlib/Topology/Category/TopCommRingCat.lean
```lean
-- Mathlib.Topology.Category.TopCommRingCat.hasForgetToCommRingCat (L80-L83)
instance hasForgetToCommRingCat : HasForget₂ TopCommRingCat CommRingCat

-- Mathlib.Topology.Category.TopCommRingCat.forgetToCommRingCatTopologicalSpace (L84-L88)
instance forgetToCommRingCatTopologicalSpace (R : TopCommRingCat) :
    TopologicalSpace ((forget₂ TopCommRingCat CommRingCat).obj R)

-- Mathlib.Topology.Category.TopCommRingCat.hasForgetToTopCat (L89-L91)
instance hasForgetToTopCat : HasForget₂ TopCommRingCat TopCat
```

```lean
theorem coe_of (X : Type u) [CommRing X] [TopologicalSpace X] [IsTopologicalRing X] :
    (of X : Type u) = X
```

Declaration: `Mathlib.Topology.Category.TopCommRingCat.coe_of` (module Mathlib.Topology.Category.TopCommRingCat).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Category.TopCommRingCat).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: CategoryTheory, Lean.PrettyPrinter.Delaborator

## Surrounding context in Mathlib/Topology/Category/TopCommRingCat.lean
```lean
-- Mathlib.Topology.Category.TopCommRingCat.hasForgetToCommRingCat (L80-L83)
instance hasForgetToCommRingCat : HasForget₂ TopCommRingCat CommRingCat

-- Mathlib.Topology.Category.TopCommRingCat.forgetToCommRingCatTopologicalSpace (L84-L88)
instance forgetToCommRingCatTopologicalSpace (R : TopCommRingCat) :
    TopologicalSpace ((forget₂ TopCommRingCat CommRingCat).obj R)

-- Mathlib.Topology.Category.TopCommRingCat.hasForgetToTopCat (L89-L91)
instance hasForgetToTopCat : HasForget₂ TopCommRingCat TopCat
```

```lean
theorem coe_of (X : Type u) [CommRing X] [TopologicalSpace X] [IsTopologicalRing X] :
    (of X : Type u) = X
```

Declaration: `Mathlib.Topology.Category.TopCommRingCat.coe_of` (module Mathlib.Topology.Category.TopCommRingCat).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.ConditionallyCompleteLattice.Indexed).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function, OrderDual, Set

## Surrounding context in Mathlib/Order/ConditionallyCompleteLattice/Indexed.lean
```lean
-- Mathlib.Order.ConditionallyCompleteLattice.Indexed.WithTop (L37-L39)
theorem WithTop.iInf_empty [IsEmpty ι] [InfSet α] (f : ι → WithTop α) :
    ⨅ i, f i = ⊤

-- Mathlib.Order.ConditionallyCompleteLattice.Indexed.WithTop (L41-L44)
theorem WithTop.coe_iInf [Nonempty ι] [InfSet α] {f : ι → α} (hf : BddBelow (range f)) :
    ↑(⨅ i, f i) = (⨅ i, f i : WithTop α)

-- Mathlib.Order.ConditionallyCompleteLattice.Indexed.WithTop (L46-L49)
theorem WithTop.coe_iSup [SupSet α] (f : ι → α) (h : BddAbove (Set.range f)) :
    ↑(⨆ i, f i) = (⨆ i, f i : WithTop α)
```

Relevant lemmas available in scope: `gc.l_ciSup`

```lean
theorem l_ciSup_set (gc : GaloisConnection l u) {s : Set γ} {f : γ → α} (hf : BddAbove (f '' s))
    (hne : s.Nonempty) : l (⨆ i : s, f i) = ⨆ i : s, l (f i)
```

Declaration: `Mathlib.Order.ConditionallyCompleteLattice.Indexed.l_ciSup_set` (module Mathlib.Order.ConditionallyCompleteLattice.Indexed).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.ConditionallyCompleteLattice.Indexed).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function, OrderDual, Set

## Surrounding context in Mathlib/Order/ConditionallyCompleteLattice/Indexed.lean
```lean
-- Mathlib.Order.ConditionallyCompleteLattice.Indexed.WithTop (L37-L39)
theorem WithTop.iInf_empty [IsEmpty ι] [InfSet α] (f : ι → WithTop α) :
    ⨅ i, f i = ⊤

-- Mathlib.Order.ConditionallyCompleteLattice.Indexed.WithTop (L41-L44)
theorem WithTop.coe_iInf [Nonempty ι] [InfSet α] {f : ι → α} (hf : BddBelow (range f)) :
    ↑(⨅ i, f i) = (⨅ i, f i : WithTop α)

-- Mathlib.Order.ConditionallyCompleteLattice.Indexed.WithTop (L46-L49)
theorem WithTop.coe_iSup [SupSet α] (f : ι → α) (h : BddAbove (Set.range f)) :
    ↑(⨆ i, f i) = (⨆ i, f i : WithTop α)
```

Relevant lemmas available in scope: `gc.l_ciSup`

```lean
theorem l_ciSup_set (gc : GaloisConnection l u) {s : Set γ} {f : γ → α} (hf : BddAbove (f '' s))
    (hne : s.Nonempty) : l (⨆ i : s, f i) = ⨆ i : s, l (f i)
```

Declaration: `Mathlib.Order.ConditionallyCompleteLattice.Indexed.l_ciSup_set` (module Mathlib.Order.ConditionallyCompleteLattice.Indexed).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.Interval.Finset.Fin).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Finset, Function

## Surrounding context in Mathlib/Order/Interval/Finset/Fin.lean
```lean
-- Mathlib.Order.Interval.Finset.Fin.instLocallyFiniteOrder (L33-L42)
instance instLocallyFiniteOrder (n : ℕ) : LocallyFiniteOrder (Fin n) where
  finsetIcc a b

-- Mathlib.Order.Interval.Finset.Fin.instLocallyFiniteOrderBot (L43-L46)
instance instLocallyFiniteOrderBot : ∀ n, LocallyFiniteOrderBot (Fin n)
  | 0 => IsEmpty.toLocallyFiniteOrderBot
  | _ + 1 => inferInstance

-- Mathlib.Order.Interval.Finset.Fin.instLocallyFiniteOrderTop (L47-L53)
instance instLocallyFiniteOrderTop : ∀ n, LocallyFiniteOrderTop (Fin n)
  | 0 => IsEmpty.toLocallyFiniteOrderTop
  | _ + 1 => inferInstance

variable {n}
variable {m : ℕ} (a b : Fin n)
```

```lean
theorem finsetImage_castLE_Icc (h : n ≤ m) :
    (Icc a b).image (castLE h) = Icc (castLE h a) (castLE h b)
```

Declaration: `Mathlib.Order.Interval.Finset.Fin.finsetImage_castLE_Icc` (module Mathlib.Order.Interval.Finset.Fin).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.Interval.Finset.Fin).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Finset, Function

## Surrounding context in Mathlib/Order/Interval/Finset/Fin.lean
```lean
-- Mathlib.Order.Interval.Finset.Fin.instLocallyFiniteOrder (L33-L42)
instance instLocallyFiniteOrder (n : ℕ) : LocallyFiniteOrder (Fin n) where
  finsetIcc a b

-- Mathlib.Order.Interval.Finset.Fin.instLocallyFiniteOrderBot (L43-L46)
instance instLocallyFiniteOrderBot : ∀ n, LocallyFiniteOrderBot (Fin n)
  | 0 => IsEmpty.toLocallyFiniteOrderBot
  | _ + 1 => inferInstance

-- Mathlib.Order.Interval.Finset.Fin.instLocallyFiniteOrderTop (L47-L53)
instance instLocallyFiniteOrderTop : ∀ n, LocallyFiniteOrderTop (Fin n)
  | 0 => IsEmpty.toLocallyFiniteOrderTop
  | _ + 1 => inferInstance

variable {n}
variable {m : ℕ} (a b : Fin n)
```

```lean
theorem finsetImage_castLE_Icc (h : n ≤ m) :
    (Icc a b).image (castLE h) = Icc (castLE h a) (castLE h b)
```

Declaration: `Mathlib.Order.Interval.Finset.Fin.finsetImage_castLE_Icc` (module Mathlib.Order.Interval.Finset.Fin).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.GroupTheory.Perm.Support).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Equiv, Finset, Function, scoped, List, in

## Surrounding context in Mathlib/GroupTheory/Perm/Support.lean
```lean
-- Mathlib.GroupTheory.Perm.Support.Disjoint (L46-L50)
def Disjoint (f g : Perm α)

-- Mathlib.GroupTheory.Perm.Support.Disjoint (L52-L53)
theorem Disjoint.symm : Disjoint f g → Disjoint g f

-- Mathlib.GroupTheory.Perm.Support.Disjoint (L54-L55)
theorem Disjoint.symmetric : Symmetric (@Disjoint α)
```

```lean
theorem disjoint_iff_disjoint_support : Disjoint f g ↔ _root_.Disjoint f.support g.support
```

Declaration: `Mathlib.GroupTheory.Perm.Support.disjoint_iff_disjoint_support` (module Mathlib.GroupTheory.Perm.Support).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.GroupTheory.Perm.Support).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Equiv, Finset, Function, scoped, List, in

## Surrounding context in Mathlib/GroupTheory/Perm/Support.lean
```lean
-- Mathlib.GroupTheory.Perm.Support.Disjoint (L46-L50)
def Disjoint (f g : Perm α)

-- Mathlib.GroupTheory.Perm.Support.Disjoint (L52-L53)
theorem Disjoint.symm : Disjoint f g → Disjoint g f

-- Mathlib.GroupTheory.Perm.Support.Disjoint (L54-L55)
theorem Disjoint.symmetric : Symmetric (@Disjoint α)
```

```lean
theorem disjoint_iff_disjoint_support : Disjoint f g ↔ _root_.Disjoint f.support g.support
```

Declaration: `Mathlib.GroupTheory.Perm.Support.disjoint_iff_disjoint_support` (module Mathlib.GroupTheory.Perm.Support).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.RootSystem.Base).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function, Set, Submodule, FaithfulSMul, (algebraMap_injective), Module, End, (invtSubmodule

## Surrounding context in Mathlib/LinearAlgebra/RootSystem/Base.lean
```lean
-- Mathlib.LinearAlgebra.RootSystem.Base.support_nonempty (L86-L91)
lemma support_nonempty [Nonempty ι] [NeZero (2 : R)] : b.support.Nonempty

-- Mathlib.LinearAlgebra.RootSystem.Base.root_ne_neg_of_ne (L101-L109)
lemma root_ne_neg_of_ne [Nontrivial R] {i j : ι}
    (hi : i ∈ b.support) (hj : j ∈ b.support) (hij : i ≠ j) :
    P.root i ≠ -P.root j

-- Mathlib.LinearAlgebra.RootSystem.Base.linearIndependent_pair_of_ne (L110-L115)
lemma linearIndependent_pair_of_ne {i j : b.support} (hij : i ≠ j) :
    LinearIndependent R ![P.root i, P.root j]
```

```lean
lemma coroot_mem_span_int (i : ι) :
    P.coroot i ∈ span ℤ (P.coroot '' b.support)
```

Declaration: `Mathlib.LinearAlgebra.RootSystem.Base.coroot_mem_span_int` (module Mathlib.LinearAlgebra.RootSystem.Base).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.RootSystem.Base).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function, Set, Submodule, FaithfulSMul, (algebraMap_injective), Module, End, (invtSubmodule

## Surrounding context in Mathlib/LinearAlgebra/RootSystem/Base.lean
```lean
-- Mathlib.LinearAlgebra.RootSystem.Base.support_nonempty (L86-L91)
lemma support_nonempty [Nonempty ι] [NeZero (2 : R)] : b.support.Nonempty

-- Mathlib.LinearAlgebra.RootSystem.Base.root_ne_neg_of_ne (L101-L109)
lemma root_ne_neg_of_ne [Nontrivial R] {i j : ι}
    (hi : i ∈ b.support) (hj : j ∈ b.support) (hij : i ≠ j) :
    P.root i ≠ -P.root j

-- Mathlib.LinearAlgebra.RootSystem.Base.linearIndependent_pair_of_ne (L110-L115)
lemma linearIndependent_pair_of_ne {i j : b.support} (hij : i ≠ j) :
    LinearIndependent R ![P.root i, P.root j]
```

```lean
lemma coroot_mem_span_int (i : ι) :
    P.coroot i ∈ span ℤ (P.coroot '' b.support)
```

Declaration: `Mathlib.LinearAlgebra.RootSystem.Base.coroot_mem_span_int` (module Mathlib.LinearAlgebra.RootSystem.Base).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.Matrix.Defs).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Matrix

## Surrounding context in Mathlib/LinearAlgebra/Matrix/Defs.lean
```lean
-- Mathlib.LinearAlgebra.Matrix.Defs.Matrix (L53-L64)
def Matrix (m : Type u) (n : Type u') (α : Type v) : Type max u u' v

-- Mathlib.LinearAlgebra.Matrix.Defs.ext_iff (L65-L67)
theorem ext_iff : (∀ i j, M i j = N i j) ↔ M = N

-- Mathlib.LinearAlgebra.Matrix.Defs.ext (L69-L83)
theorem ext : (∀ i j, M i j = N i j) → M = N
```

```lean
abbrev subDownRight {d u l r : Nat} (A : Matrix (Fin (u + d)) (Fin (l + r)) α) :
    Matrix (Fin d) (Fin r) α
```

Declaration: `Mathlib.LinearAlgebra.Matrix.Defs.subDownRight` (module Mathlib.LinearAlgebra.Matrix.Defs).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.Matrix.Defs).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Matrix

## Surrounding context in Mathlib/LinearAlgebra/Matrix/Defs.lean
```lean
-- Mathlib.LinearAlgebra.Matrix.Defs.Matrix (L53-L64)
def Matrix (m : Type u) (n : Type u') (α : Type v) : Type max u u' v

-- Mathlib.LinearAlgebra.Matrix.Defs.ext_iff (L65-L67)
theorem ext_iff : (∀ i j, M i j = N i j) ↔ M = N

-- Mathlib.LinearAlgebra.Matrix.Defs.ext (L69-L83)
theorem ext : (∀ i j, M i j = N i j) → M = N
```

```lean
abbrev subDownRight {d u l r : Nat} (A : Matrix (Fin (u + d)) (Fin (l + r)) α) :
    Matrix (Fin d) (Fin r) α
```

Declaration: `Mathlib.LinearAlgebra.Matrix.Defs.subDownRight` (module Mathlib.LinearAlgebra.Matrix.Defs).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.GroupTheory.FreeGroup.IsFreeGroup).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function, Set

## Surrounding context in Mathlib/GroupTheory/FreeGroup/IsFreeGroup.lean
```lean
-- Mathlib.GroupTheory.FreeGroup.IsFreeGroup.instFunLike (L73-L81)
instance instFunLike : FunLike (FreeGroupBasis ι G) ι G where
  coe b

-- Mathlib.GroupTheory.FreeGroup.IsFreeGroup.ofFreeGroup (L87-L88)
def ofFreeGroup (X : Type*) : FreeGroupBasis X (FreeGroup X)

-- Mathlib.GroupTheory.FreeGroup.IsFreeGroup.isFreeGroup (L111-L113)
lemma isFreeGroup (b : FreeGroupBasis ι G) : IsFreeGroup G
```

```lean
def lift (b : FreeGroupBasis ι G) : (ι → H) ≃ (G →* H)
```

Declaration: `Mathlib.GroupTheory.FreeGroup.IsFreeGroup.lift` (module Mathlib.GroupTheory.FreeGroup.IsFreeGroup).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.GroupTheory.FreeGroup.IsFreeGroup).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function, Set

## Surrounding context in Mathlib/GroupTheory/FreeGroup/IsFreeGroup.lean
```lean
-- Mathlib.GroupTheory.FreeGroup.IsFreeGroup.instFunLike (L73-L81)
instance instFunLike : FunLike (FreeGroupBasis ι G) ι G where
  coe b

-- Mathlib.GroupTheory.FreeGroup.IsFreeGroup.ofFreeGroup (L87-L88)
def ofFreeGroup (X : Type*) : FreeGroupBasis X (FreeGroup X)

-- Mathlib.GroupTheory.FreeGroup.IsFreeGroup.isFreeGroup (L111-L113)
lemma isFreeGroup (b : FreeGroupBasis ι G) : IsFreeGroup G
```

```lean
def lift (b : FreeGroupBasis ι G) : (ι → H) ≃ (G →* H)
```

Declaration: `Mathlib.GroupTheory.FreeGroup.IsFreeGroup.lift` (module Mathlib.GroupTheory.FreeGroup.IsFreeGroup).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.BigOperators.Group.List.Basic).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: scoped, Relator, in

## Surrounding context in Mathlib/Algebra/BigOperators/Group/List/Basic.lean
```lean
-- Mathlib.Algebra.BigOperators.Group.List.Basic.rel_prod (L41-L44)
theorem rel_prod {R : M → N → Prop} (h : R 1 1) (hf : (R ⇒ R ⇒ R) (· * ·) (· * ·)) :
    (Forall₂ R ⇒ R) prod prod

-- Mathlib.Algebra.BigOperators.Group.List.Basic.prod_hom_nonempty (L46-L49)
theorem prod_hom_nonempty {l : List M} {F : Type*} [FunLike F M N] [MulHomClass F M N] (f : F)
    (hl : l ≠ []) : (l.map f).prod = f l.prod

-- Mathlib.Algebra.BigOperators.Group.List.Basic.prod_hom (L51-L55)
theorem prod_hom (l : List M) {F : Type*} [FunLike F M N] [MonoidHomClass F M N] (f : F) :
    (l.map f).prod = f l.prod
```

```lean
theorem headI_mul_tail_prod_of_ne_nil [Inhabited M] (l : List M) (h : l ≠ []) :
    l.headI * l.tail.prod = l.prod
```

Declaration: `Mathlib.Algebra.BigOperators.Group.List.Basic.headI_mul_tail_prod_of_ne_nil` (module Mathlib.Algebra.BigOperators.Group.List.Basic).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.BigOperators.Group.List.Basic).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: scoped, Relator, in

## Surrounding context in Mathlib/Algebra/BigOperators/Group/List/Basic.lean
```lean
-- Mathlib.Algebra.BigOperators.Group.List.Basic.rel_prod (L41-L44)
theorem rel_prod {R : M → N → Prop} (h : R 1 1) (hf : (R ⇒ R ⇒ R) (· * ·) (· * ·)) :
    (Forall₂ R ⇒ R) prod prod

-- Mathlib.Algebra.BigOperators.Group.List.Basic.prod_hom_nonempty (L46-L49)
theorem prod_hom_nonempty {l : List M} {F : Type*} [FunLike F M N] [MulHomClass F M N] (f : F)
    (hl : l ≠ []) : (l.map f).prod = f l.prod

-- Mathlib.Algebra.BigOperators.Group.List.Basic.prod_hom (L51-L55)
theorem prod_hom (l : List M) {F : Type*} [FunLike F M N] [MonoidHomClass F M N] (f : F) :
    (l.map f).prod = f l.prod
```

```lean
theorem headI_mul_tail_prod_of_ne_nil [Inhabited M] (l : List M) (h : l ≠ []) :
    l.headI * l.tail.prod = l.prod
```

Declaration: `Mathlib.Algebra.BigOperators.Group.List.Basic.headI_mul_tail_prod_of_ne_nil` (module Mathlib.Algebra.BigOperators.Group.List.Basic).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.GroupTheory.Sylow).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: MulAction, Subgroup, Pointwise

## Surrounding context in Mathlib/GroupTheory/Sylow.lean
```lean
-- Mathlib.GroupTheory.Sylow.ext (L67-L68)
theorem ext {P Q : Sylow p G} (h : (P : Subgroup G) = Q) : P = Q

-- Mathlib.GroupTheory.Sylow.ofCard (L104-L109)
def ofCard [Finite G] {p : ℕ} [Fact p.Prime] (H : Subgroup G)
    (card_eq : Nat.card H = p ^ (Nat.card G).factorization p) : Sylow p G

-- Mathlib.GroupTheory.Sylow.coe_ofCard (L111-L119)
theorem coe_ofCard [Finite G] {p : ℕ} [Fact p.Prime] (H : Subgroup G)
    (card_eq : Nat.card H = p ^ (Nat.card G).factorization p) : ofCard H card_eq = H
```

Relevant lemmas available in scope: `P.equivSMul`

```lean
theorem not_dvd_card_sylow [hp : Fact p.Prime] [Finite (Sylow p G)] : ¬p ∣ Nat.card (Sylow p G)
```

Declaration: `Mathlib.GroupTheory.Sylow.not_dvd_card_sylow` (module Mathlib.GroupTheory.Sylow).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.GroupTheory.Sylow).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: MulAction, Subgroup, Pointwise

## Surrounding context in Mathlib/GroupTheory/Sylow.lean
```lean
-- Mathlib.GroupTheory.Sylow.ext (L67-L68)
theorem ext {P Q : Sylow p G} (h : (P : Subgroup G) = Q) : P = Q

-- Mathlib.GroupTheory.Sylow.ofCard (L104-L109)
def ofCard [Finite G] {p : ℕ} [Fact p.Prime] (H : Subgroup G)
    (card_eq : Nat.card H = p ^ (Nat.card G).factorization p) : Sylow p G

-- Mathlib.GroupTheory.Sylow.coe_ofCard (L111-L119)
theorem coe_ofCard [Finite G] {p : ℕ} [Fact p.Prime] (H : Subgroup G)
    (card_eq : Nat.card H = p ^ (Nat.card G).factorization p) : ofCard H card_eq = H
```

Relevant lemmas available in scope: `P.equivSMul`

```lean
theorem not_dvd_card_sylow [hp : Fact p.Prime] [Finite (Sylow p G)] : ¬p ∣ Nat.card (Sylow p G)
```

Declaration: `Mathlib.GroupTheory.Sylow.not_dvd_card_sylow` (module Mathlib.GroupTheory.Sylow).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Ring.Subsemiring.Basic).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

```lean
theorem mem_centralizer_iff {R} [Semiring R] {s : Set R} {z : R} :
    z ∈ centralizer s ↔ ∀ g ∈ s, g * z = z * g
```

Declaration: `Mathlib.Algebra.Ring.Subsemiring.Basic.mem_centralizer_iff` (module Mathlib.Algebra.Ring.Subsemiring.Basic).

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Ring.Subsemiring.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

```lean
theorem mem_centralizer_iff {R} [Semiring R] {s : Set R} {z : R} :
    z ∈ centralizer s ↔ ∀ g ∈ s, g * z = z * g
```

Declaration: `Mathlib.Algebra.Ring.Subsemiring.Basic.mem_centralizer_iff` (module Mathlib.Algebra.Ring.Subsemiring.Basic).[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Set.Prod).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function, Set, Function.Pullback, in, Function.PullbackSelf

## Surrounding context in Mathlib/Data/Set/Prod.lean
```lean
-- Mathlib.Data.Set.Prod.Subsingleton (L43-L46)
theorem Subsingleton.prod (hs : s.Subsingleton) (ht : t.Subsingleton) :
    (s ×ˢ t).Subsingleton

-- Mathlib.Data.Set.Prod.decidableMemProd (L47-L49)
instance decidableMemProd [DecidablePred (· ∈ s)] [DecidablePred (· ∈ t)] :
    DecidablePred (· ∈ s ×ˢ t)

-- Mathlib.Data.Set.Prod.prod_mono (L51-L53)
theorem prod_mono (hs : s₁ ⊆ s₂) (ht : t₁ ⊆ t₂) : s₁ ×ˢ t₁ ⊆ s₂ ×ˢ t₂
```

Relevant lemmas available in scope: `fun`

```lean
theorem pi_update_of_notMem [DecidableEq ι] (hi : i ∉ s) (f : ∀ j, α j) (a : α i)
    (t : ∀ j, α j → Set (β j)) : (s.pi fun j => t j (update f i a j)) = s.pi fun j => t j (f j)
```

Declaration: `Mathlib.Data.Set.Prod.pi_update_of_notMem` (module Mathlib.Data.Set.Prod).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Set.Prod).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function, Set, Function.Pullback, in, Function.PullbackSelf

## Surrounding context in Mathlib/Data/Set/Prod.lean
```lean
-- Mathlib.Data.Set.Prod.Subsingleton (L43-L46)
theorem Subsingleton.prod (hs : s.Subsingleton) (ht : t.Subsingleton) :
    (s ×ˢ t).Subsingleton

-- Mathlib.Data.Set.Prod.decidableMemProd (L47-L49)
instance decidableMemProd [DecidablePred (· ∈ s)] [DecidablePred (· ∈ t)] :
    DecidablePred (· ∈ s ×ˢ t)

-- Mathlib.Data.Set.Prod.prod_mono (L51-L53)
theorem prod_mono (hs : s₁ ⊆ s₂) (ht : t₁ ⊆ t₂) : s₁ ×ˢ t₁ ⊆ s₂ ×ˢ t₂
```

Relevant lemmas available in scope: `fun`

```lean
theorem pi_update_of_notMem [DecidableEq ι] (hi : i ∉ s) (f : ∀ j, α j) (a : α i)
    (t : ∀ j, α j → Set (β j)) : (s.pi fun j => t j (update f i a j)) = s.pi fun j => t j (f j)
```

Declaration: `Mathlib.Data.Set.Prod.pi_update_of_notMem` (module Mathlib.Data.Set.Prod).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Set.Basic).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function

## Surrounding context in Mathlib/Data/Set/Basic.lean
```lean
-- Mathlib.Data.Set.Basic.instDistribLattice (L76-L82)
instance instDistribLattice : DistribLattice (Set α) where
  __ : DistribLattice (α → Prop)

-- Mathlib.Data.Set.Basic.instBoundedOrder (L83-L87)
instance instBoundedOrder : BoundedOrder (Set α) where
  __ : BoundedOrder (α → Prop)

-- Mathlib.Data.Set.Basic.top_eq_univ (L92-L94)
theorem top_eq_univ : (⊤ : Set α) = univ
```

```lean
theorem lt_iff_ssubset : s < t ↔ s ⊂ t
```

Declaration: `Mathlib.Data.Set.Basic.lt_iff_ssubset` (module Mathlib.Data.Set.Basic).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Set.Basic).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: Function

## Surrounding context in Mathlib/Data/Set/Basic.lean
```lean
-- Mathlib.Data.Set.Basic.instDistribLattice (L76-L82)
instance instDistribLattice : DistribLattice (Set α) where
  __ : DistribLattice (α → Prop)

-- Mathlib.Data.Set.Basic.instBoundedOrder (L83-L87)
instance instBoundedOrder : BoundedOrder (Set α) where
  __ : BoundedOrder (α → Prop)

-- Mathlib.Data.Set.Basic.top_eq_univ (L92-L94)
theorem top_eq_univ : (⊤ : Set α) = univ
```

```lean
theorem lt_iff_ssubset : s < t ↔ s ⊂ t
```

Declaration: `Mathlib.Data.Set.Basic.lt_iff_ssubset` (module Mathlib.Data.Set.Basic).


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.Calculus.Deriv.Mul).

[User]
Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: scoped, Topology, Filter, ENNReal, Asymptotics, Set, ContinuousLinearMap, (smulRight

## Surrounding context in Mathlib/Analysis/Calculus/Deriv/Mul.lean
```lean
-- Mathlib.Analysis.Calculus.Deriv.Mul.hasDerivWithinAt_of_bilinear (L54-L59)
theorem hasDerivWithinAt_of_bilinear
    (hu : HasDerivWithinAt u u' s x) (hv : HasDerivWithinAt v v' s x) :
    HasDerivWithinAt (fun x ↦ B (u x) (v x)) (B (u x) v' + B u' (v x)) s x

-- Mathlib.Analysis.Calculus.Deriv.Mul.hasDerivAt_of_bilinear (L60-L76)
theorem hasDerivAt_of_bilinear (hu : x ∈ tsupport v → HasDerivAt u u' x)
    (hv : x ∈ tsupport u → HasDerivAt v v' x) :
    HasDerivAt (fun x ↦ B (u x) (v x)) (B (u x) v' + B u' (v x)) x

-- Mathlib.Analysis.Calculus.Deriv.Mul.hasStrictDerivAt_of_bilinear (L77-L81)
theorem hasStrictDerivAt_of_bilinear (hu : HasStrictDerivAt u u' x) (hv : HasStrictDerivAt v v' x) :
    HasStrictDerivAt (fun x ↦ B (u x) (v x)) (B (u x) v' + B u' (v x)) x
```

```lean
theorem deriv_div_const (d : 𝕜') : deriv (fun x => c x / d) x = deriv c x / d
```

Declaration: `Mathlib.Analysis.Calculus.Deriv.Mul.deriv_div_const` (module Mathlib.Analysis.Calculus.Deriv.Mul).

You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.Calculus.Deriv.Mul).

Explain the Lean statement below in plain mathematical language, then formalize a short related example in Lean 4.

Open namespaces: scoped, Topology, Filter, ENNReal, Asymptotics, Set, ContinuousLinearMap, (smulRight

## Surrounding context in Mathlib/Analysis/Calculus/Deriv/Mul.lean
```lean
-- Mathlib.Analysis.Calculus.Deriv.Mul.hasDerivWithinAt_of_bilinear (L54-L59)
theorem hasDerivWithinAt_of_bilinear
    (hu : HasDerivWithinAt u u' s x) (hv : HasDerivWithinAt v v' s x) :
    HasDerivWithinAt (fun x ↦ B (u x) (v x)) (B (u x) v' + B u' (v x)) s x

-- Mathlib.Analysis.Calculus.Deriv.Mul.hasDerivAt_of_bilinear (L60-L76)
theorem hasDerivAt_of_bilinear (hu : x ∈ tsupport v → HasDerivAt u u' x)
    (hv : x ∈ tsupport u → HasDerivAt v v' x) :
    HasDerivAt (fun x ↦ B (u x) (v x)) (B (u x) v' + B u' (v x)) x

-- Mathlib.Analysis.Calculus.Deriv.Mul.hasStrictDerivAt_of_bilinear (L77-L81)
theorem hasStrictDerivAt_of_bilinear (hu : HasStrictDerivAt u u' x) (hv : HasStrictDerivAt v v' x) :
    HasStrictDerivAt (fun x ↦ B (u x) (v x)) (B (u x) v' + B u' (v x)) x
```

```lean
theorem deriv_div_const (d : 𝕜') : deriv (fun x => c x / d) x = deriv c x / d
```

Declaration: `Mathlib.Analysis.Calculus.Deriv.Mul.deriv_div_const` (module Mathlib.Analysis.Calculus.Deriv.Mul).