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

@ -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

@ -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

@ -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

@ -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

@ -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⟧ :=
@ -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

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

@ -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

@ -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

@ -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

@ -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
@ -239,7 +239,7 @@ 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 -/

View file

@ -14,7 +14,7 @@ namespace sum
notation A + B := sum A B
namespace low_precedence_plus
reserve infixr ` + `:25 -- conflicts with notation for addition
infixr `+` := sum
infixr + := sum
end low_precedence_plus
variables {A B : Type}

View file

@ -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

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₁)