[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.Concept).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem extent_ssubset_extent_iff : c.extent ⊂ d.extent ↔ c < d
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Order.Concept.upperPolar (L48-L52)
def upperPolar (s : Set α) : Set β
```

-- snippet 2
```lean
-- Mathlib.Order.Concept.lowerPolar (L53-L55)
def lowerPolar (t : Set β) : Set α
```

-- snippet 3
```lean
-- Mathlib.Order.Concept.mem_upperPolar_iff (L61-L61)
theorem mem_upperPolar_iff : b ∈ upperPolar r s ↔ ∀ ⦃a⦄, a ∈ s → r a b
```

-- snippet 4
```lean
-- Mathlib.Order.Concept.mem_lowerPolar_iff (L62-L63)
theorem mem_lowerPolar_iff : a ∈ lowerPolar r t ↔ ∀ ⦃b⦄, b ∈ t → r a b
```

-- snippet 5
```lean
-- Mathlib.Order.Concept.subset_upperPolar_iff_subset_lowerPolar (L64-L69)
theorem subset_upperPolar_iff_subset_lowerPolar :
    t ⊆ upperPolar r s ↔ s ⊆ lowerPolar r t
```

-- snippet 6
```lean
-- Mathlib.Order.Concept.gc_upperPolar_lowerPolar (L70-L73)
theorem gc_upperPolar_lowerPolar :
    GaloisConnection (toDual ∘ upperPolar r) (lowerPolar r ∘ ofDual)
```

-- snippet 7
```lean
-- Mathlib.Order.Concept.gc_lowerPolar_upperPolar (L74-L77)
theorem gc_lowerPolar_upperPolar :
    GaloisConnection (toDual ∘ lowerPolar r) (upperPolar r ∘ ofDual)
```

-- snippet 8
```lean
-- Mathlib.Order.Concept.upperPolar_swap (L78-L80)
theorem upperPolar_swap (t : Set β) : upperPolar (swap r) t = lowerPolar r t
```

<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.Order.Concept).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem extent_ssubset_extent_iff : c.extent ⊂ d.extent ↔ c < d
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Order.Concept.upperPolar (L48-L52)
def upperPolar (s : Set α) : Set β
```

-- snippet 2
```lean
-- Mathlib.Order.Concept.lowerPolar (L53-L55)
def lowerPolar (t : Set β) : Set α
```

-- snippet 3
```lean
-- Mathlib.Order.Concept.mem_upperPolar_iff (L61-L61)
theorem mem_upperPolar_iff : b ∈ upperPolar r s ↔ ∀ ⦃a⦄, a ∈ s → r a b
```

-- snippet 4
```lean
-- Mathlib.Order.Concept.mem_lowerPolar_iff (L62-L63)
theorem mem_lowerPolar_iff : a ∈ lowerPolar r t ↔ ∀ ⦃b⦄, b ∈ t → r a b
```

-- snippet 5
```lean
-- Mathlib.Order.Concept.subset_upperPolar_iff_subset_lowerPolar (L64-L69)
theorem subset_upperPolar_iff_subset_lowerPolar :
    t ⊆ upperPolar r s ↔ s ⊆ lowerPolar r t
```

-- snippet 6
```lean
-- Mathlib.Order.Concept.gc_upperPolar_lowerPolar (L70-L73)
theorem gc_upperPolar_lowerPolar :
    GaloisConnection (toDual ∘ upperPolar r) (lowerPolar r ∘ ofDual)
```

-- snippet 7
```lean
-- Mathlib.Order.Concept.gc_lowerPolar_upperPolar (L74-L77)
theorem gc_lowerPolar_upperPolar :
    GaloisConnection (toDual ∘ lowerPolar r) (upperPolar r ∘ ofDual)
```

-- snippet 8
```lean
-- Mathlib.Order.Concept.upperPolar_swap (L78-L80)
theorem upperPolar_swap (t : Set β) : upperPolar (swap r) t = lowerPolar r t
```
[/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.Data.Fin.Basic).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
def factorial {n : ℕ} : Fin n → ℕ
  | ⟨0, _⟩
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Data.Fin.Basic.Nat (L36-L39)
theorem Nat.forall_lt_iff_fin {n : ℕ} {p : ∀ k, k < n → Prop} :
    (∀ k hk, p k hk) ↔ ∀ k : Fin n, p k k.is_lt
```

-- snippet 2
```lean
-- Mathlib.Data.Fin.Basic.Nat (L40-L44)
theorem Nat.exists_lt_iff_fin {n : ℕ} {p : ∀ k, k < n → Prop} :
    (∃ k hk, p k hk) ↔ ∃ k : Fin n, p k k.is_lt
```

-- snippet 3
```lean
-- Mathlib.Data.Fin.Basic.finZeroElim (L45-L49)
def finZeroElim {α : Fin 0 → Sort*} (x : Fin 0) : α x
```

-- snippet 4
```lean
-- Mathlib.Data.Fin.Basic.rec0 (L62-L65)
def rec0 {α : Fin 0 → Sort*} (i : Fin 0) : α i
```

-- snippet 5
```lean
-- Mathlib.Data.Fin.Basic.val_injective (L66-L69)
theorem val_injective : Function.Injective (@Fin.val n)
```

-- snippet 6
```lean
-- Mathlib.Data.Fin.Basic.size_positive (L70-L71)
lemma size_positive : Fin n → 0 < n
```

-- snippet 7
```lean
-- Mathlib.Data.Fin.Basic.size_positive' (L72-L77)
lemma size_positive' [Nonempty (Fin n)] : 0 < n
```

-- snippet 8
```lean
-- Mathlib.Data.Fin.Basic.lt_last_iff_ne_last (L78-L80)
lemma lt_last_iff_ne_last {a : Fin (n + 1)} : a < last n ↔ a ≠ last n
```

-- snippet 9
```lean
-- Mathlib.Data.Fin.Embedding.equivSubtype_symm_trans_valEmbedding (L52-L64)
theorem equivSubtype_symm_trans_valEmbedding :
    equivSubtype.symm.toEmbedding.trans valEmbedding = Embedding.subtype (· < n)
```

-- snippet 10
```lean
-- Mathlib.Data.Fin.Embedding.coe_succEmb (L70-L72)
theorem coe_succEmb : ⇑(succEmb n) = Fin.succ
```

-- snippet 11
```lean
-- Mathlib.Data.Fin.Embedding.nonempty_embedding_iff (L86-L98)
lemma nonempty_embedding_iff : Nonempty (Fin n ↪ Fin m) ↔ n ≤ m
```

-- snippet 12
```lean
-- Mathlib.Data.Fin.Embedding.castLEEmb (L77-L80)
def castLEEmb (h : n ≤ m) : Fin n ↪ Fin m where
  toFun
```

-- snippet 13
```lean
-- Mathlib.Data.Fin.Embedding.succEmb (L65-L68)
def succEmb (n : ℕ) : Fin n ↪ Fin (n + 1) where
  toFun
```

-- snippet 14
```lean
-- Mathlib.Data.Fin.Embedding.valEmbedding (L48-L50)
def valEmbedding : Fin n ↪ ℕ
```

<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.Fin.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
def factorial {n : ℕ} : Fin n → ℕ
  | ⟨0, _⟩
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Data.Fin.Basic.Nat (L36-L39)
theorem Nat.forall_lt_iff_fin {n : ℕ} {p : ∀ k, k < n → Prop} :
    (∀ k hk, p k hk) ↔ ∀ k : Fin n, p k k.is_lt
```

-- snippet 2
```lean
-- Mathlib.Data.Fin.Basic.Nat (L40-L44)
theorem Nat.exists_lt_iff_fin {n : ℕ} {p : ∀ k, k < n → Prop} :
    (∃ k hk, p k hk) ↔ ∃ k : Fin n, p k k.is_lt
```

-- snippet 3
```lean
-- Mathlib.Data.Fin.Basic.finZeroElim (L45-L49)
def finZeroElim {α : Fin 0 → Sort*} (x : Fin 0) : α x
```

-- snippet 4
```lean
-- Mathlib.Data.Fin.Basic.rec0 (L62-L65)
def rec0 {α : Fin 0 → Sort*} (i : Fin 0) : α i
```

-- snippet 5
```lean
-- Mathlib.Data.Fin.Basic.val_injective (L66-L69)
theorem val_injective : Function.Injective (@Fin.val n)
```

-- snippet 6
```lean
-- Mathlib.Data.Fin.Basic.size_positive (L70-L71)
lemma size_positive : Fin n → 0 < n
```

-- snippet 7
```lean
-- Mathlib.Data.Fin.Basic.size_positive' (L72-L77)
lemma size_positive' [Nonempty (Fin n)] : 0 < n
```

-- snippet 8
```lean
-- Mathlib.Data.Fin.Basic.lt_last_iff_ne_last (L78-L80)
lemma lt_last_iff_ne_last {a : Fin (n + 1)} : a < last n ↔ a ≠ last n
```

-- snippet 9
```lean
-- Mathlib.Data.Fin.Embedding.equivSubtype_symm_trans_valEmbedding (L52-L64)
theorem equivSubtype_symm_trans_valEmbedding :
    equivSubtype.symm.toEmbedding.trans valEmbedding = Embedding.subtype (· < n)
```

-- snippet 10
```lean
-- Mathlib.Data.Fin.Embedding.coe_succEmb (L70-L72)
theorem coe_succEmb : ⇑(succEmb n) = Fin.succ
```

-- snippet 11
```lean
-- Mathlib.Data.Fin.Embedding.nonempty_embedding_iff (L86-L98)
lemma nonempty_embedding_iff : Nonempty (Fin n ↪ Fin m) ↔ n ≤ m
```

-- snippet 12
```lean
-- Mathlib.Data.Fin.Embedding.castLEEmb (L77-L80)
def castLEEmb (h : n ≤ m) : Fin n ↪ Fin m where
  toFun
```

-- snippet 13
```lean
-- Mathlib.Data.Fin.Embedding.succEmb (L65-L68)
def succEmb (n : ℕ) : Fin n ↪ Fin (n + 1) where
  toFun
```

-- snippet 14
```lean
-- Mathlib.Data.Fin.Embedding.valEmbedding (L48-L50)
def valEmbedding : Fin n ↪ ℕ
```
[/INST]

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.Topology.UniformSpace.Basic).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem uniformContinuous_iInf_rng {f : α → β} {u₁ : UniformSpace α} {u₂ : ι → UniformSpace β} :
    UniformContinuous[u₁, iInf u₂] f ↔ ∀ i, UniformContinuous[u₁, u₂ i] f
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsOpen (L54-L59)
lemma IsOpen.relComp [TopologicalSpace α] [TopologicalSpace β] [TopologicalSpace γ]
    {s : SetRel α β} {t : SetRel β γ} (hs : IsOpen s) (ht : IsOpen t) : IsOpen (s ○ t)
```

-- snippet 2
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsOpen (L60-L63)
lemma IsOpen.relInv [TopologicalSpace α] [TopologicalSpace β]
    {s : SetRel α β} (hs : IsOpen s) : IsOpen s.inv
```

-- snippet 3
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsOpen (L64-L68)
lemma IsOpen.relImage [TopologicalSpace α] [TopologicalSpace β]
    {s : SetRel α β} (hs : IsOpen s) {t : Set α} : IsOpen (s.image t)
```

-- snippet 4
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsOpen (L69-L72)
lemma IsOpen.relPreimage [TopologicalSpace α] [TopologicalSpace β]
    {s : SetRel α β} (hs : IsOpen s) {t : Set β} : IsOpen (s.preimage t)
```

-- snippet 5
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsClosed (L73-L76)
lemma IsClosed.relInv [TopologicalSpace α] [TopologicalSpace β]
    {s : SetRel α β} (hs : IsClosed s) : IsClosed s.inv
```

-- snippet 6
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsClosed (L77-L81)
lemma IsClosed.relImage_of_finite [TopologicalSpace α] [TopologicalSpace β]
    {s : SetRel α β} (hs : IsClosed s) {t : Set α} (ht : t.Finite) : IsClosed (s.image t)
```

-- snippet 7
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsClosed (L82-L91)
lemma IsClosed.relPreimage_of_finite [TopologicalSpace α] [TopologicalSpace β]
    {s : SetRel α β} (hs : IsClosed s) {t : Set β} (ht : t.Finite) : IsClosed (s.preimage t)
```

-- snippet 8
```lean
-- Mathlib.Topology.UniformSpace.Basic.eventually_uniformity_iterate_comp_subset (L92-L106)
theorem eventually_uniformity_iterate_comp_subset {s : SetRel α α} (hs : s ∈ 𝓤 α) (n : ℕ) :
    ∀ᶠ t in (𝓤 α).smallSets, (t ○ ·)^[n] t ⊆ s
```

-- snippet 9
```lean
-- Mathlib.Topology.UniformSpace.AbsoluteValue.hasBasis_uniformity (L45-L49)
theorem hasBasis_uniformity :
    𝓤[abv.uniformSpace].HasBasis ((0 : 𝕜) < ·) fun ε => { p : R × R | abv (p.2 - p.1) < ε }
```

-- snippet 10
```lean
-- Mathlib.Topology.UniformSpace.AbstractCompletion.uniformContinuous_coe (L97-L99)
theorem uniformContinuous_coe : UniformContinuous ι
```

-- snippet 11
```lean
-- Mathlib.Topology.UniformSpace.AbstractCompletion.closure_range (L91-L93)
theorem closure_range : closure (range ι) = univ
```

-- snippet 12
```lean
-- Mathlib.Topology.UniformSpace.AbstractCompletion.ofComplete (L88-L90)
def ofComplete [T0Space α] [CompleteSpace α] : AbstractCompletion α
```

-- snippet 13
```lean
-- Mathlib.Topology.UniformSpace.AbstractCompletion.isDenseInducing (L94-L96)
theorem isDenseInducing : IsDenseInducing ι
```

-- snippet 14
```lean
-- Mathlib.Topology.UniformSpace.AbsoluteValue.uniformSpace (L40-L44)
def uniformSpace : UniformSpace R
```

<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.Topology.UniformSpace.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem uniformContinuous_iInf_rng {f : α → β} {u₁ : UniformSpace α} {u₂ : ι → UniformSpace β} :
    UniformContinuous[u₁, iInf u₂] f ↔ ∀ i, UniformContinuous[u₁, u₂ i] f
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsOpen (L54-L59)
lemma IsOpen.relComp [TopologicalSpace α] [TopologicalSpace β] [TopologicalSpace γ]
    {s : SetRel α β} {t : SetRel β γ} (hs : IsOpen s) (ht : IsOpen t) : IsOpen (s ○ t)
```

