## Fuzzy logic

Fuzzy logic is the addition of other sorts of values to true and false, like adding a “maybe true or false” value, and using a continuum of values between true and false. Traditional mathematical logic, with only true and false, is sometimes called crisp logic by comparison. It is also known as Boolean algebra, from 19th cy. mathematician George Boole, who found analogies between logic and arithmetic.

Fuzzy logic has turned out to be very useful for device control, because it is a good way of handling real-world conditions. For instance, when does gray stop being black and start being white? For crisp logic, one can say black – medium gray is dark and medium gray to white is light. That is not very informative, so we subdivide these ranges: black to dark gray is dark-dark, dark gray to medium gray is dark-light, medium gray to light gray is light-dark, and light gray to white is light-light. One can continue with these subdivisions, reinventing binary representations of numbers. But once one does that, one can use the numbers directly. Black is 100% dark and 0% light, dark gray 75% dark 25% light, medium gray 50% dark 50% light, light gray 25% dark 75% light, and white 0% dark 100% light. Once one has such numbers, one can then use them in fuzzy analogs of crisp-logic operations like “not”, “and” and “or”.

Below the fold, I will construct some a simple system of fuzzy logic using “maybe true or false”.

I first state the truth tables for familiar crisp-logic operations, using T for true and F for false. Not = negation, and = conjunction, or = disjunction, impl = implication, and eqv = equivalence.

`Not: F: TT: FAnd:    Or:     Impl:   Eqv:- F T   - F T   - F T   - F TF F F   F F T   F T T   F T FT F T   T T T   T F T   T F T`

Adding M for maybe true or false, I find

`Not:F: TM: MT: FAnd:      Or:       Impl:     Eqv:- F M T   - F M T   - F M T   - F M TF F F F   F F M T   F T T T   F T M FM F M M   M M M T   M M M M   M M M MT F M T   T T T T   T F M T   T F M T`

Let us see what crisp-logic properties this true-maybe-false fuzzy-logic system satisfies.

• Commutative:
• (x and y) = (y and x)
• (x or y) = (y or x)
• TMF logic? Yes.
• Associative:
• ((x and y) and z) = (x and (y and z))
• ((x or y) or z) = (x or (y or z))
• TMF logic? Yes.
• Distributive:
• (x and (y or z)) = ((x and y) or (x and z))
• (x or (y and z)) = ((x or y) and (x or z))
• TMF logic? Yes.
• Identity and Zero (Annihilator):
• (x and true) = x, (x or false) = x
• (x and false) = false, (x or true) = true
• Absorption:
• (x and (x or y)) = x
• (x or (x and y)) = x
• TMF logic? Yes.
• Idempotence (repeat gives itself):
• (x and x) = x
• (x or x) = x
• TMF logic? Yes.
• Involution (inverse is itself):
• (not (not x)) = x
• TMF logic? Yes.
• DeMorgan inversion:
• (not (x and y)) = ((not x) or (not y))
• (not (x or y)) = ((not x) and (not y))
• TMF logic? Yes.
• NC: (x and (not x)) = false
• EM: (x or (not x)) = true
• TMF logic? No.

So TMF logic has all the properties of crisp logic except for NCEM. Fuzzy logic can be defined more generally as having numerical variables that range between 0 (false) and 1 (true). One tries to carry over as many properties as possible from crisp logic, and from common definitions of fuzzy logic, one uses the commutative, associative, identity, zero, involution, and DeMorgan inversion properties. One also adds monotonicity:

If x < y, then for function f, f(x) <= f(y) (increasing) or f(x) >= f(y) (decreasing). Negation is decreasing, while conjunction and disjunction are both increasing.

Mathematicians have come up with a variety of possible forms for the operators. They almost always use (not x) = (1 – x), and they have a variety of forms for conjunction and disjunction:

• Minmax or Zadeh: (x and y) = min(x,y), (x or y) = max(x,y) — it is the only fuzzy logic that also satisfies distributivity, even if not NCEM.
• Lukasiewicz: (x and y) = max(x+y-1,0), (x or y) = min(x+y,1) — it is likely the only fuzzy logic that satisfies NCEM, even if not distributivity.
• Multiplicative; (x and y) = x*y, (x or y) = x + y – x*y — it satisfies neither distributivity nor NCEM, something typical of fuzzy logics.

The TMF logic that I presented here is a special case of minmax logic, with maybe = 1/2. There is a rather nice proof that the only fuzzy logic that is distributive is minmax logic.

One starts with what distributivity implies: (distributivity -> absorption -> idempotence)

It is equivalent to: (not idempotence) -> (not absorption) -> (not distributivity).

So let us see what idempotence implies. Consider (x and y) where y <= x <= 1. From idempotence, (x and x) = x, and from identity, (x and 1) = x. From monotonicity, (x and y) must also equal x. Meaning that (x and y) = min(x,y). From DeMorgan, (x or y) = max(x,y). Thus getting minmax logic. One can then verify absorption and distributivity.

Since (distributivity -> absorption -> idempotence -> minmax), one concludes that ((not minmax) -> (not idempotence) -> (not absorption) -> (not distributivity)). Which concludes the proof.

I think I’ll end here.