@@ -19,6 +19,9 @@ nonarchimedean functions.
1919
2020public section
2121
22+ /- TODO: Remove the Funlike hypothesis on these statements and turn them all into the form
23+ {f : α → R} + properties on f. -/
24+
2225namespace IsNonarchimedean
2326
2427variable {R : Type *} [Semiring R] [LinearOrder R] {a b : R} {m n : ℕ}
@@ -112,6 +115,37 @@ theorem add_eq_max_of_ne {F α : Type*} [AddGroup α] [FunLike F α R]
112115 · rw [add_eq_left_of_lt hna h_lt]
113116 exact (max_eq_left_of_lt h_lt).symm
114117
118+ /- TODO: Remove the funlike conditions on the lemmas required for add_max_of_ne, this will allow us
119+ to remove the CommGroup part in the below which is unnecessary. -/
120+
121+ lemma add_eq_max_of_ne' {α S : Type *} [Semiring S] [LinearOrder S] [AddCommGroup α]
122+ (f : α → S) (fna : IsNonarchimedean f) (Neg : ∀ a, f a = f (-a)) {a b : α}
123+ (hne : f a ≠ f b) : f (a + b) = max (f a) (f b) := by
124+ wlog hab : f a > f b generalizing a b with H
125+ · simpa [add_comm, max_comm] using (H hne.symm ((not_lt.mp hab).lt_of_ne hne))
126+ apply le_antisymm (fna a b)
127+ rcases le_max_iff.mp (fna (a + b) (-b)) with h | h
128+ · simpa [max_eq_left (le_of_lt hab)] using h
129+ · exact absurd h (not_le.mpr (by simpa [Neg b] using hab))
130+
131+ omit [Semiring R] in
132+ open Finset in
133+ /-- Ultrametric inequality with `Finset.sum`. -/
134+ lemma apply_sum_le_sup {α β : Type *} [AddCommMonoid α] {f : α → R}
135+ (nonarch : IsNonarchimedean f) {s : Finset β} (hnonempty : s.Nonempty) {l : β → α} :
136+ f (∑ i ∈ s, l i) ≤ s.sup' hnonempty fun i => f (l i) := by
137+ induction hnonempty using Nonempty.cons_induction with
138+ | singleton i => simp
139+ | cons i s _ hs hind =>
140+ simp only [sum_cons, le_sup'_iff, mem_cons, exists_eq_or_imp]
141+ rw [← le_sup'_iff hs]
142+ rcases le_max_iff.mp <| nonarch (l i) (∑ i ∈ s, l i) with h₁ | h₂
143+ · exact .inl h₁
144+ · exact .inr <| le_trans h₂ hind
145+
146+ @ [deprecated (since := "2026-04-27" )]
147+ alias apply_sum_le_sup_of_isNonarchimedean := apply_sum_le_sup
148+
115149omit [Semiring R] in
116150/-- Given a nonarchimedean function `α → R`, a function `g : β → α` and a nonempty multiset
117151 `s : Multiset β`, we can always find `b : β` belonging to `s` such that
@@ -133,11 +167,10 @@ theorem multiset_image_add_of_nonempty {α β : Type*} [AddCommMonoid α] [Nonem
133167omit [Semiring R] in
134168/-- Given a nonarchimedean function `α → R`, a function `g : β → α` and a nonempty finset
135169 `t : Finset β`, we can always find `b : β` belonging to `t` such that `f (t.sum g) ≤ f (g b)` . -/
136- theorem finset_image_add_of_nonempty {α β : Type *} [AddCommMonoid α] [Nonempty β] {f : α → R}
170+ theorem finset_image_add_of_nonempty {α β : Type *} [AddCommMonoid α] {f : α → R}
137171 (hna : IsNonarchimedean f) (g : β → α) {t : Finset β} (ht : t.Nonempty) :
138172 ∃ b ∈ t, f (t.sum g) ≤ f (g b) := by
139- apply multiset_image_add_of_nonempty hna
140- simp_all [Finset.nonempty_iff_ne_empty]
173+ simpa [Finset.le_sup'_iff] using IsNonarchimedean.apply_sum_le_sup hna ht
141174
142175/-- Given a nonnegative nonarchimedean function `α → R` such that `f 0 = 0`, a function `g : β → α`
143176 and a multiset `s : Multiset β`, we can always find `b : β`, belonging to `s` if `s` is nonempty,
@@ -155,13 +188,13 @@ theorem multiset_image_add {F α β : Type*} [AddCommMonoid α] [FunLike F α R]
155188/-- Given a nonnegative nonarchimedean function `α → R` such that `f 0 = 0`, a function `g : β → α`
156189 and a finset `t : Finset β`, we can always find `b : β`, belonging to `t` if `t` is nonempty,
157190 such that `f (t.sum g) ≤ f (g b)` . -/
158- theorem finset_image_add {F α β : Type *} [AddCommMonoid α] [FunLike F α R]
159- [ZeroHomClass F α R] [NonnegHomClass F α R] [Nonempty β] {f : F} (hna : IsNonarchimedean f)
160- (g : β → α) (t : Finset β ) :
161- ∃ b : β, (t.Nonempty → b ∈ t) ∧ f (t.sum g) ≤ f (g b) := by
162- have h1 : t.Nonempty ↔ t.val ≠ 0 := by simp [Finset.nonempty_iff_ne_empty ]
163- rw [h1]
164- exact multiset_image_add hna g t.val
191+ lemma finset_image_add {α β : Type *} [AddCommMonoid α] [Nonempty β] {f : α → R} (f_zero : f 0 = 0 )
192+ (f_nonneg : ∀ x, 0 ≤ f x) (hna : IsNonarchimedean f) (g : β → α) (t : Finset β) :
193+ ∃ i, (t.Nonempty → i ∈ t) ∧ f (t.sum g) ≤ f (g i ) := by
194+ rcases t.eq_empty_or_nonempty with rfl | ht
195+ · simp [f_zero, f_nonneg ]
196+ · exact ( fun ⟨i, h, h'⟩ => ⟨i, fun _ ↦ h, h'⟩) <|
197+ IsNonarchimedean.finset_image_add_of_nonempty hna g ht
165198
166199open Multiset in
167200theorem multiset_powerset_image_add [IsStrictOrderedRing R]
@@ -186,50 +219,30 @@ theorem finset_powerset_image_add [IsStrictOrderedRing R]
186219 f ((powersetCard (s.card - m) s).sum fun t : Finset β ↦
187220 t.prod fun i : β ↦ -b i) ≤ f (u.val.prod fun i : β ↦ -b i) := by
188221 set g := fun t : Finset β ↦ t.prod fun i : β ↦ - b i
189- obtain ⟨b, hb_in, hb⟩ := hf_na.finset_image_add g (powersetCard (s.card - m) s)
222+ obtain ⟨b, hb_in, hb⟩ := hf_na.finset_image_add (by grind) (apply_nonneg f)
223+ g (powersetCard (s.card - m) s)
190224 exact ⟨⟨b, hb_in (powersetCard_nonempty.mpr (Nat.sub_le s.card m))⟩, hb⟩
191225
192- omit [Semiring R] in
193- open Finset in
194- /-- Ultrametric inequality with `Finset.sum`. -/
195- lemma apply_sum_le_sup {α β : Type *} [AddCommMonoid α] {f : α → R}
196- (nonarch : IsNonarchimedean f) {s : Finset β} (hnonempty : s.Nonempty) {l : β → α} :
197- f (∑ i ∈ s, l i) ≤ s.sup' hnonempty fun i => f (l i) := by
198- induction hnonempty using Nonempty.cons_induction with
199- | singleton i => simp
200- | cons i s _ hs hind =>
201- simp only [sum_cons, le_sup'_iff, mem_cons, exists_eq_or_imp]
202- rw [← le_sup'_iff hs]
203- rcases le_max_iff.mp <| nonarch (l i) (∑ i ∈ s, l i) with h₁ | h₂
204- · exact .inl h₁
205- · exact .inr <| le_trans h₂ hind
206-
207- @ [deprecated (since := "2026-04-27" )]
208- alias apply_sum_le_sup_of_isNonarchimedean := apply_sum_le_sup
209-
210- open Finset in
211- lemma apply_sum_eq_of_lt {α β F : Type *} [AddCommGroup α] [FunLike F α R]
212- [AddGroupSeminormClass F α R] {f : F} (nonarch : IsNonarchimedean f) {s : Finset β} {l : β → α}
213- {k : β} (hk : k ∈ s) (hmax : ∀ j ∈ s, j ≠ k → f (l j) < f (l k)) :
214- f (∑ i ∈ s, l i) = f (l k) := by
215- have : s.Nonempty := by use k
216- induction this using Nonempty.cons_induction generalizing k with
217- | singleton a => simp_all
218- | cons a s _ hs _ =>
219- by_cases ha : k = a
220- · rw [sum_cons, ha]
221- apply add_eq_left_of_lt nonarch
222- grw [apply_sum_le_sup nonarch hs]
223- grind [sup'_lt_iff]
224- · grind [add_eq_right_of_lt nonarch]
226+ lemma apply_sum_eq_of_lt {α β : Type *} [AddCommGroup α] {f : α → R} (fna : IsNonarchimedean f)
227+ (f_neg : ∀ a, f a = f (-a)) {s : Finset β} {l : β → α} {k : β} (hk : k ∈ s)
228+ (hmax : ∀ j ∈ s, j ≠ k → f (l j) < f (l k)) : f (∑ i ∈ s, l i) = f (l k) := by
229+ by_cases hcard : s.card = 1
230+ · grind [Finset.card_eq_one.mp hcard]
231+ · classical
232+ rw [← Finset.add_sum_erase _ _ hk]
233+ have hNonempty : (s.erase k).Nonempty :=
234+ Finset.Nontrivial.erase_nonempty (Finset.one_lt_card_iff_nontrivial.mp (by grind))
235+ have hrest_le := IsNonarchimedean.apply_sum_le_sup fna hNonempty (l := l)
236+ simp only [Finset.le_sup'_iff, Finset.mem_erase, ne_eq] at hrest_le
237+ rw [add_eq_max_of_ne' f fna f_neg (by grind), max_eq_left (le_of_lt (by grind))]
225238
226239/-- If `f` is a nonarchimedean additive group seminorm on a commutative ring `α`, `n : ℕ`, and
227240 `a b : α`, then we can find `m : ℕ` such that `m ≤ n` and
228241 `f ((a + b) ^ n) ≤ (f (a ^ m)) * (f (b ^ (n - m)))`. -/
229242theorem add_pow_le {F α : Type *} [CommRing α] [FunLike F α R] [ZeroHomClass F α R]
230243 [NonnegHomClass F α R] [SubmultiplicativeHomClass F α R] {f : F} (hna : IsNonarchimedean f)
231244 (n : ℕ) (a b : α) : ∃ m < n + 1 , f ((a + b) ^ n) ≤ f (a ^ m) * f (b ^ (n - m)) := by
232- obtain ⟨m, hm_lt, hM⟩ := finset_image_add hna
245+ obtain ⟨m, hm_lt, hM⟩ := finset_image_add ( by aesop) ( by aesop) hna
233246 (fun m => a ^ m * b ^ (n - m) * ↑(n.choose m)) (Finset.range (n + 1 ))
234247 simp only [Finset.nonempty_range_iff, ne_eq, Nat.succ_ne_zero, not_false_iff, Finset.mem_range,
235248 forall_true_left] at hm_lt
0 commit comments