Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 287492c

Browse files
committed
refactor(ring_theory/hahn_series): non-linearly-ordered Hahn series (#7377)
Refactors Hahn series to use `set.is_pwo` instead of `set.is_wf`, allowing them to be defined on non-linearly-ordered monomial types
1 parent 57cc384 commit 287492c

File tree

2 files changed

+148
-84
lines changed

2 files changed

+148
-84
lines changed

src/order/well_founded_set.lean

Lines changed: 83 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ def partially_well_ordered_on (s) (r : α → α → Prop) : Prop :=
163163
def is_pwo [preorder α] (s) : Prop :=
164164
partially_well_ordered_on s ((≤) : α → α → Prop)
165165

166+
theorem partially_well_ordered_on.mono {s t : set α} {r : α → α → Prop}
167+
(ht : t.partially_well_ordered_on r) (hsub : s ⊆ t) :
168+
s.partially_well_ordered_on r :=
169+
λ f hf, ht f (set.subset.trans hf hsub)
170+
166171
theorem partially_well_ordered_on.image_of_monotone {s : set α}
167172
{r : α → α → Prop} {β : Type*} {r' : β → β → Prop}
168173
(hs : s.partially_well_ordered_on r) {f : α → β} (hf : ∀ a1 a2 : α, r a1 a2 → r' (f a1) (f a2)) :
@@ -271,6 +276,36 @@ theorem is_pwo.image_of_monotone {β : Type*} [partial_order β]
271276
is_pwo (f '' s) :=
272277
hs.image_of_monotone hf
273278

279+
theorem is_pwo.union (hs : is_pwo s) (ht : is_pwo t) : is_pwo (s ∪ t) :=
280+
begin
281+
classical,
282+
rw [is_pwo_iff_exists_monotone_subseq] at *,
283+
rintros f fst,
284+
have h : infinite (f ⁻¹' s) ∨ infinite (f ⁻¹' t),
285+
{ have h : infinite (univ : set ℕ) := infinite_univ,
286+
have hpre : f ⁻¹' (s ∪ t) = set.univ,
287+
{ rw [← image_univ, image_subset_iff, univ_subset_iff] at fst,
288+
exact fst },
289+
rw preimage_union at hpre,
290+
rw ← hpre at h,
291+
rw [infinite, infinite],
292+
rw infinite at h,
293+
contrapose! h,
294+
exact finite.union h.1 h.2, },
295+
rw [← infinite_coe_iff, ← infinite_coe_iff] at h,
296+
cases h with inf inf; haveI := inf,
297+
{ obtain ⟨g, hg⟩ := hs (f ∘ (nat.order_embedding_of_set (f ⁻¹' s))) _,
298+
{ rw [function.comp.assoc, ← rel_embedding.coe_trans] at hg,
299+
exact ⟨_, hg⟩ },
300+
rw [range_comp, image_subset_iff],
301+
simp },
302+
{ obtain ⟨g, hg⟩ := ht (f ∘ (nat.order_embedding_of_set (f ⁻¹' t))) _,
303+
{ rw [function.comp.assoc, ← rel_embedding.coe_trans] at hg,
304+
exact ⟨_, hg⟩ },
305+
rw [range_comp, image_subset_iff],
306+
simp }
307+
end
308+
274309
end partial_order
275310

276311
theorem is_wf.is_pwo [linear_order α] {s : set α}
@@ -294,8 +329,10 @@ theorem is_wf_iff_is_pwo [linear_order α] {s : set α} :
294329

295330
end set
296331

332+
namespace finset
333+
297334
@[simp]
298-
theorem finset.partially_well_ordered_on {r : α → α → Prop} [is_refl α r] {f : finset α} :
335+
theorem partially_well_ordered_on {r : α → α → Prop} [is_refl α r] {f : finset α} :
299336
set.partially_well_ordered_on (↑f : set α) r :=
300337
begin
301338
intros g hg,
@@ -312,12 +349,12 @@ begin
312349
end
313350

314351
@[simp]
315-
theorem finset.is_pwo [partial_order α] {f : finset α} :
352+
theorem is_pwo [partial_order α] {f : finset α} :
316353
set.is_pwo (↑f : set α) :=
317354
finset.partially_well_ordered_on
318355

319356
@[simp]
320-
theorem finset.well_founded_on {r : α → α → Prop} [is_strict_order α r] {f : finset α} :
357+
theorem well_founded_on {r : α → α → Prop} [is_strict_order α r] {f : finset α} :
321358
set.well_founded_on (↑f : set α) r :=
322359
begin
323360
rw [set.well_founded_on_iff_no_descending_seq],
@@ -327,31 +364,33 @@ begin
327364
end
328365

329366
@[simp]
330-
theorem finset.is_wf [partial_order α] {f : finset α} : set.is_wf (↑f : set α) :=
367+
theorem is_wf [partial_order α] {f : finset α} : set.is_wf (↑f : set α) :=
331368
finset.is_pwo.is_wf
332369

370+
end finset
371+
333372
namespace set
334373
variables [partial_order α] {s : set α} {a : α}
335374

336-
theorem finite.is_wf (h : s.finite) : s.is_wf :=
375+
theorem finite.is_pwo (h : s.finite) : s.is_pwo :=
337376
begin
338377
rw ← h.coe_to_finset,
339-
exact finset.is_wf,
378+
exact finset.is_pwo,
340379
end
341380

342381
@[simp]
343-
theorem fintype.is_wf [fintype α] : s.is_wf := (finite.of_fintype s).is_wf
382+
theorem fintype.is_pwo [fintype α] : s.is_pwo := (finite.of_fintype s).is_pwo
344383

345384
@[simp]
346-
theorem is_wf_empty : is_wf (∅ : set α) :=
347-
finite_empty.is_wf
385+
theorem is_pwo_empty : is_pwo (∅ : set α) :=
386+
finite_empty.is_pwo
348387

349388
@[simp]
350-
theorem is_wf_singleton (a) : is_wf ({a} : set α) :=
351-
(finite_singleton a).is_wf
389+
theorem is_pwo_singleton (a) : is_pwo ({a} : set α) :=
390+
(finite_singleton a).is_pwo
352391

353-
theorem is_wf.insert (a) (hs : is_wf s) : is_wf (insert a s) :=
354-
by { rw ← union_singleton, exact hs.union (is_wf_singleton a) }
392+
theorem is_pwo.insert (a) (hs : is_pwo s) : is_pwo (insert a s) :=
393+
by { rw ← union_singleton, exact hs.union (is_pwo_singleton a) }
355394

356395
/-- `is_wf.min` returns a minimal element of a nonempty well-founded set. -/
357396
noncomputable def is_wf.min (hs : is_wf s) (hn : s.nonempty) : α :=
@@ -378,7 +417,22 @@ begin
378417
revert hf,
379418
apply f.induction_on,
380419
{ intro h,
381-
simp, },
420+
simp [set.is_pwo_empty.is_wf], },
421+
{ intros s f sf hf hsf,
422+
rw finset.sup_insert,
423+
exact (hsf s (finset.mem_insert_self _ _)).union (hf (λ s' s'f, hsf _
424+
(finset.mem_insert_of_mem s'f))) }
425+
end
426+
427+
@[simp]
428+
theorem finset.is_pwo_sup {ι : Type*} [partial_order α] (f : finset ι) (g : ι → set α)
429+
(hf : ∀ i : ι, i ∈ f → (g i).is_pwo) : (f.sup g).is_pwo :=
430+
begin
431+
classical,
432+
revert hf,
433+
apply f.induction_on,
434+
{ intro h,
435+
simp [set.is_pwo_empty.is_wf], },
382436
{ intros s f sf hf hsf,
383437
rw finset.sup_insert,
384438
exact (hsf s (finset.mem_insert_self _ _)).union (hf (λ s' s'f, hsf _
@@ -416,17 +470,18 @@ end set
416470

417471
namespace set
418472

419-
variables [linear_ordered_cancel_comm_monoid α] {s : set α} {t : set α}
473+
variables {s : set α} {t : set α}
420474

421475
@[to_additive]
422-
theorem is_pwo.mul
423-
(hs : s.is_pwo) (ht : t.is_pwo) :
476+
theorem is_pwo.mul [ordered_cancel_comm_monoid α] (hs : s.is_pwo) (ht : t.is_pwo) :
424477
is_pwo (s * t) :=
425478
begin
426479
rw ← image_mul_prod,
427480
exact (is_pwo.prod hs ht).image_of_monotone (λ _ _ h, mul_le_mul' h.1 h.2),
428481
end
429482

483+
variable [linear_ordered_cancel_comm_monoid α]
484+
430485
@[to_additive]
431486
theorem is_wf.mul (hs : s.is_wf) (ht : t.is_wf) : is_wf (s * t) :=
432487
(hs.is_pwo.mul ht.is_pwo).is_wf
@@ -545,8 +600,8 @@ end set
545600

546601
namespace finset
547602

548-
variables [linear_ordered_cancel_comm_monoid α]
549-
variables {s t : set α} (hs : s.is_wf) (ht : t.is_wf) (a : α)
603+
variables [ordered_cancel_comm_monoid α]
604+
variables {s t : set α} (hs : s.is_pwo) (ht : t.is_pwo) (a : α)
550605

551606
/-- `finset.mul_antidiagonal_of_is_wf hs ht a` is the set of all pairs of an element in
552607
`s` and an element in `t` that multiply to `a`, but its construction requires proofs
@@ -555,9 +610,9 @@ variables {s t : set α} (hs : s.is_wf) (ht : t.is_wf) (a : α)
555610
`s` and an element in `t` that add to `a`, but its construction requires proofs
556611
`hs` and `ht` that `s` and `t` are well-ordered."]
557612
noncomputable def mul_antidiagonal : finset (α × α) :=
558-
(set.mul_antidiagonal.finite_of_is_wf hs ht a).to_finset
613+
(set.mul_antidiagonal.finite_of_is_pwo hs ht a).to_finset
559614

560-
variables {hs} {ht} {u : set α} {hu : u.is_wf} {a} {x : α × α}
615+
variables {hs} {ht} {u : set α} {hu : u.is_pwo} {a} {x : α × α}
561616

562617
@[simp, to_additive]
563618
lemma mem_mul_antidiagonal :
@@ -589,13 +644,16 @@ lemma support_mul_antidiagonal_subset_mul :
589644
end)
590645

591646
@[to_additive]
592-
theorem is_wf_support_mul_antidiagonal :
593-
{ a : α | (mul_antidiagonal hs ht a).nonempty }.is_wf :=
647+
theorem is_pwo_support_mul_antidiagonal :
648+
{ a : α | (mul_antidiagonal hs ht a).nonempty }.is_pwo :=
594649
(hs.mul ht).mono support_mul_antidiagonal_subset_mul
595650

596651
@[to_additive]
597-
theorem mul_antidiagonal_min_mul_min (hns : s.nonempty) (hnt : t.nonempty) :
598-
mul_antidiagonal hs ht ((hs.min hns) * (ht.min hnt)) = {(hs.min hns, ht.min hnt)} :=
652+
theorem mul_antidiagonal_min_mul_min {α} [linear_ordered_cancel_comm_monoid α] {s t : set α}
653+
(hs : s.is_wf) (ht : t.is_wf)
654+
(hns : s.nonempty) (hnt : t.nonempty) :
655+
mul_antidiagonal hs.is_pwo ht.is_pwo ((hs.min hns) * (ht.min hnt)) =
656+
{(hs.min hns, ht.min hnt)} :=
599657
begin
600658
ext ⟨a1, a2⟩,
601659
rw [mem_mul_antidiagonal, finset.mem_singleton, prod.ext_iff],

0 commit comments

Comments
 (0)