-- snippet 2
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsOpen (L60-L63)
lemma IsOpen.relInv [TopologicalSpace α] [TopologicalSpace β]
    {s : SetRel α β} (hs : IsOpen s) : IsOpen s.inv
```

-- snippet 3
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsOpen (L64-L68)
lemma IsOpen.relImage [TopologicalSpace α] [TopologicalSpace β]
    {s : SetRel α β} (hs : IsOpen s) {t : Set α} : IsOpen (s.image t)
```

-- snippet 4
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsOpen (L69-L72)
lemma IsOpen.relPreimage [TopologicalSpace α] [TopologicalSpace β]
    {s : SetRel α β} (hs : IsOpen s) {t : Set β} : IsOpen (s.preimage t)
```

-- snippet 5
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsClosed (L73-L76)
lemma IsClosed.relInv [TopologicalSpace α] [TopologicalSpace β]
    {s : SetRel α β} (hs : IsClosed s) : IsClosed s.inv
```

-- snippet 6
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsClosed (L77-L81)
lemma IsClosed.relImage_of_finite [TopologicalSpace α] [TopologicalSpace β]
    {s : SetRel α β} (hs : IsClosed s) {t : Set α} (ht : t.Finite) : IsClosed (s.image t)
```

-- snippet 7
```lean
-- Mathlib.Topology.UniformSpace.Basic.IsClosed (L82-L91)
lemma IsClosed.relPreimage_of_finite [TopologicalSpace α] [TopologicalSpace β]
    {s : SetRel α β} (hs : IsClosed s) {t : Set β} (ht : t.Finite) : IsClosed (s.preimage t)
```

-- snippet 8
```lean
-- Mathlib.Topology.UniformSpace.Basic.eventually_uniformity_iterate_comp_subset (L92-L106)
theorem eventually_uniformity_iterate_comp_subset {s : SetRel α α} (hs : s ∈ 𝓤 α) (n : ℕ) :
    ∀ᶠ t in (𝓤 α).smallSets, (t ○ ·)^[n] t ⊆ s
```

-- snippet 9
```lean
-- Mathlib.Topology.UniformSpace.AbsoluteValue.hasBasis_uniformity (L45-L49)
theorem hasBasis_uniformity :
    𝓤[abv.uniformSpace].HasBasis ((0 : 𝕜) < ·) fun ε => { p : R × R | abv (p.2 - p.1) < ε }
```

-- snippet 10
```lean
-- Mathlib.Topology.UniformSpace.AbstractCompletion.uniformContinuous_coe (L97-L99)
theorem uniformContinuous_coe : UniformContinuous ι
```

-- snippet 11
```lean
-- Mathlib.Topology.UniformSpace.AbstractCompletion.closure_range (L91-L93)
theorem closure_range : closure (range ι) = univ
```

-- snippet 12
```lean
-- Mathlib.Topology.UniformSpace.AbstractCompletion.ofComplete (L88-L90)
def ofComplete [T0Space α] [CompleteSpace α] : AbstractCompletion α
```

-- snippet 13
```lean
-- Mathlib.Topology.UniformSpace.AbstractCompletion.isDenseInducing (L94-L96)
theorem isDenseInducing : IsDenseInducing ι
```

-- snippet 14
```lean
-- Mathlib.Topology.UniformSpace.AbsoluteValue.uniformSpace (L40-L44)
def uniformSpace : UniformSpace R
```
[/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.Convex.Slope).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem StrictConvexOn.secant_strict_mono_aux2 (hf : StrictConvexOn 𝕜 s f) {x y z : 𝕜} (hx : x ∈ s)
    (hz : z ∈ s) (hxy : x < y) (hyz : y < z) : (f y - f x) / (y - x) < (f z - f x) / (z - x)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Analysis.Convex.Slope.ConvexOn (L28-L41)
theorem ConvexOn.slope_mono_adjacent (hf : ConvexOn 𝕜 s f) {x y z : 𝕜} (hx : x ∈ s) (hz : z ∈ s)
    (hxy : x < y) (hyz : y < z) : (f y - f x) / (y - x) ≤ (f z - f y) / (z - y)
```

-- snippet 2
```lean
-- Mathlib.Analysis.Convex.Slope.ConcaveOn (L42-L50)
theorem ConcaveOn.slope_anti_adjacent (hf : ConcaveOn 𝕜 s f) {x y z : 𝕜} (hx : x ∈ s) (hz : z ∈ s)
    (hxy : x < y) (hyz : y < z) : (f z - f y) / (z - y) ≤ (f y - f x) / (y - x)
```

-- snippet 3
```lean
-- Mathlib.Analysis.Convex.Slope.StrictConcaveOn (L68-L75)
theorem StrictConcaveOn.slope_anti_adjacent (hf : StrictConcaveOn 𝕜 s f) {x y z : 𝕜} (hx : x ∈ s)
    (hz : z ∈ s) (hxy : x < y) (hyz : y < z) : (f z - f y) / (z - y) < (f y - f x) / (y - x)
```

-- snippet 4
```lean
-- Mathlib.Analysis.Convex.Slope.convexOn_of_slope_mono_adjacent (L76-L91)
theorem convexOn_of_slope_mono_adjacent (hs : Convex 𝕜 s)
    (hf :
      ∀ {x y z : 𝕜},
        x ∈ s → z ∈ s → x < y → y < z → (f y - f x) / (y - x) ≤ (f z - f y) / (z - y)) :
    ConvexOn 𝕜 s f
```

-- snippet 5
```lean
-- Mathlib.Analysis.Convex.Slope.concaveOn_of_slope_anti_adjacent (L92-L103)
theorem concaveOn_of_slope_anti_adjacent (hs : Convex 𝕜 s)
    (hf :
      ∀ {x y z : 𝕜},
        x ∈ s → z ∈ s → x < y → y < z → (f z - f y) / (z - y) ≤ (f y - f x) / (y - x)) :
    ConcaveOn 𝕜 s f
```

-- snippet 6
```lean
-- Mathlib.Analysis.Convex.Slope.strictConvexOn_of_slope_strict_mono_adjacent (L104-L120)
theorem strictConvexOn_of_slope_strict_mono_adjacent (hs : Convex 𝕜 s)
    (hf :
      ∀ {x y z : 𝕜},
        x ∈ s → z ∈ s → x < y → y < z → (f y - f x) / (y - x) < (f z - f y) / (z - y)) :
    StrictConvexOn 𝕜 s f
```

-- snippet 7
```lean
-- Mathlib.Analysis.Convex.Slope.strictConcaveOn_of_slope_strict_anti_adjacent (L121-L132)
theorem strictConcaveOn_of_slope_strict_anti_adjacent (hs : Convex 𝕜 s)
    (hf :
      ∀ {x y z : 𝕜},
        x ∈ s → z ∈ s → x < y → y < z → (f z - f y) / (z - y) < (f y - f x) / (y - x)) :
    StrictConcaveOn 𝕜 s f
```

-- snippet 8
```lean
-- Mathlib.Analysis.Convex.Slope.convexOn_iff_slope_mono_adjacent (L133-L141)
theorem convexOn_iff_slope_mono_adjacent :
    ConvexOn 𝕜 s f ↔
      Convex 𝕜 s ∧ ∀ ⦃x y z : 𝕜⦄,
          x ∈ s → z ∈ s → x < y → y < z → (f y - f x) / (y - x) ≤ (f z - f y) / (z - y)
```

-- snippet 9
```lean
-- Mathlib.Analysis.Convex.AmpleSet.image (L84-L93)
theorem image {s : Set E} (h : AmpleSet s) (L : E ≃ᴬ[ℝ] F) :
    AmpleSet (L '' s)
```

-- snippet 10
```lean
-- Mathlib.Analysis.Convex.AmpleSet.union (L70-L83)
theorem union {s t : Set F} (hs : AmpleSet s) (ht : AmpleSet t) : AmpleSet (s ∪ t)
```

-- snippet 11
```lean
-- Mathlib.Analysis.Convex.AmpleSet.ampleSet_univ (L58-L63)
theorem ampleSet_univ {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] :
    AmpleSet (univ : Set F)
```

-- snippet 12
```lean
-- Mathlib.Analysis.Convex.AmpleSet.AmpleSet (L53-L56)
def AmpleSet (s : Set F) : Prop
```

-- snippet 13
```lean
-- Mathlib.Analysis.Convex.AmpleSet.ampleSet_empty (L65-L69)
theorem ampleSet_empty : AmpleSet (∅ : Set F)
```

-- snippet 14
```lean
-- Mathlib.Analysis.Convex.AmpleSet.image_iff (L94-L98)
theorem image_iff {s : Set E} (L : E ≃ᴬ[ℝ] F) :
    AmpleSet (L '' s) ↔ AmpleSet s
```

<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.Analysis.Convex.Slope).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem StrictConvexOn.secant_strict_mono_aux2 (hf : StrictConvexOn 𝕜 s f) {x y z : 𝕜} (hx : x ∈ s)
    (hz : z ∈ s) (hxy : x < y) (hyz : y < z) : (f y - f x) / (y - x) < (f z - f x) / (z - x)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Analysis.Convex.Slope.ConvexOn (L28-L41)
theorem ConvexOn.slope_mono_adjacent (hf : ConvexOn 𝕜 s f) {x y z : 𝕜} (hx : x ∈ s) (hz : z ∈ s)
    (hxy : x < y) (hyz : y < z) : (f y - f x) / (y - x) ≤ (f z - f y) / (z - y)
```

-- snippet 2
```lean
-- Mathlib.Analysis.Convex.Slope.ConcaveOn (L42-L50)
theorem ConcaveOn.slope_anti_adjacent (hf : ConcaveOn 𝕜 s f) {x y z : 𝕜} (hx : x ∈ s) (hz : z ∈ s)
    (hxy : x < y) (hyz : y < z) : (f z - f y) / (z - y) ≤ (f y - f x) / (y - x)
```

-- snippet 3
```lean
-- Mathlib.Analysis.Convex.Slope.StrictConcaveOn (L68-L75)
theorem StrictConcaveOn.slope_anti_adjacent (hf : StrictConcaveOn 𝕜 s f) {x y z : 𝕜} (hx : x ∈ s)
    (hz : z ∈ s) (hxy : x < y) (hyz : y < z) : (f z - f y) / (z - y) < (f y - f x) / (y - x)
```

-- snippet 4
```lean
-- Mathlib.Analysis.Convex.Slope.convexOn_of_slope_mono_adjacent (L76-L91)
theorem convexOn_of_slope_mono_adjacent (hs : Convex 𝕜 s)
    (hf :
      ∀ {x y z : 𝕜},
        x ∈ s → z ∈ s → x < y → y < z → (f y - f x) / (y - x) ≤ (f z - f y) / (z - y)) :
    ConvexOn 𝕜 s f
```

-- snippet 5
```lean
-- Mathlib.Analysis.Convex.Slope.concaveOn_of_slope_anti_adjacent (L92-L103)
theorem concaveOn_of_slope_anti_adjacent (hs : Convex 𝕜 s)
    (hf :
      ∀ {x y z : 𝕜},
        x ∈ s → z ∈ s → x < y → y < z → (f z - f y) / (z - y) ≤ (f y - f x) / (y - x)) :
    ConcaveOn 𝕜 s f
```

-- snippet 6
```lean
-- Mathlib.Analysis.Convex.Slope.strictConvexOn_of_slope_strict_mono_adjacent (L104-L120)
theorem strictConvexOn_of_slope_strict_mono_adjacent (hs : Convex 𝕜 s)
    (hf :
      ∀ {x y z : 𝕜},
        x ∈ s → z ∈ s → x < y → y < z → (f y - f x) / (y - x) < (f z - f y) / (z - y)) :
    StrictConvexOn 𝕜 s f
```

-- snippet 7
```lean
-- Mathlib.Analysis.Convex.Slope.strictConcaveOn_of_slope_strict_anti_adjacent (L121-L132)
theorem strictConcaveOn_of_slope_strict_anti_adjacent (hs : Convex 𝕜 s)
    (hf :
      ∀ {x y z : 𝕜},
        x ∈ s → z ∈ s → x < y → y < z → (f z - f y) / (z - y) < (f y - f x) / (y - x)) :
    StrictConcaveOn 𝕜 s f
```

-- snippet 8
```lean
-- Mathlib.Analysis.Convex.Slope.convexOn_iff_slope_mono_adjacent (L133-L141)
theorem convexOn_iff_slope_mono_adjacent :
    ConvexOn 𝕜 s f ↔
      Convex 𝕜 s ∧ ∀ ⦃x y z : 𝕜⦄,
          x ∈ s → z ∈ s → x < y → y < z → (f y - f x) / (y - x) ≤ (f z - f y) / (z - y)
```

-- snippet 9
```lean
-- Mathlib.Analysis.Convex.AmpleSet.image (L84-L93)
theorem image {s : Set E} (h : AmpleSet s) (L : E ≃ᴬ[ℝ] F) :
    AmpleSet (L '' s)
```

-- snippet 10
```lean
-- Mathlib.Analysis.Convex.AmpleSet.union (L70-L83)
theorem union {s t : Set F} (hs : AmpleSet s) (ht : AmpleSet t) : AmpleSet (s ∪ t)
```

-- snippet 11
```lean
-- Mathlib.Analysis.Convex.AmpleSet.ampleSet_univ (L58-L63)
theorem ampleSet_univ {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] :
    AmpleSet (univ : Set F)
