feat(library): add some spacing hints

This commit is contained in:
Sebastian Ullrich 2015-09-30 17:06:31 +02:00 committed by Leonardo de Moura
parent da08079af9
commit d1b5031dbd
32 changed files with 115 additions and 115 deletions

View file

@ -125,8 +125,8 @@ variable [C : complete_lattice A]
include C
prefix `⨅`:70 := Inf
prefix `⨆`:65 := Sup
infix `⊓` := inf
infix `⊔` := sup
infix ` ` := inf
infix ` ` := sup
variable {f : A → A}
premise (mono : ∀ x y : A, x ≤ y → f x ≤ f y)

View file

@ -25,7 +25,7 @@ section division_ring
include s
definition divide (a b : A) : A := a * b⁻¹
infix [priority algebra.prio] `/` := divide
infix [priority algebra.prio] / := divide
-- only in this file
local attribute divide [reducible]

View file

@ -36,8 +36,8 @@ structure has_inv [class] (A : Type) :=
structure has_neg [class] (A : Type) :=
(neg : A → A)
infixl [priority algebra.prio] `*` := has_mul.mul
infixl [priority algebra.prio] `+` := has_add.add
infixl [priority algebra.prio] ` * ` := has_mul.mul
infixl [priority algebra.prio] ` + ` := has_add.add
postfix [priority algebra.prio] `⁻¹` := has_inv.inv
prefix [priority algebra.prio] `-` := has_neg.neg
notation 1 := !has_one.one
@ -287,8 +287,8 @@ section group
definition conj_by (g a : A) := g * a * g⁻¹
definition is_conjugate (a b : A) := ∃ x, conj_by x b = a
local infixl `~` := is_conjugate
local infixr `∘c`:55 := conj_by
local infixl ` ~ ` := is_conjugate
local infixr ` ∘c `:55 := conj_by
lemma conj_compose (f g a : A) : f ∘c g ∘c a = f*g ∘c a :=
calc f ∘c g ∘c a = f * (g * a * g⁻¹) * f⁻¹ : rfl
@ -478,7 +478,7 @@ section add_group
-- TODO: derive corresponding facts for div in a field
definition sub [reducible] (a b : A) : A := a + -b
infix [priority algebra.prio] `-` := sub
infix [priority algebra.prio] - := sub
theorem sub_eq_add_neg (a b : A) : a - b = a + -b := rfl

View file

@ -28,7 +28,7 @@ definition pow (a : A) : → A
| 0 := 1
| (n+1) := a * pow n
infix [priority algebra.prio] `^` := pow
infix [priority algebra.prio] ` ^ ` := pow
theorem pow_zero (a : A) : a^0 = 1 := rfl
theorem pow_succ (a : A) (n : ) : a^(succ n) = a * a^n := rfl

View file

@ -23,8 +23,8 @@ structure lattice [class] (A : Type) extends weak_order A :=
definition inf := @lattice.inf
definition sup := @lattice.sup
infix `⊓`:70 := inf
infix `⊔`:65 := sup
infix ` `:70 := inf
infix ` `:65 := sup
section
variable [s : lattice A]

View file

@ -20,9 +20,9 @@ structure has_le [class] (A : Type) :=
structure has_lt [class] (A : Type) :=
(lt : A → A → Prop)
infixl [priority algebra.prio] `<=` := has_le.le
infixl [priority algebra.prio] `` := has_le.le
infixl [priority algebra.prio] `<` := has_lt.lt
infixl [priority algebra.prio] <= := has_le.le
infixl [priority algebra.prio] ≤ := has_le.le
infixl [priority algebra.prio] < := has_lt.lt
definition has_le.ge [reducible] {A : Type} [s : has_le A] (a b : A) := b ≤ a
notation [priority algebra.prio] a ≥ b := has_le.ge a b

View file

@ -20,12 +20,12 @@ structure equiv [class] (A B : Type) :=
namespace equiv
definition perm [reducible] (A : Type) := equiv A A
infix `≃`:50 := equiv
infix ` `:50 := equiv
definition fn {A B : Type} (e : equiv A B) : A → B :=
@equiv.to_fun A B e
infixr `∙`:100 := fn
infixr ` `:100 := fn
definition inv {A B : Type} [e : equiv A B] : B → A :=
@equiv.inv_fun A B e
@ -54,9 +54,9 @@ protected definition trans [trans] {A B C : Type} : A ≃ B → B ≃ C → A
abbreviation id {A : Type} := equiv.refl A
namespace ops
postfix `⁻¹` := equiv.symm
postfix `⁻¹` := equiv.inv
notation e₁ `` e₂ := equiv.trans e₂ e₁
postfix ⁻¹ := equiv.symm
postfix ⁻¹ := equiv.inv
notation e₁ ∘ e₂ := equiv.trans e₂ e₁
end ops
open equiv.ops

View file

@ -15,7 +15,7 @@ inductive vector (A : Type) : nat → Type :=
namespace vector
notation a :: b := cons a b
notation `[` l:(foldr `,` (h t, cons h t) nil `]`) := l
notation `[` l:(foldr `, ` (h t, cons h t) nil `]`) := l
variables {A B C : Type}

View file

@ -74,7 +74,7 @@ quot.lift_on s (λ l, a ∈ elt_of l)
(λ ainl₁, mem_perm e ainl₁)
(λ ainl₂, mem_perm (perm.symm e) ainl₂)))
infix [priority finset.prio] `` := mem
infix [priority finset.prio] ∈ := mem
notation [priority finset.prio] a ∉ b := ¬ mem a b
theorem mem_of_mem_list {a : A} {l : nodup_list A} : a ∈ elt_of l → a ∈ ⟦l⟧ :=
@ -169,7 +169,7 @@ quot.lift_on s
(λ (l₁ l₂ : nodup_list A) (p : l₁ ~ l₂), quot.sound (perm_insert a p))
-- set builder notation
notation [priority finset.prio] `'{`:max a:(foldr `,` (x b, insert x b) ∅) `}`:0 := a
notation [priority finset.prio] `'{`:max a:(foldr `, ` (x b, insert x b) ∅) `}`:0 := a
theorem mem_insert (a : A) (s : finset A) : a ∈ insert a s :=
quot.induction_on s
@ -546,7 +546,7 @@ quot.lift_on₂ s₁ s₂
(λ s₁ a i, mem_perm p₂ (s₁ a (mem_perm (perm.symm p₁) i)))
(λ s₂ a i, mem_perm (perm.symm p₂) (s₂ a (mem_perm p₁ i)))))
infix [priority finset.prio] `` := subset
infix [priority finset.prio] ⊆ := subset
theorem empty_subset (s : finset A) : ∅ ⊆ s :=
quot.induction_on s (λ l, list.nil_sub (elt_of l))

View file

