TPTP Problem File: DAT435^1.p

View Solutions - Solve Problem

%------------------------------------------------------------------------------
% File     : DAT435^1 : TPTP v9.3.1. Released v9.3.0.
% Domain   : Data Structures
% Problem  : Length of list map
% Version  : Especial.
% English  :

% Refs     :
% Source   : [TPTP]
% Names    : 001 [TPTP]

% Status   : Theorem
% Rating   : 1.00 v9.3.0
% Syntax   : Number of formulae    :   14 (   5 unt;   8 typ;   0 def)
%            Number of atoms       :    5 (   5 equ;   0 cnn)
%            Maximal formula atoms :    1 (   0 avg)
%            Number of connectives :   63 (   0   ~;   0   |;   1   &;  60   @)
%                                         (   0 <=>;   2  =>;   0  <=;   0 <~>)
%            Maximal formula depth :   12 (   6 avg)
%            Number of types       :    2 (   1 usr)
%            Number of type decls  :    8 (   4 !>P;   0 !>D)
%            Number of type conns  :   12 (  12   >;   0   *;   0   +;   0  <<)
%            Number of symbols     :    8 (   7 usr;   1 con; 0-4 aty)
%            Number of variables   :   26 (   0   ^;  21   !;   0   ?;  26   :)
%                                         (   5  !>;   0  ?*;   0  @-;   0  @+)
% SPC      : TH1_THM_EQU_NAR_NDT

% Comments : Originally from HOL Light
%------------------------------------------------------------------------------
thf(num,type,
    num: $tType ).

thf(list,type,
    list: $tType > $tType ).

thf(nil,type,
    nil: 
      !>[A: $tType] : ( list @ A ) ).

thf(cons,type,
    cons: 
      !>[A: $tType] : ( A > ( list @ A ) > ( list @ A ) ) ).

thf('ind_types/list_INDUCT_',axiom,
    ! [A: $tType,P: ( list @ A ) > $o] :
      ( ( ( P @ ( nil @ A ) )
        & ! [A0: A,A1: list @ A] :
            ( ( P @ A1 )
           => ( P @ ( cons @ A @ A0 @ A1 ) ) ) )
     => ! [X: list @ A] : ( P @ X ) ) ).

thf(map,type,
    map: 
      !>[A: $tType,B: $tType] : ( ( A > B ) > ( list @ A ) > ( list @ B ) ) ).

thf('lists/MAP_0',axiom,
    ! [A: $tType,B: $tType,F: A > B] :
      ( ( map @ A @ B @ F @ ( nil @ A ) )
      = ( nil @ B ) ) ).

thf('lists/MAP_1',axiom,
    ! [B: $tType,A: $tType,F: A > B,H: A,T: list @ A] :
      ( ( map @ A @ B @ F @ ( cons @ A @ H @ T ) )
      = ( cons @ B @ ( F @ H ) @ ( map @ A @ B @ F @ T ) ) ) ).

thf(zero,type,
    zero: num ).

thf(suc,type,
    suc: num > num ).

thf(length,type,
    length: 
      !>[A: $tType] : ( ( list @ A ) > num ) ).

thf('lists/LENGTH_0',axiom,
    ! [A: $tType] :
      ( ( length @ A @ ( nil @ A ) )
      = zero ) ).

thf('lists/LENGTH_1',axiom,
    ! [A: $tType,H: A,T: list @ A] :
      ( ( length @ A @ ( cons @ A @ H @ T ) )
      = ( suc @ ( length @ A @ T ) ) ) ).

thf('lists/LENGTH_MAP_',conjecture,
    ! [B: $tType,A: $tType,L: list @ A,F: A > B] :
      ( ( length @ B @ ( map @ A @ B @ F @ L ) )
      = ( length @ A @ L ) ) ).

%------------------------------------------------------------------------------