@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
4
4
Author: Jeremy Avigad, Andrew Zipperer, Haitao Zhang, Minchao Wu, Yury Kudryashov
5
5
-/
6
6
import data.set.basic
7
- import logic.function.basic
7
+ import logic.function.conjugate
8
8
9
9
/-!
10
10
# Functions over sets
@@ -91,7 +91,7 @@ lemma eq_on.mono (hs : s₁ ⊆ s₂) (hf : eq_on f₁ f₂ s₂) : eq_on f₁ f
91
91
/-! ### maps to -/
92
92
93
93
/-- `maps_to f a b` means that the image of `a` is contained in `b`. -/
94
- @[reducible] def maps_to (f : α → β) (s : set α) (t : set β) : Prop := s ⊆ f ⁻¹' t
94
+ @[reducible] def maps_to (f : α → β) (s : set α) (t : set β) : Prop := ∀ ⦃x⦄, x ∈ s → f x ∈ t
95
95
96
96
/-- Given a map `f` sending `s : set α` into `t : set β`, restrict domain of `f` to `s`
97
97
and the codomain to `t`. Same as `subtype.map`. -/
@@ -112,7 +112,7 @@ maps_to'.1 h
112
112
113
113
theorem maps_to.congr (h₁ : maps_to f₁ s t) (h : eq_on f₁ f₂ s) :
114
114
maps_to f₂ s t :=
115
- λ x hx, by rw [mem_preimage, ← h hx]; exact h₁ hx
115
+ λ x hx, h hx ▸ h₁ hx
116
116
117
117
theorem eq_on.maps_to_iff (H : eq_on f₁ f₂ s) : maps_to f₁ s t ↔ maps_to f₂ s t :=
118
118
⟨λ h, h.congr H, λ h, h.congr H.symm⟩
@@ -353,7 +353,8 @@ left_inv_on g f s ∧ right_inv_on g f t
353
353
354
354
lemma inv_on.symm (h : inv_on f' f s t) : inv_on f f' t s := ⟨h.right, h.left⟩
355
355
356
- theorem inv_on.bij_on (h : inv_on f' f s t) (hf : maps_to f s t) (hf' : maps_to f' t s) : bij_on f s t :=
356
+ theorem inv_on.bij_on (h : inv_on f' f s t) (hf : maps_to f s t) (hf' : maps_to f' t s) :
357
+ bij_on f s t :=
357
358
⟨hf, h.left.inj_on, h.right.surj_on hf'⟩
358
359
359
360
/-! ### `inv_fun_on` is a left/right inverse -/
@@ -387,7 +388,7 @@ theorem surj_on.bij_on_subset [nonempty α] (h : surj_on f s t) :
387
388
begin
388
389
refine h.inv_on_inv_fun_on.bij_on _ (maps_to_image _ _),
389
390
rintros _ ⟨y, hy, rfl⟩,
390
- rwa [mem_preimage, h.right_inv_on_inv_fun_on hy]
391
+ rwa [h.right_inv_on_inv_fun_on hy]
391
392
end
392
393
393
394
theorem surj_on_iff_exists_bij_on_subset :
@@ -453,7 +454,7 @@ namespace function
453
454
454
455
open set
455
456
456
- variables {f : α → β} {g : β → γ} {s : set α}
457
+ variables {fa : α → α} {fb : β → β} { f : α → β} {g : β → γ} {s t : set α}
457
458
458
459
lemma injective.inj_on (h : injective f) (s : set α) : s.inj_on f :=
459
460
λ _ _ _ _ heq, h heq
@@ -465,6 +466,68 @@ lemma surjective.surj_on (hf : surjective f) (s : set β) :
465
466
surj_on f univ s :=
466
467
(surjective_iff_surj_on_univ.1 hf).mono (subset.refl _) (subset_univ _)
467
468
469
+ namespace semiconj
470
+
471
+ lemma maps_to_image (h : semiconj f fa fb) (ha : maps_to fa s t) :
472
+ maps_to fb (f '' s) (f '' t) :=
473
+ λ y ⟨x, hx, hy⟩, hy ▸ ⟨fa x, ha hx, h x⟩
474
+
475
+ lemma maps_to_range (h : semiconj f fa fb) : maps_to fb (range f) (range f) :=
476
+ λ y ⟨x, hy⟩, hy ▸ ⟨fa x, h x⟩
477
+
478
+ lemma surj_on_image (h : semiconj f fa fb) (ha : surj_on fa s t) :
479
+ surj_on fb (f '' s) (f '' t) :=
480
+ begin
481
+ rintros y ⟨x, hxt, rfl⟩,
482
+ rcases ha hxt with ⟨x, hxs, rfl⟩,
483
+ rw [h x],
484
+ exact mem_image_of_mem _ (mem_image_of_mem _ hxs)
485
+ end
486
+
487
+ lemma surj_on_range (h : semiconj f fa fb) (ha : surjective fa) :
488
+ surj_on fb (range f) (range f) :=
489
+ by { rw ← image_univ, exact h.surj_on_image (ha.surj_on univ) }
490
+
491
+ lemma inj_on_image (h : semiconj f fa fb) (ha : inj_on fa s) (hf : inj_on f (fa '' s)) :
492
+ inj_on fb (f '' s) :=
493
+ begin
494
+ rintros _ _ ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩ H,
495
+ simp only [← h.eq] at H,
496
+ exact congr_arg f (ha hx hy $ hf (mem_image_of_mem fa hx) (mem_image_of_mem fa hy) H)
497
+ end
498
+
499
+ lemma inj_on_range (h : semiconj f fa fb) (ha : injective fa) (hf : inj_on f (range fa)) :
500
+ inj_on fb (range f) :=
501
+ by { rw ← image_univ at *, exact h.inj_on_image (ha.inj_on univ) hf }
502
+
503
+ lemma bij_on_image (h : semiconj f fa fb) (ha : bij_on fa s t) (hf : inj_on f t) :
504
+ bij_on fb (f '' s) (f '' t) :=
505
+ ⟨h.maps_to_image ha.maps_to, h.inj_on_image ha.inj_on (ha.image_eq.symm ▸ hf),
506
+ h.surj_on_image ha.surj_on⟩
507
+
508
+ lemma bij_on_range (h : semiconj f fa fb) (ha : bijective fa) (hf : injective f) :
509
+ bij_on fb (range f) (range f) :=
510
+ begin
511
+ rw [← image_univ],
512
+ exact h.bij_on_image (bijective_iff_bij_on_univ.1 ha) (hf.inj_on univ)
513
+ end
514
+
515
+ lemma maps_to_preimage (h : semiconj f fa fb) {s t : set β} (hb : maps_to fb s t) :
516
+ maps_to fa (f ⁻¹' s) (f ⁻¹' t) :=
517
+ λ x hx, by simp only [mem_preimage, h x, hb hx]
518
+
519
+ lemma inj_on_preimage (h : semiconj f fa fb) {s : set β} (hb : inj_on fb s)
520
+ (hf : inj_on f (f ⁻¹' s)) :
521
+ inj_on fa (f ⁻¹' s) :=
522
+ begin
523
+ intros x y hx hy H,
524
+ have := congr_arg f H,
525
+ rw [h.eq, h.eq] at this ,
526
+ exact hf hx hy (hb hx hy this )
527
+ end
528
+
529
+ end semiconj
530
+
468
531
lemma update_comp_eq_of_not_mem_range [decidable_eq β]
469
532
(g : β → γ) {f : α → β} {i : β} (a : γ) (h : i ∉ set.range f) :
470
533
(function.update g i a) ∘ f = g ∘ f :=
0 commit comments