Ruka hadi maudhui
The Lumenary

Kila karatasi ya kazi huchapishwa vizuri kwenye karatasi ya A4 au Letter. Majibu yako kwenye ukurasa tofauti.

The Lumenary · Darasa la 9–12

Composition

Jina: ______________________

Tarehe: ______________________

Utajifunza

  • Compute composites g∘fg \circ f and state their domain and codomain
  • Show by example that composition is not commutative
  • Prove that composition is associative and that identity functions are neutral
  • Prove that composites of injections (surjections, bijections) are injections (surjections, bijections)
  • Describe sets and functions as a first example of a category
  1. 1.

    Let f(x)=x+3f(x) = x + 3 and g(x)=x2g(x) = x^2. Compute (g∘f)(2)(g \circ f)(2).

  2. 2.

    If f:A→Bf : A \to B and g:B→Cg : B \to C, what are the domain and codomain of g∘fg \circ f?

    • A.g∘f:A→Cg \circ f : A \to C
    • B.g∘f:B→Bg \circ f : B \to B
    • C.g∘f:C→Ag \circ f : C \to A
  3. 3.

    Let f(x)=3xf(x) = 3x and g(x)=x−2g(x) = x - 2. Compute (g∘f)(4)−(f∘g)(4)(g \circ f)(4) - (f \circ g)(4).

  4. 4.

    Suppose g∘fg \circ f is injective. Which of these must be true? (Choose all that apply.)

    • A.ff is injective
    • B.gg is injective
    • C.g∘fg \circ f is surjective
  5. 5.

    In Lean, comp_assoc is proved by rfl. What does that tell us?

    • A.Both sides unfold, by definition, to the same function fun x => h (g (f x)).
    • B.Lean checked associativity on many examples.
    • C.Associativity is an axiom in Lean.
  6. 6.

    Finite functions can be stored as dictionaries. Write compose(g, f) returning a dictionary for g∘fg \circ f (apply f first!). You may assume every value of f is a key of g.

    Kikokotozi — Mazoezi

Msimbo: Apache-2.0 · Maudhui: CC BY-SA 4.0