1-- Images of finite sets are finite, without Choice.2-- Part of Cumulus, the Grace17 mathematics library.3-- Copyright (c) 2026 Grant Passmore.4-- Released under the Apache License 2.0. See LICENSE in the repository root.5-- Authors: Grant Passmore67module Grace.Cumulus.Cardinal.FiniteImage8import ListSupport910theorem listSupport.image_cover (D C f : Set) (xs : List(D))11requires function : f : D → C12shows∃ ys, List(C, ys) ∧ (∀ x ∈ listSupport{D}(xs), f(x) ∈ listSupport{C}(ys))13proof14induction xs15| List.nil =>16have nil : List(C, []) bytypecheck17refine⟨[], nil, _⟩18intros x hx19unfold listSupport at hx20exfalso21exactset.empty with hx22| List.cons(x, tail) using ih =>23obtain⟨ys, listY, covers⟩:= ih24have value := FunctionBetween.apply_closed with*25have next : List(C, f(x) :: ys) bytypecheck26refine⟨f(x) :: ys, next, _⟩27intros y hy28rw listSupport at hy29have casesY := insert.membership.forward with hy30rw listSupport31cases casesY with same | old32 . rw same33exact insert.self34 . have previous := covers with y, old35exact insert.contains with previous3637theorem Finite.function_image (D C f S : Set)38requires function : f : D → C39requires finite : Finite(S)40requires subset : S ⊆ D41shows Finite(functionImage(f, S, C))42proof43obtain⟨xs, listX, covers⟩:= Finite.cover_in with finite, subset44obtain⟨ys, listY, values⟩:= listSupport.image_cover at D, C, f, xs with*45have finiteY := listSupport.finite at C, ys with*46have bounded : functionImage(f, S, C) ⊆ listSupport{C}(ys)47intros y hy48obtain⟨inC, x, hx, equation⟩:= functionImage.membership.forward with hy49have covered := covers with x, hx50have value := values with x, covered51 rwa equation52exact Finite.subset with finiteY, bounded53