@@ -32,6 +32,33 @@ infix 4 _≢_
32
32
_≢_ : {A : Set a} → Rel A a
33
33
x ≢ y = ¬ x ≡ y
34
34
35
+ ------------------------------------------------------------------------
36
+ -- A variant of `refl` where the argument is explicit
37
+
38
+ pattern erefl x = refl {x = x}
39
+
40
+ ------------------------------------------------------------------------
41
+ -- Congruence lemmas
42
+
43
+ cong : ∀ (f : A → B) {x y} → x ≡ y → f x ≡ f y
44
+ cong f refl = refl
45
+
46
+ cong′ : ∀ {f : A → B} x → f x ≡ f x
47
+ cong′ _ = refl
48
+
49
+ icong : ∀ {f : A → B} {x y} → x ≡ y → f x ≡ f y
50
+ icong = cong _
51
+
52
+ icong′ : ∀ {f : A → B} x → f x ≡ f x
53
+ icong′ _ = refl
54
+
55
+ cong₂ : ∀ (f : A → B → C) {x y u v} → x ≡ y → u ≡ v → f x u ≡ f y v
56
+ cong₂ f refl refl = refl
57
+
58
+ cong-app : ∀ {A : Set a} {B : A → Set b} {f g : (x : A) → B x} →
59
+ f ≡ g → (x : A) → f x ≡ g x
60
+ cong-app refl x = refl
61
+
35
62
------------------------------------------------------------------------
36
63
-- Properties of _≡_
37
64
@@ -44,19 +71,9 @@ trans refl eq = eq
44
71
subst : Substitutive {A = A} _≡_ ℓ
45
72
subst P refl p = p
46
73
47
- cong : ∀ (f : A → B) {x y} → x ≡ y → f x ≡ f y
48
- cong f refl = refl
49
-
50
74
subst₂ : ∀ (_∼_ : REL A B ℓ) {x y u v} → x ≡ y → u ≡ v → x ∼ u → y ∼ v
51
75
subst₂ _ refl refl p = p
52
76
53
- cong-app : ∀ {A : Set a} {B : A → Set b} {f g : (x : A) → B x} →
54
- f ≡ g → (x : A) → f x ≡ g x
55
- cong-app refl x = refl
56
-
57
- cong₂ : ∀ (f : A → B → C) {x y u v} → x ≡ y → u ≡ v → f x u ≡ f y v
58
- cong₂ f refl refl = refl
59
-
60
77
respˡ : ∀ (∼ : Rel A ℓ) → ∼ Respectsˡ _≡_
61
78
respˡ _∼_ refl x∼y = x∼y
62
79
0 commit comments