Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  IMO2019_Q1.thy

  Sprache: Isabelle
 

(*
  File:    IMO2019_Q1.thy
  Author:  Manuel Eberl, TU München
*)

section Q1
theory IMO2019_Q1
  imports Main
begin

text 
 Consider a function f : that fulfils the functional equation
 f(2a) + 2f(b) = f(f(a+b)) for all a, b .

 Then f is either identically 0 or of the form f(x) = 2x + c for some constant c .
 


context
  fixes f :: "int ==> int" and m :: int
  assumes f_eq: "f (2 * a) + 2 * f b = f (f (a + b))"
  defines "m (f 0 - f (-2)) div 2"
begin

text 
 We first show that f is affine with slope (f(0) - f(-2)) / 2.
 This follows from plugging in (0, b) and (-1, b + 1) into the functional equation.
 

lemma f_eq': "f x = m * x + f 0"
proof -
  have rec: "f (b + 1) = f b + m" for b
    using f_eq[of 0 b] f_eq[of "-1" "b + 1"by (simp add: m_def)
  moreover have "f (b - 1) = f b - m" for b
    using rec[of "b - 1"by simp
  ultimately show ?thesis
    by (induction x rule: int_induct[of _ 0]) (auto simp: algebra_simps)
qed

text 
 This version is better for the simplifier because it prevents it from looping.
 

lemma f_eq'_aux [simp]: "NO_MATCH 0 x ==> f x = m * x + f 0"
  by (rule f_eq')

text 
 Plugging in (0, 0) and (0, 1).
 

lemma f_classification: "(x. f x = 0) (x. f x = 2 * x + f 0)"
  using f_eq[of 0 0] f_eq[of 0 1by auto

end

text 
 It is now easy to derive the full characterisation of the functions we considered:
 

theorem
  fixes f :: "int ==> int"
  shows "(a b. f (2 * a) + 2 * f b = f (f (a + b)))
           (x. f x = 0) (x. f x = 2 * x + f 0)" (is "?lhs ?rhs")
proof
  assume ?lhs
  thus ?rhs using f_classification[of f] by blast
next
  assume ?rhs
  thus ?lhs by (smt (verit, ccfv_threshold) mult_2)
qed

end

Messung V0.5 in Prozent
C=93 H=99 G=95

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Versionsinformation zu Columbo

Bemerkung:

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge