diff --git a/hott/hit/trunc.hlean b/hott/hit/trunc.hlean index 78f41e963..68278b7ef 100644 --- a/hott/hit/trunc.hlean +++ b/hott/hit/trunc.hlean @@ -114,7 +114,7 @@ namespace trunc notation `exists` binders `,` r:(scoped P, Exists P) := r notation `∃` binders `,` r:(scoped P, Exists P) := r - notation A `\/` B := or A B + notation A ` \/ ` B := or A B notation A ∨ B := or A B definition merely.intro [reducible] [constructor] (a : A) : ∥ A ∥ := tr a diff --git a/hott/init/function.hlean b/hott/init/function.hlean index 1e9b754a1..6f1e4eeb3 100644 --- a/hott/init/function.hlean +++ b/hott/init/function.hlean @@ -58,11 +58,11 @@ precedence `on`:1 precedence `$`:1 -infixr ∘ := compose -infixr ∘' := dcompose -infixl on := on_fun -infixr $ := app -notation f `-[` op `]-` g := combine f op g +infixr ∘ := compose +infixr ∘' := dcompose +infixl on := on_fun +infixr $ := app +notation f ` -[` op `]- ` g := combine f op g end function diff --git a/hott/init/path.hlean b/hott/init/path.hlean index 6a2fc5128..18180e0f7 100644 --- a/hott/init/path.hlean +++ b/hott/init/path.hlean @@ -458,14 +458,14 @@ namespace eq -- In Coq the variables P, Q and b are explicit, but in Lean we can probably have them implicit -- using the following notation - notation p `▸D`:65 x:64 := transportD _ p _ x + notation p ` ▸D `:65 x:64 := transportD _ p _ x -- Transporting along higher-dimensional paths definition transport2 [unfold 7] (P : A → Type) {x y : A} {p q : x = y} (r : p = q) (z : P x) : p ▸ z = q ▸ z := ap (λp', p' ▸ z) r - notation p `▸2`:65 x:64 := transport2 _ p _ x + notation p ` ▸2 `:65 x:64 := transport2 _ p _ x -- An alternative definition. definition tr2_eq_ap10 (Q : A → Type) {x y : A} {p q : x = y} (r : p = q) @@ -486,7 +486,7 @@ namespace eq {x1 x2 : A} (p : x1 = x2) (y : B x1) (z : C x1) (w : D x1 y z) : D x2 (p ▸ y) (p ▸ z) := eq.rec_on p w - notation p `▸D2`:65 x:64 := transportD2 _ _ _ p _ _ x + notation p ` ▸D2 `:65 x:64 := transportD2 _ _ _ p _ _ x definition ap_tr_con_tr2 (P : A → Type) {x y : A} {p q : x = y} {z w : P x} (r : p = q) (s : z = w) : diff --git a/hott/init/pathover.hlean b/hott/init/pathover.hlean index 72b1ce5a8..1459145bc 100644 --- a/hott/init/pathover.hlean +++ b/hott/init/pathover.hlean @@ -20,7 +20,7 @@ namespace eq inductive pathover.{l} (B : A → Type.{l}) (b : B a) : Π{a₂ : A}, a = a₂ → B a₂ → Type.{l} := idpatho : pathover B b (refl a) b - notation b `=[`:50 p:0 `]`:0 b₂:50 := pathover _ b p b₂ + notation b ` =[`:50 p:0 `] `:0 b₂:50 := pathover _ b p b₂ definition idpo [reducible] [constructor] : b =[refl a] b := pathover.idpatho b diff --git a/hott/init/reserved_notation.hlean b/hott/init/reserved_notation.hlean index dbf2d60f0..3a17537bc 100644 --- a/hott/init/reserved_notation.hlean +++ b/hott/init/reserved_notation.hlean @@ -33,62 +33,62 @@ num.succ (num.succ (num.succ (num.succ (num.succ (num.succ (num.succ (num.succ ( /- Logical operations and relations -/ reserve prefix `¬`:40 -reserve prefix `~`:40 -reserve infixr `∧`:35 -reserve infixr `/\`:35 -reserve infixr `\/`:30 -reserve infixr `∨`:30 -reserve infix `<->`:20 -reserve infix `↔`:20 -reserve infix `=`:50 -reserve infix `≠`:50 -reserve infix `≈`:50 -reserve infix `~`:50 -reserve infix `≡`:50 +reserve prefix ` ~ `:40 +reserve infixr ` ∧ `:35 +reserve infixr ` /\ `:35 +reserve infixr ` \/ `:30 +reserve infixr ` ∨ `:30 +reserve infix ` <-> `:20 +reserve infix ` ↔ `:20 +reserve infix ` = `:50 +reserve infix ` ≠ `:50 +reserve infix ` ≈ `:50 +reserve infix ` ~ `:50 +reserve infix ` ≡ `:50 -reserve infixr `∘`:60 -- input with \comp +reserve infixr ` ∘ `:60 -- input with \comp reserve postfix `⁻¹`:std.prec.max_plus -- input with \sy or \-1 or \inv -reserve infixl `⬝`:75 -reserve infixr `▸`:75 +reserve infixl ` ⬝ `:75 +reserve infixr ` ▸ `:75 /- types and type constructors -/ -reserve infixr `⊎`:25 -reserve infixr `×`:30 +reserve infixr ` ⊎ `:25 +reserve infixr ` × `:30 /- arithmetic operations -/ -reserve infixl `+`:65 -reserve infixl `-`:65 -reserve infixl `*`:70 -reserve infixl `div`:70 -reserve infixl `mod`:70 -reserve infixl `/`:70 -reserve prefix `-`:100 -reserve infix `^`:80 +reserve infixl ` + `:65 +reserve infixl ` - `:65 +reserve infixl ` * `:70 +reserve infixl ` div `:70 +reserve infixl ` mod `:70 +reserve infixl ` / `:70 +reserve prefix ` - `:100 +reserve infix ` ^ `:80 -reserve infix `<=`:50 -reserve infix `≤`:50 -reserve infix `<`:50 -reserve infix `>=`:50 -reserve infix `≥`:50 -reserve infix `>`:50 +reserve infix ` <= `:50 +reserve infix ` ≤ `:50 +reserve infix ` < `:50 +reserve infix ` >= `:50 +reserve infix ` ≥ `:50 +reserve infix ` > `:50 /- boolean operations -/ -reserve infixl `&&`:70 -reserve infixl `||`:65 +reserve infixl ` && `:70 +reserve infixl ` || `:65 /- set operations -/ -reserve infix `∈`:50 -reserve infix `∉`:50 -reserve infixl `∩`:70 -reserve infixl `∪`:65 +reserve infix ` ∈ `:50 +reserve infix ` ∉ `:50 +reserve infixl ` ∩ `:70 +reserve infixl ` ∪ `:65 /- other symbols -/ -reserve infix `∣`:50 -reserve infixl `++`:65 -reserve infixr `::`:65 +reserve infix ` ∣ `:50 +reserve infixl ` ++ `:65 +reserve infixr ` :: `:65 diff --git a/hott/init/types.hlean b/hott/init/types.hlean index e8c60d189..19aa3880b 100644 --- a/hott/init/types.hlean +++ b/hott/init/types.hlean @@ -32,10 +32,10 @@ end unit -- Sigma type -- ---------- -notation `Σ` binders `,` r:(scoped P, sigma P) := r +notation `Σ` binders `, ` r:(scoped P, sigma P) := r namespace sigma - notation `⟨`:max t:(foldr `,` (e r, mk e r)) `⟩`:0 := t --input ⟨ ⟩ as \< \> + notation `⟨`:max t:(foldr `, ` (e r, mk e r)) `⟩`:0 := t --input ⟨ ⟩ as \< \> namespace ops postfix `.1`:(max+1) := pr1 @@ -52,8 +52,8 @@ namespace sum infixr ⊎ := sum infixr + := sum namespace low_precedence_plus - reserve infixr `+`:25 -- conflicts with notation for addition - infixr `+` := sum + reserve infixr ` + `:25 -- conflicts with notation for addition + infixr ` + ` := sum end low_precedence_plus variables {a b c d : Type} @@ -81,7 +81,7 @@ abbreviation pair [constructor] := @prod.mk namespace prod -- notation for n-ary tuples - notation `(` h `,` t:(foldl `,` (e r, prod.mk r e) h) `)` := t + notation `(` h `, ` t:(foldl `,` (e r, prod.mk r e) h) `)` := t infixr × := prod namespace ops @@ -94,8 +94,8 @@ namespace prod namespace low_precedence_times - reserve infixr `*`:30 -- conflicts with notation for multiplication - infixr `*` := prod + reserve infixr ` * `:30 -- conflicts with notation for multiplication + infixr ` * ` := prod end low_precedence_times diff --git a/hott/types/W.hlean b/hott/types/W.hlean index fa074a905..51d1f6e67 100644 --- a/hott/types/W.hlean +++ b/hott/types/W.hlean @@ -13,7 +13,7 @@ inductive Wtype.{l k} {A : Type.{l}} (B : A → Type.{k}) : Type.{max l k} := sup : Π (a : A), (B a → Wtype.{l k} B) → Wtype.{l k} B namespace Wtype - notation `W` binders `,` r:(scoped B, Wtype B) := r + notation `W` binders `, ` r:(scoped B, Wtype B) := r universe variables u v variables {A A' : Type.{u}} {B B' : A → Type.{v}} {C : Π(a : A), B a → Type} @@ -28,7 +28,7 @@ namespace Wtype namespace ops postfix `.1`:(max+1) := Wtype.pr1 postfix `.2`:(max+1) := Wtype.pr2 - notation `⟨` a `,` f `⟩`:0 := Wtype.sup a f --input ⟨ ⟩ as \< \> + notation `⟨` a `, ` f `⟩`:0 := Wtype.sup a f --input ⟨ ⟩ as \< \> end ops open ops diff --git a/library/data/set/basic.lean b/library/data/set/basic.lean index 5edee0594..ba389f600 100644 --- a/library/data/set/basic.lean +++ b/library/data/set/basic.lean @@ -53,12 +53,12 @@ assume h, absurd rfl (and.elim_right h) /- bounded quantification -/ abbreviation bounded_forall (a : set X) (P : X → Prop) := ∀⦃x⦄, x ∈ a → P x -notation `forallb` binders `∈` a `,` r:(scoped:1 P, P) := bounded_forall a r -notation `∀₀` binders `∈` a `,` r:(scoped:1 P, P) := bounded_forall a r +notation `forallb` binders `∈` a `, ` r:(scoped:1 P, P) := bounded_forall a r +notation `∀₀` binders `∈` a `, ` r:(scoped:1 P, P) := bounded_forall a r abbreviation bounded_exists (a : set X) (P : X → Prop) := ∃⦃x⦄, x ∈ a ∧ P x -notation `existsb` binders `∈` a `,` r:(scoped:1 P, P) := bounded_exists a r -notation `∃₀` binders `∈` a `,` r:(scoped:1 P, P) := bounded_exists a r +notation `existsb` binders `∈` a `, ` r:(scoped:1 P, P) := bounded_exists a r +notation `∃₀` binders `∈` a `, ` r:(scoped:1 P, P) := bounded_exists a r theorem bounded_exists.intro {P : X → Prop} {s : set X} {x : X} (xs : x ∈ s) (Px : P x) : ∃₀ x ∈ s, P x := diff --git a/library/init/function.lean b/library/init/function.lean index 2a8d28684..a918662e9 100644 --- a/library/init/function.lean +++ b/library/init/function.lean @@ -56,15 +56,11 @@ rfl theorem uncurry_curry (f : A × B → C) : uncurry (curry f) = f := funext (λ p, match p with (a, b) := rfl end) -precedence `∘'`:60 -precedence `on`:1 -precedence `$`:1 - -infixr ∘ := compose -infixr ∘' := dcompose -infixl on := on_fun -infixr $ := app -notation f `-[` op `]-` g := combine f op g +infixr ` ∘ ` := compose +infixr ` ∘' `:60 := dcompose +infixl ` on `:1 := on_fun +infixr ` $ `:1 := app +notation f ` -[` op `]- ` g := combine f op g lemma left_id (f : A → B) : id ∘ f = f := rfl diff --git a/library/init/setoid.lean b/library/init/setoid.lean index a253d90ee..dc138dc77 100644 --- a/library/init/setoid.lean +++ b/library/init/setoid.lean @@ -11,7 +11,7 @@ structure setoid [class] (A : Type) := (r : A → A → Prop) (iseqv : equivalence r) namespace setoid - infix `≈` := setoid.r + infix ` ≈ ` := setoid.r variable {A : Type} variable [s : setoid A] diff --git a/library/logic/quantifiers.lean b/library/logic/quantifiers.lean index 129f4c98d..ca55b9cdd 100644 --- a/library/logic/quantifiers.lean +++ b/library/logic/quantifiers.lean @@ -75,7 +75,7 @@ end definition exists_unique {A : Type} (p : A → Prop) := ∃x, p x ∧ ∀y, p y → y = x -notation `∃!` binders `,` r:(scoped P, exists_unique P) := r +notation `∃!` binders `, ` r:(scoped P, exists_unique P) := r theorem exists_unique.intro {A : Type} {p : A → Prop} (w : A) (H1 : p w) (H2 : ∀y, p y → y = w) : ∃!x, p x :=