```

-- snippet 12
```lean
-- Mathlib.Analysis.Convex.AmpleSet.AmpleSet (L53-L56)
def AmpleSet (s : Set F) : Prop
```

-- snippet 13
```lean
-- Mathlib.Analysis.Convex.AmpleSet.ampleSet_empty (L65-L69)
theorem ampleSet_empty : AmpleSet (∅ : Set F)
```

-- snippet 14
```lean
-- Mathlib.Analysis.Convex.AmpleSet.image_iff (L94-L98)
theorem image_iff {s : Set E} (L : E ≃ᴬ[ℝ] F) :
    AmpleSet (L '' s) ↔ AmpleSet s
```
[/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.Data.Ordmap.Invariants).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem Bounded.dual :
    ∀ {t : Ordnode α} {o₁ o₂}, Bounded t o₁ o₂ → @Bounded αᵒᵈ _ (dual t) o₂ o₁
  | nil, o₁, o₂, h => by cases o₁ <;> cases o₂ <;> trivial
  | node _ _ _ _, _, _, ⟨ol, Or⟩ => ⟨Or.dual, ol.dual⟩

set_option backward.isDefEq.respectTransparency false in
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Data.Ordmap.Invariants.not_le_delta (L59-L61)
theorem not_le_delta {s} (H : 1 ≤ s) : ¬s ≤ delta * 0
```

-- snippet 2
```lean
-- Mathlib.Data.Ordmap.Invariants.delta_lt_false (L62-L72)
theorem delta_lt_false {a b : ℕ} (h₁ : delta * a < b) (h₂ : delta * b < a) : False
```

-- snippet 3
```lean
-- Mathlib.Data.Ordmap.Invariants.realSize (L73-L81)
def realSize : Ordnode α → ℕ
  | nil => 0
  | node _ l _ r => realSize l + realSize r + 1

/-! ### `Sized` -/

/-- The `Sized` property asserts that all the `size` fields in nodes match the actual size of the
respective subtrees. -/
```

-- snippet 4
```lean
-- Mathlib.Data.Ordmap.Invariants.Sized (L82-L85)
def Sized : Ordnode α → Prop
  | nil => True
  | node s l _ r => s = size l + size r + 1 ∧ Sized l ∧ Sized r
```

-- snippet 5
```lean
-- Mathlib.Data.Ordmap.Invariants.Sized (L86-L88)
theorem Sized.node' {l x r} (hl : @Sized α l) (hr : Sized r) : Sized (node' l x r)
```

-- snippet 6
```lean
-- Mathlib.Data.Ordmap.Invariants.Sized (L89-L91)
theorem Sized.eq_node' {s l x r} (h : @Sized α (node s l x r)) : node s l x r = .node' l x r
```

-- snippet 7
```lean
-- Mathlib.Data.Ordmap.Invariants.Sized (L92-L95)
theorem Sized.size_eq {s l x r} (H : Sized (@node α s l x r)) :
    size (@node α s l x r) = size l + size r + 1
```

-- snippet 8
```lean
-- Mathlib.Data.Ordmap.Invariants.Sized (L97-L104)
theorem Sized.induction {t} (hl : @Sized α t) {C : Ordnode α → Prop} (H0 : C nil)
    (H1 : ∀ l x r, C l → C r → C (.node' l x r)) : C t
```

-- snippet 9
```lean
-- Mathlib.Data.Ordmap.Ordnode.balanceL (L182-L215)
def balanceL (l : Ordnode α) (x : α) (r : Ordnode α) : Ordnode α
```

-- snippet 10
```lean
-- Mathlib.Data.Ordmap.Ordnode.node' (L159-L164)
def node' (l : Ordnode α) (x : α) (r : Ordnode α) : Ordnode α
```

-- snippet 11
```lean
-- Mathlib.Data.Ordmap.Ordnode.ratio (L107-L112)
def ratio
```

-- snippet 12
```lean
-- Mathlib.Data.Ordmap.Ordnode.balanceR (L216-L249)
def balanceR (l : Ordnode α) (x : α) (r : Ordnode α) : Ordnode α
```

-- snippet 13
```lean
-- Mathlib.Data.Ordmap.Ordnode.repr (L165-L173)
def repr {α} [Repr α] (o : Ordnode α) (n : ℕ) : Std.Format
```

-- snippet 14
```lean
-- Mathlib.Data.Ordmap.Ordnode.delta (L96-L105)
def delta
```

<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.Ordmap.Invariants).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem Bounded.dual :
    ∀ {t : Ordnode α} {o₁ o₂}, Bounded t o₁ o₂ → @Bounded αᵒᵈ _ (dual t) o₂ o₁
  | nil, o₁, o₂, h => by cases o₁ <;> cases o₂ <;> trivial
  | node _ _ _ _, _, _, ⟨ol, Or⟩ => ⟨Or.dual, ol.dual⟩

set_option backward.isDefEq.respectTransparency false in
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Data.Ordmap.Invariants.not_le_delta (L59-L61)
theorem not_le_delta {s} (H : 1 ≤ s) : ¬s ≤ delta * 0
```

-- snippet 2
```lean
-- Mathlib.Data.Ordmap.Invariants.delta_lt_false (L62-L72)
theorem delta_lt_false {a b : ℕ} (h₁ : delta * a < b) (h₂ : delta * b < a) : False
```

-- snippet 3
```lean
-- Mathlib.Data.Ordmap.Invariants.realSize (L73-L81)
def realSize : Ordnode α → ℕ
  | nil => 0
  | node _ l _ r => realSize l + realSize r + 1

/-! ### `Sized` -/

/-- The `Sized` property asserts that all the `size` fields in nodes match the actual size of the
respective subtrees. -/
```

-- snippet 4
```lean
-- Mathlib.Data.Ordmap.Invariants.Sized (L82-L85)
def Sized : Ordnode α → Prop
  | nil => True
  | node s l _ r => s = size l + size r + 1 ∧ Sized l ∧ Sized r
```

-- snippet 5
```lean
-- Mathlib.Data.Ordmap.Invariants.Sized (L86-L88)
theorem Sized.node' {l x r} (hl : @Sized α l) (hr : Sized r) : Sized (node' l x r)
```

-- snippet 6
```lean
-- Mathlib.Data.Ordmap.Invariants.Sized (L89-L91)
theorem Sized.eq_node' {s l x r} (h : @Sized α (node s l x r)) : node s l x r = .node' l x r
```

-- snippet 7
```lean
-- Mathlib.Data.Ordmap.Invariants.Sized (L92-L95)
theorem Sized.size_eq {s l x r} (H : Sized (@node α s l x r)) :
    size (@node α s l x r) = size l + size r + 1
