Zulip Chat Archive

Stream: general

Topic: congrarg for dependent types?


Dean Young (Aug 03 2023 at 04:29):

Is there a dependent version of congrarg? I have this dilemma with needing category.mk X = category.mk Y when X = Y

def zero : Nat := 0


def reflexivity {X : Type} {x : X} : x = x := Eq.refl x


def symmetry {X : Type} {x : X} {y : X}  (p : x = y) := Eq.symm p


def transitivity {X : Type} {x : X} {y : X} {z : X} (p : x = y) (q : y = z) := Eq.trans p q


def extensionality (f g : X  Y) (p : (x:X)  f x = g x) : f = g := funext p

def proposition_extensionality (p : Prop) (x : p) (y : p) : x = y := by
simp

def equal_arguments {X : Type} {Y : Type} {a : X} {b : X} (f : X  Y) (p : a = b) : f a = f b := congrArg f p

def equal_functions {X : Type} {Y : Type} {f₁ : X  Y} {f₂ : X  Y} (p : f₁ = f₂) (x : X) : f₁ x = f₂ x := congrFun p x

def pairwise {A : Type} {B : Type} (a₁ : A) (a₂ : A) (b₁ : B) (b₂ : B) (p : a₁ = a₂) (q : b₁ = b₂) : (a₁,b₁)=(a₂,b₂) := (congr ((congrArg Prod.mk) p) q)


-- A category C consists of:
structure category.{u₀,v₀} where
  Obj : Type u₀
  Hom : Obj  Obj  Type v₀
  Idn : (X:Obj)  Hom X X
  Cmp : (X:Obj)  (Y:Obj)  (Z:Obj)  (_:Hom X Y)  (_:Hom Y Z)  Hom X Z
  Id₁ : (X:Obj)  (Y:Obj)  (f:Hom X Y) 
    Cmp X Y Y f (Idn Y) = f
  Id₂ : (X:Obj)  (Y:Obj)  (f:Hom X Y) 
    Cmp X X Y (Idn X) f = f
  Ass : (W:Obj)  (X:Obj)  (Y:Obj)  (Z:Obj)  (f:Hom W X)  (g:Hom X Y)  (h:Hom Y Z) 
    (Cmp W X Z) f (Cmp X Y Z g h) = Cmp W Y Z (Cmp W X Y f g) h


def equal_arguments  := congrArg f p

def MWE {X : Type} {Y : Type} (p : X = Y)  : (category.mk X = category.mk Y) := congrArg category.mk p

Scott Morrison (Aug 03 2023 at 04:50):

Why do you post all those synonyms (zero, etc) at the top of your #mwe? They are irrelevant.

Scott Morrison (Aug 03 2023 at 04:51):

category.mk X = category.mk Y doesn't typecheck, and I'm not sure what you want to do.

Scott Morrison (Aug 03 2023 at 04:51):

Have you tried using the Mathlib development of category theory?


Last updated: Dec 20 2023 at 11:08 UTC