@ -125,7 +125,7 @@ quot.lift_on s
(list.nodup_filter p (subtype.has_property l)))
(λ l₁ l₂ u, quot.sound (perm.perm_filter u))
notation [priority finset.prio] `{` binder ∈ s `|` r:(scoped:1 p, sep p s) `}` := r
notation [priority finset.prio] `{` binder ` ` s ` | ` r:(scoped:1 p, sep p s) `}` := r
theorem sep_empty : sep p ∅ = ∅ := rfl
@ -178,7 +178,7 @@ variables {A : Type} [deceq : decidable_eq A]
include deceq
definition diff (s t : finset A) : finset A := {x ∈ s | x ∉ t}
infix [priority finset.prio] `\`:70 := diff
infix [priority finset.prio] ` \ `:70 := diff
theorem mem_of_mem_diff {s t : finset A} {x : A} (H : x ∈ s \ t) : x ∈ s :=
mem_of_mem_sep H

View file

@ -64,7 +64,7 @@ of_finset (finset.insert a (to_finset s))
definition mem (a : hf) (s : hf) : Prop :=
finset.mem a (to_finset s)
infix `` := mem
infix ∈ := mem
notation [priority finset.prio] a ∉ b := ¬ mem a b
lemma insert_lt_of_not_mem {a s : hf} : a ∉ s → s < insert a s :=
@ -314,7 +314,7 @@ end
definition subset (s₁ s₂ : hf) : Prop :=
finset.subset (to_finset s₁) (to_finset s₂)
infix [priority hf.prio] `` := subset
infix [priority hf.prio] ⊆ := subset
theorem empty_subset (s : hf) : ∅ ⊆ s :=
begin unfold [empty, subset], rewrite to_finset_of_finset, apply finset.empty_subset (to_finset s) end

View file

@ -45,7 +45,7 @@ namespace int
attribute int.of_nat [coercion]
notation `-[1+` n `]` := int.neg_succ_of_nat n -- for pretty-printing output
notation `-[1+ ` n `]` := int.neg_succ_of_nat n -- for pretty-printing output
/- definitions of basic functions -/
@ -137,7 +137,7 @@ theorem eq_zero_of_nat_abs_eq_zero : Π {a : }, nat_abs a = 0 → a = 0
protected definition equiv (p q : × ) : Prop := pr1 p + pr2 q = pr2 p + pr1 q
local infix `` := int.equiv
local infix ≡ := int.equiv
protected theorem equiv.refl [refl] {p : × } : p ≡ p := !add.comm

View file

@ -26,7 +26,7 @@ notation [priority int.prio] a div b := divide a b
definition modulo (a b : ) : := a - a div b * b
notation [priority int.prio] a mod b := modulo a b
notation [priority int.prio] a `` b `[mod`:100 c `]`:0 := a mod c = b mod c
notation [priority int.prio] a ≡ b `[mod `:100 c `]`:0 := a mod c = b mod c
/- div -/

View file

@ -19,7 +19,7 @@ section migrate_algebra
definition pow (a : ) (n : ) : := algebra.pow a n
infix [priority int.prio] ^ := pow
definition nmul (n : ) (a : ) : := algebra.nmul n a
infix [priority int.prio] `` := nmul
infix [priority int.prio] ⬝ := nmul
definition imul (i : ) (a : ) : := algebra.imul i a
migrate from algebra with int

View file

@ -17,7 +17,7 @@ inhabited.mk list.nil
namespace list
notation h :: t := cons h t
notation `[` l:(foldr `,` (h t, cons h t) nil `]`) := l
notation `[` l:(foldr `, ` (h t, cons h t) nil `]`) := l
variable {T : Type}
@ -352,7 +352,7 @@ assume P, and.intro (ne_of_not_mem_cons P) (not_mem_of_not_mem_cons P)
definition sublist (l₁ l₂ : list T) := ∀ ⦃a : T⦄, a ∈ l₁ → a ∈ l₂
infix `` := sublist
infix ⊆ := sublist
theorem nil_sub [simp] (l : list T) : [] ⊆ l :=
λ b i, false.elim (iff.mp (mem_nil_iff b) i)

View file

@ -17,7 +17,7 @@ definition val [reducible] (M : matrix A m n) (i : fin m) (j : fin n) : A :=
M i j
namespace ops
notation M `[` i `,` j `]` := val M i j
notation M `[` i `, ` j `]` := val M i j
end ops
open ops

View file

@ -14,7 +14,7 @@ namespace nat
definition addl (x y : ) : :=
nat.rec y (λ n r, succ r) x
infix `⊕`:65 := addl
infix ` `:65 := addl
theorem addl_succ_right (n m : ) : n ⊕ succ m = succ (n ⊕ m) :=
nat.induction_on n

View file

@ -78,7 +78,7 @@ if H : 0 < y ∧ y ≤ x then f (x - y) (div_rec_lemma H) y else x
definition modulo := fix mod.F
notation a mod b := modulo a b
notation a `` b `[mod`:100 c `]`:0 := a mod c = b mod c
notation a ≡ b `[mod `:100 c `]`:0 := a mod c = b mod c
theorem modulo_def (x y : nat) : modulo x y = if 0 < y ∧ y ≤ x then modulo (x - y) y else x :=
congr_fun (fix_eq mod.F x) y

View file

@ -31,7 +31,7 @@ private lemma lbp_succ {x : nat} : lbp x → ¬ p x → lbp (succ x) :=
private definition gtb (a b : nat) : Prop :=
a > b ∧ lbp a
local infix `≺`:50 := gtb
local infix ` `:50 := gtb
private lemma acc_of_px {x : nat} : p x → acc gtb x :=
assume h,

View file

@ -17,7 +17,7 @@ private definition pair_nat.lt.wf : well_founded pair_nat.lt :=
intro_k (measure.wf pr₂) 20 -- we use intro_k to be able to execute gcd efficiently in the kernel
local attribute pair_nat.lt.wf [instance] -- instance will not be saved in .olean
local infixl `≺`:50 := pair_nat.lt
local infixl ` `:50 := pair_nat.lt
private definition gcd.lt.dec (x y₁ : nat) : (succ y₁, x mod succ y₁) ≺ (x, succ y₁) :=
!mod_lt (succ_pos y₁)

View file

@ -77,7 +77,7 @@ namespace pos_num
end
local notation a < b := (lt a b = tt)
local notation a `≮`:50 b:50 := (lt a b = ff)
local notation a ` `:50 b:50 := (lt a b = ff)
theorem lt_one_right_eq_ff : ∀ a : pos_num, a ≮ one
| one := rfl

View file

@ -27,18 +27,18 @@ theorem pnat_pos (p : +) : p~ > 0 := has_property p
definition add (p q : +) : + :=
tag (p~ + q~) (nat.add_pos (pnat_pos p) (pnat_pos q))
infix `+` := add
infix + := add
definition mul (p q : +) : + :=
tag (p~ * q~) (nat.mul_pos (pnat_pos p) (pnat_pos q))
infix `*` := mul
infix * := mul
definition le (p q : +) := p~ ≤ q~
infix `` := le
notation p `` q := q ≤ p
infix ≤ := le
notation p ≥ q := q ≤ p
definition lt (p q : +) := p~ < q~
infix `<` := lt
infix < := lt
protected theorem pnat.eq {p q : +} : p~ = q~ → p = q :=
subtype.eq

View file

@ -22,7 +22,7 @@ namespace prerat
definition equiv (a b : prerat) : Prop := num a * denom b = num b * denom a
infix `` := equiv
infix ≡ := equiv
theorem equiv.refl [refl] (a : prerat) : a ≡ a := rfl
@ -539,12 +539,12 @@ section migrate_algebra
local attribute rat.discrete_field [instance]
definition divide (a b : rat) := algebra.divide a b
infix [priority rat.prio] `/` := divide
infix [priority rat.prio] / := divide
definition pow (a : ) (n : ) : := algebra.pow a n
infix [priority rat.prio] ^ := pow
definition nmul (n : ) (a : ) : := algebra.nmul n a
infix [priority rat.prio] `` := nmul
infix [priority rat.prio] ⬝ := nmul
definition imul (i : ) (a : ) : := algebra.imul i a
migrate from algebra with rat

View file

@ -936,16 +936,16 @@ definition requiv.trans (s t u : reg_seq) (H : requiv s t) (H2 : requiv t u) : r
definition radd (s t : reg_seq) : reg_seq :=
reg_seq.mk (sadd (reg_seq.sq s) (reg_seq.sq t))
(reg_add_reg (reg_seq.is_reg s) (reg_seq.is_reg t))
infix `+` := radd
infix + := radd
definition rmul (s t : reg_seq) : reg_seq :=
reg_seq.mk (smul (reg_seq.sq s) (reg_seq.sq t))
(reg_mul_reg (reg_seq.is_reg s) (reg_seq.is_reg t))
infix `*` := rmul
infix * := rmul
definition rneg (s : reg_seq) : reg_seq :=
reg_seq.mk (sneg (reg_seq.sq s)) (reg_neg_reg (reg_seq.is_reg s))
prefix `-` := rneg
prefix - := rneg
definition radd_well_defined {s t u v : reg_seq} (H : requiv s u) (H2 : requiv t v) :
requiv (s + t) (u + v) :=
@ -1025,13 +1025,13 @@ definition add (x y : ) : :=
(take a b c d : reg_seq, take Hab : requiv a c, take Hcd : requiv b d,
quot.sound (radd_well_defined Hab Hcd)))
protected definition prio := num.pred rat.prio
infix [priority real.prio] `+` := add
infix [priority real.prio] + := add
definition mul (x y : ) : :=
(quot.lift_on₂ x y (λ a b, quot.mk (a * b))
(take a b c d : reg_seq, take Hab : requiv a c, take Hcd : requiv b d,
quot.sound (rmul_well_defined Hab Hcd)))
infix [priority real.prio] `*` := mul
infix [priority real.prio] * := mul
definition neg (x : ) : :=
(quot.lift_on x (λ a, quot.mk (-a)) (take a b : reg_seq, take Hab : requiv a b,

View file

@ -15,17 +15,17 @@ variable {X : Type}
/- membership and subset -/
definition mem [reducible] (x : X) (a : set X) := a x
infix `` := mem
infix ∈ := mem
notation a ∉ b := ¬ mem a b
theorem ext {a b : set X} (H : ∀x, x ∈ a ↔ x ∈ b) : a = b :=
funext (take x, propext (H x))
definition subset (a b : set X) := ∀⦃x⦄, x ∈ a → x ∈ b
infix `` := subset
infix ⊆ := subset
definition superset [reducible] (s t : set X) : Prop := t ⊆ s
infix `` := superset
infix ⊇ := superset
theorem subset.refl (a : set X) : a ⊆ a := take x, assume H, H
@ -45,7 +45,7 @@ assume h₁ h₂, h₁ _ h₂
/- strict subset -/
definition strict_subset (a b : set X) := a ⊆ b ∧ a ≠ b
infix `⊂`:50 := strict_subset
infix ` `:50 := strict_subset
theorem strict_subset.irrefl (a : set X) : ¬ a ⊂ a :=
assume h, absurd rfl (and.elim_right h)
@ -235,18 +235,18 @@ ext (take x, !or.right_distrib)
-- {x : X | P}
definition set_of [reducible] (P : X → Prop) : set X := P
notation `{` binder `|` r:(scoped:1 P, set_of P) `}` := r
notation `{` binder ` | ` r:(scoped:1 P, set_of P) `}` := r
-- {x ∈ s | P}
definition sep (P : X → Prop) (s : set X) : set X := λx, x ∈ s ∧ P x
notation `{` binder ∈ s `|` r:(scoped:1 p, sep p s) `}` := r
notation `{` binder ` ` s ` | ` r:(scoped:1 p, sep p s) `}` := r
/- insert -/
definition insert (x : X) (a : set X) : set X := {y : X | y = x y ∈ a}
-- '{x, y, z}
notation `'{`:max a:(foldr `,` (x b, insert x b) ∅) `}`:0 := a
notation `'{`:max a:(foldr `, ` (x b, insert x b) ∅) `}`:0 := a
theorem subset_insert (x : X) (a : set X) : a ⊆ insert x a :=
take y, assume ys, or.inr ys