```

-- snippet 8
```lean
-- Mathlib.Data.Ordmap.Invariants.Sized (L97-L104)
theorem Sized.induction {t} (hl : @Sized α t) {C : Ordnode α → Prop} (H0 : C nil)
    (H1 : ∀ l x r, C l → C r → C (.node' l x r)) : C t
```

-- snippet 9
```lean
-- Mathlib.Data.Ordmap.Ordnode.balanceL (L182-L215)
def balanceL (l : Ordnode α) (x : α) (r : Ordnode α) : Ordnode α
```

-- snippet 10
```lean
-- Mathlib.Data.Ordmap.Ordnode.node' (L159-L164)
def node' (l : Ordnode α) (x : α) (r : Ordnode α) : Ordnode α
```

-- snippet 11
```lean
-- Mathlib.Data.Ordmap.Ordnode.ratio (L107-L112)
def ratio
```

-- snippet 12
```lean
-- Mathlib.Data.Ordmap.Ordnode.balanceR (L216-L249)
def balanceR (l : Ordnode α) (x : α) (r : Ordnode α) : Ordnode α
```

-- snippet 13
```lean
-- Mathlib.Data.Ordmap.Ordnode.repr (L165-L173)
def repr {α} [Repr α] (o : Ordnode α) (n : ℕ) : Std.Format
```

-- snippet 14
```lean
-- Mathlib.Data.Ordmap.Ordnode.delta (L96-L105)
def delta
```
[/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.RestrictScalars).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
def RestrictScalars.ringEquiv : RestrictScalars R S A ≃+* A
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Algebra.RestrictScalars.Module (L111-L118)
abbrev Module.restrictScalars [Module S M] : Module R M
```

-- snippet 2
```lean
-- Mathlib.Algebra.Algebra.RestrictScalars.IsScalarTower (L123-L129)
theorem IsScalarTower.restrictScalars [Module S M] :
    letI
```

-- snippet 3
```lean
-- Mathlib.Algebra.Algebra.RestrictScalars.Algebra (L220-L223)
abbrev Algebra.restrictScalars : Algebra R A
```

-- snippet 4
```lean
-- Mathlib.Algebra.Algebra.Basic.algebraMap_ofSubsemiring_apply (L113-L116)
theorem algebraMap_ofSubsemiring_apply (S : C) (x : S) : algebraMap S R x = x
```

-- snippet 5
```lean
-- Mathlib.Algebra.Algebra.Basic.algebraMap_pUnit (L54-L60)
theorem algebraMap_pUnit (r : R) : algebraMap R PUnit r = PUnit.unit
```

-- snippet 6
```lean
-- Mathlib.Algebra.Algebra.Basic.coe_algebraMap_ofSubsemiring (L110-L112)
theorem coe_algebraMap_ofSubsemiring (S : C) : (algebraMap S R : S → R) = Subtype.val
```

-- snippet 7
```lean
-- Mathlib.Algebra.Algebra.Basic.algebraMap_ofSubring (L120-L123)
theorem algebraMap_ofSubring {R : Type*} [CommRing R] (S : Subring R) :
    (algebraMap S R : S →+* R) = S.subtype
```

-- snippet 8
```lean
-- Mathlib.Algebra.Algebra.Basic.ofSubring (L117-L119)
instance ofSubring {R A : Type*} [CommRing R] [Ring A] [Algebra R A] (S : Subring R) :
    Algebra S A
```

-- snippet 9
```lean
-- Mathlib.Algebra.Algebra.Basic.algebraMap_ofSubsemiring (L106-L109)
theorem algebraMap_ofSubsemiring (S : Subsemiring R) :
    (algebraMap S R : S →+* R) = S.subtype
```

<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.RestrictScalars).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
def RestrictScalars.ringEquiv : RestrictScalars R S A ≃+* A
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Algebra.RestrictScalars.Module (L111-L118)
abbrev Module.restrictScalars [Module S M] : Module R M
```

-- snippet 2
```lean
-- Mathlib.Algebra.Algebra.RestrictScalars.IsScalarTower (L123-L129)
theorem IsScalarTower.restrictScalars [Module S M] :
    letI
```

-- snippet 3
```lean
-- Mathlib.Algebra.Algebra.RestrictScalars.Algebra (L220-L223)
abbrev Algebra.restrictScalars : Algebra R A
```

-- snippet 4
```lean
-- Mathlib.Algebra.Algebra.Basic.algebraMap_ofSubsemiring_apply (L113-L116)
theorem algebraMap_ofSubsemiring_apply (S : C) (x : S) : algebraMap S R x = x
```

-- snippet 5
```lean
-- Mathlib.Algebra.Algebra.Basic.algebraMap_pUnit (L54-L60)
theorem algebraMap_pUnit (r : R) : algebraMap R PUnit r = PUnit.unit
```

-- snippet 6
```lean
-- Mathlib.Algebra.Algebra.Basic.coe_algebraMap_ofSubsemiring (L110-L112)
theorem coe_algebraMap_ofSubsemiring (S : C) : (algebraMap S R : S → R) = Subtype.val
```

-- snippet 7
```lean
-- Mathlib.Algebra.Algebra.Basic.algebraMap_ofSubring (L120-L123)
theorem algebraMap_ofSubring {R : Type*} [CommRing R] (S : Subring R) :
    (algebraMap S R : S →+* R) = S.subtype
```

-- snippet 8
```lean
-- Mathlib.Algebra.Algebra.Basic.ofSubring (L117-L119)
instance ofSubring {R A : Type*} [CommRing R] [Ring A] [Algebra R A] (S : Subring R) :
    Algebra S A
```

-- snippet 9
```lean
-- Mathlib.Algebra.Algebra.Basic.algebraMap_ofSubsemiring (L106-L109)
theorem algebraMap_ofSubsemiring (S : Subsemiring R) :
    (algebraMap S R : S →+* R) = S.subtype
```
[/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.Topology.MetricSpace.Pseudo.Defs).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem tendsto_iff_dist_tendsto_zero {f : β → α} {x : Filter β} {a : α} :
    Tendsto f x (𝓝 a) ↔ Tendsto (fun b => dist (f b) a) x (𝓝 0)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.UniformSpace (L56-L59)
theorem UniformSpace.ofDist_aux (ε : ℝ) (hε : 0 < ε) : ∃ δ > (0 : ℝ), ∀ x < δ, ∀ y < δ, x + y < ε
```

-- snippet 2
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.UniformSpace (L61-L66)
def UniformSpace.ofDist (dist : α → α → ℝ) (dist_self : ∀ x : α, dist x x = 0)
    (dist_comm : ∀ x y : α, dist x y = dist y x)
    (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z) : UniformSpace α
```

-- snippet 3
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.Bornology (L67-L87)
abbrev Bornology.ofDist {α : Type*} (dist : α → α → ℝ) (dist_comm : ∀ x y, dist x y = dist y x)
    (dist_triangle : ∀ x y z, dist x z ≤ dist x y + dist y z) : Bornology α
```

-- snippet 4
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.PseudoMetricSpace (L142-L157)
theorem PseudoMetricSpace.ext {α : Type*} {m m' : PseudoMetricSpace α}
    (h : m.toDist = m'.toDist) : m = m'
```

-- snippet 5
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.PseudoMetricSpace (L169-L186)
def PseudoMetricSpace.ofDistTopology {α : Type u} [TopologicalSpace α] (dist : α → α → ℝ)
    (dist_self : ∀ x : α, dist x x = 0) (dist_comm : ∀ x y : α, dist x y = dist y x)
    (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z)
    (H : ∀ s : Set α, IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s) :
    PseudoMetricSpace α
```

-- snippet 6
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.dist_self (L188-L190)
theorem dist_self (x : α) : dist x x = 0
```

-- snippet 7
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.dist_comm (L191-L193)
theorem dist_comm (x y : α) : dist x y = dist y x
```

-- snippet 8
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.edist_dist (L194-L196)
theorem edist_dist (x y : α) : edist x y = ENNReal.ofReal (dist x y)
```

-- snippet 9
```lean
-- Mathlib.Topology.MetricSpace.Algebra.LipschitzMul (L56-L59)
def LipschitzMul.C [_i : LipschitzMul β] : ℝ≥0
```

-- snippet 10
```lean
-- Mathlib.Topology.MetricSpace.Algebra.MulOpposite (L85-L91)
instance MulOpposite.lipschitzMul : LipschitzMul βᵐᵒᵖ where
  lipschitz_mul
```

-- snippet 11
```lean
-- Mathlib.Topology.MetricSpace.Algebra.Real (L92-L100)
instance Real.hasLipschitzAdd : LipschitzAdd ℝ where
  lipschitz_add
```

-- snippet 12
```lean
-- Mathlib.Topology.MetricSpace.Algebra.lipschitz_with_lipschitz_const_mul (L68-L73)
theorem lipschitz_with_lipschitz_const_mul :
    ∀ p q : β × β, dist (p.1 * p.2) (q.1 * q.2) ≤ LipschitzMul.C β * dist p q
```

-- snippet 13
```lean
-- Mathlib.Topology.MetricSpace.Algebra.Submonoid (L79-L83)
instance Submonoid.lipschitzMul (s : Submonoid β) : LipschitzMul s where
  lipschitz_mul
```

-- snippet 14
```lean
-- Mathlib.Topology.MetricSpace.Algebra.lipschitzWith_lipschitz_const_mul_edist (L61-L66)
theorem lipschitzWith_lipschitz_const_mul_edist [_i : LipschitzMul β] :
    LipschitzWith (LipschitzMul.C β) fun p : β × β => p.1 * p.2
```

<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.Topology.MetricSpace.Pseudo.Defs).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem tendsto_iff_dist_tendsto_zero {f : β → α} {x : Filter β} {a : α} :
    Tendsto f x (𝓝 a) ↔ Tendsto (fun b => dist (f b) a) x (𝓝 0)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.UniformSpace (L56-L59)
theorem UniformSpace.ofDist_aux (ε : ℝ) (hε : 0 < ε) : ∃ δ > (0 : ℝ), ∀ x < δ, ∀ y < δ, x + y < ε
```

-- snippet 2
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.UniformSpace (L61-L66)
def UniformSpace.ofDist (dist : α → α → ℝ) (dist_self : ∀ x : α, dist x x = 0)
    (dist_comm : ∀ x y : α, dist x y = dist y x)
    (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z) : UniformSpace α
```

-- snippet 3
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.Bornology (L67-L87)
abbrev Bornology.ofDist {α : Type*} (dist : α → α → ℝ) (dist_comm : ∀ x y, dist x y = dist y x)
    (dist_triangle : ∀ x y z, dist x z ≤ dist x y + dist y z) : Bornology α
```

-- snippet 4
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.PseudoMetricSpace (L142-L157)
theorem PseudoMetricSpace.ext {α : Type*} {m m' : PseudoMetricSpace α}
    (h : m.toDist = m'.toDist) : m = m'
```

-- snippet 5
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.PseudoMetricSpace (L169-L186)
def PseudoMetricSpace.ofDistTopology {α : Type u} [TopologicalSpace α] (dist : α → α → ℝ)
    (dist_self : ∀ x : α, dist x x = 0) (dist_comm : ∀ x y : α, dist x y = dist y x)
    (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z)
    (H : ∀ s : Set α, IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s) :
    PseudoMetricSpace α
```

-- snippet 6
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.dist_self (L188-L190)
theorem dist_self (x : α) : dist x x = 0
```

-- snippet 7
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.dist_comm (L191-L193)
theorem dist_comm (x y : α) : dist x y = dist y x
```

-- snippet 8
```lean
-- Mathlib.Topology.MetricSpace.Pseudo.Defs.edist_dist (L194-L196)
theorem edist_dist (x y : α) : edist x y = ENNReal.ofReal (dist x y)
```

-- snippet 9
```lean
-- Mathlib.Topology.MetricSpace.Algebra.LipschitzMul (L56-L59)
def LipschitzMul.C [_i : LipschitzMul β] : ℝ≥0
```

-- snippet 10
```lean
-- Mathlib.Topology.MetricSpace.Algebra.MulOpposite (L85-L91)
instance MulOpposite.lipschitzMul : LipschitzMul βᵐᵒᵖ where
  lipschitz_mul
```

-- snippet 11
```lean
-- Mathlib.Topology.MetricSpace.Algebra.Real (L92-L100)
instance Real.hasLipschitzAdd : LipschitzAdd ℝ where
  lipschitz_add
```

-- snippet 12
```lean
-- Mathlib.Topology.MetricSpace.Algebra.lipschitz_with_lipschitz_const_mul (L68-L73)
theorem lipschitz_with_lipschitz_const_mul :
    ∀ p q : β × β, dist (p.1 * p.2) (q.1 * q.2) ≤ LipschitzMul.C β * dist p q
```

-- snippet 13
```lean
-- Mathlib.Topology.MetricSpace.Algebra.Submonoid (L79-L83)
instance Submonoid.lipschitzMul (s : Submonoid β) : LipschitzMul s where
  lipschitz_mul
```

-- snippet 14
```lean
-- Mathlib.Topology.MetricSpace.Algebra.lipschitzWith_lipschitz_const_mul_edist (L61-L66)
theorem lipschitzWith_lipschitz_const_mul_edist [_i : LipschitzMul β] :
    LipschitzWith (LipschitzMul.C β) fun p : β × β => p.1 * p.2
```
[/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.Order.Monovary).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
lemma monovary_iff_forall_smul_nonneg : Monovary f g ↔ ∀ i j, 0 ≤ (f j - f i) • (g j - g i)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Order.Monovary.monovaryOn_inv_left (L38-L40)
lemma monovaryOn_inv_left : MonovaryOn f⁻¹ g s ↔ AntivaryOn f g s
```

-- snippet 2
```lean
-- Mathlib.Algebra.Order.Monovary.antivaryOn_inv_left (L42-L44)
lemma antivaryOn_inv_left : AntivaryOn f⁻¹ g s ↔ MonovaryOn f g s
```

-- snippet 3
```lean
-- Mathlib.Algebra.Order.Monovary.Monovary (L70-L72)
lemma Monovary.mul_left (h₁ : Monovary f₁ g) (h₂ : Monovary f₂ g) : Monovary (f₁ * f₂) g
```

-- snippet 4
```lean
-- Mathlib.Algebra.Order.Monovary.Antivary (L74-L76)
lemma Antivary.mul_left (h₁ : Antivary f₁ g) (h₂ : Antivary f₂ g) : Antivary (f₁ * f₂) g
```

-- snippet 5
```lean
-- Mathlib.Algebra.Order.Monovary.Monovary (L78-L80)
lemma Monovary.div_left (h₁ : Monovary f₁ g) (h₂ : Antivary f₂ g) : Monovary (f₁ / f₂) g
```

-- snippet 6
```lean
-- Mathlib.Algebra.Order.Monovary.Antivary (L82-L84)
lemma Antivary.div_left (h₁ : Antivary f₁ g) (h₂ : Monovary f₂ g) : Antivary (f₁ / f₂) g
```

-- snippet 7
```lean
-- Mathlib.Algebra.Order.Monovary.monovaryOn_inv_right (L98-L100)
lemma monovaryOn_inv_right : MonovaryOn f g⁻¹ s ↔ AntivaryOn f g s
```

-- snippet 8
```lean
-- Mathlib.Algebra.Order.Monovary.antivaryOn_inv_right (L102-L104)
lemma antivaryOn_inv_right : AntivaryOn f g⁻¹ s ↔ MonovaryOn f g s
```

-- snippet 9
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.subadditiveHomClass (L68-L70)
instance subadditiveHomClass : SubadditiveHomClass (AbsoluteValue R S) R S
```

-- snippet 10
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.nonnegHomClass (L65-L67)
instance nonnegHomClass : NonnegHomClass (AbsoluteValue R S) R S
```

-- snippet 11
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.mulHomClass (L62-L64)
instance mulHomClass : MulHomClass (AbsoluteValue R S) R S
```

-- snippet 12
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.funLike (L55-L58)
instance funLike : FunLike (AbsoluteValue R S) R S where
  coe f
```

-- snippet 13
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.coe_mk (L72-L74)
theorem coe_mk (f : R →ₙ* S) {h₁ h₂ h₃} : (AbsoluteValue.mk f h₁ h₂ h₃ : R → S) = f
```

-- snippet 14
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.zeroHomClass (L59-L61)
instance zeroHomClass : ZeroHomClass (AbsoluteValue R S) R S where
  map_zero f
```

<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.Order.Monovary).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
lemma monovary_iff_forall_smul_nonneg : Monovary f g ↔ ∀ i j, 0 ≤ (f j - f i) • (g j - g i)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Order.Monovary.monovaryOn_inv_left (L38-L40)
lemma monovaryOn_inv_left : MonovaryOn f⁻¹ g s ↔ AntivaryOn f g s
```

-- snippet 2
```lean
-- Mathlib.Algebra.Order.Monovary.antivaryOn_inv_left (L42-L44)
lemma antivaryOn_inv_left : AntivaryOn f⁻¹ g s ↔ MonovaryOn f g s
```

-- snippet 3
```lean
-- Mathlib.Algebra.Order.Monovary.Monovary (L70-L72)
lemma Monovary.mul_left (h₁ : Monovary f₁ g) (h₂ : Monovary f₂ g) : Monovary (f₁ * f₂) g
```

-- snippet 4
```lean
-- Mathlib.Algebra.Order.Monovary.Antivary (L74-L76)
lemma Antivary.mul_left (h₁ : Antivary f₁ g) (h₂ : Antivary f₂ g) : Antivary (f₁ * f₂) g
```

-- snippet 5
```lean
-- Mathlib.Algebra.Order.Monovary.Monovary (L78-L80)
lemma Monovary.div_left (h₁ : Monovary f₁ g) (h₂ : Antivary f₂ g) : Monovary (f₁ / f₂) g
```

-- snippet 6
```lean
-- Mathlib.Algebra.Order.Monovary.Antivary (L82-L84)
lemma Antivary.div_left (h₁ : Antivary f₁ g) (h₂ : Monovary f₂ g) : Antivary (f₁ / f₂) g
```

-- snippet 7
```lean
-- Mathlib.Algebra.Order.Monovary.monovaryOn_inv_right (L98-L100)
lemma monovaryOn_inv_right : MonovaryOn f g⁻¹ s ↔ AntivaryOn f g s
```

-- snippet 8
```lean
-- Mathlib.Algebra.Order.Monovary.antivaryOn_inv_right (L102-L104)
lemma antivaryOn_inv_right : AntivaryOn f g⁻¹ s ↔ MonovaryOn f g s
```

-- snippet 9
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.subadditiveHomClass (L68-L70)
instance subadditiveHomClass : SubadditiveHomClass (AbsoluteValue R S) R S
```

-- snippet 10
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.nonnegHomClass (L65-L67)
instance nonnegHomClass : NonnegHomClass (AbsoluteValue R S) R S
```

-- snippet 11
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.mulHomClass (L62-L64)
instance mulHomClass : MulHomClass (AbsoluteValue R S) R S
```

-- snippet 12
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.funLike (L55-L58)
instance funLike : FunLike (AbsoluteValue R S) R S where
  coe f
```

-- snippet 13
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.coe_mk (L72-L74)
theorem coe_mk (f : R →ₙ* S) {h₁ h₂ h₃} : (AbsoluteValue.mk f h₁ h₂ h₃ : R → S) = f
```

-- snippet 14
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.zeroHomClass (L59-L61)
instance zeroHomClass : ZeroHomClass (AbsoluteValue R S) R S where
  map_zero f
```
[/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.Topology.Algebra.InfiniteSum.Defs).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem tprod_eq_one_of_not_multipliable (h : ¬Multipliable f L) : ∏'[L] b, f b = 1
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.HasProd (L106-L110)
def HasProd (f : β → α) (a : α) (L
```

-- snippet 2
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.Multipliable (L114-L116)
def Multipliable (f : β → α) (L
```

-- snippet 3
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.Multipliable (L118-L131)
lemma Multipliable.mono_filter {f : β → α} {L₁ L₂ : SummationFilter β}
    (hf : Multipliable f L₂) (h : L₁.filter ≤ L₂.filter) : Multipliable f L₁
```

-- snippet 4
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.hasProd_bot (L163-L168)
lemma hasProd_bot (hL : ¬L.NeBot) (f : β → α) (a : α) :
    HasProd f a L
```

-- snippet 5
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.multipliable_bot (L170-L178)
lemma multipliable_bot (hL : ¬L.NeBot) (f : β → α) :
    Multipliable f L
```

-- snippet 6
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.tprod_bot (L184-L195)
lemma tprod_bot (hL : ¬L.NeBot) (f : β → α) : ∏'[L] b, f b = ∏ᶠ b, f b
```

-- snippet 7
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.HasProd (L197-L199)
theorem HasProd.multipliable (h : HasProd f a L) : Multipliable f L
```

-- snippet 8
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.Function (L205-L208)
theorem Function.Injective.hasProd_map_iff {L : SummationFilter γ} {g : γ → β} (hg : Injective g) :
    HasProd f a (L.map ⟨g, hg⟩) ↔ HasProd (f ∘ g) a L
```

-- snippet 9
```lean
-- Mathlib.Topology.Algebra.Affine.homothety_isOpenMap (L146-L152)
theorem homothety_isOpenMap (x : P) (t : R) (ht : t ≠ 0) : IsOpenMap <| homothety x t
```

-- snippet 10
```lean
-- Mathlib.Topology.Algebra.Affine.homothety_continuous (L118-L125)
theorem homothety_continuous (x : P) (t : R) : Continuous <| homothety x t
```

-- snippet 11
```lean
-- Mathlib.Topology.Algebra.Affine.lineMap_continuous (L66-L75)
theorem lineMap_continuous {p q : P} :
    Continuous (lineMap p q : R →ᵃ[R] P)
```

-- snippet 12
```lean
-- Mathlib.Topology.Algebra.Affine.lineMap_continuous_uncurry (L60-L65)
theorem lineMap_continuous_uncurry :
    Continuous (fun pqt : P × P × R ↦ lineMap pqt.1 pqt.2.1 pqt.2.2)
```

-- snippet 13
```lean
-- Mathlib.Topology.Algebra.Affine.isOpenMap_linear_iff (L46-L58)
theorem isOpenMap_linear_iff {f : P →ᵃ[R] Q} : IsOpenMap f.linear ↔ IsOpenMap f
```

-- snippet 14
```lean
-- Mathlib.Topology.Algebra.Affine.continuous_linear_iff (L35-L45)
theorem continuous_linear_iff {f : P →ᵃ[R] Q} : Continuous f.linear ↔ Continuous f
```

<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.Topology.Algebra.InfiniteSum.Defs).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem tprod_eq_one_of_not_multipliable (h : ¬Multipliable f L) : ∏'[L] b, f b = 1
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.HasProd (L106-L110)
def HasProd (f : β → α) (a : α) (L
```

-- snippet 2
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.Multipliable (L114-L116)
def Multipliable (f : β → α) (L
```

-- snippet 3
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.Multipliable (L118-L131)
lemma Multipliable.mono_filter {f : β → α} {L₁ L₂ : SummationFilter β}
    (hf : Multipliable f L₂) (h : L₁.filter ≤ L₂.filter) : Multipliable f L₁
```

-- snippet 4
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.hasProd_bot (L163-L168)
lemma hasProd_bot (hL : ¬L.NeBot) (f : β → α) (a : α) :
    HasProd f a L
```

-- snippet 5
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.multipliable_bot (L170-L178)
lemma multipliable_bot (hL : ¬L.NeBot) (f : β → α) :
    Multipliable f L
```

-- snippet 6
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.tprod_bot (L184-L195)
lemma tprod_bot (hL : ¬L.NeBot) (f : β → α) : ∏'[L] b, f b = ∏ᶠ b, f b
```

-- snippet 7
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.HasProd (L197-L199)
theorem HasProd.multipliable (h : HasProd f a L) : Multipliable f L
```

-- snippet 8
```lean
-- Mathlib.Topology.Algebra.InfiniteSum.Defs.Function (L205-L208)
theorem Function.Injective.hasProd_map_iff {L : SummationFilter γ} {g : γ → β} (hg : Injective g) :
    HasProd f a (L.map ⟨g, hg⟩) ↔ HasProd (f ∘ g) a L
```

-- snippet 9
```lean
-- Mathlib.Topology.Algebra.Affine.homothety_isOpenMap (L146-L152)
theorem homothety_isOpenMap (x : P) (t : R) (ht : t ≠ 0) : IsOpenMap <| homothety x t
```

-- snippet 10
```lean
-- Mathlib.Topology.Algebra.Affine.homothety_continuous (L118-L125)
theorem homothety_continuous (x : P) (t : R) : Continuous <| homothety x t
```

-- snippet 11
```lean
-- Mathlib.Topology.Algebra.Affine.lineMap_continuous (L66-L75)
theorem lineMap_continuous {p q : P} :
    Continuous (lineMap p q : R →ᵃ[R] P)
```

-- snippet 12
```lean
-- Mathlib.Topology.Algebra.Affine.lineMap_continuous_uncurry (L60-L65)
theorem lineMap_continuous_uncurry :
    Continuous (fun pqt : P × P × R ↦ lineMap pqt.1 pqt.2.1 pqt.2.2)
```

-- snippet 13
```lean
-- Mathlib.Topology.Algebra.Affine.isOpenMap_linear_iff (L46-L58)
theorem isOpenMap_linear_iff {f : P →ᵃ[R] Q} : IsOpenMap f.linear ↔ IsOpenMap f
```

-- snippet 14
```lean
-- Mathlib.Topology.Algebra.Affine.continuous_linear_iff (L35-L45)
theorem continuous_linear_iff {f : P →ᵃ[R] Q} : Continuous f.linear ↔ Continuous f
```
[/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.Asymptotics.TVS).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem IsBigOTVS.neg_right (h : f =O[𝕜; l] g) : f =O[𝕜; l] (-g)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Analysis.Asymptotics.TVS.IsThetaTVS (L120-L122)
def IsThetaTVS (l : Filter α) (f : α → E) (g : α → F) : Prop
```

-- snippet 2
```lean
-- Mathlib.Analysis.Asymptotics.TVS.isLittleOTVS_iff_tendsto_div (L141-L151)
theorem isLittleOTVS_iff_tendsto_div :
    f =o[𝕜; l] g ↔ ∀ U ∈ 𝓝 0, ∃ V ∈ 𝓝 0,
      Tendsto (fun x ↦ egauge 𝕜 U (f x) / egauge 𝕜 V (g x)) l (𝓝 0)
```

-- snippet 3
```lean
-- Mathlib.Analysis.Asymptotics.TVS.IsLittleOTVS (L152-L159)
theorem IsLittleOTVS.exists_eventuallyLE_mul_ennreal (h : f =o[𝕜; l] g) {U : Set E} (hU : U ∈ 𝓝 0) :
    ∃ V ∈ 𝓝 (0 : F), ∀ ε ≠ 0, (fun x ↦ egauge 𝕜 U (f x)) ≤ᶠ[l] (fun x ↦ ε * egauge 𝕜 V (g x))
```

-- snippet 4
```lean
-- Mathlib.Analysis.Asymptotics.TVS.isLittleOTVS_congr (L160-L167)
theorem isLittleOTVS_congr (hf : f₁ =ᶠ[l] f₂) (hg : g₁ =ᶠ[l] g₂) :
    f₁ =o[𝕜; l] g₁ ↔ f₂ =o[𝕜; l] g₂
```

-- snippet 5
```lean
-- Mathlib.Analysis.Asymptotics.TVS.IsLittleOTVS (L168-L171)
theorem IsLittleOTVS.congr' (h : f₁ =o[𝕜; l] g₁) (hf : f₁ =ᶠ[l] f₂) (hg : g₁ =ᶠ[l] g₂) :
    f₂ =o[𝕜; l] g₂
```

-- snippet 6
```lean
-- Mathlib.Analysis.Asymptotics.TVS.IsLittleOTVS (L172-L175)
theorem IsLittleOTVS.congr (h : f₁ =o[𝕜; l] g₁) (hf : ∀ x, f₁ x = f₂ x) (hg : ∀ x, g₁ x = g₂ x) :
    f₂ =o[𝕜; l] g₂
```

-- snippet 7
```lean
-- Mathlib.Analysis.Asymptotics.TVS.IsLittleOTVS (L176-L178)
theorem IsLittleOTVS.congr_left (h : f₁ =o[𝕜; l] g) (hf : ∀ x, f₁ x = f₂ x) : f₂ =o[𝕜; l] g
```

-- snippet 8
```lean
-- Mathlib.Analysis.Asymptotics.TVS.IsLittleOTVS (L179-L181)
theorem IsLittleOTVS.congr_right (h : f =o[𝕜; l] g₁) (hg : ∀ x, g₁ x = g₂ x) : f =o[𝕜; l] g₂
```

-- snippet 9
```lean
-- Mathlib.Analysis.Asymptotics.AsymptoticEquivalent.IsLittleO (L153-L155)
theorem IsLittleO.add_isEquivalent (hu : u =o[l] w) (hv : v ~[l] w) : u + v ~[l] w
```

-- snippet 10
```lean
-- Mathlib.Analysis.Asymptotics.AsymptoticEquivalent.isEquivalent_iff_exists_eq_mul (L181-L191)
theorem isEquivalent_iff_exists_eq_mul :
    u ~[l] v ↔ ∃ (φ : α → β) (_ : Tendsto φ l (𝓝 1)), u =ᶠ[l] φ * v
```

-- snippet 11
```lean
-- Mathlib.Analysis.Asymptotics.AsymptoticEquivalent.isEquivalent_zero_iff_isBigO_zero (L114-L118)
theorem isEquivalent_zero_iff_isBigO_zero : u ~[l] 0 ↔ u =O[l] (0 : α → β)
```

-- snippet 12
```lean
-- Mathlib.Analysis.Asymptotics.AsymptoticEquivalent.IsEquivalent (L73-L77)
theorem IsEquivalent.isLittleO (h : u ~[l] v) : (u - v) =o[l] v
```

-- snippet 13
```lean
-- Mathlib.Analysis.Asymptotics.AsymptoticEquivalent.isEquivalent_const_iff_tendsto (L119-L128)
theorem isEquivalent_const_iff_tendsto {c : β} (h : c ≠ 0) :
    u ~[l] const _ c ↔ Tendsto u l (𝓝 c)
```

-- snippet 14
```lean
-- Mathlib.Analysis.Asymptotics.AsymptoticEquivalent.isEquivalent_zero_iff_eventually_zero (L110-L113)
theorem isEquivalent_zero_iff_eventually_zero : u ~[l] 0 ↔ u =ᶠ[l] 0
```

<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.Analysis.Asymptotics.TVS).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem IsBigOTVS.neg_right (h : f =O[𝕜; l] g) : f =O[𝕜; l] (-g)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Analysis.Asymptotics.TVS.IsThetaTVS (L120-L122)
def IsThetaTVS (l : Filter α) (f : α → E) (g : α → F) : Prop
```

-- snippet 2
```lean
-- Mathlib.Analysis.Asymptotics.TVS.isLittleOTVS_iff_tendsto_div (L141-L151)
theorem isLittleOTVS_iff_tendsto_div :
    f =o[𝕜; l] g ↔ ∀ U ∈ 𝓝 0, ∃ V ∈ 𝓝 0,
      Tendsto (fun x ↦ egauge 𝕜 U (f x) / egauge 𝕜 V (g x)) l (𝓝 0)
```

-- snippet 3
```lean
-- Mathlib.Analysis.Asymptotics.TVS.IsLittleOTVS (L152-L159)
theorem IsLittleOTVS.exists_eventuallyLE_mul_ennreal (h : f =o[𝕜; l] g) {U : Set E} (hU : U ∈ 𝓝 0) :
    ∃ V ∈ 𝓝 (0 : F), ∀ ε ≠ 0, (fun x ↦ egauge 𝕜 U (f x)) ≤ᶠ[l] (fun x ↦ ε * egauge 𝕜 V (g x))
```

-- snippet 4
```lean
-- Mathlib.Analysis.Asymptotics.TVS.isLittleOTVS_congr (L160-L167)
theorem isLittleOTVS_congr (hf : f₁ =ᶠ[l] f₂) (hg : g₁ =ᶠ[l] g₂) :
    f₁ =o[𝕜; l] g₁ ↔ f₂ =o[𝕜; l] g₂
```

-- snippet 5
```lean
-- Mathlib.Analysis.Asymptotics.TVS.IsLittleOTVS (L168-L171)
theorem IsLittleOTVS.congr' (h : f₁ =o[𝕜; l] g₁) (hf : f₁ =ᶠ[l] f₂) (hg : g₁ =ᶠ[l] g₂) :
    f₂ =o[𝕜; l] g₂
```

-- snippet 6
```lean
-- Mathlib.Analysis.Asymptotics.TVS.IsLittleOTVS (L172-L175)
theorem IsLittleOTVS.congr (h : f₁ =o[𝕜; l] g₁) (hf : ∀ x, f₁ x = f₂ x) (hg : ∀ x, g₁ x = g₂ x) :
    f₂ =o[𝕜; l] g₂
```

-- snippet 7
```lean
-- Mathlib.Analysis.Asymptotics.TVS.IsLittleOTVS (L176-L178)
theorem IsLittleOTVS.congr_left (h : f₁ =o[𝕜; l] g) (hf : ∀ x, f₁ x = f₂ x) : f₂ =o[𝕜; l] g
```

-- snippet 8
```lean
-- Mathlib.Analysis.Asymptotics.TVS.IsLittleOTVS (L179-L181)
theorem IsLittleOTVS.congr_right (h : f =o[𝕜; l] g₁) (hg : ∀ x, g₁ x = g₂ x) : f =o[𝕜; l] g₂
```

-- snippet 9
```lean
-- Mathlib.Analysis.Asymptotics.AsymptoticEquivalent.IsLittleO (L153-L155)
theorem IsLittleO.add_isEquivalent (hu : u =o[l] w) (hv : v ~[l] w) : u + v ~[l] w
```

-- snippet 10
```lean
-- Mathlib.Analysis.Asymptotics.AsymptoticEquivalent.isEquivalent_iff_exists_eq_mul (L181-L191)
theorem isEquivalent_iff_exists_eq_mul :
    u ~[l] v ↔ ∃ (φ : α → β) (_ : Tendsto φ l (𝓝 1)), u =ᶠ[l] φ * v
```

-- snippet 11
```lean
-- Mathlib.Analysis.Asymptotics.AsymptoticEquivalent.isEquivalent_zero_iff_isBigO_zero (L114-L118)
theorem isEquivalent_zero_iff_isBigO_zero : u ~[l] 0 ↔ u =O[l] (0 : α → β)
```

-- snippet 12
```lean
-- Mathlib.Analysis.Asymptotics.AsymptoticEquivalent.IsEquivalent (L73-L77)
theorem IsEquivalent.isLittleO (h : u ~[l] v) : (u - v) =o[l] v
```

-- snippet 13
```lean
-- Mathlib.Analysis.Asymptotics.AsymptoticEquivalent.isEquivalent_const_iff_tendsto (L119-L128)
theorem isEquivalent_const_iff_tendsto {c : β} (h : c ≠ 0) :
    u ~[l] const _ c ↔ Tendsto u l (𝓝 c)
```

-- snippet 14
```lean
-- Mathlib.Analysis.Asymptotics.AsymptoticEquivalent.isEquivalent_zero_iff_eventually_zero (L110-L113)
theorem isEquivalent_zero_iff_eventually_zero : u ~[l] 0 ↔ u =ᶠ[l] 0
```
[/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.Homology.ShortComplex.Limits).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
instance hasColimitsOfShape :
    HasColimitsOfShape J (ShortComplex C) where

noncomputable instance : PreservesColimitsOfShape J (π₁ : _ ⥤ C) where

noncomputable instance : PreservesColimitsOfShape J (π₂ : _ ⥤ C) where

noncomputable instance : PreservesColimitsOfShape J (π₃ : _ ⥤ C) where
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.isLimitOfIsLimitπ (L34-L61)
def isLimitOfIsLimitπ (c : Cone F)
    (h₁ : IsLimit (π₁.mapCone c)) (h₂ : IsLimit (π₂.mapCone c))
    (h₃ : IsLimit (π₃.mapCone c)) : IsLimit c where
  lift s
```

-- snippet 2
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.hasLimit_of_hasLimitπ (L98-L108)
instance hasLimit_of_hasLimitπ : HasLimit F
```

-- snippet 3
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.hasLimitsOfShape (L115-L123)
instance hasLimitsOfShape :
    HasLimitsOfShape J (ShortComplex C) where

noncomputable instance : PreservesLimitsOfShape J (π₁ : _ ⥤ C) where

noncomputable instance : PreservesLimitsOfShape J (π₂ : _ ⥤ C) where

noncomputable instance : PreservesLimitsOfShape J (π₃ : _ ⥤ C) where
```

-- snippet 4
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.hasFiniteLimits (L130-L141)
instance hasFiniteLimits : HasFiniteLimits (ShortComplex C)
```

-- snippet 5
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.preservesMonomorphisms_π₁ (L148-L151)
instance preservesMonomorphisms_π₁ :
    Functor.PreservesMonomorphisms (π₁ : _ ⥤ C)
```

-- snippet 6
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.preservesMonomorphisms_π₂ (L152-L155)
instance preservesMonomorphisms_π₂ :
    Functor.PreservesMonomorphisms (π₂ : _ ⥤ C)
```

-- snippet 7
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.preservesMonomorphisms_π₃ (L156-L159)
instance preservesMonomorphisms_π₃ :
    Functor.PreservesMonomorphisms (π₃ : _ ⥤ C)
```

-- snippet 8
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.isColimitOfIsColimitπ (L164-L195)
def isColimitOfIsColimitπ (c : Cocone F)
    (h₁ : IsColimit (π₁.mapCocone c)) (h₂ : IsColimit (π₂.mapCocone c))
    (h₃ : IsColimit (π₃.mapCocone c)) : IsColimit c where
  desc s
```

-- snippet 9
```lean
-- Mathlib.Algebra.Homology.Additive.hasIntScalar (L53-L57)
instance hasIntScalar : SMul ℤ (C ⟶ D)
```

-- snippet 10
```lean
-- Mathlib.Algebra.Homology.Additive.zero_f_apply (L59-L61)
theorem zero_f_apply (i : ι) : (0 : C ⟶ D).f i = 0
```

-- snippet 11
```lean
-- Mathlib.Algebra.Homology.Additive.sub_f_apply (L71-L73)
theorem sub_f_apply (f g : C ⟶ D) (i : ι) : (f - g).f i = f.f i - g.f i
```

-- snippet 12
```lean
-- Mathlib.Algebra.Homology.Additive.neg_f_apply (L67-L69)
theorem neg_f_apply (f : C ⟶ D) (i : ι) : (-f).f i = -f.f i
```

-- snippet 13
```lean
-- Mathlib.Algebra.Homology.Additive.hasNatScalar (L48-L52)
instance hasNatScalar : SMul ℕ (C ⟶ D)
```

-- snippet 14
```lean
-- Mathlib.Algebra.Homology.Additive.add_f_apply (L63-L65)
theorem add_f_apply (f g : C ⟶ D) (i : ι) : (f + g).f i = f.f i + g.f i
```

<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.Homology.ShortComplex.Limits).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
instance hasColimitsOfShape :
    HasColimitsOfShape J (ShortComplex C) where

noncomputable instance : PreservesColimitsOfShape J (π₁ : _ ⥤ C) where

noncomputable instance : PreservesColimitsOfShape J (π₂ : _ ⥤ C) where

noncomputable instance : PreservesColimitsOfShape J (π₃ : _ ⥤ C) where
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.isLimitOfIsLimitπ (L34-L61)
def isLimitOfIsLimitπ (c : Cone F)
    (h₁ : IsLimit (π₁.mapCone c)) (h₂ : IsLimit (π₂.mapCone c))
    (h₃ : IsLimit (π₃.mapCone c)) : IsLimit c where
  lift s
```

-- snippet 2
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.hasLimit_of_hasLimitπ (L98-L108)
instance hasLimit_of_hasLimitπ : HasLimit F
```

-- snippet 3
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.hasLimitsOfShape (L115-L123)
instance hasLimitsOfShape :
    HasLimitsOfShape J (ShortComplex C) where

noncomputable instance : PreservesLimitsOfShape J (π₁ : _ ⥤ C) where

noncomputable instance : PreservesLimitsOfShape J (π₂ : _ ⥤ C) where

noncomputable instance : PreservesLimitsOfShape J (π₃ : _ ⥤ C) where
```

-- snippet 4
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.hasFiniteLimits (L130-L141)
instance hasFiniteLimits : HasFiniteLimits (ShortComplex C)
```

-- snippet 5
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.preservesMonomorphisms_π₁ (L148-L151)
instance preservesMonomorphisms_π₁ :
    Functor.PreservesMonomorphisms (π₁ : _ ⥤ C)
```

-- snippet 6
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.preservesMonomorphisms_π₂ (L152-L155)
instance preservesMonomorphisms_π₂ :
    Functor.PreservesMonomorphisms (π₂ : _ ⥤ C)
```

-- snippet 7
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.preservesMonomorphisms_π₃ (L156-L159)
instance preservesMonomorphisms_π₃ :
    Functor.PreservesMonomorphisms (π₃ : _ ⥤ C)
```

-- snippet 8
```lean
-- Mathlib.Algebra.Homology.ShortComplex.Limits.isColimitOfIsColimitπ (L164-L195)
def isColimitOfIsColimitπ (c : Cocone F)
    (h₁ : IsColimit (π₁.mapCocone c)) (h₂ : IsColimit (π₂.mapCocone c))
    (h₃ : IsColimit (π₃.mapCocone c)) : IsColimit c where
  desc s
```

-- snippet 9
```lean
-- Mathlib.Algebra.Homology.Additive.hasIntScalar (L53-L57)
instance hasIntScalar : SMul ℤ (C ⟶ D)
```

-- snippet 10
```lean
-- Mathlib.Algebra.Homology.Additive.zero_f_apply (L59-L61)
theorem zero_f_apply (i : ι) : (0 : C ⟶ D).f i = 0
```

-- snippet 11
```lean
-- Mathlib.Algebra.Homology.Additive.sub_f_apply (L71-L73)
theorem sub_f_apply (f g : C ⟶ D) (i : ι) : (f - g).f i = f.f i - g.f i
```

-- snippet 12
```lean
-- Mathlib.Algebra.Homology.Additive.neg_f_apply (L67-L69)
theorem neg_f_apply (f : C ⟶ D) (i : ι) : (-f).f i = -f.f i
```

-- snippet 13
```lean
-- Mathlib.Algebra.Homology.Additive.hasNatScalar (L48-L52)
instance hasNatScalar : SMul ℕ (C ⟶ D)
```

-- snippet 14
```lean
-- Mathlib.Algebra.Homology.Additive.add_f_apply (L63-L65)
theorem add_f_apply (f g : C ⟶ D) (i : ι) : (f + g).f i = f.f i + g.f i
```
[/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.Topology.OpenPartialHomeomorph.Defs).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem eq_symm_apply {x : X} {y : Y} (hx : x ∈ e.source) (hy : y ∈ e.target) :
    x = e.symm y ↔ e x = y
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.Simps (L88-L90)
def Simps.apply (e : OpenPartialHomeomorph X Y) : X → Y
```

-- snippet 2
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.Simps (L91-L97)
def Simps.symm_apply (e : OpenPartialHomeomorph X Y) : Y → X
```

-- snippet 3
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.continuousOn_symm (L98-L100)
theorem continuousOn_symm : ContinuousOn e.symm e.target
```

-- snippet 4
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.mk_coe (L102-L105)
theorem mk_coe (e : PartialEquiv X Y) (a b c d) :
    (OpenPartialHomeomorph.mk e a b c d : X → Y) = e
```

-- snippet 5
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.mk_coe_symm (L107-L110)
theorem mk_coe_symm (e : PartialEquiv X Y) (a b c d) :
    ((OpenPartialHomeomorph.mk e a b c d).symm : Y → X) = e.symm
```

-- snippet 6
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.toPartialEquiv_injective (L111-L116)
theorem toPartialEquiv_injective :
    Injective (toPartialEquiv : OpenPartialHomeomorph X Y → PartialEquiv X Y)
  | ⟨_, _, _, _, _⟩, ⟨_, _, _, _, _⟩, rfl => rfl

/- Register a few simp lemmas to make sure that `simp` puts the application of a local
homeomorphism in its normal form, i.e., in terms of its coercion to a function. -/
```

-- snippet 7
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.toFun_eq_coe (L118-L120)
theorem toFun_eq_coe (e : OpenPartialHomeomorph X Y) : e.toFun = e
```

-- snippet 8
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.invFun_eq_coe (L122-L124)
theorem invFun_eq_coe (e : OpenPartialHomeomorph X Y) : e.invFun = e.symm
```

-- snippet 9
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Basic.image_source_inter_eq' (L54-L56)
theorem image_source_inter_eq' (s : Set X) : e '' (e.source ∩ s) = e.target ∩ e.symm ⁻¹' s
```

-- snippet 10
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Basic.image_source_inter_eq (L57-L60)
theorem image_source_inter_eq (s : Set X) :
    e '' (e.source ∩ s) = e.target ∩ e.symm ⁻¹' (e.source ∩ s)
```

-- snippet 11
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Basic.refl_partialEquiv (L38-L40)
theorem refl_partialEquiv : (OpenPartialHomeomorph.refl X).toPartialEquiv = PartialEquiv.refl X
```

-- snippet 12
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Basic.image_eq_target_inter_inv_preimage (L50-L53)
theorem image_eq_target_inter_inv_preimage {s : Set X} (h : s ⊆ e.source) :
    e '' s = e.target ∩ e.symm ⁻¹' s
```

-- snippet 13
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Basic.refl_symm (L42-L46)
theorem refl_symm : (OpenPartialHomeomorph.refl X).symm = OpenPartialHomeomorph.refl X
```

-- snippet 14
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Basic.source_preimage_target (L47-L49)
theorem source_preimage_target : e.source ⊆ e ⁻¹' e.target
```

<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.Topology.OpenPartialHomeomorph.Defs).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem eq_symm_apply {x : X} {y : Y} (hx : x ∈ e.source) (hy : y ∈ e.target) :
    x = e.symm y ↔ e x = y
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.Simps (L88-L90)
def Simps.apply (e : OpenPartialHomeomorph X Y) : X → Y
```

-- snippet 2
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.Simps (L91-L97)
def Simps.symm_apply (e : OpenPartialHomeomorph X Y) : Y → X
```

-- snippet 3
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.continuousOn_symm (L98-L100)
theorem continuousOn_symm : ContinuousOn e.symm e.target
```

-- snippet 4
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.mk_coe (L102-L105)
theorem mk_coe (e : PartialEquiv X Y) (a b c d) :
    (OpenPartialHomeomorph.mk e a b c d : X → Y) = e
```

-- snippet 5
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.mk_coe_symm (L107-L110)
theorem mk_coe_symm (e : PartialEquiv X Y) (a b c d) :
    ((OpenPartialHomeomorph.mk e a b c d).symm : Y → X) = e.symm
```

-- snippet 6
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.toPartialEquiv_injective (L111-L116)
theorem toPartialEquiv_injective :
    Injective (toPartialEquiv : OpenPartialHomeomorph X Y → PartialEquiv X Y)
  | ⟨_, _, _, _, _⟩, ⟨_, _, _, _, _⟩, rfl => rfl

/- Register a few simp lemmas to make sure that `simp` puts the application of a local
homeomorphism in its normal form, i.e., in terms of its coercion to a function. -/
```

-- snippet 7
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.toFun_eq_coe (L118-L120)
theorem toFun_eq_coe (e : OpenPartialHomeomorph X Y) : e.toFun = e
```

-- snippet 8
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Defs.invFun_eq_coe (L122-L124)
theorem invFun_eq_coe (e : OpenPartialHomeomorph X Y) : e.invFun = e.symm
```

-- snippet 9
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Basic.image_source_inter_eq' (L54-L56)
theorem image_source_inter_eq' (s : Set X) : e '' (e.source ∩ s) = e.target ∩ e.symm ⁻¹' s
```

-- snippet 10
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Basic.image_source_inter_eq (L57-L60)
theorem image_source_inter_eq (s : Set X) :
    e '' (e.source ∩ s) = e.target ∩ e.symm ⁻¹' (e.source ∩ s)
```

-- snippet 11
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Basic.refl_partialEquiv (L38-L40)
theorem refl_partialEquiv : (OpenPartialHomeomorph.refl X).toPartialEquiv = PartialEquiv.refl X
```

-- snippet 12
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Basic.image_eq_target_inter_inv_preimage (L50-L53)
theorem image_eq_target_inter_inv_preimage {s : Set X} (h : s ⊆ e.source) :
    e '' s = e.target ∩ e.symm ⁻¹' s
```

-- snippet 13
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Basic.refl_symm (L42-L46)
theorem refl_symm : (OpenPartialHomeomorph.refl X).symm = OpenPartialHomeomorph.refl X
```

-- snippet 14
```lean
-- Mathlib.Topology.OpenPartialHomeomorph.Basic.source_preimage_target (L47-L49)
theorem source_preimage_target : e.source ⊆ e ⁻¹' e.target
```
[/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.GroupTheory.Perm.Cycle.Basic).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem IsCycle.isConj_iff (hσ : IsCycle σ) (hτ : IsCycle τ) :
    IsConj σ τ ↔ #σ.support = #τ.support where
  mp h
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L53-L55)
def SameCycle (f : Perm α) (x y : α) : Prop
```

-- snippet 2
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L57-L59)
theorem SameCycle.refl (f : Perm α) (x : α) : SameCycle f x x
```

-- snippet 3
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L60-L64)
theorem SameCycle.rfl : SameCycle f x x
```

-- snippet 4
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L66-L68)
theorem SameCycle.symm : SameCycle f x y → SameCycle f y x
```

-- snippet 5
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.sameCycle_comm (L69-L71)
theorem sameCycle_comm : SameCycle f x y ↔ SameCycle f y x
```

-- snippet 6
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L73-L76)
theorem SameCycle.trans : SameCycle f x y → SameCycle f y z → SameCycle f x z
```

-- snippet 7
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L77-L80)
theorem SameCycle.equivalence : Equivalence (SameCycle f)
```

-- snippet 8
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L82-L85)
def SameCycle.setoid (f : Perm α) : Setoid α where
  r
