#lang scribble/manual @title{The mathsymbols library} @defmodule[(planet "mathsymbols.rkt" ("stephanh" "mathsymbols.plt" 1 0))] @;@defmodule["mathsymbols.rkt"] This library contains definitions for various Unicode math symbols, such as ≤, ¬, ∅ and ∈, so that you can use these in your program. DrRacket has support for typing these symbols by entering a LaTeX-like sequence such as @exec{\leq} and then pressing M-\. @section{Numerical operations} @defproc[(≤ (x real?) (y real?) ...) boolean?]{Alias for @racket[<=]. In DrRacket, type @exec{\leq} M-\.} @defproc[(≥ (x real?) (y real?) ...) boolean?]{Alias for @racket[>=]. In DrRacket, type @exec{\geq} M-\.} @defproc[(≠ (x number?) (y number?)) boolean?]{ Returns @racket[#f] if the arguments are numerically equal, @racket[#t] otherwise. In DrRacket, type @exec{\neq} M-\. } @defproc[(√ (x number?)) number?]{Alias for @racket[sqrt]. In DrRacket, type @exec{\surd} M-\. } @section{Famous numbers} @defthing[π flonum?]{Alias for @racket[pi], a numerical approximation of the real π which is, among many other things, the area of the unit circle. In DrRacket, type @exec{\pi} M-\. } @defthing[∞ flonum?]{A number larger than any finite number. Alias for @racket[+inf.0]. In DrRacket, type @exec{\infty} M-\. } @defthing[-∞ flonum?]{A number smaller than any finite number. Alias for @racket[-inf.0]. } @section{Logical operations} @defproc[(∧ (expr any/c) ...) any]{Alias for @racket[and]. In DrRacket, type @exec{\wedge} M-\. } @defproc[(∨ (expr any/c) ...) any]{Alias for @racket[or]. In DrRacket, type @exec{\vee} M-\. Fun fact: the symbol looks like a v because "vel" is Latin for "or". (And Latin is, as we all know, the international language of science.) } @defproc[(¬ (expr any/c)) boolean?]{Alias for @racket[not]. In DrRacket, type @exec{\neg} M-\. } @defproc[(⇒ (a any/c) (b any/c)) any]{ Implication. If @racket[a] evaluates to @racket[#f] then the whole form evaluates to @racket[#t] and @racket[b] is never evaluated. Otherwise, it evaluates to whatever @racket[b] evaluates to. In DrRacket, type @exec{\Rightarrow} M-\. } @defproc[(⇐ (a any/c) (b any/c)) any]{ Reverse implication. If @racket[a] evaluates to a true value then the whole form evaluates to that value and @racket[b] is never evaluated. Otherwise, it evaluates to the logical negation of @racket[b]. Note that this is not simply the reversal of @racket[⇒]; the short-cutting works the other way around. In DrRacket, type @exec{\Leftarrow} M-\. } @defproc[(⇔ (a any/c) (b any/c)) boolean?]{ Double implication. Returns @racket[#t] if @racket[a] and @racket[b] are the same considered as truth values, @racket[#f] otherwise. Unlike @racket[⇒] and @racket[⇐] this is a plain procedure without any short-cutting behavior. In DrRacket, type @exec{\Leftrightarrow} M-\. } @section{Function operations} @defproc[(∘ (proc procedure?) ...) procedure?]{ Alias for @racket[compose]. In DrRacket, type @exec{\circ} M-\. } @section{Set operations} @defproc[(∋ (st set?) (v any/c)) boolean?]{ Alias for @racket[set-member?]. In DrRacket, type @exec{\ni} M-\. } @defproc[(∈ (v any/c) (st set?)) boolean?]{ Like @racket[∋] but with the arguments swapped. This is the more conventional ordering of arguments. In DrRacket, type @exec{\in} M-\. } @defproc[(∪ (st set?) ...+) set?]{ Alias for @racket[set-union]. In DrRacket, type @exec{\cup} M-\. } @defproc[(∩ (st set?) ...+) set?]{ Alias for @racket[set-intersect]. In DrRacket, type @exec{\cap} M-\. } @defproc[(⊆ (st set?) (st2 set?)) boolean?]{ Alias for @racket[subset?]. In DrRacket, type @exec{\subseteq} M-\. } @defproc[(⊂ (st set?) (st2 set?)) boolean?]{ Alias for @racket[proper-subset?]. In DrRacket, type @exec{\subset} M-\. } @defproc[(⊇ (st set?) (st2 set?)) boolean?]{ Like @racket[⊆] but with the arguments swapped. In DrRacket, type @exec{\supseteq} M-\. } @defproc[(⊃ (st set?) (st2 set?)) boolean?]{ Like @racket[⊂] but with the arguments swapped. In DrRacket, type @exec{\supset} M-\. } @section{Famous sets} @defthing[∅ set?]{ The empty set. It uses @racket[equal?] for element comparisons, but since it doesn't have any elements to compare with, it actually never invokes @racket[equal?]. In DrRacket, type @exec{\emptyset} M-\. } @defthing[∅eq set?]{ The empty set, again. It uses @racket[eq?] for element comparisons. } @defthing[∅eqv set?]{ The empty set, yet another time. It uses @racket[eqv?] for element comparisons. } @section{Comprehensions} @defform*[((∀ (for-clause ...) body ...+) (∀* (for-clause ...) body ...+))]{ Aliases for @racket[for/and] and @racket[for*/and]. In DrRacket, type @exec{\forall} M-\. } @defform*[((∃ (for-clause ...) body ...+) (∃* (for-clause ...) body ...+))]{ Aliases for @racket[for/or] and @racket[for*/or]. In DrRacket, type @exec{\exists} M-\. } @defform*[((Σ (for-clause ...) body ...+) (Σ* (for-clause ...) body ...+))]{ Iterates like @racket[for] and @racket[for*], respectively, but that the last expression in the @racket[body]s must produce a single number. The result of the expression is the sum of these numbers. In DrRacket, type @exec{\Sigma} M-\. } @defform*[((Π (for-clause ...) body ...+) (Π* (for-clause ...) body ...+))]{ Iterates like @racket[for] and @racket[for*], respectively, but that the last expression in the @racket[body]s must produce a single number. The result of the expression is the product of these numbers. In DrRacket, type @exec{\Pi} M-\. } @defform*[((flΣ (for-clause ...) body ...+) (flΣ* (for-clause ...) body ...+) (flΠ (for-clause ...) body ...+) (flΠ* (for-clause ...) body ...+))]{ Variants of @racket[Σ], @racket[Σ*], @racket[Π] and @racket[Π*] which are restricted to @racket[flonum]s. }