Skip to content

Commit 4cdbe00

Browse files
committed
feat(Logic/Relation): more lemmas relating Relation.Map and Function.onFun
1 parent 9b57848 commit 4cdbe00

1 file changed

Lines changed: 22 additions & 5 deletions

File tree

Mathlib/Logic/Relation.lean

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,19 +240,36 @@ lemma map_mono {r s : α → β → Prop} {f : α → γ} {g : β → δ} (h :
240240
∀ x y, Relation.Map r f g x y → Relation.Map s f g x y :=
241241
fun _ _ ⟨x, y, hxy, hx, hy⟩ => ⟨x, y, h _ _ hxy, hx, hy⟩
242242

243+
lemma le_onFun_map {r : α → α → Prop} (f : α → β) :
244+
∀ x y, r x y → (Relation.Map r f f on f) x y := by
245+
grind [Relation.Map]
246+
247+
lemma onFun_map_eq_of_injective {r : α → α → Prop} {f : α → β} (hinj : f.Injective) :
248+
(Relation.Map r f f on f) = r := by
249+
ext x y
250+
exact ⟨fun ⟨x', y', hr, hx, hy⟩ ↦ hinj hx ▸ hinj hy ▸ hr, fun h ↦ ⟨x, y, h, rfl, rfl⟩⟩
251+
243252
lemma map_onFun_le {r : β → β → Prop} (f : α → β) :
244-
∀ x y, Relation.Map (Function.onFun r f) f f x y → r x y := by
253+
∀ x y, Relation.Map (r on f) f f x y → r x y := by
245254
grind [Relation.Map]
246255

247-
lemma map_onFun_eq_of_surjective {r : β → β → Prop} {f : α → β} (hsurj : Function.Surjective f) :
248-
Relation.Map (Function.onFun r f) f f = r := by
256+
lemma map_onFun_eq_of_surjective {r : β → β → Prop} {f : α → β} (hsurj : f.Surjective) :
257+
Relation.Map (r on f) f f = r := by
249258
ext x y
250259
have _ := hsurj x
251260
have _ := hsurj y
252261
grind [Relation.Map]
253262

254-
lemma map_onFun_iff {r : β → β → Prop} (f : α → β) (a₁ a₂ : α) :
255-
Relation.Map (Function.onFun r f) f f (f a₁) (f a₂) ↔ r (f a₁) (f a₂) := by
263+
lemma map_onFun_map_eq_map {r : α → α → Prop} (f : α → β) :
264+
Relation.Map (Relation.Map r f f on f) f f = Relation.Map r f f := by
265+
grind [Relation.Map]
266+
267+
lemma onFun_map_onFun_eq_onFun {r : β → β → Prop} (f : α → β) :
268+
(Relation.Map (r on f) f f on f) = (r on f) := by
269+
grind [Relation.Map]
270+
271+
lemma onFun_map_onFun_iff_onFun {r : β → β → Prop} (f : α → β) (a₁ a₂ : α) :
272+
Relation.Map (r on f) f f (f a₁) (f a₂) ↔ r (f a₁) (f a₂) := by
256273
grind [Relation.Map]
257274

258275
end Map

0 commit comments

Comments
 (0)