View file

@ -13,8 +13,8 @@ notation A ⊎ B := sum A B
namespace sum
notation A + B := sum A B
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 : Type}

View file

@ -152,7 +152,7 @@ section
ne_false_of_self trivial
end
infixl `==`:50 := heq
infixl ` == `:50 := heq
namespace heq
universe variable u
@ -233,7 +233,7 @@ and.rec H₂ H₁
/- or -/
notation a `\/` b := or a b
notation a \/ b := or a b
notation a b := or a b
namespace or
@ -321,8 +321,8 @@ intro : ∀ (a : A), P a → Exists P
definition exists.intro := @Exists.intro
notation `exists` binders `,` r:(scoped P, Exists P) := r
notation `∃` binders `,` r:(scoped P, Exists P) := r
notation `exists` binders `, ` r:(scoped P, Exists P) := r
notation `∃` binders `, ` r:(scoped P, Exists P) := r
theorem exists.elim {A : Type} {p : A → Prop} {B : Prop}
(H1 : ∃x, p x) (H2 : ∀ (a : A), p a → B) : B :=

View file

@ -16,15 +16,15 @@ namespace nat
| refl : le a a
| step : Π {b}, le a b → le a (succ b)
infix `` := le
infix ≤ := le
attribute le.refl [refl]
definition lt [reducible] (n m : ) := succ n ≤ m
definition ge [reducible] (n m : ) := m ≤ n
definition gt [reducible] (n m : ) := succ m ≤ n
infix `<` := lt
infix `` := ge
infix `>` := gt
infix < := lt
infix ≥ := ge
infix > := gt
definition pred [unfold 1] (a : nat) : nat :=
nat.cases_on a zero (λ a₁, a₁)