```

-- snippet 9
```lean
-- Mathlib.GroupTheory.Perm.Basic.SurjOn (L59-L60)
lemma SurjOn.perm_pow : SurjOn f s s → ∀ n : ℕ, SurjOn (f ^ n) s s
```

-- snippet 10
```lean
-- Mathlib.GroupTheory.Perm.Basic.MapsTo (L57-L58)
lemma MapsTo.perm_pow : MapsTo f s s → ∀ n : ℕ, MapsTo (f ^ n) s s
```

-- snippet 11
```lean
-- Mathlib.GroupTheory.Perm.Basic.swap_smul_involutive (L44-L54)
theorem swap_smul_involutive [MulAction (Perm α) β] (i j : α) :
    Function.Involutive (swap i j • · : β → β)
```

-- snippet 12
```lean
-- Mathlib.GroupTheory.Perm.Basic.swap_smul_self_smul (L41-L43)
theorem swap_smul_self_smul [MulAction (Perm α) β] (i j : α) (x : β) :
    swap i j • swap i j • x = x
```

-- snippet 13
```lean
-- Mathlib.GroupTheory.Perm.Centralizer.Subgroup (L116-L130)
lemma Subgroup.Centralizer.toConjAct_smul_mem_cycleFactorsFinset {k c : Perm α}
    (k_mem : k ∈ centralizer {g}) (c_mem : c ∈ g.cycleFactorsFinset) :
    ConjAct.toConjAct k • c ∈ g.cycleFactorsFinset
