Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Filezilla/src/interface/resources/     Datei vom 7.0.2015 mit Größe 990 B image not shown  

Quellverzeichnis  FinsuppNotation.lean   Interaktion und
PortierbarkeitLean

 

module

public meta import Mathlib.Data.Finsupp.Notation
public meta import Mathlib.Data.Nat.Factorization.Basic
public import Mathlib.Data.DFinsupp.Notation -- to ensure it does not interfere

example : (fun₀ | 1 => 3) 1 = 3 := by
  simp

example : (fun₀ | 1 | 2 | 3 => 3 | 3 => 4) 1 = 3 := by
  simp
example : (fun₀ | 1 | 2 | 3 => 3 | 3 => 4) 2 = 3 := by
  simp
example : (fun₀ | 1 | 2 | 3 => 3 | 3 => 4) 3 = 4 := by
  simp

section repr

/-- info: fun₀ | 1 => 3 | 2 => 3 -/
#guard_msgs in
#eval (Finsupp.mk {1, 2} (fun | 1 | 2 => 3 | _ => 0) (fun x => by aesop))

/--
info: fun₀
  | ["there are five words here", "and five more words here"] => 5
  | ["there are seven words but only here"] => 7
  | ["just two"] => 2
-/

#guard_msgs in
#eval Finsupp.mk
  {["there are five words here", "and five more words here"],
   ["there are seven words but only here"],
   ["just two"]}
  (fun
    | ["there are five words here", "and five more words here"] => 5
    | ["there are seven words but only here"] => 7
    | ["just two"] => 2
    | _ => 0)
  (fun x => by aesop)

end repr

section PrettyPrinter

/--
info: fun₀
  | ["there are five words here", "and five more words here"] => 5
  | ["there are seven words but only here"] => 7
  | ["just two"] => 2 : List String →₀ ℕ
-/

#guard_msgs in
#check fun₀
    | ["there are five words here", "and five more words here"] => 5
    | ["there are seven words but only here"] => 7
    | ["just two"] => 2

end PrettyPrinter


/-! ## (computable) number theory examples -/

/-- info: fun₀ | 2 => 2 | 7 => 1 -/
#guard_msgs in
#eval Nat.factorization 28

/-- info: fun₀ | 3 => 2 | 5 => 1 -/
#guard_msgs in
#eval (Nat.factorization 720).filter Odd

Messung
CHZG
939910097

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.0Angebot  (Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-11-24) ¤

*Eine klare Vorstellung vom Zielzustand