View file

@ -9,7 +9,7 @@ import init.num init.wf
definition pair [constructor] := @prod.mk
notation A × B := prod A B
-- 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
namespace prod
notation [parsing-only] A * B := prod A B

View file

@ -33,65 +33,65 @@ 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 infixr `▹`:75
reserve infixl ` `:75
reserve infixr ` `:75
reserve infixr ` `:75
/- types and type constructors -/
reserve infixl `⊎`:25
reserve infixl `×`:30
reserve infixl ` `:25
reserve infixl ` × `:30
/- arithmetic operations -/
reserve infixl `+`:65
reserve infixl `-`:65
reserve infixl `*`:70
reserve infixl `div`:70
reserve infixl `mod`:70
reserve infixl `/`:70
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 ` ^ `: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 infix ` `:50
reserve infix ` `:50
reserve infixl ` `:70
reserve infixl ` `:65
reserve infix ` `:50
reserve infix ` `:50
/- other symbols -/
reserve infix ``:50
reserve infixl `++`:65
reserve infixr `::`:65
reserve infix ` `:50
reserve infixl ` ++ `:65
reserve infixr ` :: `:65

View file

@ -7,9 +7,9 @@ prelude
import init.datatypes init.num init.wf init.logic init.tactic
definition dpair := @sigma.mk
notation `Σ` binders `,` r:(scoped P, sigma P) := r
notation `Σ` binders `, ` r:(scoped P, sigma P) := r
-- notation for n-ary tuples; input ⟨ ⟩ as \< \>
notation `⟨`:max t:(foldr `,` (e r, sigma.mk e r)) `⟩`:0 := t
notation `⟨`:max t:(foldr `, ` (e r, sigma.mk e r)) `⟩`:0 := t
lemma ex_of_sig {A : Type} {P : A → Prop} : (Σ x, P x) → ∃ x, P x :=
assume h, obtain x hx, from h, exists.intro x hx

View file

@ -12,7 +12,7 @@ set_option structure.proj_mk_thm true
structure subtype {A : Type} (P : A → Prop) :=
tag :: (elt_of : A) (has_property : P elt_of)
notation `{` binder `|` r:(scoped:1 P, subtype P) `}` := r
notation `{` binder ` | ` r:(scoped:1 P, subtype P) `}` := r
definition ex_of_sub {A : Type} {P : A → Prop} : { x | P x } → ∃ x, P x
| (subtype.tag a h) := exists.intro a h