```

-- snippet 14
```lean
-- Mathlib.GroupTheory.Perm.Basic.BijOn (L55-L56)
lemma BijOn.perm_inv (hf : BijOn f s s) : BijOn ↑(f⁻¹) s s
```

<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.GroupTheory.Perm.Cycle.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem IsCycle.isConj_iff (hσ : IsCycle σ) (hτ : IsCycle τ) :
    IsConj σ τ ↔ #σ.support = #τ.support where
  mp h
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L53-L55)
def SameCycle (f : Perm α) (x y : α) : Prop
```

-- snippet 2
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L57-L59)
theorem SameCycle.refl (f : Perm α) (x : α) : SameCycle f x x
```

-- snippet 3
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L60-L64)
theorem SameCycle.rfl : SameCycle f x x
```

-- snippet 4
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L66-L68)
theorem SameCycle.symm : SameCycle f x y → SameCycle f y x
```

-- snippet 5
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.sameCycle_comm (L69-L71)
theorem sameCycle_comm : SameCycle f x y ↔ SameCycle f y x
```

-- snippet 6
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L73-L76)
theorem SameCycle.trans : SameCycle f x y → SameCycle f y z → SameCycle f x z
```

-- snippet 7
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L77-L80)
theorem SameCycle.equivalence : Equivalence (SameCycle f)
```

