Zulip Chat Archive

Stream: lean4

Topic: quiz: the smallest equivalence relation of `r`


Bulhwi Cha (Feb 15 2023 at 02:38):

Quiz: read the following excerpt from Section Quotients of #tpil4 and prove the theorems below.

universe u
#check (Quot.sound :  {α : Type u} {r : α  α  Prop} {a b : α},
  r a b  Quot.mk r a = Quot.mk r b)

This is the axiom that asserts that any two elements of α that are related by r become identified in the quotient. If a theorem or definition makes use of Quot.sound, it will show up in the #print axioms command.

Of course, the quotient construction is most commonly used in situations when r is an equivalence relation. Given r as above, if we define r' according to the rule r' a b iff Quot.mk r a = Quot.mk r b, then it's clear that r' is an equivalence relation. Indeed, r' is the kernel of the function a ↦ Quot.mk r a. The axiom Quot.sound says that r a b implies r' a b. Using Quot.lift and Quot.ind, we can show that r' is the smallest equivalence relation containing r, in the sense that if r'' is any equivalence relation containing r, then r' a b implies r'' a b. In particular, if r was an equivalence relation to start with, then for all a and b we have r a b iff r' a b.

import Mathlib.Logic.Basic
namespace Quot

-- `Ker r` is the *kernel* of the function `a ↦ Quot.mk r a`
def Ker {α : Type u} (r : α  α  Prop) : α  α  Prop :=
  sorry

-- `Ker r` is an equivalence relation
theorem Ker_is_equivalence {α : Type u} (r : α  α  Prop) : Equivalence (Ker r) where
  refl  := sorry
  symm  := sorry
  trans := sorry

-- `Ker r` is the smallest equivalence relation containing `r`
theorem Ker_is_smallest {α : Type u} {r r' : α  α  Prop} (eqv_r' : Equivalence r')
    (sub_r_r' : Subrelation r r') : Subrelation (Ker r) r' := by
  sorry

-- if `r` is an equivalence relation, then `r = Ker r`
theorem eqv_eq_Ker {α : Type u} {r : α  α  Prop} (eqv_r : Equivalence r) : r = Ker r :=
  sorry

end Quot

Solutions

Bulhwi Cha (Feb 15 2023 at 02:38):

The theorem Ker_is_smallest was much harder to prove than I thought.


Last updated: Dec 20 2023 at 11:08 UTC