Skip to content
Tutorials Center
My learning

Topics

Lesson 11 of 36 ยท Membership Functions and Operations

Fuzzy Complement, Union and Intersection

Learn the standard fuzzy set operations NOT, OR and AND (1 - mu, max, min), check De Morgan and other laws with Python, and see which Boolean laws survive in fuzzy logic.

Once you have fuzzy sets such as "warm" and "humid", you need to combine them: "warm AND humid", "warm OR humid", "NOT warm". These operations are the grammar of every fuzzy rule. This lesson defines the standard versions, shows them on numbers, and checks which familiar laws of set theory still hold. T-norms and S-norms then shows the alternatives to the standard choices.

The three standard operations

Zadeh defined them point by point on the membership degrees:

Operation Name Formula
NOT A Complement 1 - mu_A(x)
A AND B Intersection min(mu_A(x), mu_B(x))
A OR B Union max(mu_A(x), mu_B(x))

For degrees of exactly 0 and 1 they reproduce the crisp operations (see Crisp Sets vs Fuzzy Thinking). Intuitively, the intersection is "as true as the weakest part", and the union is "as true as the strongest part".

flowchart LR
    A["mu_A(x)"] --> N["NOT: 1 - mu_A"]
    A --> AND["AND: min"]
    B["mu_B(x)"] --> AND
    A --> OR["OR: max"]
    B --> OR

All three operations work independently at every point x.

Python Operations on two sampled sets

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Pick x = 5: warm is 1, humid is 0.4, so "warm AND humid" is 0.4 and "warm OR humid" is 1. Pick x = 9: warm is 0, humid is 1, so the AND is 0 and the OR is 1. Notice that "NOT warm" is 0 where warm is fully true and rises as warm fades.

Which laws still hold?

Because min, max and 1 - x are simple, most of the algebra of crisp sets survives. These laws hold exactly for every membership value:

  • Commutativity: A AND B = B AND A, A OR B = B OR A
  • Associativity: (A AND B) AND C = A AND (B AND C), same for OR
  • Idempotence: A AND A = A, A OR A = A
  • Distributivity: A AND (B OR C) = (A AND B) OR (A AND C) and the dual
  • Absorption: A AND (A OR B) = A
  • De Morgan's laws: NOT (A AND B) = (NOT A) OR (NOT B) and NOT (A OR B) = (NOT A) AND (NOT B)
  • Double negation: NOT NOT A = A

Two laws of Boolean logic do not hold: the law of non-contradiction A AND NOT A = empty and the law of excluded middle A OR NOT A = universe. The reason is natural: a borderline element is partly in A and partly in NOT A at once. Let us verify everything numerically with random memberships.

Python Checking the laws with random degrees

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

All the algebraic laws are True, and the two contradiction laws are False. A useful fact is visible in the last line: A AND NOT A never exceeds 0.5, and A OR NOT A is never below 0.5.

Other complements

The standard complement 1 - mu is not the only valid one. A complement function c must satisfy c(0) = 1, c(1) = 0 and be non-increasing. Two families are popular when you need a "softer" or "harder" negation:

  • Sugeno complement: c(a) = (1 - a) / (1 + lam * a) with lam > -1.
  • Yager complement: c(a) = (1 - a^w) ^ (1/w) with w > 0.

With lam = 0 or w = 1, both reduce to the standard 1 - a.

Python Sugeno and Yager complements

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

You can see that some complements fall faster at the start, others at the end, and all of them go from 1 at a = 0 to 0 at a = 1.

Set difference and other derived operations

Operations are built from the three basics:

  • Difference A - B = A AND NOT B, "warm but not humid".
  • Exclusive or, (A AND NOT B) OR (NOT A AND B).
  • Implication and equivalence appear in rules; see Fuzzy IF-THEN Rules.
Python Warm but not humid

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. With standard fuzzy operators, what is 0.6 AND 0.9?

    Standard fuzzy AND is the minimum, so the result is 0.6.
  2. 2. Which Boolean law does NOT hold for standard fuzzy sets?

    If A = 0.7, A OR NOT A = max(0.7, 0.3) = 0.7, not 1. Excluded middle fails for partial memberships.
  3. 3. NOT (A AND B) equals which expression?

    De Morgan: the complement of an intersection is the union of the complements.
  4. 4. What is the largest possible value of A AND NOT A?

    min(a, 1 - a) is largest at a = 0.5, where it equals 0.5.
  5. 5. What must a valid complement function satisfy?

    Boundary conditions c(0) = 1 and c(1) = 0 with monotonic decrease define the family; the standard 1 - a is one member.

Summary

  • NOT, AND and OR are 1 - mu, min and max, applied at every point.
  • Commutativity, associativity, idempotence, distributivity, absorption, De Morgan and double negation all hold.
  • Non-contradiction and excluded middle fail for partial degrees.
  • Other complements (Sugeno, Yager) exist with the same boundary conditions.
  • Derived operations such as difference are built from the three basics.

Next: T-norms and S-norms