-- snippet 8
```lean
-- Mathlib.GroupTheory.Perm.Cycle.Basic.SameCycle (L82-L85)
def SameCycle.setoid (f : Perm α) : Setoid α where
  r
```

-- snippet 9
```lean
-- Mathlib.GroupTheory.Perm.Basic.SurjOn (L59-L60)
lemma SurjOn.perm_pow : SurjOn f s s → ∀ n : ℕ, SurjOn (f ^ n) s s
```

-- snippet 10
```lean
-- Mathlib.GroupTheory.Perm.Basic.MapsTo (L57-L58)
lemma MapsTo.perm_pow : MapsTo f s s → ∀ n : ℕ, MapsTo (f ^ n) s s
```

-- snippet 11
```lean
-- Mathlib.GroupTheory.Perm.Basic.swap_smul_involutive (L44-L54)
theorem swap_smul_involutive [MulAction (Perm α) β] (i j : α) :
    Function.Involutive (swap i j • · : β → β)
```

-- snippet 12
```lean
-- Mathlib.GroupTheory.Perm.Basic.swap_smul_self_smul (L41-L43)
theorem swap_smul_self_smul [MulAction (Perm α) β] (i j : α) (x : β) :
    swap i j • swap i j • x = x
```

-- snippet 13
```lean
-- Mathlib.GroupTheory.Perm.Centralizer.Subgroup (L116-L130)
lemma Subgroup.Centralizer.toConjAct_smul_mem_cycleFactorsFinset {k c : Perm α}
    (k_mem : k ∈ centralizer {g}) (c_mem : c ∈ g.cycleFactorsFinset) :
    ConjAct.toConjAct k • c ∈ g.cycleFactorsFinset
```

-- snippet 14
```lean
-- Mathlib.GroupTheory.Perm.Basic.BijOn (L55-L56)
lemma BijOn.perm_inv (hf : BijOn f s s) : BijOn ↑(f⁻¹) s s
```
[/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.Analytic.ChangeOrigin).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
def changeOriginSeries (k : ℕ) : FormalMultilinearSeries 𝕜 E (E [×k]→L[𝕜] F)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.changeOriginSeriesTerm (L64-L69)
def changeOriginSeriesTerm (k l : ℕ) (s : Finset (Fin (k + l))) (hs : s.card = l) :
    E [×l]→L[𝕜] E [×k]→L[𝕜] F
```

-- snippet 2
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.changeOriginSeriesTerm_apply (L70-L75)
theorem changeOriginSeriesTerm_apply (k l : ℕ) (s : Finset (Fin (k + l))) (hs : s.card = l)
    (x y : E) :
    (p.changeOriginSeriesTerm k l s hs (fun _ => x) fun _ => y) =
      p (k + l) (s.piecewise (fun _ => x) fun _ => y)
```

-- snippet 3
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.norm_changeOriginSeriesTerm (L77-L80)
theorem norm_changeOriginSeriesTerm (k l : ℕ) (s : Finset (Fin (k + l))) (hs : s.card = l) :
    ‖p.changeOriginSeriesTerm k l s hs‖ = ‖p (k + l)‖
```

-- snippet 4
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.nnnorm_changeOriginSeriesTerm (L82-L85)
theorem nnnorm_changeOriginSeriesTerm (k l : ℕ) (s : Finset (Fin (k + l))) (hs : s.card = l) :
    ‖p.changeOriginSeriesTerm k l s hs‖₊ = ‖p (k + l)‖₊
```

-- snippet 5
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.nnnorm_changeOriginSeriesTerm_apply_le (L86-L99)
theorem nnnorm_changeOriginSeriesTerm_apply_le (k l : ℕ) (s : Finset (Fin (k + l)))
    (hs : s.card = l) (x y : E) :
    ‖p.changeOriginSeriesTerm k l s hs (fun _ => x) fun _ => y‖₊ ≤
      ‖p (k + l)‖₊ * ‖x‖₊ ^ l * ‖y‖₊ ^ k
```

-- snippet 6
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.nnnorm_changeOriginSeries_le_tsum (L103-L108)
theorem nnnorm_changeOriginSeries_le_tsum (k l : ℕ) :
    ‖p.changeOriginSeries k l‖₊ ≤
      ∑' _ : { s : Finset (Fin (k + l)) // s.card = l }, ‖p (k + l)‖₊
```

-- snippet 7
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.nnnorm_changeOriginSeries_apply_le_tsum (L109-L117)
theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : ℕ) (x : E) :
    ‖p.changeOriginSeries k l fun _ => x‖₊ ≤
      ∑' _ : { s : Finset (Fin (k + l)) // s.card = l }, ‖p (k + l)‖₊ * ‖x‖₊ ^ l
```

-- snippet 8
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.changeOrigin (L118-L128)
def changeOrigin (x : E) : FormalMultilinearSeries 𝕜 E F
```

-- snippet 9
```lean
-- Mathlib.Analysis.Analytic.Basic.HasFPowerSeriesWithinAt (L98-L101)
def HasFPowerSeriesWithinAt (f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (s : Set E) (x : E)
```

-- snippet 10
```lean
-- Mathlib.Analysis.Analytic.Basic.HasFPowerSeriesAt (L94-L97)
def HasFPowerSeriesAt (f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (x : E)
```

-- snippet 11
```lean
-- Mathlib.Analysis.Analytic.Basic.AnalyticWithinAt (L113-L117)
def AnalyticWithinAt (f : E → F) (s : Set E) (x : E) : Prop
```

-- snippet 12
```lean
-- Mathlib.Analysis.Analytic.Basic.AnalyticOnNhd (L118-L122)
def AnalyticOnNhd (f : E → F) (s : Set E)
```

-- snippet 13
```lean
-- Mathlib.Analysis.Analytic.Basic.AnalyticAt (L109-L112)
def AnalyticAt (f : E → F) (x : E)
```

-- snippet 14
```lean
-- Mathlib.Analysis.Analytic.Basic.AnalyticOn (L123-L131)
def AnalyticOn (f : E → F) (s : Set E) : Prop
```

<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.Analysis.Analytic.ChangeOrigin).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
def changeOriginSeries (k : ℕ) : FormalMultilinearSeries 𝕜 E (E [×k]→L[𝕜] F)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.changeOriginSeriesTerm (L64-L69)
def changeOriginSeriesTerm (k l : ℕ) (s : Finset (Fin (k + l))) (hs : s.card = l) :
    E [×l]→L[𝕜] E [×k]→L[𝕜] F
```

-- snippet 2
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.changeOriginSeriesTerm_apply (L70-L75)
theorem changeOriginSeriesTerm_apply (k l : ℕ) (s : Finset (Fin (k + l))) (hs : s.card = l)
    (x y : E) :
    (p.changeOriginSeriesTerm k l s hs (fun _ => x) fun _ => y) =
      p (k + l) (s.piecewise (fun _ => x) fun _ => y)
```

-- snippet 3
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.norm_changeOriginSeriesTerm (L77-L80)
theorem norm_changeOriginSeriesTerm (k l : ℕ) (s : Finset (Fin (k + l))) (hs : s.card = l) :
    ‖p.changeOriginSeriesTerm k l s hs‖ = ‖p (k + l)‖
```

-- snippet 4
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.nnnorm_changeOriginSeriesTerm (L82-L85)
theorem nnnorm_changeOriginSeriesTerm (k l : ℕ) (s : Finset (Fin (k + l))) (hs : s.card = l) :
    ‖p.changeOriginSeriesTerm k l s hs‖₊ = ‖p (k + l)‖₊
```

-- snippet 5
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.nnnorm_changeOriginSeriesTerm_apply_le (L86-L99)
theorem nnnorm_changeOriginSeriesTerm_apply_le (k l : ℕ) (s : Finset (Fin (k + l)))
    (hs : s.card = l) (x y : E) :
    ‖p.changeOriginSeriesTerm k l s hs (fun _ => x) fun _ => y‖₊ ≤
      ‖p (k + l)‖₊ * ‖x‖₊ ^ l * ‖y‖₊ ^ k
```

-- snippet 6
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.nnnorm_changeOriginSeries_le_tsum (L103-L108)
theorem nnnorm_changeOriginSeries_le_tsum (k l : ℕ) :
    ‖p.changeOriginSeries k l‖₊ ≤
      ∑' _ : { s : Finset (Fin (k + l)) // s.card = l }, ‖p (k + l)‖₊
```

-- snippet 7
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.nnnorm_changeOriginSeries_apply_le_tsum (L109-L117)
theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : ℕ) (x : E) :
    ‖p.changeOriginSeries k l fun _ => x‖₊ ≤
      ∑' _ : { s : Finset (Fin (k + l)) // s.card = l }, ‖p (k + l)‖₊ * ‖x‖₊ ^ l
