Maths Logic

Proposition is a statement that can be true or false

Definitions

Functions

A function is where every input has exactly 1 or 0 outputs

The identity function is where the input = the output.

A total function is where every possible item in the domain can be input in to the function

A partial function is where not every element in the domain can be input in to the function

injective: Where no two inputs to a function give the same output

surjective: where all elements in the co domain can be given by the output of the function

bijective: where a function is both injective and surjective.

Rules

Rules

Orderd Pairs

The order of sets doesent matter, however with orderd pairs, the order does matter! Orderd pairs are noted with normal (a,b) brackets instead of curly brackets {a,b}.

Cartesian Producut of A and B is the set of all possible orderd pairs (where Elements from A come before B)

You can define a relation between two sets using rules, involving the Cartesian product.

Binary relation "T" from A to B is a list of possible (but not all possible) Orderd pairs that follow a rule

LET "R" BE A BINARY RELATION ON A SET A!!!

Reflexivity

Where for every element in the set A, there is a orderd pair where both values are the same value as the element in A

Symetry

Where for each element in the Relation R, there is a symetric element, where the values in each pair are swapped. eg. (1,4), (4,1)

Transistivity

Where two Orderd Pairs (1,2) (2,3) can be imagined as a path, and the Binary Relation R also contains an element (1,3) that simplifies the path.

Equivelence

Equivelence is where R is Reflexive, Symetrical, and Transitive.

Haskell Basics

Haskell does not have loops, it has if statements, expressions, and functions only. If you need to do loops, you have to use recursion, or ther techniques (learned in following weeks).

Example Function

function1 :: Int -> Int

function1 x = x ^ 2

This function for example will take an Int input, square it, and then give the output as an Int.

There are many different styles of proramming (paradimes)

Discrete Mathematics Rules

Written Notation of set symbols