@@ -163,6 +163,11 @@ def partially_well_ordered_on (s) (r : α → α → Prop) : Prop :=
163
163
def is_pwo [preorder α] (s) : Prop :=
164
164
partially_well_ordered_on s ((≤) : α → α → Prop )
165
165
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
+
166
171
theorem partially_well_ordered_on.image_of_monotone {s : set α}
167
172
{r : α → α → Prop } {β : Type *} {r' : β → β → Prop }
168
173
(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 β]
271
276
is_pwo (f '' s) :=
272
277
hs.image_of_monotone hf
273
278
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
+
274
309
end partial_order
275
310
276
311
theorem is_wf.is_pwo [linear_order α] {s : set α}
@@ -294,8 +329,10 @@ theorem is_wf_iff_is_pwo [linear_order α] {s : set α} :
294
329
295
330
end set
296
331
332
+ namespace finset
333
+
297
334
@[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 α} :
299
336
set.partially_well_ordered_on (↑f : set α) r :=
300
337
begin
301
338
intros g hg,
@@ -312,12 +349,12 @@ begin
312
349
end
313
350
314
351
@[simp]
315
- theorem finset. is_pwo [partial_order α] {f : finset α} :
352
+ theorem is_pwo [partial_order α] {f : finset α} :
316
353
set.is_pwo (↑f : set α) :=
317
354
finset.partially_well_ordered_on
318
355
319
356
@[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 α} :
321
358
set.well_founded_on (↑f : set α) r :=
322
359
begin
323
360
rw [set.well_founded_on_iff_no_descending_seq],
@@ -327,31 +364,33 @@ begin
327
364
end
328
365
329
366
@[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 α) :=
331
368
finset.is_pwo.is_wf
332
369
370
+ end finset
371
+
333
372
namespace set
334
373
variables [partial_order α] {s : set α} {a : α}
335
374
336
- theorem finite.is_wf (h : s.finite) : s.is_wf :=
375
+ theorem finite.is_pwo (h : s.finite) : s.is_pwo :=
337
376
begin
338
377
rw ← h.coe_to_finset,
339
- exact finset.is_wf ,
378
+ exact finset.is_pwo ,
340
379
end
341
380
342
381
@[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
344
383
345
384
@[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
348
387
349
388
@[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
352
391
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) }
355
394
356
395
/-- `is_wf.min` returns a minimal element of a nonempty well-founded set. -/
357
396
noncomputable def is_wf.min (hs : is_wf s) (hn : s.nonempty) : α :=
@@ -378,7 +417,22 @@ begin
378
417
revert hf,
379
418
apply f.induction_on,
380
419
{ 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], },
382
436
{ intros s f sf hf hsf,
383
437
rw finset.sup_insert,
384
438
exact (hsf s (finset.mem_insert_self _ _)).union (hf (λ s' s'f, hsf _
@@ -416,17 +470,18 @@ end set
416
470
417
471
namespace set
418
472
419
- variables [linear_ordered_cancel_comm_monoid α] {s : set α} {t : set α}
473
+ variables {s : set α} {t : set α}
420
474
421
475
@[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) :
424
477
is_pwo (s * t) :=
425
478
begin
426
479
rw ← image_mul_prod,
427
480
exact (is_pwo.prod hs ht).image_of_monotone (λ _ _ h, mul_le_mul' h.1 h.2 ),
428
481
end
429
482
483
+ variable [linear_ordered_cancel_comm_monoid α]
484
+
430
485
@[to_additive]
431
486
theorem is_wf.mul (hs : s.is_wf) (ht : t.is_wf) : is_wf (s * t) :=
432
487
(hs.is_pwo.mul ht.is_pwo).is_wf
@@ -545,8 +600,8 @@ end set
545
600
546
601
namespace finset
547
602
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 : α)
550
605
551
606
/-- `finset.mul_antidiagonal_of_is_wf hs ht a` is the set of all pairs of an element in
552
607
`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 : α)
555
610
`s` and an element in `t` that add to `a`, but its construction requires proofs
556
611
`hs` and `ht` that `s` and `t` are well-ordered." ]
557
612
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
559
614
560
- variables {hs} {ht} {u : set α} {hu : u.is_wf } {a} {x : α × α}
615
+ variables {hs} {ht} {u : set α} {hu : u.is_pwo } {a} {x : α × α}
561
616
562
617
@[simp, to_additive]
563
618
lemma mem_mul_antidiagonal :
@@ -589,13 +644,16 @@ lemma support_mul_antidiagonal_subset_mul :
589
644
end )
590
645
591
646
@[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 :=
594
649
(hs.mul ht).mono support_mul_antidiagonal_subset_mul
595
650
596
651
@[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)} :=
599
657
begin
600
658
ext ⟨a1, a2⟩,
601
659
rw [mem_mul_antidiagonal, finset.mem_singleton, prod.ext_iff],
0 commit comments