```

-- snippet 8
```lean
-- Mathlib.Analysis.Analytic.ChangeOrigin.changeOrigin (L118-L128)
def changeOrigin (x : E) : FormalMultilinearSeries 𝕜 E F
```

-- snippet 9
```lean
-- Mathlib.Analysis.Analytic.Basic.HasFPowerSeriesWithinAt (L98-L101)
def HasFPowerSeriesWithinAt (f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (s : Set E) (x : E)
```

-- snippet 10
```lean
-- Mathlib.Analysis.Analytic.Basic.HasFPowerSeriesAt (L94-L97)
def HasFPowerSeriesAt (f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (x : E)
```

-- snippet 11
```lean
-- Mathlib.Analysis.Analytic.Basic.AnalyticWithinAt (L113-L117)
def AnalyticWithinAt (f : E → F) (s : Set E) (x : E) : Prop
```

-- snippet 12
```lean
-- Mathlib.Analysis.Analytic.Basic.AnalyticOnNhd (L118-L122)
def AnalyticOnNhd (f : E → F) (s : Set E)
```

-- snippet 13
```lean
-- Mathlib.Analysis.Analytic.Basic.AnalyticAt (L109-L112)
def AnalyticAt (f : E → F) (x : E)
```

-- snippet 14
```lean
-- Mathlib.Analysis.Analytic.Basic.AnalyticOn (L123-L131)
def AnalyticOn (f : E → F) (s : Set E) : Prop
```
[/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.NumberTheory.Modular).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem lcRow0_apply (p : Fin 2 → ℤ) (g : Matrix (Fin 2) (Fin 2) ℝ) :
    lcRow0 p g = p 0 * g 0 0 + p 1 * g 0 1
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.NumberTheory.Modular.bottom_row_coprime (L86-L91)
theorem bottom_row_coprime {R : Type*} [CommRing R] (g : SL(2, R)) :
    IsCoprime ((↑g : Matrix (Fin 2) (Fin 2) R) 1 0) ((↑g : Matrix (Fin 2) (Fin 2) R) 1 1)
```

-- snippet 2
```lean
-- Mathlib.NumberTheory.Modular.bottom_row_surj (L92-L109)
theorem bottom_row_surj {R : Type*} [CommRing R] :
    Set.SurjOn (fun g : SL(2, R) => (↑g : Matrix (Fin 2) (Fin 2) R) 1) Set.univ
      {cd | IsCoprime (cd 0) (cd 1)}
```

-- snippet 3
```lean
-- Mathlib.NumberTheory.Modular.tendsto_normSq_coprime_pair (L115-L163)
theorem tendsto_normSq_coprime_pair :
    Filter.Tendsto (fun p : Fin 2 → ℤ => normSq ((p 0 : ℂ) * z + p 1)) cofinite atTop
```

-- snippet 4
```lean
-- Mathlib.NumberTheory.Modular.lcRow0 (L164-L168)
def lcRow0 (p : Fin 2 → ℤ) : Matrix (Fin 2) (Fin 2) ℝ →ₗ[ℝ] ℝ
```

-- snippet 5
```lean
-- Mathlib.NumberTheory.Modular.lcRow0Extend (L177-L189)
def lcRow0Extend {cd : Fin 2 → ℤ} (hcd : IsCoprime (cd 0) (cd 1)) :
    Matrix (Fin 2) (Fin 2) ℝ ≃ₗ[ℝ] Matrix (Fin 2) (Fin 2) ℝ
```

-- snippet 6
```lean
-- Mathlib.NumberTheory.Modular.tendsto_lcRow0 (L190-L233)
theorem tendsto_lcRow0 {cd : Fin 2 → ℤ} (hcd : IsCoprime (cd 0) (cd 1)) :
    Tendsto (fun g : { g : SL(2, ℤ) // g 1 = cd } => lcRow0 cd ↑(↑g : SL(2, ℝ))) cofinite
      (cocompact ℝ)
```

-- snippet 7
```lean
-- Mathlib.NumberTheory.Modular.smul_eq_lcRow0_add (L234-L249)
theorem smul_eq_lcRow0_add {p : Fin 2 → ℤ} (hp : IsCoprime (p 0) (p 1)) (hg : g 1 = p) :
    ↑(g • z) =
      (lcRow0 p ↑(g : SL(2, ℝ)) : ℂ) / ((p 0 : ℂ) ^ 2 + (p 1 : ℂ) ^ 2) +
        ((p 1 : ℂ) * z - p 0) / (((p 0 : ℂ) ^ 2 + (p 1 : ℂ) ^ 2) * (p 0 * z + p 1))
```

-- snippet 8
```lean
-- Mathlib.NumberTheory.Modular.tendsto_abs_re_smul (L250-L274)
theorem tendsto_abs_re_smul {p : Fin 2 → ℤ} (hp : IsCoprime (p 0) (p 1)) :
    Tendsto
      (fun g : { g : SL(2, ℤ) // g 1 = p } => |((g : SL(2, ℤ)) • z).re|) cofinite atTop
```

<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.NumberTheory.Modular).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem lcRow0_apply (p : Fin 2 → ℤ) (g : Matrix (Fin 2) (Fin 2) ℝ) :
    lcRow0 p g = p 0 * g 0 0 + p 1 * g 0 1
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.NumberTheory.Modular.bottom_row_coprime (L86-L91)
theorem bottom_row_coprime {R : Type*} [CommRing R] (g : SL(2, R)) :
    IsCoprime ((↑g : Matrix (Fin 2) (Fin 2) R) 1 0) ((↑g : Matrix (Fin 2) (Fin 2) R) 1 1)
```

-- snippet 2
```lean
-- Mathlib.NumberTheory.Modular.bottom_row_surj (L92-L109)
theorem bottom_row_surj {R : Type*} [CommRing R] :
    Set.SurjOn (fun g : SL(2, R) => (↑g : Matrix (Fin 2) (Fin 2) R) 1) Set.univ
      {cd | IsCoprime (cd 0) (cd 1)}
```

-- snippet 3
```lean
-- Mathlib.NumberTheory.Modular.tendsto_normSq_coprime_pair (L115-L163)
theorem tendsto_normSq_coprime_pair :
    Filter.Tendsto (fun p : Fin 2 → ℤ => normSq ((p 0 : ℂ) * z + p 1)) cofinite atTop
```

-- snippet 4
```lean
-- Mathlib.NumberTheory.Modular.lcRow0 (L164-L168)
def lcRow0 (p : Fin 2 → ℤ) : Matrix (Fin 2) (Fin 2) ℝ →ₗ[ℝ] ℝ
```

-- snippet 5
```lean
-- Mathlib.NumberTheory.Modular.lcRow0Extend (L177-L189)
def lcRow0Extend {cd : Fin 2 → ℤ} (hcd : IsCoprime (cd 0) (cd 1)) :
    Matrix (Fin 2) (Fin 2) ℝ ≃ₗ[ℝ] Matrix (Fin 2) (Fin 2) ℝ
```

-- snippet 6
```lean
-- Mathlib.NumberTheory.Modular.tendsto_lcRow0 (L190-L233)
theorem tendsto_lcRow0 {cd : Fin 2 → ℤ} (hcd : IsCoprime (cd 0) (cd 1)) :
    Tendsto (fun g : { g : SL(2, ℤ) // g 1 = cd } => lcRow0 cd ↑(↑g : SL(2, ℝ))) cofinite
      (cocompact ℝ)
```

-- snippet 7
```lean
-- Mathlib.NumberTheory.Modular.smul_eq_lcRow0_add (L234-L249)
theorem smul_eq_lcRow0_add {p : Fin 2 → ℤ} (hp : IsCoprime (p 0) (p 1)) (hg : g 1 = p) :
    ↑(g • z) =
      (lcRow0 p ↑(g : SL(2, ℝ)) : ℂ) / ((p 0 : ℂ) ^ 2 + (p 1 : ℂ) ^ 2) +
        ((p 1 : ℂ) * z - p 0) / (((p 0 : ℂ) ^ 2 + (p 1 : ℂ) ^ 2) * (p 0 * z + p 1))
```

-- snippet 8
```lean
-- Mathlib.NumberTheory.Modular.tendsto_abs_re_smul (L250-L274)
theorem tendsto_abs_re_smul {p : Fin 2 → ℤ} (hp : IsCoprime (p 0) (p 1)) :
    Tendsto
      (fun g : { g : SL(2, ℤ) // g 1 = p } => |((g : SL(2, ℤ)) • z).re|) cofinite atTop
```
[/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.SpecialFunctions.Elliptic.Weierstrass).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
lemma derivWeierstrassP_zero : ℘'[L] 0 = 0
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.lattice (L79-L80)
def lattice : Submodule ℤ ℂ
```

-- snippet 2
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.mem_lattice (L81-L84)
lemma mem_lattice {L : PeriodPair} {x : ℂ} :
    x ∈ L.lattice ↔ ∃ m n : ℤ, m * L.ω₁ + n * L.ω₂ = x
```

-- snippet 3
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.ω₁_mem_lattice (L85-L85)
lemma ω₁_mem_lattice : L.ω₁ ∈ L.lattice
```

-- snippet 4
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.ω₂_mem_lattice (L86-L88)
lemma ω₂_mem_lattice : L.ω₂ ∈ L.lattice
```

-- snippet 5
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.mul_ω₁_add_mul_ω₂_mem_lattice (L89-L103)
lemma mul_ω₁_add_mul_ω₂_mem_lattice {L : PeriodPair} {α β : ℚ} :
    α * L.ω₁ + β * L.ω₂ ∈ L.lattice ↔ α.den = 1 ∧ β.den = 1
```

-- snippet 6
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.ω₁_div_two_notMem_lattice (L104-L107)
lemma ω₁_div_two_notMem_lattice : L.ω₁ / 2 ∉ L.lattice
```

-- snippet 7
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.ω₂_div_two_notMem_lattice (L108-L112)
lemma ω₂_div_two_notMem_lattice : L.ω₂ / 2 ∉ L.lattice
```

-- snippet 8
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.lattice_eq_span_range_basis (L113-L118)
lemma lattice_eq_span_range_basis :
    L.lattice = Submodule.span ℤ (Set.range L.basis)
```

-- snippet 9
```lean
-- Mathlib.Analysis.SpecialFunctions.Arcosh.arcosh_eq_zero_iff (L81-L84)
theorem arcosh_eq_zero_iff {x : ℝ} (hx : 1 ≤ x) : arcosh x = 0 ↔ x = 1
```

-- snippet 10
```lean
-- Mathlib.Analysis.SpecialFunctions.Arcosh.arcosh_zero (L69-L70)
theorem arcosh_zero : arcosh 1 = 0
```

-- snippet 11
```lean
-- Mathlib.Analysis.SpecialFunctions.Arcosh.cosh_arcosh (L77-L80)
theorem cosh_arcosh {x : ℝ} (hx : 1 ≤ x) : cosh (arcosh x) = x
```

-- snippet 12
```lean
-- Mathlib.Analysis.SpecialFunctions.Arcosh.add_sqrt_self_sq_sub_one_inv (L71-L76)
lemma add_sqrt_self_sq_sub_one_inv {x : ℝ} (hx : 1 ≤ x) :
    (x + √(x ^ 2 - 1))⁻¹ = x - √(x ^ 2 - 1)
```

-- snippet 13
```lean
-- Mathlib.Analysis.SpecialFunctions.Arcosh.exp_arcosh (L64-L67)
theorem exp_arcosh {x : ℝ} (hx : 1 ≤ x) : exp (arcosh x) = x + √(x ^ 2 - 1)
```

-- snippet 14
```lean
-- Mathlib.Analysis.SpecialFunctions.Arcosh.arcosh (L61-L63)
def arcosh (x : ℝ)
```

<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.Analysis.SpecialFunctions.Elliptic.Weierstrass).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
lemma derivWeierstrassP_zero : ℘'[L] 0 = 0
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.lattice (L79-L80)
def lattice : Submodule ℤ ℂ
```

-- snippet 2
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.mem_lattice (L81-L84)
lemma mem_lattice {L : PeriodPair} {x : ℂ} :
    x ∈ L.lattice ↔ ∃ m n : ℤ, m * L.ω₁ + n * L.ω₂ = x
```

-- snippet 3
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.ω₁_mem_lattice (L85-L85)
lemma ω₁_mem_lattice : L.ω₁ ∈ L.lattice
```

-- snippet 4
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.ω₂_mem_lattice (L86-L88)
lemma ω₂_mem_lattice : L.ω₂ ∈ L.lattice
```

-- snippet 5
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.mul_ω₁_add_mul_ω₂_mem_lattice (L89-L103)
lemma mul_ω₁_add_mul_ω₂_mem_lattice {L : PeriodPair} {α β : ℚ} :
    α * L.ω₁ + β * L.ω₂ ∈ L.lattice ↔ α.den = 1 ∧ β.den = 1
```

-- snippet 6
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.ω₁_div_two_notMem_lattice (L104-L107)
lemma ω₁_div_two_notMem_lattice : L.ω₁ / 2 ∉ L.lattice
```

-- snippet 7
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.ω₂_div_two_notMem_lattice (L108-L112)
lemma ω₂_div_two_notMem_lattice : L.ω₂ / 2 ∉ L.lattice
```

-- snippet 8
```lean
-- Mathlib.Analysis.SpecialFunctions.Elliptic.Weierstrass.lattice_eq_span_range_basis (L113-L118)
lemma lattice_eq_span_range_basis :
    L.lattice = Submodule.span ℤ (Set.range L.basis)
```

-- snippet 9
```lean
-- Mathlib.Analysis.SpecialFunctions.Arcosh.arcosh_eq_zero_iff (L81-L84)
theorem arcosh_eq_zero_iff {x : ℝ} (hx : 1 ≤ x) : arcosh x = 0 ↔ x = 1
```

-- snippet 10
```lean
-- Mathlib.Analysis.SpecialFunctions.Arcosh.arcosh_zero (L69-L70)
theorem arcosh_zero : arcosh 1 = 0
```

-- snippet 11
```lean
-- Mathlib.Analysis.SpecialFunctions.Arcosh.cosh_arcosh (L77-L80)
theorem cosh_arcosh {x : ℝ} (hx : 1 ≤ x) : cosh (arcosh x) = x
```

-- snippet 12
```lean
-- Mathlib.Analysis.SpecialFunctions.Arcosh.add_sqrt_self_sq_sub_one_inv (L71-L76)
lemma add_sqrt_self_sq_sub_one_inv {x : ℝ} (hx : 1 ≤ x) :
    (x + √(x ^ 2 - 1))⁻¹ = x - √(x ^ 2 - 1)
```

-- snippet 13
```lean
-- Mathlib.Analysis.SpecialFunctions.Arcosh.exp_arcosh (L64-L67)
theorem exp_arcosh {x : ℝ} (hx : 1 ≤ x) : exp (arcosh x) = x + √(x ^ 2 - 1)
```

-- snippet 14
```lean
-- Mathlib.Analysis.SpecialFunctions.Arcosh.arcosh (L61-L63)
def arcosh (x : ℝ)
```
[/INST]